build: use -no_exported_symbols on macOS

This reduces the size of the binary by 2-3% when building with
`--enable-reduce-exports`.
This commit is contained in:
fanquake 2023-01-09 13:40:40 +00:00
parent 9c5cdf07f3
commit 81d4dc8e87
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -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