2011-06-07 12:24:09 removing libstdc++, libobjc, libnsl, libmudflap*, and more from ucLinux build
Timothy Stotts (UNITED STATES)
To find unused libraries in my romfs, I have run the following shell command in my build directory on the development host. Why are there so many libraries being built for the romfs that are not referenced by any other binary in the build? For example, I am not building an C++ applications and the C++ library is built. Are these safe to remove? How can I automate their removal prior to romfs generation and/or prevent them from building? Will this disrupt the kernel's usage of ld.so.cache?
# for n in romfs/lib/*.* romfs/usr/lib/*.*; do du -sh $n; nn=`basename $n`; find romfs/ -type f -print0 | xargs -0 grep -l $nn | grep -v $n | grep -v ld.so.cache | wc -l; done
2011-06-07 12:49:56 Re: removing libstdc++, libobjc, libnsl, libmudflap*, and more from ucLinux build
Mike Frysinger (UNITED STATES)
the dist already provides an option for automatically trimming libraries:
obviously by default, we have no idea what programs people are going to load after the fact and thus what libraries they're going to need, so we cant remove based purely on the contents of romfs/.