Commit 320c7be3 by Sebastian Huber Committed by Sebastian Huber

[RTEMS] Always use atomic builtins for libstdc++

libstdc++-v3/
	* config/cpu/m68k/atomicity.h: Adjust comment.
	* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Honor
	explicit atomicity_dir setup via configure.host.
	* configure.host (rtems-*): Set atomicity_dir.
	* configure: Regenerate.

From-SVN: r240387
parent e9f1eeed
2015-09-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
* config/cpu/m68k/atomicity.h: Adjust comment.
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Honor
explicit atomicity_dir setup via configure.host.
* configure.host (rtems-*): Set atomicity_dir.
* configure: Regenerate.
2016-09-22 Jonathan Wakely <jwakely@redhat.com> 2016-09-22 Jonathan Wakely <jwakely@redhat.com>
Implement C++17 node extraction and insertion (P0083R5) Implement C++17 node extraction and insertion (P0083R5)
......
...@@ -3489,10 +3489,12 @@ EOF ...@@ -3489,10 +3489,12 @@ EOF
CXXFLAGS="$old_CXXFLAGS" CXXFLAGS="$old_CXXFLAGS"
AC_LANG_RESTORE AC_LANG_RESTORE
# Set atomicity_dir to builtins if all but the long long test above passes. # Set atomicity_dir to builtins if all but the long long test above passes,
if test "$glibcxx_cv_atomic_bool" = yes \ # or if the builtins were already chosen (e.g. by configure.host).
if { test "$glibcxx_cv_atomic_bool" = yes \
&& test "$glibcxx_cv_atomic_short" = yes \ && test "$glibcxx_cv_atomic_short" = yes \
&& test "$glibcxx_cv_atomic_int" = yes; then && test "$glibcxx_cv_atomic_int" = yes; } \
|| test "$atomicity_dir" = "cpu/generic/atomicity_builtins"; then
AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1, AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1,
[Define if the compiler supports C++11 atomics.]) [Define if the compiler supports C++11 atomics.])
atomicity_dir=cpu/generic/atomicity_builtins atomicity_dir=cpu/generic/atomicity_builtins
......
...@@ -48,6 +48,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -48,6 +48,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
} }
#elif defined(__rtems__) #elif defined(__rtems__)
// This code is only provided for reference. RTEMS uses now the atomic
// builtins and libatomic. See configure.host.
//
// TAS/JBNE is unsafe on systems with strict priority-based scheduling. // TAS/JBNE is unsafe on systems with strict priority-based scheduling.
// Disable interrupts, which we can do only from supervisor mode. // Disable interrupts, which we can do only from supervisor mode.
_Atomic_word _Atomic_word
......
...@@ -15538,10 +15538,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ...@@ -15538,10 +15538,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Set atomicity_dir to builtins if all but the long long test above passes. # Set atomicity_dir to builtins if all but the long long test above passes,
if test "$glibcxx_cv_atomic_bool" = yes \ # or if the builtins were already chosen (e.g. by configure.host).
if { test "$glibcxx_cv_atomic_bool" = yes \
&& test "$glibcxx_cv_atomic_short" = yes \ && test "$glibcxx_cv_atomic_short" = yes \
&& test "$glibcxx_cv_atomic_int" = yes; then && test "$glibcxx_cv_atomic_int" = yes; } \
|| test "$atomicity_dir" = "cpu/generic/atomicity_builtins"; then
$as_echo "#define _GLIBCXX_ATOMIC_BUILTINS 1" >>confdefs.h $as_echo "#define _GLIBCXX_ATOMIC_BUILTINS 1" >>confdefs.h
...@@ -15573,7 +15575,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu ...@@ -15573,7 +15575,7 @@ $as_echo "$as_me: WARNING: Performance of certain classes will degrade as a resu
# unnecessary for this test. # unnecessary for this test.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15576 "configure" #line 15578 "configure"
int main() int main()
{ {
_Decimal32 d1; _Decimal32 d1;
...@@ -15615,7 +15617,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ...@@ -15615,7 +15617,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test. # unnecessary for this test.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15618 "configure" #line 15620 "configure"
template<typename T1, typename T2> template<typename T1, typename T2>
struct same struct same
{ typedef T2 type; }; { typedef T2 type; };
...@@ -15649,7 +15651,7 @@ $as_echo "$enable_int128" >&6; } ...@@ -15649,7 +15651,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15652 "configure" #line 15654 "configure"
template<typename T1, typename T2> template<typename T1, typename T2>
struct same struct same
{ typedef T2 type; }; { typedef T2 type; };
...@@ -296,6 +296,10 @@ case "${host_os}" in ...@@ -296,6 +296,10 @@ case "${host_os}" in
os_include_dir="os/qnx/qnx6.1" os_include_dir="os/qnx/qnx6.1"
c_model=c c_model=c
;; ;;
rtems*)
# Use libatomic if necessary and avoid libstdc++ specific atomicity support
atomicity_dir="cpu/generic/atomicity_builtins"
;;
solaris2) solaris2)
# This too-vague configuration does not provide enough information # This too-vague configuration does not provide enough information
# to select a ctype include, and thus os_include_dir is a crap shoot. # to select a ctype include, and thus os_include_dir is a crap shoot.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment