This commit is contained in:
2025-12-15 23:58:42 +01:00
commit 04d59fd6d2
14 changed files with 182 additions and 0 deletions

32
kernel/generic/flags.mk Normal file
View File

@@ -0,0 +1,32 @@
cflags += -nostdinc \
-nostdlib \
-ffreestanding \
-fno-builtin \
-std=c11 \
-pedantic \
-Wall \
-Wextra
ifeq ($(buildtype),debug)
cflags += -O0 -g
endif
ifeq ($(buildtype),release)
cflags += -ffunction-sections -fdata-sections -Oz
endif
ldflags += -ffreestanding \
-nostdlib \
-fno-builtin \
-fuse-ld=lld \
-static
ifeq ($(buildtype),debug)
ldflags += -g
endif
ifeq ($(buildtype),release)
ldflags += -Wl,--gc-sections \
-Wl,--strip-all \
-flto
endif