On Fri, Feb 21, 2014 at 18:53:48 -0800, Dave Abrahams wrote: > I'm following up on this recent thread: > http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/9324/focus=9330 > > Unfortunately, most of what was discussed there appears to involve advanced > CMake knowledge that I don't have. Would it be possible for someone to > look at the llvm/clang build and make some specific recommendations, > perhaps suggesting a procedure I could follow to winnow out the excess > dependencies?
My usual process for this is to start with no linked libraries then add them in as needed. Detecting this involves writing a little tool which dlopen's all built shared libraries with RTLD_NOW and failing if symbols are missing. I have test cases which are automatically added for each shared library my builds generate to ensure that new dependencies are always satisfied. For a less time-intensive process, the --print-gc-sections and --gc-sections linker options may be of help. The --strip-unneeded option to strip(1) may help, but I doubt it. Maybe you could diff the nm -C output between the old and new libraries to see if any libraries were dropped? This[1] PDF states that ldd -u can help as well (but only shows unused direct dependencies). There is also a libaudit.so available on github which apparently can help as well (see the PDF for the URL and how to use it). For OS X, it appears[2] there is a -dead_strip_dylibs option which removes links to libraries which supply no used symbols. I don't know if it tells you when that happens. --Ben [1]http://elinux.org/images/6/6c/Elc2011_sankar.pdf [2]https://stackoverflow.com/questions/6687630/c-c-gcc-ld-remove-unused-symbols -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers