From 49e93194a48d2f81ece727cf0433445b9a83f08a Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Mon, 5 Aug 2024 05:53:47 -0400 Subject: [PATCH] build: fix build on newer versions of gcc Signed-off-by: Eric Callahan --- src/generic/armcm_deployer.lds.S | 3 +++ src/generic/armcm_link.lds.S | 3 +++ src/lpc176x/Makefile | 4 ++-- src/rp2040/Makefile | 4 ++-- src/rp2040/rp2040_link.lds.S | 3 +++ src/stm32/Makefile | 4 ++-- 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/generic/armcm_deployer.lds.S b/src/generic/armcm_deployer.lds.S index 1638243..e9bf33c 100644 --- a/src/generic/armcm_deployer.lds.S +++ b/src/generic/armcm_deployer.lds.S @@ -72,5 +72,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) } } diff --git a/src/generic/armcm_link.lds.S b/src/generic/armcm_link.lds.S index 2dfc7db..146d600 100644 --- a/src/generic/armcm_link.lds.S +++ b/src/generic/armcm_link.lds.S @@ -74,5 +74,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) } } diff --git a/src/lpc176x/Makefile b/src/lpc176x/Makefile index 987f10b..057a98b 100644 --- a/src/lpc176x/Makefile +++ b/src/lpc176x/Makefile @@ -8,7 +8,7 @@ dirs-y += src/lpc176x src/generic lib/lpc176x/device CFLAGS += -mthumb -mcpu=cortex-m3 -Ilib/lpc176x/device -Ilib/cmsis-core CFLAGS += -Wno-nonnull -CFLAGS_katapult.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_katapult.elf += -nostdlib -lgcc -lc_nano CFLAGS_katapult.elf += -T $(OUT)src/generic/armcm_link.ld $(OUT)katapult.elf: $(OUT)src/generic/armcm_link.ld @@ -26,6 +26,6 @@ BUILDBINARY_FLAGS = -l # Deployer build deployer-y += generic/armcm_boot.c generic/armcm_reset.c $(mcu-y) -CFLAGS_deployer.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_deployer.elf += -nostdlib -lgcc -lc_nano CFLAGS_deployer.elf += -T $(OUT)src/generic/armcm_deployer.ld $(OUT)deployer.elf: $(OUT)src/generic/armcm_deployer.ld diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile index a9ee3aa..58efca1 100644 --- a/src/rp2040/Makefile +++ b/src/rp2040/Makefile @@ -8,7 +8,7 @@ dirs-y += src/rp2040 src/generic lib/rp2040/elf2uf2 lib/fast-hash lib/can2040 li CFLAGS += -mcpu=cortex-m0plus -mthumb -Ilib/cmsis-core CFLAGS += -Ilib/rp2040 -Ilib/rp2040/cmsis_include -Ilib/fast-hash -Ilib/can2040 -Ilib/rp2040/pico/flash/ -Ilib/rp2040/pico/bootrom/ -CFLAGS_katapult.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_katapult.elf += -nostdlib -lgcc -lc_nano CFLAGS_katapult.elf += -T $(OUT)src/rp2040/rp2040_link.ld # Add source files @@ -62,6 +62,6 @@ flash: $(OUT)katapult.uf2 lib/rp2040_flash/rp2040_flash # Deployer build deployer-y += generic/armcm_boot.c generic/armcm_reset.c $(mcu-y) -CFLAGS_deployer.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_deployer.elf += -nostdlib -lgcc -lc_nano CFLAGS_deployer.elf += -T $(OUT)src/generic/armcm_deployer.ld $(OUT)deployer.elf: $(OUT)src/generic/armcm_deployer.ld diff --git a/src/rp2040/rp2040_link.lds.S b/src/rp2040/rp2040_link.lds.S index 8df488d..193c21e 100644 --- a/src/rp2040/rp2040_link.lds.S +++ b/src/rp2040/rp2040_link.lds.S @@ -63,5 +63,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) } } diff --git a/src/stm32/Makefile b/src/stm32/Makefile index 1a9100f..e2a8a78 100644 --- a/src/stm32/Makefile +++ b/src/stm32/Makefile @@ -22,7 +22,7 @@ CFLAGS-$(CONFIG_MACH_STM32G0) += -mcpu=cortex-m0plus -Ilib/stm32g0/include CFLAGS-$(CONFIG_MACH_STM32H7) += -mcpu=cortex-m7 -Ilib/stm32h7/include CFLAGS += $(CFLAGS-y) -D$(MCU_UPPER) -mthumb -Ilib/cmsis-core -Ilib/fast-hash -CFLAGS_katapult.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_katapult.elf += -nostdlib -lgcc -lc_nano CFLAGS_katapult.elf += -T $(OUT)src/generic/armcm_link.ld $(OUT)katapult.elf: $(OUT)src/generic/armcm_link.ld @@ -67,6 +67,6 @@ src-$(CONFIG_CANSERIAL) += $(canbus-src-y) generic/canbus.c stm32/chipid.c # Deployer build deployer-y += generic/armcm_boot.c generic/armcm_reset.c $(mcu-y) -CFLAGS_deployer.elf += --specs=nano.specs --specs=nosys.specs +CFLAGS_deployer.elf += -nostdlib -lgcc -lc_nano CFLAGS_deployer.elf += -T $(OUT)src/generic/armcm_deployer.ld $(OUT)deployer.elf: $(OUT)src/generic/armcm_deployer.ld