RISC-V: Test whether toolchain has both assembler and compiler support for Zcmp #3055

Merged
liamfraser merged 2 commits from riscv_zcmp_test into develop 2026-07-02 09:46:31 -05:00
liamfraser commented 2026-07-02 07:43:58 -05:00 (Migrated from github.com)

This solves the issue where GCC 14.1.0 claims it supports zcmp in the arch flags but does not actually support it when you compile it. This results in compile errors on release. See this multi-gcc exhaustive run for an example of the failure:

https://github.com/raspberrypi/pico-sdk/actions/runs/28577860556/job/84731730132

Note: multi-gcc works on all RISC-V compilers with this patch

This solves the issue where GCC 14.1.0 claims it supports zcmp in the arch flags but does not actually support it when you compile it. This results in compile errors on release. See this multi-gcc exhaustive run for an example of the failure: https://github.com/raspberrypi/pico-sdk/actions/runs/28577860556/job/84731730132 Note: multi-gcc works on all RISC-V compilers with this patch
Wren6991 (Migrated from github.com) reviewed 2026-07-02 07:43:58 -05:00
Wren6991 (Migrated from github.com) reviewed 2026-07-02 07:48:44 -05:00
Wren6991 commented 2026-07-02 07:52:57 -05:00 (Migrated from github.com)

For context when we look back and wonder why this exists: there was a period where riscv-gnu-toolchain shipped a version of GCC with full Zcmp support, but a version of binutils which lacked support for some Zcmp instructions (I think just cm.mvsa01 and cm.mva01s), so the assembler choked on the compiler output if you actually tried to compile anything significant.

https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1472#issuecomment-2143520816

https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1747

For context when we look back and wonder why this exists: there was a period where `riscv-gnu-toolchain` shipped a version of GCC with full Zcmp support, but a version of binutils which lacked support for some Zcmp instructions (I think just `cm.mvsa01` and `cm.mva01s`), so the assembler choked on the compiler output if you actually tried to compile anything significant. https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1472#issuecomment-2143520816 https://github.com/riscv-collab/riscv-gnu-toolchain/pull/1747
kilograham (Migrated from github.com) reviewed 2026-07-02 08:01:55 -05:00
@ -10,0 +11,4 @@
# C file used to test the flags listed above. There needs to be an equal number
# of entries in PICO_COMMON_LANG_FLAGS_LIST and PICO_COMMON_LANG_FLAGS_TEST_FILES.
set(PICO_COMMON_LANG_FLAGS_TEST_FILES
"${CMAKE_CURRENT_LIST_DIR}/util/riscv_zcmp_test.c"
kilograham (Migrated from github.com) commented 2026-07-02 08:01:55 -05:00

seems to be here twice

seems to be here twice
kilograham (Migrated from github.com) requested changes 2026-07-02 08:04:28 -05:00
@ -10,0 +11,4 @@
# C file used to test the flags listed above. There needs to be an equal number
# of entries in PICO_COMMON_LANG_FLAGS_LIST and PICO_COMMON_LANG_FLAGS_TEST_FILES.
set(PICO_COMMON_LANG_FLAGS_TEST_FILES
"${CMAKE_CURRENT_LIST_DIR}/util/riscv_zcmp_test.c"
kilograham (Migrated from github.com) commented 2026-07-02 08:04:23 -05:00

oh, ok, so the two lists must be in sync - needs a big comment to that effect then

oh, ok, so the two lists must be in sync - needs a big comment to that effect then
kilograham (Migrated from github.com) approved these changes 2026-07-02 09:46:03 -05:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!3055
No description provided.