From ae227d485cdac859b22d77da4072f870bce07740 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 11 Jun 2024 08:58:31 -0400 Subject: armcm_link: Fix build on recent arm gcc/newlibc versions It seems recent arm gcc versions no longer build correctly using the "--specs=nano.specs --specs=nosys.specs" linker flags. Replace those linker flags with "-nostdlib -lgcc -lc_nano". Signed-off-by: Kevin O'Connor --- src/rp2040/Makefile | 7 +++---- src/rp2040/rp2040_link.lds.S | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/rp2040') diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile index 64199014..b82503a3 100644 --- a/src/rp2040/Makefile +++ b/src/rp2040/Makefile @@ -46,7 +46,6 @@ $(OUT)klipper.uf2: $(OUT)klipper.elf $(OUT)lib/rp2040/elf2uf2/elf2uf2 $(Q)$(OUT)lib/rp2040/elf2uf2/elf2uf2 $< $@ rptarget-$(CONFIG_RP2040_HAVE_STAGE2) := $(OUT)klipper.uf2 -rplink-$(CONFIG_RP2040_HAVE_STAGE2) := $(OUT)src/rp2040/rp2040_link.ld stage2-$(CONFIG_RP2040_HAVE_STAGE2) := $(OUT)stage2.o # rp2040 building when using a bootloader @@ -55,13 +54,13 @@ $(OUT)klipper.bin: $(OUT)klipper.elf $(Q)$(OBJCOPY) -O binary $< $@ rptarget-$(CONFIG_RP2040_HAVE_BOOTLOADER) := $(OUT)klipper.bin -rplink-$(CONFIG_RP2040_HAVE_BOOTLOADER) := $(OUT)src/rp2040/rp2040_link.ld # Set klipper.elf linker rules target-y += $(rptarget-y) -CFLAGS_klipper.elf += --specs=nano.specs --specs=nosys.specs -T $(rplink-y) +CFLAGS_klipper.elf += -nostdlib -lgcc -lc_nano +CFLAGS_klipper.elf += -T $(OUT)src/rp2040/rp2040_link.ld OBJS_klipper.elf += $(stage2-y) -$(OUT)klipper.elf: $(stage2-y) $(rplink-y) +$(OUT)klipper.elf: $(stage2-y) $(OUT)src/rp2040/rp2040_link.ld # Flash rules lib/rp2040_flash/rp2040_flash: diff --git a/src/rp2040/rp2040_link.lds.S b/src/rp2040/rp2040_link.lds.S index 9b0264a2..6c2db3c9 100644 --- a/src/rp2040/rp2040_link.lds.S +++ b/src/rp2040/rp2040_link.lds.S @@ -77,5 +77,8 @@ SECTIONS // that isn't needed so no need to include them in the binary. *(.init) *(.fini) + // Don't include exception tables + *(.ARM.extab) + *(.ARM.exidx) } } -- cgit v1.2.3-70-g09d2