Reduce binary sizes for the kernel and userspace apps

This commit is contained in:
2025-11-15 23:56:16 +01:00
parent e66fe4030d
commit 0a43ba36cd
7 changed files with 24 additions and 7 deletions

View File

@ -4,7 +4,8 @@ include $(ROOT)/mk/grabsrc.mk
PUTCHAR_ ?= fb
CFLAGS := -ffreestanding -Wall -Wextra -g -fcommon -nostdinc
CFLAGS := -ffreestanding -Wall -Wextra -fcommon -nostdinc \
-fdata-sections -ffunction-sections
CFLAGS += -I. \
-I$(ROOT)/limine \
@ -24,7 +25,8 @@ CFLAGS += -I. \
include arch/$(ARCH)/$(ARCH).mk
LDFLAGS += -nostdlib -static -T arch/$(ARCH)/link.ld $(shell $(CC) -print-libgcc-file-name)
LDFLAGS += -nostdlib -static -T arch/$(ARCH)/link.ld $(shell $(CC) -print-libgcc-file-name) \
--gc-sections --strip-all
SRCFILES :=