Y
Hacker News
new
|
ask
|
show
|
jobs
by
jacquesm
2686 days ago
You want -flto and to strip the binary of symbols if you are looking for a small executable size. The C runtime is about 800K.
1 comments
tom_mellior
2686 days ago
-flto combined with -static doesn't seem to do anything for me:
$ gcc -O3 foo.c -flto -static -o foo $ du -sh foo 828K foo $ strip foo $ du -sh foo 760K foo
Could you post a complete command line and the version of the compiler you have showing how to make this work with static linking?
link