]> git.ipfire.org Git - thirdparty/libarchive.git/commit
cmake: drop -rdynamic aka CMP0065 NEW
authorEmil Velikov <emil.l.velikov@gmail.com>
Sun, 21 Nov 2021 14:50:25 +0000 (14:50 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Sun, 21 Nov 2021 15:05:28 +0000 (15:05 +0000)
commit1b50bca40b0bb78f7250eef176a8a0a1464e2751
tree29fbe305ad354a33ee3a9ca79d8af2ad903bbdd0
parent8d4d0b346fcb22ef9b5f7165eae4d5a18bd62f09
cmake: drop -rdynamic aka CMP0065 NEW

Prior to version 3.3 cmake would always use -rdynamic. That in itself
causes all the internal symbols to be exported, increasing the binaries
by 5-10% and making it impossible for the compiler to reason, optimise
and discard unused code.

The -rdynamic is useful in two cases:
 - having a third party module (say /usr/lib/foo/foobar.so) which is
   underlinked and depends on symbols from the main binary - apps like
   irssi, bash and zsh use that

 - uses the glibc backtrace, which relies on dlopen/dlsym to fetch the
   symbol data. Unwind is much better solution, since it replies on the
   DWARF data

Our binaries do not use either of these - so drop the -rdynamic. The
autotools build doesn't use it either.

   text    data     bss     dec     hex filename
 229000    2120    4424  235544   39818 bsdcat -- before
 208324    2120    4424  214868   34754 bsdcat -- after
1093939   12128   24176 1130243  113f03 bsdcpio -- before
1059181   12128   24176 1095485  10b73d bsdcpio -- after
1130091   14264    6608 1150963  118ff3 bsdtar -- before
1093690   14264    6608 1114562  1101c2 bsdtar -- after

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
CMakeLists.txt