From 58234eaeae607a7b98c885861c254dfd301fda65 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 13 Jan 2022 13:00:30 +0100 Subject: [PATCH] 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. --- pdns/dnsdistdist/configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]) -- 2.47.2