Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
On Thu, 13 Mar 2003, Jonathan King wrote:
> On Thu, 13 Mar 2003, Mike Miller wrote:
>
> > What's the trick to compiling it smaller?
>
> Michael apears to be suggesting that you compiled a so-called "static"
> binary (libraries linked into the binary at build time), rather than a
> binary where the libraries are "dynamically" loaded and used at
> run-time.
I see. This is interesting. I guess I don't care too much about disk
size and I like the idea that the thing doesn't have to depend on other
parts of the system. But if I can save space for free, I'll do it. This
brings me to "strip": Does anyone understand the "strip" command. I
don't, but I have used it on compiled binaries. It really reduces the
size and they seem to work just the same. Weird, no?
Here's an example using dillo:
# cp dillo dillo2
# strip dillo2
# ls -lAF dillo*
-rwxr-xr-x 1 root other 6413104 Mar 13 16:58 dillo*
-rwxr-x--- 1 root other 364924 Mar 14 01:05 dillo2*
# mv dillo2 dillo
Hmmm... the strip command finished in less than one second and the dillo
file was reduced by more than 6 MB down to a mere 365 KB. Interesting!
Regarding dependencies: I have all these even with the small file:
ldd /usr/local/bin/dillo
librt.so.1 => /usr/lib/librt.so.1
libpng.so.2 => /usr/local/lib/libpng.so.2
libz.so => /usr/local/lib/libz.so
libpthread.so.1 => /usr/lib/libpthread.so.1
libgtk-1.2.so.0 => /usr/local/lib/libgtk-1.2.so.0
libgdk-1.2.so.0 => /usr/local/lib/libgdk-1.2.so.0
libgmodule-1.2.so.0 => /usr/local/lib/libgmodule-1.2.so.0
libglib-1.2.so.0 => /usr/local/lib/libglib-1.2.so.0
libdl.so.1 => /usr/lib/libdl.so.1
libXext.so.0 => /usr/openwin/lib/libXext.so.0
libX11.so.4 => /usr/openwin/lib/libX11.so.4
libsocket.so.1 => /usr/lib/libsocket.so.1
libnsl.so.1 => /usr/lib/libnsl.so.1
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libdga.so.1 => /usr/openwin/lib/libdga.so.1
libmp.so.2 => /usr/lib/libmp.so.2
libthread.so.1 => /usr/lib/libthread.so.1
/usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1
So maybe the big difference in size is all about the stripping (whatever
that is!).
Best,
Mike
_______________________________________________
discussion mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/discussion