From 0de4e7d36430ea52b21e7b12d69605569bc986e7 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Thu, 18 Apr 2024 03:58:03 +0200 Subject: nasm: ignore zeroing warning When using `resb` outside of a BSS section, nasm will yell at you. But we know what we are doing! We never expect zero-init for such reserved spaces! --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 9f48c8a..e7e3ac5 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,10 @@ BUILD = build ARCH = x86_64 ASM = nasm ASMOBJFORMAT = elf64 +ASMFLAGS = -w-zeroing LINKER_SCRIPT = ./defs/$(ARCH)-linker.ld CARGO_XBUILD_TARGET = ./defs/$(ARCH)-rustubs.json -CARGO_XBUILD_FLAGS = +CARGO_XBUILD_FLAGS = --release # ---------- No need to edit below this line -------------- # ---------- If you have to, something is wrong ----------- ASM_SOURCES = $(shell find ./src -name "*.s") @@ -53,7 +54,7 @@ $(BUILD)/kernel : rust_kernel startup.o $(ASMOBJ_PREFIXED) $(BUILD)/_%.o : %.s | $(BUILD) @echo "ASM $@" @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi - $(VERBOSE) $(ASM) -f $(ASMOBJFORMAT) -o $@ $< + $(VERBOSE) $(ASM) -f $(ASMOBJFORMAT) $(ASMFLAGS) -o $@ $< # install xbuild first. (cargo install xbuild) @@ -66,7 +67,7 @@ rust_kernel: check # TODO make this arch dependent startup.o: boot/startup-$(ARCH).s | $(BUILD) @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi - nasm -f elf64 -o $(BUILD)/startup.o boot/startup-$(ARCH).s + $(VERBOSE) $(ASM) -f $(ASMOBJFORMAT) $(ASMFLAGS) -o $(BUILD)/startup.o boot/startup-$(ARCH).s .PHONY: $(BUILD) $(BUILD): -- cgit v1.2.3-70-g09d2