Skip to content

Commit 3ee028f

Browse files
committed
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.
1 parent 8b298ca commit 3ee028f

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

configure.ac

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ AC_ARG_ENABLE([hardening],
115115

116116
AC_ARG_ENABLE([reduce-exports],
117117
[AS_HELP_STRING([--enable-reduce-exports],
118-
[attempt to reduce exported symbols in the resulting executables (default is yes)])],
118+
[attempt to reduce exported symbols in the resulting executables (default is no)])],
119119
[use_reduce_exports=$enableval],
120-
[use_reduce_exports=auto])
120+
[use_reduce_exports=no])
121121

122122
AC_ARG_ENABLE([ccache],
123123
[AS_HELP_STRING([--enable-ccache],
@@ -473,20 +473,12 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([
473473
if test x$use_reduce_exports = xyes; then
474474
AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduced-exports.])
475475
fi
476-
AC_MSG_WARN([Cannot find a working visibility attribute. Disabling reduced exports.])
477-
use_reduce_exports=no
478476
]
479477
)
480478

481-
if test x$use_reduce_exports != xno; then
479+
if test x$use_reduce_exports = xyes; then
482480
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
483-
[
484-
if test x$use_reduce_exports = xyes; then
485-
AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])
486-
fi
487-
AC_MSG_WARN([Cannot set default symbol visibility. Disabling reduced exports.])
488-
use_reduce_exports=no
489-
])
481+
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduced-exports.])])
490482
fi
491483

492484
LEVELDB_CPPFLAGS=
@@ -533,7 +525,7 @@ AX_BOOST_THREAD
533525
AX_BOOST_CHRONO
534526

535527

536-
if test x$use_reduce_exports != xno; then
528+
if test x$use_reduce_exports = xyes; then
537529
AC_MSG_CHECKING([for working boost reduced exports])
538530
TEMP_CPPFLAGS="$CPPFLAGS"
539531
CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
@@ -547,25 +539,14 @@ if test x$use_reduce_exports != xno; then
547539
#endif
548540
]])],[
549541
AC_MSG_RESULT(yes)
550-
],[:
551-
if test x$use_reduce_exports = xauto; then
552-
use_reduce_exports=no
553-
else
554-
if test x$use_reduce_exports = xyes; then
555-
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.])
556-
fi
557-
fi
558-
AC_MSG_RESULT(no)
559-
AC_MSG_WARN([boost versions < 1.49 are known to have symbol visibility issues. Disabling reduced exports.])
542+
],[
543+
AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduced-exports.])
560544
])
561545
CPPFLAGS="$TEMP_CPPFLAGS"
562546
fi
563-
564-
elif test x$use_reduce_exports = xauto; then
565-
use_reduce_exports=yes
566547
fi
567548

568-
if test x$use_reduce_exports != xno; then
549+
if test x$use_reduce_exports = xyes; then
569550
CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
570551
AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
571552
fi
@@ -827,7 +808,7 @@ else
827808
fi
828809

829810
AC_MSG_CHECKING([whether to reduce exports])
830-
if test x$use_reduce_exports != xno; then
811+
if test x$use_reduce_exports = xyes; then
831812
AC_MSG_RESULT([yes])
832813
else
833814
AC_MSG_RESULT([no])

0 commit comments

Comments
 (0)