diff options
author | QMK Bot <[email protected]> | 2024-03-09 10:40:47 +0000 |
---|---|---|
committer | QMK Bot <[email protected]> | 2024-03-09 10:40:47 +0000 |
commit | 145a1eca1b8935c300cf567c2b40a7916cd0ba0c (patch) | |
tree | 71c32a6bb94a0646c56eb4447f30cc373a7ce5f8 /platforms/chibios | |
parent | 1db7ff7f18b7d6922dec6e8746850e0f41cef984 (diff) | |
parent | 900e79febebaa6e8c682755442a385dc6f2ed703 (diff) | |
download | qmk_firmware-145a1eca1b8935c300cf567c2b40a7916cd0ba0c.tar.gz qmk_firmware-145a1eca1b8935c300cf567c2b40a7916cd0ba0c.zip |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'platforms/chibios')
-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- |