riscv-none-elf-gcc-xpack icon indicating copy to clipboard operation
riscv-none-elf-gcc-xpack copied to clipboard

rv32ec_zicsr tries to link against RVI libc

Open jnk0le opened this issue 1 year ago • 14 comments

whenever -march=rv32ec_zicsr -mabi=ilp32e is used any reference to standard lib (newlib nano specs) ends up with:

c:/program files/gnu mcu eclipse/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: error: c:/program files/gnu mcu eclipse/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/lib\libg_nano.a(lib_a-memcpy-asm.o): mis-matched ISA string to merge 'i' and 'e'
c:/program files/gnu mcu eclipse/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: failed to merge target specific data of file c:/program files/gnu mcu eclipse/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/lib\libg_nano.a(lib_a-memcpy-asm.o)

The only working (with csr insns) workaround is to use -march=rv32ec -mabi=ilp32e -misa-spec=2.2 (https://www.eevblog.com/forum/microcontrollers/risc-v-compilation-errors-mismatched-libgcc/)

jnk0le avatar May 20 '23 14:05 jnk0le