From 81d4dc8e8739df0e9a8e92f55071733f6500617b Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 9 Jan 2023 13:40:40 +0000 Subject: [PATCH] build: use -no_exported_symbols on macOS This reduces the size of the binary by 2-3% when building with `--enable-reduce-exports`. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index ab369cc98af..1f0402c8854 100644 --- a/configure.ac +++ b/configure.ac @@ -1316,6 +1316,7 @@ if test "$use_reduce_exports" = "yes"; then AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fvisibility=hidden"], [AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])], [$CXXFLAG_WERROR]) AX_CHECK_LINK_FLAG([-Wl,--exclude-libs,ALL], [RELDFLAGS="-Wl,--exclude-libs,ALL"], [], [$LDFLAG_WERROR]) + AX_CHECK_LINK_FLAG([-Wl,-no_exported_symbols], [LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -Wl,-no_exported_symbols"], [], [$LDFLAG_WERROR]) fi if test "$use_tests" = "yes"; then