diff options
author | Nick Brassel <[email protected]> | 2024-03-09 21:40:19 +1100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-09 21:40:19 +1100 |
commit | 900e79febebaa6e8c682755442a385dc6f2ed703 (patch) | |
tree | 7a950302d76b0a399658e91b0f261ca7bb294820 | |
parent | fec2323089ab38262195eda4e68db7d0d6c9e7c7 (diff) | |
download | qmk_firmware-900e79febebaa6e8c682755442a385dc6f2ed703.tar.gz qmk_firmware-900e79febebaa6e8c682755442a385dc6f2ed703.zip |
Attempt to deal with GCC 13+ and rv32 arch extensions. (#23086)0.24.3
-rw-r--r-- | platforms/chibios/platform.mk | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk index f38a888012..b13eed39be 100644 --- a/platforms/chibios/platform.mk +++ b/platforms/chibios/platform.mk @@ -402,6 +402,17 @@ ifeq ($(strip $(MCU)), risc-v) -mabi=$(MCU_ABI) \ -mcmodel=$(MCU_CMODEL) \ -mstrict-align + + # Deal with different arch revisions and gcc renaming them + ifneq ($(shell echo 'int main() { asm("csrc 0x300,8"); return 0; }' | $(TOOLCHAIN)gcc $(MCUFLAGS) $(TOOLCHAIN_CFLAGS) -x c -o /dev/null - 2>/dev/null >/dev/null; echo $$?),0) + MCUFLAGS = -march=$(MCU_ARCH)_zicsr \ + -mabi=$(MCU_ABI) \ + -mcmodel=$(MCU_CMODEL) \ + -mstrict-align + ifneq ($(shell echo 'int main() { asm("csrc 0x300,8"); return 0; }' | $(TOOLCHAIN)gcc $(MCUFLAGS) $(TOOLCHAIN_CFLAGS) -x c -o /dev/null - 2>/dev/null >/dev/null; echo $$?),0) + $(call CATASTROPHIC_ERROR,Incompatible toolchain,No compatible RISC-V toolchain found. Can't work out correct architecture.) + endif + endif else # ARM toolchain specific configuration TOOLCHAIN ?= arm-none-eabi- |