From d40664bb740baacaccf112529b17017cee839e7e Mon Sep 17 00:00:00 2001 From: Henny022p Date: Thu, 11 May 2023 19:02:49 +0200 Subject: [PATCH 1/2] revert memcpy linker change because new ld does not like it adjust dependency scan to still skip libs --- GBA.mk | 2 +- linker.ld | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GBA.mk b/GBA.mk index 62221d21..a81be08f 100644 --- a/GBA.mk +++ b/GBA.mk @@ -136,7 +136,7 @@ LIB := -L ../../tools/agbcc/lib -lc $(ROM): $(ELF) $(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0x9000000 $< $@ -$(ELF): objs = $(shell grep -o -E "(\w|/)+\.o" linker.ld) +$(ELF): objs = $(shell grep -vE "\*\w+\.a" linker.ld | grep -oE "(\w|/)+\.o") $(ELF): $(BUILD_DIR)/linker.ld $$(addprefix $(BUILD_DIR)/, $$(objs)) cd $(BUILD_DIR) && $(LD) $(LDFLAGS) -n -T linker.ld -o ../../$@ $(LIB) $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent diff --git a/linker.ld b/linker.ld index 039ac9c5..17221aa0 100644 --- a/linker.ld +++ b/linker.ld @@ -867,7 +867,7 @@ SECTIONS { src/gba/m4a.o(.text); asm/lib/libagbsyscall.o(.text); src/eeprom.o(.text); - libc.a(.text); + *libc.a:memcpy.o(.text); /* handwritten assembly in arm mode */ asm/src/intr.o(.text); From 7c749c7f3c8219f368304b05643fa3b2f9665fc7 Mon Sep 17 00:00:00 2001 From: Henny022p Date: Sat, 13 May 2023 16:41:48 +0200 Subject: [PATCH 2/2] use printf instead of echo echo is not portable, hope is that printf is more so --- GBA.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GBA.mk b/GBA.mk index a81be08f..87048ef9 100644 --- a/GBA.mk +++ b/GBA.mk @@ -123,7 +123,7 @@ $(BUILD_DIR)/%.o : %.c $$(deps) @mkdir -p $(dir $@) $(CPP) $(CPPFLAGS) $< -o $(BUILD_DIR)/$*.i $(CC1) $(CFLAGS) -o $(BUILD_DIR)/$*.s $(BUILD_DIR)/$*.i - @echo "\t.text\n\t.align\t2, 0 @ Don't pad with nop\n" >> $(BUILD_DIR)/$*.s + @printf "\t.text\n\t.align\t2, 0 @ Don't pad with nop\n" >> $(BUILD_DIR)/$*.s $(AS) $(ASFLAGS) -o $@ $(BUILD_DIR)/$*.s # ==============