From b1396172e8b2914d269eee7c8957b0029f2b6076 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Thu, 18 Apr 2024 05:14:17 +0200 Subject: makefile: mute ld RWX warning --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f83fb12..9ae5e85 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ CARGO_XBUILD_TARGET = ./defs/$(ARCH)-rustubs.json CARGO_XBUILD_FLAGS = --release # ---------- No need to edit below this line -------------- # ---------- If you have to, something is wrong ----------- +LDFLAGS = -no-warn-rwx-segment -static -e startup ASM_SOURCES = $(shell find ./src -name "*.s") ASM_OBJECTS = $(patsubst %.s,_%.o, $(notdir $(ASM_SOURCES))) # I don't like this style... but what can I do? @@ -32,7 +33,7 @@ ASMOBJ_PREFIXED = $(addprefix $(BUILD)/,$(ASM_OBJECTS)) VPATH = $(sort $(dir $(ASM_SOURCES))) -ifneq ($(filter --release,$(CARGO_XBUILD_FLAGS)),) +ifneq ($(filter --release,$(CARGO_XBUILD_FLAGS)),) RUST_BUILD = release else RUST_BUILD = debug @@ -50,7 +51,7 @@ bootdisk.iso : $(BUILD)/kernel # Note: explicitly tell the linker to use startup: as the entry point (we have no main here) $(BUILD)/kernel : rust_kernel startup.o $(ASMOBJ_PREFIXED) @echo "---LINKING ... ---" - $(VERBOSE) ld -static -e startup -T $(LINKER_SCRIPT) -o $@ $(BUILD)/startup.o $(ASMOBJ_PREFIXED) $(RUST_OBJECT) + $(VERBOSE) ld $(LDFLAGS) -T $(LINKER_SCRIPT) -o $@ $(BUILD)/startup.o $(ASMOBJ_PREFIXED) $(RUST_OBJECT) # Note: this target works when the VPATH is set correctly $(BUILD)/_%.o : %.s | $(BUILD) -- cgit v1.2.3-70-g09d2