pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

add support for the riscv-none-elf triplet

Open ilg-ul opened this issue 1 year ago • 6 comments

The xPack RISC-V Embedded GCC toolchain uses the riscv-none-elf triplet.

If you agree, I would like to contribute a small pull request to add it to the PICO_DEFAULT_GCC_TRIPLE list in the CMake files.

ilg-ul avatar Aug 30 '24 12:08 ilg-ul

sure; submit a PR

kilograham avatar Aug 30 '24 16:08 kilograham

cc @Wren6991

kilograham avatar Aug 30 '24 16:08 kilograham

sure; submit a PR

done.

ilg-ul avatar Aug 30 '24 17:08 ilg-ul

I don't know if it will hold up, but since it has no zcmp (_zcb_zcmp fails) at least now, maybe adding an extra pico_riscv_gcc_zcb.cmake:

set(CMAKE_SYSTEM_PROCESSOR hazard3)

set(PICO_DEFAULT_GCC_TRIPLE riscv32-unknown-elf riscv32-corev-elf riscv-none-elf)

set(PICO_COMMON_LANG_FLAGS " -march=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb -mabi=ilp32")

include(${CMAKE_CURRENT_LIST_DIR}/util/pico_arm_gcc_common.cmake)

as well to differentiate impact on performance of user code, which is basically pico_riscv_gcc_zcb_zcmp.cmake without zcmp. Compiles, but if it works, I don't know.

matsobdev avatar Aug 30 '24 19:08 matsobdev

The xPack RISC-V Embedded GCC toolchain is based on the upstream GCC, without changes. If there are extensions not yet upstreamed, I expect they'll be added at a certain point.

A friend edited locally these files and ran some benchmarks, thus I concluded that the xPack toolchain can be used to compile the SDK and some examples.

@matsobdev, I'm not sure what you suggest, but, if necessary, we can add a third file, no problem.

ilg-ul avatar Aug 30 '24 20:08 ilg-ul

zcmp is not accepted by my 14.2.0-1 release because of the outdated binutils 2.42 (the error comes from the assembler).

I did a new build with binutils 2.43.1 and the zcmp extension was accepted:

ilg@wksi tmp % /Users/ilg/Work/xpack-dev-tools-build/riscv-none-elf-gcc-14.2.0-2/darwin-x64/application/bin/riscv-none-elf-gcc m.c -march=rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb_zcmp -mabi=ilp32
ilg@wksi tmp % 

I'll make a new 14.2.0-2 release with the latest binutils.

ilg-ul avatar Sep 01 '24 20:09 ilg-ul

I think this is now obsolete; please reopen if not

kilograham avatar Jul 02 '25 14:07 kilograham