Patchwork _GLIBCXX_ATOMIC_BUILTINS too coarse

login
register
mail settings
Submitter Alan Modra
Date April 14, 2012, 1:23 p.m.
Message ID <20120414132338.GB3218@bubble.grove.modra.org>
Download mbox | patch
Permalink /patch/152505/
State New
Headers show

Comments

Alan Modra - April 14, 2012, 1:23 p.m.
This patch partially reverts the change made on 2012-02-10 that
partially disabled builtin atomics on powerpc, resulting in
inconsistent locking (mix of atomics and pthread mutexes) and an ABI
incompatibility with previous versions of libstdc++.  See the PR for
all the gory details.  Applying to mainline with Jonathan's approval,
and in a few days to the 4.7 branch assuming no problems appear due to
this change on mainline.

	PR libstdc++/52839
	* acinclude.m4 (_GLIBCXX_ATOMIC_BUILTINS): Do not depend on
	glibcxx_cv_atomic_long_long.
	* configure: Regenerate.

Patch

Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4	(revision 186130)
+++ libstdc++-v3/acinclude.m4	(working copy)
@@ -2861,11 +2861,10 @@ 
   CXXFLAGS="$old_CXXFLAGS"
   AC_LANG_RESTORE
 
-  # Set atomicity_dir to builtins if all of above tests pass.
+  # Set atomicity_dir to builtins if all but the long long test above passes.
   if test $glibcxx_cv_atomic_bool = yes \
      && test $glibcxx_cv_atomic_short = yes \
-     && test $glibcxx_cv_atomic_int = yes \
-     && test $glibcxx_cv_atomic_long_long = yes ; then
+     && test $glibcxx_cv_atomic_int = yes; then
     AC_DEFINE(_GLIBCXX_ATOMIC_BUILTINS, 1,
     [Define if the compiler supports C++11 atomics.])
     atomicity_dir=cpu/generic/atomicity_builtins