From: Remi Gacogne Date: Thu, 13 Jan 2022 12:00:30 +0000 (+0100) Subject: dnsdist: Build with -fvisibility=hidden by default X-Git-Tag: auth-4.7.0-alpha1~72^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11178%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Build with -fvisibility=hidden by default Not marking our symbols visible by default allows the compiler to do better optimizations, especially with Link-Time Optimizations that several distributions are now enabling by default. The most obvious optimization comes from dead code removal because the compiler now knows that it cannot be used by an external shared object, but better inlining might also occur. Even without LTO, it reduces the final size of stripped binaries and might improve loading times a bit. Note that we already mark the symbols that we want to export with the 'default' visibilty, for example for Lua FFI. --- diff --git a/pdns/dnsdistdist/configure.ac b/pdns/dnsdistdist/configure.ac index 1846f17580..b5757f088d 100644 --- a/pdns/dnsdistdist/configure.ac +++ b/pdns/dnsdistdist/configure.ac @@ -18,8 +18,8 @@ AC_DEFINE([DNSDIST], [1], LT_PREREQ([2.2.2]) LT_INIT([disable-static]) -CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter $CFLAGS" -CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CXXFLAGS" +CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -fvisibility=hidden $CFLAGS" +CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls -fvisibility=hidden $CXXFLAGS" PDNS_WITH_LIBSODIUM PDNS_CHECK_DNSTAP([auto])