From 3ee028f131db0ea78bfde0961a3fca7b9e95b193 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 23 Feb 2015 17:48:57 -0500 Subject: build: disable reduced exports by default This is really a packager's option. While it's helpful to encourage devs to test this option for daily builds, it's not reliable in several real-world use-cases. Some older libstdc++ runtimes (freebsd 9, debian wheezy, for example) fail to properly catch exceptions due to mismatched type_info. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19664 for more info. --- configure.ac | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 85e3d1d669..9dd3f17d88 100644 --- a/configure.ac +++ b/configure.ac @@ -115,9 +115,9 @@ AC_ARG_ENABLE([hardening], AC_ARG_ENABLE([reduce-exports], [AS_HELP_STRING([--enable-reduce-exports], - [attempt to reduce exported symbols in the resulting executables (default is yes)])], + [attempt to reduce exported symbols in the resulting executables (default is no)])], [use_reduce_exports=$enableval], - [use_reduce_exports=auto]) + [use_reduce_exports=no]) AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], @@ -473,20 +473,12 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ if test x$use_reduce_exports = xyes; then AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) fi - AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.]) - use_reduce_exports=no ] ) -if test x$use_reduce_exports != xno; then +if test x$use_reduce_exports = xyes; then AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], - [ - if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.]) - fi - AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.]) - use_reduce_exports=no - ]) + [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])]) fi LEVELDB_CPPFLAGS= @@ -533,7 +525,7 @@ AX_BOOST_THREAD AX_BOOST_CHRONO -if test x$use_reduce_exports != xno; then +if test x$use_reduce_exports = xyes; then AC_MSG_CHECKING([for working boost reduced exports]) TEMP_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS" @@ -547,25 +539,14 @@ if test x$use_reduce_exports != xno; then #endif ]])],[ AC_MSG_RESULT(yes) - ],[: - if test x$use_reduce_exports = xauto; then - use_reduce_exports=no - else - if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) - fi - fi - AC_MSG_RESULT(no) - AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.]) + ],[ + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) ]) CPPFLAGS="$TEMP_CPPFLAGS" fi - -elif test x$use_reduce_exports = xauto; then - use_reduce_exports=yes fi -if test x$use_reduce_exports != xno; then +if test x$use_reduce_exports = xyes; then CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS" AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"]) fi @@ -827,7 +808,7 @@ else fi AC_MSG_CHECKING([whether to reduce exports]) -if test x$use_reduce_exports != xno; then +if test x$use_reduce_exports = xyes; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) -- cgit v1.2.3 From aa3673064c5cc2009d4a75d0ab8a553e99861ccb Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 23 Feb 2015 17:56:15 -0500 Subject: build: remove libstdc++ backwards-compat Backwards-compatibility for libstdc++ is not limited to straightforward abi changes. Symbol visibility also needs to be taken into consideration, and that really can't be addressed simply. Instead, just static-link libstdc++ for backwards-compat. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 9dd3f17d88..006c5f38aa 100644 --- a/configure.ac +++ b/configure.ac @@ -133,7 +133,7 @@ AC_ARG_ENABLE([lcov], AC_ARG_ENABLE([glibc-back-compat], [AS_HELP_STRING([--enable-glibc-back-compat], - [enable backwards compatibility with glibc and libstdc++])], + [enable backwards compatibility with glibc])], [use_glibc_compat=$enableval], [use_glibc_compat=no]) -- cgit v1.2.3 From 3448b132c4150509eec9bf585552d1994fd32090 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Mon, 23 Feb 2015 20:18:54 -0500 Subject: build: fix typo in configure help --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 006c5f38aa..67a0cc28e5 100644 --- a/configure.ac +++ b/configure.ac @@ -471,14 +471,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ [ AC_MSG_RESULT(no) if test x$use_reduce_exports = xyes; then - AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.]) + AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.]) fi ] ) if test x$use_reduce_exports = xyes; then AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"], - [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])]) + [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])]) fi LEVELDB_CPPFLAGS= @@ -540,7 +540,7 @@ if test x$use_reduce_exports = xyes; then ]])],[ AC_MSG_RESULT(yes) ],[ - AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.]) + AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.]) ]) CPPFLAGS="$TEMP_CPPFLAGS" fi -- cgit v1.2.3