diff mbox

libstdc++/64967 disable new std::string for gnu-versioned-namespace

Message ID 20150323164751.GC9755@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely March 23, 2015, 4:47 p.m. UTC
This restores bootstrap for --enable-symvers=gnu-versioned-namespace
by disabling the new std::string ABI.

After GCC 5.1 (probably for GCC 6, rather than 5.2) I will make
another attempt to make gnu-versioned-namespace use the new
std::string only (and bump the soname from libstdc++.so.7 to .so.8)

Tested x86_64-linux, both with and without
--enable-symvers=gnu-versioned-namespace.

There are loads of test failures with gnu-versioned-namespace, but
they are unrelated to the std::string ABI changes (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59256 and
https://gcc.gnu.org/ml/libstdc++/2015-03/msg00058.html for the biggest
causes of test failures).

Committed to trunk.
diff mbox

Patch

commit 0f3295873da44bded61f0bd4eb0542795bf92c0a
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Mar 20 15:12:40 2015 +0000

    	PR libstdc++/64967
    	* acinclude.m4: Disable dual ABI when gnu-versioned-namespace in use.
    	* configure: Regenerate.
    	* src/c++11/compatibility-c++0x.cc (error_category), generic_category,
    	system_category): Use macros for versioned namespace.
    	* src/c++11/futex.cc: Add missing end macro for versioned namespace.

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 74f5a65..a1e301f 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3859,6 +3859,10 @@  dnl  _GLIBCXX_USE_DUAL_ABI (always defined, either to 1 or 0)
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI], [
   GLIBCXX_ENABLE(libstdcxx-dual-abi,$1,,[support two versions of std::string])
+  if test x$enable_symvers = xgnu-versioned-namespace; then
+    # gnu-versioned-namespace is incompatible with the dual ABI.
+    enable_libstdcxx_dual_abi="no"
+  fi
   if test x"$enable_libstdcxx_dual_abi" != xyes; then
     AC_MSG_NOTICE([dual ABI is disabled])
     default_libstdcxx_abi="c++98"
diff --git a/libstdc++-v3/src/c++11/compatibility-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-c++0x.cc
index 9ed367b..01a9690 100644
--- a/libstdc++-v3/src/c++11/compatibility-c++0x.cc
+++ b/libstdc++-v3/src/c++11/compatibility-c++0x.cc
@@ -130,6 +130,7 @@  namespace std _GLIBCXX_VISIBILITY(default)
     constexpr bool system_clock::is_monotonic;
   } // namespace chrono
 
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
   // gcc-5 replaces this with _V2::error_category
   class error_category
   {
@@ -168,6 +169,7 @@  namespace std _GLIBCXX_VISIBILITY(default)
     operator!=(const error_category& __other) const noexcept
     { return this != &__other; }
   };
+_GLIBCXX_END_NAMESPACE_VERSION
 
   // gcc-4.9.0
   // LWG 2145 changes this constructor to constexpr i.e. inline
@@ -213,6 +215,7 @@  namespace std _GLIBCXX_VISIBILITY(default)
     const system_error_category system_category_instance{};
   }
 
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
   const error_category&
   system_category() noexcept { return system_category_instance; }
 
@@ -224,6 +227,7 @@  namespace std _GLIBCXX_VISIBILITY(default)
     _GLIBCXX_CONST const error_categoryxx& system_category() noexcept;
     _GLIBCXX_CONST const error_categoryxx& generic_category() noexcept;
   }
+_GLIBCXX_END_NAMESPACE_VERSION
 
   error_condition
   error_category::default_error_condition(int __i) const noexcept
diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc
index a7f0200..e04dba8 100644
--- a/libstdc++-v3/src/c++11/futex.cc
+++ b/libstdc++-v3/src/c++11/futex.cc
@@ -93,6 +93,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
     syscall (SYS_futex, __addr, futex_wake_op, INT_MAX);
   }
 
+_GLIBCXX_END_NAMESPACE_VERSION
 }
 #endif
 #endif