Makefile: Build with -Os instead of -O2

Build size is likely more important than CPU performance for a
bootloader.  So, instruct gcc to optimize for size by default.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-05-04 14:02:50 -04:00 committed by Eric Callahan
parent da0f92f721
commit 34e14386ed

View File

@ -29,7 +29,7 @@ dirs-y = src
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -O2 -MD -g \
CFLAGS := -I$(OUT) -Isrc -I$(OUT)board-generic/ -std=gnu11 -Os -MD -g \
-Wall -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \
-ffunction-sections -fdata-sections
CFLAGS += -flto -fwhole-program -fno-use-linker-plugin