Hello to everibody!
I have a big problem compiling from source apps for Linux.
Let us take for example Squid3.
I downloaded tarball, configured and compiled it.
It was compiled OK, but the squid executable file is 24M!
I downloaded ready rpm package, and extracted files into some directory.
Executable for squid is 5.2M only, almost 5 times less than mine!
Configuration and compilation params was the same (tested it with squid -v)
What I am doing wrong?!
OK, seems I got the reason!
Binary in rpm was stripped, but compiled by me - was not.
So I striiped it by strip --strip-unneeded
File size of stripped squid became 7 times less from original!
$ du -h squid
3.5M squid
I simply could not expect such effect, because did stripping before,
and loss of size was no more than 10 percents
running strip is a good way to get the size down after you have a binary and the binary is in ELF format. strip just removes debug and unreferenced symbols after the binary has been created.
You can also try compiling the source with out the debug flag turned on. if using gcc it is the -g option. That prevents the compiler from adding the symbolic debugging symbols at compile time.