You are not logged in.
whats the best way to optimize (size wise) a static program using gcc (not uclibc or similar) for compiling? ie, remove debug info & symbols, optimize for size (-Os), etc.
tnx.
[EDIT]
up-til now, the best i got was with :
gcc -o unionctl-static unionctl.c -static -s -Os -Wl,--gc-sections
Offline
optimizing for size or speed?
if looking for speed over size, then -funroll_loops is great
I also recall -fomit_frame_pointer (or whatever) doing some good for speed and memory usage (it tires to pass as much in registers as possible, instead of pushing it on the stack)
Offline
Offline
for size:
-fno-inline (removes all inline functions) - might do a small amount
-fmerge-constants (tries to combine constants with the same value)
that's all i can really come up with... I think the second one is enabled by default... not sure
Offline