diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-06-13 20:06:08 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-06-13 20:08:16 +0200 |
commit | 5a8233df858bc06b1cec8f0bcd65333a743c098a (patch) | |
tree | 39bab080b08201b471a184cafab83576f64d75d0 /configure.ac | |
parent | 50d248aa3fe5132382676cc5c91e313b5aa1036b (diff) |
fix libstdc++ C++11 ABI check with Clang
Do not confuse GCC and libstdc++ versions. Clang defines GCC
version #defines, so the old version was wrong for it. Correct __GLIBCXX__
values found from GCC/libstdc++ repository history.
Change-Id: I94f5250609f7c9a114b2d15093abc9ca4209b13f
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 6a612f923493..4b47a3ef0b08 100644 --- a/configure.ac +++ b/configure.ac @@ -5584,16 +5584,22 @@ if test "$GCC" = "yes"; then if test "$HAVE_CXX11" = TRUE; then AC_MSG_CHECKING([whether using C++11 causes libstdc++ 4.7.0/4.7.1 ABI breakage]) - # This should check libstdc++ version, not gcc, but clang has incidentally C++11 support - # disabled in this case by the __float128 case below. + AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#if __GNUC__ == 4 && __GNUC_MINOR__ == 7 && (__GNUC_PATCHLEVEL__ == 0 || __GNUC_PATCHLEVEL__ == 1) -abi broken +#include <list> +#if !defined(__GLIBCXX__) +/* ok */ +#elif __GLIBCXX__ < 20111004 +/* before breakage */ +#elif __GLIBCXX__ > 20120703 +/* after breakage */ #else +abi broken #endif ]])], [AC_MSG_RESULT(no, ok)], [AC_MSG_RESULT(yes, disabling C++11) HAVE_CXX11=]) + AC_LANG_POP([C++]) fi if test "$HAVE_CXX11" = TRUE; then @@ -5643,7 +5649,7 @@ return !(i != 0 && j != 0); AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <vector> - // some Clang fail when compiling against GCC 4.7 headers with -std=gnu++0x + // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x // (__float128) ]]) ],[ AC_MSG_RESULT(yes) ], @@ -5660,7 +5666,7 @@ return !(i != 0 && j != 0); CXXFLAGS="$CXXFLAGS -D__float128=void" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <vector> - // some Clang fail when compiling against GCC 4.7 headers with -std=gnu++0x + // some Clang fail when compiling against libstdc++ headers with -std=gnu++0x // (__float128) ]]) ], |