diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-06-13 19:29:32 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-06-13 20:08:16 +0200 |
commit | 50d248aa3fe5132382676cc5c91e313b5aa1036b (patch) | |
tree | bb484594fe19719a468ae3c44eea73de1743098c /configure.ac | |
parent | 44159c6cdf3127ef8ee628f07f3f2d38a93dc3b2 (diff) |
work around the C++11 __float128 problem with libstdc++ headers and clang
Change-Id: Ia1b443d22b3b7f6f93f1ad8c5fa760b0f1da3b83
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 07885b508786..6a612f923493 100644 --- a/configure.ac +++ b/configure.ac @@ -5647,8 +5647,31 @@ return !(i != 0 && j != 0); // (__float128) ]]) ],[ AC_MSG_RESULT(yes) ], - [ AC_MSG_RESULT(no) - HAVE_CXX11= + [ + AC_MSG_RESULT(no) + # The only reason why libstdc++ headers fail with Clang in C++11 mode is because + # they use the __float128 type that Clang doesn't know (libstdc++ checks whether + # __float128 is available during its build, but it's usually built using GCC, + # and so c++config.h hardcodes __float128 being supported). As the only place + # where __float128 is actually used is in a template specialization, + # -D__float128=void will avoid the problem there while still causing a problem + # if somebody actually uses the type. + AC_MSG_CHECKING([whether -D__float128=void workaround helps]) + 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 + // (__float128) +]]) + ], + [ + AC_MSG_RESULT(yes) + CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -D__float128=void" + ], + [ + AC_MSG_RESULT(no) + HAVE_CXX11= + ]) ]) AC_LANG_POP([C++]) |