This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] <stdatomic> -> <atomic>


> This patch caused:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42456
> 
> After revision 155372,  you can use
> 
> # CC="gcc -m32" CXX="g++ -m32" .../configure i686-linux
> 
> to bootstrap 32bit gcc on Linux/x86-64.

Thanks for the pointer on reproducing. 

Fixed with the attached, by
exporting the new symbols in the current version, and aliasing to the
old names/version.

tested x86_64/linux
tested i686/linux

-benjamin
2009-12-21  Benjamin Kosnik  <bkoz@redhat.com>

        PR libstdc++/42456
        * src/atomic.cc: Move _GLIBCXX_ASM_SYMVER define within guard.
        * config/abi/pre/gnu.ver: Add non-volatile exports.

Index: src/atomic.cc
===================================================================
--- src/atomic.cc	(revision 155392)
+++ src/atomic.cc	(working copy)
@@ -78,15 +78,15 @@
   {
     bool
     atomic_flag_test_and_set_explicit(__atomic_flag_base* __a,
-				      memory_order __m) throw ()
+				      memory_order __m) throw()
     {
       atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
       return d->test_and_set(__m);
     }
 
     void
-    atomic_flag_clear_explicit(__atomic_flag_base* __a,
-			       memory_order __m) throw ()
+    atomic_flag_clear_explicit(__atomic_flag_base* __a, 
+			       memory_order __m) throw()
     {
       atomic_flag* d = static_cast<volatile atomic_flag*>(__a);
       return d->clear(__m);
@@ -94,14 +94,14 @@
 
     void
     __atomic_flag_wait_explicit(__atomic_flag_base* __a,
-				memory_order __x) throw ()
+				memory_order __x) throw()
     {
       while (atomic_flag_test_and_set_explicit(__a, __x))
 	{ };
     }
 
     __atomic_flag_base*
-    __atomic_flag_for_address(const void* __z) throw ()
+    __atomic_flag_for_address(const void* __z) throw()
     {
       uintptr_t __u = reinterpret_cast<uintptr_t>(__z);
       __u += (__u >> 2) + (__u << 4);
@@ -126,12 +126,14 @@
 // In the future, GLIBCXX_ABI > 6 should remove all uses of
 // _GLIBCXX_*_SYMVER macros in this file.
 
+#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
+    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
+
 #define _GLIBCXX_ASM_SYMVER(cur, old, version) \
    asm (".symver " #cur "," #old "@@" #version);
 
-#if defined(_GLIBCXX_SYMVER_GNU) && defined(PIC) \
-    && defined(_GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE)
 _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag5clearESt12memory_order, _ZNVSt9__atomic011atomic_flag5clearESt12memory_order, GLIBCXX_3.4.11)
 
 _GLIBCXX_ASM_SYMVER(_ZNSt9__atomic011atomic_flag12test_and_setESt12memory_order, _ZNVSt9__atomic011atomic_flag12test_and_setESt12memory_order, GLIBCXX_3.4.11)
+
 #endif
Index: config/abi/pre/gnu.ver
===================================================================
--- config/abi/pre/gnu.ver	(revision 155392)
+++ config/abi/pre/gnu.ver	(working copy)
@@ -1050,6 +1050,10 @@
 
 GLIBCXX_3.4.14 {
 
+    # atomic
+    _ZNSt9__atomic011atomic_flag12test_and_setESt12memory_order;
+    _ZNSt9__atomic011atomic_flag5clearESt12memory_order;
+
     # future
     _ZSt15future_category;
     _ZNSt12future_errorD*;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]