Check separately and more thoroughly what the C++ library is
I.e., GNU libstdc++, LLVM libc++, or Microsoft. Also, do the grepping for "visibility push" only in the libstdc++ case. Change-Id: Ibf1038e37780774d9595eccfe47894dd88fc5591
This commit is contained in:
parent
d74ca89ae8
commit
739ddcfd83
56
configure.ac
56
configure.ac
@ -430,10 +430,6 @@ DLLPOST=".so"
|
|||||||
|
|
||||||
LINKFLAGSNOUNDEFS="-Wl,-z,defs"
|
LINKFLAGSNOUNDEFS="-Wl,-z,defs"
|
||||||
|
|
||||||
# Most platforms use GNU libstdc++
|
|
||||||
CPP_LIBRARY="GLIBCXX"
|
|
||||||
AC_SUBST(CPP_LIBRARY)
|
|
||||||
|
|
||||||
INSTROOTSUFFIX=
|
INSTROOTSUFFIX=
|
||||||
SDKDIRNAME=sdk
|
SDKDIRNAME=sdk
|
||||||
|
|
||||||
@ -2781,7 +2777,6 @@ if test $_os = Darwin; then
|
|||||||
fi
|
fi
|
||||||
# Use libc++ instead of libstdc++ when possible
|
# Use libc++ instead of libstdc++ when possible
|
||||||
stdlib=-stdlib=libc++
|
stdlib=-stdlib=libc++
|
||||||
CPP_LIBRARY="LIBCPP"
|
|
||||||
fi
|
fi
|
||||||
if test "$ENABLE_LTO" = TRUE; then
|
if test "$ENABLE_LTO" = TRUE; then
|
||||||
lto=-flto
|
lto=-flto
|
||||||
@ -2797,14 +2792,6 @@ if test $_os = Darwin; then
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
AC_MSG_RESULT([$CC and $CXX])
|
AC_MSG_RESULT([$CC and $CXX])
|
||||||
else
|
|
||||||
# In case somebody insists on passing in CXX, and perhaps CFLAGS or CXXFLAGS to choose
|
|
||||||
# compiler. Not really something we encourage or support.
|
|
||||||
case "$CXX $CFLAGS $CXXFLAGS" in
|
|
||||||
*-stdlib=libc++*)
|
|
||||||
CPP_LIBRARY="LIBCPP"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$with_macosx_version_max_allowed" in
|
case "$with_macosx_version_max_allowed" in
|
||||||
@ -3858,7 +3845,6 @@ cygwin*)
|
|||||||
OS=WNT
|
OS=WNT
|
||||||
RTL_OS=Windows
|
RTL_OS=Windows
|
||||||
P_SEP=";"
|
P_SEP=";"
|
||||||
CPP_LIBRARY="MSVCRT"
|
|
||||||
|
|
||||||
case "$host_cpu" in
|
case "$host_cpu" in
|
||||||
i*86|x86_64)
|
i*86|x86_64)
|
||||||
@ -6148,6 +6134,40 @@ if test "$HAVE_CXX11" = TRUE; then
|
|||||||
CXXFLAGS=$save_CXXFLAGS
|
CXXFLAGS=$save_CXXFLAGS
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([What the C++ library is])
|
||||||
|
AC_LANG_PUSH([C++])
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
#include <utility>
|
||||||
|
#ifndef __GLIBCXX__
|
||||||
|
foo bar
|
||||||
|
#endif
|
||||||
|
]])],
|
||||||
|
[CPP_LIBRARY=GLIBCXX
|
||||||
|
cpp_library_name="GNU libstdc++"
|
||||||
|
],
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
#include <utility>
|
||||||
|
#ifndef _LIBCPP_VERSION
|
||||||
|
foo bar
|
||||||
|
#endif
|
||||||
|
]])],
|
||||||
|
[CPP_LIBRARY=LIBCPP
|
||||||
|
cpp_library_name="LLVM libc++"
|
||||||
|
],
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
|
#include <utility>
|
||||||
|
#ifndef _MSC_VER
|
||||||
|
foo bar
|
||||||
|
#endif
|
||||||
|
]])],
|
||||||
|
[CPP_LIBRARY=MSVCRT
|
||||||
|
cpp_library_name="Microsoft"
|
||||||
|
],
|
||||||
|
AC_MSG_ERROR([Could not figure out what C++ library this is]))))
|
||||||
|
AC_MSG_RESULT([$cpp_library_name])
|
||||||
|
AC_LANG_POP([C++])
|
||||||
|
AC_SUBST(CPP_LIBRARY)
|
||||||
|
|
||||||
if test "$HAVE_CXX11" = "TRUE"; then
|
if test "$HAVE_CXX11" = "TRUE"; then
|
||||||
AC_DEFINE(HAVE_CXX11)
|
AC_DEFINE(HAVE_CXX11)
|
||||||
elif test -n "$CXXFLAGS_CXX11"; then
|
elif test -n "$CXXFLAGS_CXX11"; then
|
||||||
@ -6340,14 +6360,16 @@ if test \( "$_os" != "WINNT" -o "$WITH_MINGW" = "yes" \); then
|
|||||||
CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
|
CPPFLAGS="-isysroot $MACOSX_SDK_PATH $CPPFLAGS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then
|
# Assume visibility is not broken with libc++ even if libc++ headers. The below test is very much
|
||||||
|
# designed for libstdc++ only.
|
||||||
|
if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE" -a \( "$COM_GCC_IS_CLANG" != TRUE -o "$CPP_LIBRARY" != LIBCPP \); then
|
||||||
dnl gcc#19664, gcc#22482, rhbz#162935
|
dnl gcc#19664, gcc#22482, rhbz#162935
|
||||||
AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
|
AC_MSG_CHECKING([if STL headers are visibility safe (GCC bug 22482)])
|
||||||
AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
|
AC_EGREP_HEADER(visibility push, string, stlvisok=yes, stlvisok=no)
|
||||||
AC_MSG_RESULT([$stlvisok])
|
AC_MSG_RESULT([$stlvisok])
|
||||||
if test "$stlvisok" = "no"; then
|
if test "$stlvisok" = "no"; then
|
||||||
AC_MSG_WARN([Your gcc STL headers are not visibility safe. Disabling visibility])
|
AC_MSG_WARN([Your libstdc++ headers are not visibility safe. Disabling visibility])
|
||||||
add_warning "Your gcc STL headers are not visibility safe. Disabling visibility"
|
add_warning "Your libstdc++ headers are not visibility safe. Disabling visibility"
|
||||||
unset HAVE_GCC_VISIBILITY_FEATURE
|
unset HAVE_GCC_VISIBILITY_FEATURE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user