-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Was ROOT-9874 on JIRA, but it's good to make this issue public, as it's a good first issue for new contributors. No ROOT-specific knowledge is required, just some CMake.
According to ldd -u/ldd --unused we are (might be) sometimes explicitly linking too many libraries (see the list below for examples of how the output can look like for some libraries).
To address this issue for good, one would first have to check for unused dependecies in each of the shared libraries in the build directory. This is best done by writing a script. If there are unused dependencies, there are two general cases that one has to address:
- The unused dependency is linked directly in the library itself (via
target_link_librariesor theLIBRARIESorDEPENDENCIESarguments if the library is declared with ROOT macros likeROOT_STANDARD_LIBRARY_PACKAGE). Then it just has to be removed - The unused dependency comes indirectly from another dependency, which unnecessarily linked some of its own dependencies with the
PUBLICproperty. In that case, one has to identify where this indirect dependency comes from, and then make sure that the dependency is liked privately there (via thePRIVATEproperty oftarget_link_libraries, or by appending to theLIBRARIESinstead ofDEPENDENCIESargument when a ROOT macro is used. The mapping isPUBLIC->DEPENDENCIESandPRIVATE->LIBRARIES).
libCling.so:
Unused direct dependencies:
libcomplexDict.so:
Unused direct dependencies:
libCore.so:
Unused direct dependencies:
libdequeDict.so:
Unused direct dependencies:
libEG.so:
Unused direct dependencies:
/home/pcanal/root_builds/master/gcc8/lib/libGraf3d.so
/home/pcanal/root_builds/master/gcc8/lib/libGpad.so
/home/pcanal/root_builds/master/gcc8/lib/libGraf.so
/home/pcanal/root_builds/master/gcc8/lib/libHist.so
/home/pcanal/root_builds/master/gcc8/lib/libMatrix.so
/home/pcanal/root_builds/master/gcc8/lib/libRIO.so
/home/pcanal/root_builds/master/gcc8/lib/libThread.so
libFitPanel.so:
Unused direct dependencies:
/home/pcanal/root_builds/master/gcc8/lib/libGraf.so
/home/pcanal/root_builds/master/gcc8/lib/libMatrix.so
/home/pcanal/root_builds/master/gcc8/lib/libImt.so
/home/pcanal/root_builds/master/gcc8/lib/libNet.so
/home/pcanal/root_builds/master/gcc8/lib/libRIO.so
/home/pcanal/root_builds/master/gcc8/lib/libThread.so
libFoam.so:
Unused direct dependencies:
/home/pcanal/root_builds/master/gcc8/lib/libHist.so
/home/pcanal/root_builds/master/gcc8/lib/libMatrix.so
/home/pcanal/root_builds/master/gcc8/lib/libRIO.so
/home/pcanal/root_builds/master/gcc8/lib/libThread.so