|
|
|
|
|
by geocar
4478 days ago
|
|
I start with: -Os
I really don't like the stack protector. It adds a lot of space to executables, so I turn it off: -fno-stack-protector
Arthur told me about: -fno-asynchronous-unwind-tables
which seems to save a lot of space. I don't know exactly what it does, but the documentation suggests it does something with debugging, however `-s` doesn't remove it so I have this here.I often work without glibc (don't need it) but I like gcc's builtins so I have: -Dabort=__builtin_trap -Dmemcpy=__builtin_memcpy -Dmemset=__builtin_memset -minline-all-stringops -msse2 -ffreestanding -nostdlib -fno-builtin
which seems to do the trick. I don't think all of these are necessary on all versions of GCC but I keep running into versions that complain about something so this line keeps getting longer. On x86 I additionally use: -mregparm=3
since it saves a lot of space and helps benchmarks. |
|