From 7101970b3cdb2a0190e69a98352275907ab935a4 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 11 Sep 2022 01:07:52 +0300 Subject: allow building with riscv64-linux-gnu + May warn about PHDR not being in LOAD, there is a flag to silence it (--no-warn-rwx-segment) but it doesn't seem to exist in riscv64-unknown-elf for some reason. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a647267..3c29758 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ DEBUGFLAGS != [ $(RELEASE) ] \ && echo "-flto -O2 -g -DNDEBUG" \ || echo "-O0 -g -DDEBUG" -CFLAGS = -ffreestanding -nostdlib -std=c17 -Wall -Wextra -Wvla -D$(ARCH) +CFLAGS = -ffreestanding -nostdlib -static -fno-pie -std=c17 -Wall -Wextra -Wvla -D$(ARCH) DEPFLAGS = -MT $@ -MMD -MP -MF $@.d LINTFLAGS = -fsyntax-only PREPROCESS = -E @@ -47,7 +47,8 @@ LINK_FLAGS := $(LDFLAGS) $(ARCH_LDFLAGS) INCLUDE_FLAGS := -I include -include config.h -include arch/$(ARCH)/config.h # This makes sure .bss is loaded into the binary -OBJCOPY_FLAGS ?= -Obinary --set-section-flags .bss=alloc,load,contents +OBJCOPY_FLAGS ?= -Obinary -R .garbage \ + --set-section-flags .bss=alloc,load,contents COMPILE = $(COMPILER) $(DEBUGFLAGS)\ $(COMPILE_FLAGS) $(DEPFLAGS) $(INCLUDE_FLAGS) -- cgit v1.3