From 5c243e3f81a8a02c586170cbaeffbb8cb3dbdd0c Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 1 Oct 2025 03:39:50 +0200 Subject: [PATCH] Makefile: separate machine specific options, add link to gcc docs --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5622f00..3e7e62a 100644 --- a/Makefile +++ b/Makefile @@ -26,11 +26,13 @@ ASFLAGS = -march=rv64gc -mabi=lp64 LDFLAGS = -Tkern/kernel.ld LDFLAGS += -m elf64lriscv -CFLAGS = -Wall -Werror -O -CFLAGS += -Wno-unused-result -CFLAGS += -Wno-unused-variable +# See: https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/RISC-V-Options.html#index-march-14 CFLAGS += -mcmodel=medany CFLAGS += -march=rv64gc -mabi=lp64 + +CFLAGS += -Wall -Werror -O +CFLAGS += -Wno-unused-result +CFLAGS += -Wno-unused-variable CFLAGS += -ffreestanding CFLAGS += -fno-common CFLAGS += -nostdlib