minimal: Disable stack protector, unwind tables, set stack align to 4.
These are the options typically enabled in modern compilers, which bloat
executable size largely. Default stack alignment of 16 on x86 also
contributes to the code size.
With these options, stripped executable size for x86 is under 100K.
@@ -34,6 +34,11 @@ CFLAGS += -O0 -ggdb
else
CFLAGS += -Os -DNDEBUG
CFLAGS += -fdata-sections -ffunction-sections
+CFLAGS += -fno-stack-protector
+CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables
+ifneq ($(CROSS), 1)
+CFLAGS += -mpreferred-stack-boundary=2
+endif
endif
LIBS =
