Clean up library linkage
authorJosh Stone <jistone@redhat.com>
Sat, 15 Mar 2014 00:37:54 +0000 (17:37 -0700)
committerJosh Stone <jistone@redhat.com>
Tue, 22 Apr 2014 22:22:11 +0000 (15:22 -0700)
commitedfa02c969f5b433cd4748d31da41d7906d349e0
tree6662e7e13d1e07729964607cca0ac2b73ebad391
parent25261b76909b970daa3f745f774f03310846c4b7
Clean up library linkage

- Add -Wl,--no-undefined to gnu link flags, so it's a link-time error if
  any library doesn't declare everything it uses.

- Add a 'target_link_private_libraries' function to set LINK_PRIVATE, so
  dependencies aren't implicitly propagated.  Each library must thus
  explicitly declare its link needs.  This only works for CMake 2.8.7+,
  but falls back gracefully otherwise.

- All libraries are now whittled down to link only against their direct
  dependencies to satisfy used symbols.  Check this with "ldd -r -u".
  The only extras now are libelf in libdynDwarf, because libdwarf
  doesn't always link libelf itself, and libm is always added by g++.
14 files changed:
cmake/optimization.cmake
cmake/packages.cmake
cmake/shared.cmake
common/CMakeLists.txt
dwarf/CMakeLists.txt
dyninstAPI/CMakeLists.txt
elf/CMakeLists.txt
instructionAPI/CMakeLists.txt
parseAPI/CMakeLists.txt
patchAPI/CMakeLists.txt
proccontrol/CMakeLists.txt
stackwalk/CMakeLists.txt
symlite/CMakeLists.txt
symtabAPI/CMakeLists.txt