This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Change valid arguments for --with-default-libstdcxx-abi
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 1 Jul 2015 14:38:12 +0100
- Subject: [patch] Change valid arguments for --with-default-libstdcxx-abi
- Authentication-results: sourceware.org; auth=none
I intend to commit this to trunk and the gcc-5-branch either today or
tomorrow.
I made a mistake in using "c++98" and "c++11" as the valid arguments
for the ABI configure option, because it confuses people into thinking
that it is affected by, or affects, the -std=c++11 option. In fact
the ABI mode and -std standard mode are independent.
The inline namespace is called __cxx11, the ABI-tag is "cxx11" and the
controlling macro is _GLIBCXX_USE_CXX11_ABI so I think referring to
the ABI as "cxx11" might help distinguish it from the -std=c++11 mode.
This will require distros that are using the
--with-default-libstdcxx-abi option to change their build scripts,
because using c++98 (or similar) now gives an error:
checking for default std::string ABI to use... configure: error: Supported arguments for --with-default-libstdcxx-abi have changed, use "cxx11" or "cxx98"
Makefile:11390: recipe for target 'configure-target-libstdc++-v3' failed
commit 6baea9aaba16ee07e0ad2a190ec9c2a2d6f5648c
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Jul 1 14:22:05 2015 +0100
* acinclude.m4 (GLIBCXX_DEFAULT_ABI): Change valid arguments for
--with-default-libstdcxx-abi
* configure: Regenerate.
* doc/xml/manual/configure.xml: Document valid arguments.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 8340572..df71a08 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3792,7 +3792,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI], [
fi
if test x"$enable_libstdcxx_dual_abi" != xyes; then
AC_MSG_NOTICE([dual ABI is disabled])
- default_libstdcxx_abi="c++98"
+ default_libstdcxx_abi="cxx98"
fi
GLIBCXX_CONDITIONAL(ENABLE_DUAL_ABI, test $enable_libstdcxx_dual_abi = yes)
])
@@ -3800,7 +3800,7 @@ AC_DEFUN([GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI], [
dnl
dnl Check to see which ABI should be enabled by default.
dnl
-dnl --with-default-libstdcxx-abi={c++98,c++11}
+dnl --with-default-libstdcxx-abi={cxx98,cxx11}
dnl
dnl Defines:
dnl _GLIBCXX_USE_CXX11_ABI (always defined, either to 1 or 0)
@@ -3812,14 +3812,16 @@ AC_DEFUN([GLIBCXX_DEFAULT_ABI], [
AS_HELP_STRING([--with-default-libstdcxx-abi],
[set the std::string ABI to use by default]),
[case "$withval" in
- c++98|gnu++98|c++03|gnu++03) default_libstdcxx_abi="c++98" ;;
- c++1?|gnu++1?) default_libstdcxx_abi="c++11" ;;
+ cxx98) default_libstdcxx_abi="cxx98" ;;
+ cxx11) default_libstdcxx_abi="cxx11" ;;
+ c++*|gnu++*) AC_MSG_ERROR([Supported arguments for --with-default-libstdcxx-abi have changed, use "cxx11" or "cxx98"]) ;;
*) AC_MSG_ERROR([Invalid argument for --with-default-libstdcxx-abi]) ;;
- esac],
- [default_libstdcxx_abi="c++11"])
+ esac
+ ],
+ [default_libstdcxx_abi="cxx11"])
AC_MSG_RESULT(${default_libstdcxx_abi})
fi
- if test $default_libstdcxx_abi = "c++11"; then
+ if test $default_libstdcxx_abi = "cxx11"; then
glibcxx_cxx11_abi=1
glibcxx_cxx98_abi=0
else
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index 9ba9c1a..40d7138 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -389,9 +389,9 @@
<para>
Set the default value for the <symbol>_GLIBCXX_USE_CXX11_ABI</symbol>
macro (see <xref linkend="manual.intro.using.macros"/>).
- The default is <option>OPTION=c++11</option> which sets the macro to
+ The default is <option>OPTION=cxx11</option> which sets the macro to
<literal>1</literal>,
- use <option>OPTION=c++98</option> to set it to <literal>0</literal>.
+ use <option>OPTION=cxx98</option> to set it to <literal>0</literal>.
This option does not change the library ABI.
</para>
</listitem></varlistentry>