diff --git a/amd64/flags.mk b/amd64/flags.mk index 07c4f10..2256f33 100644 --- a/amd64/flags.mk +++ b/amd64/flags.mk @@ -4,7 +4,8 @@ cflags += --target=x86_64-pc-none-elf \ -mno-avx \ -mno-mmx \ -mno-80387 \ - -mno-red-zone + -mno-red-zone \ + -mcmodel=large ldflags += --target=x86_64-pc-none-elf \ -Wl,-zmax-page-size=0x1000 diff --git a/generic/flags.mk b/generic/flags.mk index ae363e1..1cff0e7 100644 --- a/generic/flags.mk +++ b/generic/flags.mk @@ -5,7 +5,9 @@ cflags += -nostdinc \ -std=c11 \ -pedantic \ -Wall \ - -Wextra + -Wextra \ + -ffunction-sections \ + -fdata-sections cflags += -isystem ../include @@ -13,4 +15,7 @@ ldflags += -ffreestanding \ -nostdlib \ -fno-builtin \ -fuse-ld=lld \ - -static + -static \ + -Wl,--gc-sections \ + -Wl,--strip-all \ + -flto