Removing dependency to libgcc_s.so
Michael Hunold
hunold at linuxtv.org
Fri Jul 21 05:56:40 PDT 2006
Hi,
I'm building busybox using a MIPS toolchain created by buildroot.
When building busybox as a dynamically linked application (which I want
to do), there will be a dependency to libgcc_s.so.1, which is 274843
bytes big. Not exactly what I call a leightweight.
busybox with my configuration is 187572 bytes.
I added "-nodefaultlibs -lm -lc" to the Makefile and ended up with
unresolved symbols to __udivdi3 and friends.
I found out that these provide 64bit divison and modulo operations and
are part of libgcc. Apparently they are used when the processor has no
native 64bit division in hardware.
I added a straight-forward implementation to libbb and ended up with a
busybox that is now 179204 bytes, so I saved 8368 bytes for the binary
plus the complete libgcc that I don't need anymore.
Is removing the dependency to libgcc a good thing to do?
If so, I can provide a patch. But I'm not sure how to handle the case
where busybox is built with a toolchain for a processor that has 64bit
divison in hardware.
Best regards
Michael Hunold.
More information about the busybox
mailing list