Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rv32ec_zicsr tries to link against RVI libc #17

Open
jnk0le opened this issue May 20, 2023 · 14 comments
Open

rv32ec_zicsr tries to link against RVI libc #17

jnk0le opened this issue May 20, 2023 · 14 comments

Comments

@jnk0le
Copy link

jnk0le commented May 20, 2023

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 jnk0le changed the title rv32ec_zicsr tries to link against RVI libgcc rv32ec_zicsr tries to link against RVI "libg" May 20, 2023
@ilg-ul
Copy link
Contributor

ilg-ul commented May 20, 2023

Thank you for the link, but can you summarise the issue?

The current build uses the following multilibs:

XBB_GCC_MULTILIB_LIST=${XBB_GCC_MULTILIB_LIST:-"\
rv32e-ilp32e-- \
rv32ea-ilp32e-- \
rv32eac-ilp32e-- \
rv32ec-ilp32e-- \
rv32em-ilp32e-- \
rv32ema-ilp32e-- \
rv32emac-ilp32e-- \
rv32emc-ilp32e-- \
\
rv32i-ilp32-- \
rv32ia-ilp32-- \
rv32iac-ilp32-- \
rv32iaf-ilp32f-- \
rv32iafc-ilp32f-- \
rv32iafd-ilp32d-- \
rv32iafdc-ilp32d-- \
rv32ic-ilp32-- \
rv32if-ilp32f-- \
rv32ifc-ilp32f-- \
rv32ifd-ilp32d-- \
rv32ifdc-ilp32d-- \
rv32im-ilp32-- \
rv32ima-ilp32-- \
rv32imaf-ilp32f-- \
rv32imafc-ilp32f-- \
rv32imafd-ilp32d-- \
rv32imafdc-ilp32d-- \
rv32imc-ilp32-- \
rv32imf-ilp32f-- \
rv32imfc-ilp32f-- \
rv32imfd-ilp32d-- \
rv32imfdc-ilp32d-- \
\
rv64i-lp64-- \
rv64ia-lp64-- \
rv64iac-lp64-- \
rv64iaf-lp64f-- \
rv64iafc-lp64f-- \
rv64iafd-lp64d-- \
rv64iafdc-lp64d-- \
rv64ic-lp64-- \
rv64if-lp64f-- \
rv64ifc-lp64f-- \
rv64ifd-lp64d-- \
rv64ifdc-lp64d-- \
rv64im-lp64-- \
rv64ima-lp64-- \
rv64imac-lp64-- \
rv64imaf-lp64f-- \
rv64imafc-lp64f-- \
rv64imafd-lp64d-- \
rv64imafdc-lp64d-- \
rv64imc-lp64-- \
rv64imf-lp64f-- \
rv64imfc-lp64f-- \
rv64imfd-lp64d-- \
rv64imfdc-lp64d-- \
"}

Do you imply that these definitions are incomplete/incorrect?

@jnk0le
Copy link
Author

jnk0le commented May 20, 2023

The list doesn't contain _zicsr extension, but Zicsr ext will be useless here and I belive that it should't be added to the permutation set.

In this case compiler should pull in the biggest common denominator being rv32ec + ilp32e.
Instead it's pullnig RVI one (rv32i2p1_m2p0_a2p1_c2p0 ?)

here is log when trying printf()

c:/program files/gnu mcu eclipse/gcc/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/gcc/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-errno.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-errno.o): mis-matched ISA string to merge 'i' and 'e'
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-errno.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-impure.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-impure.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-printf.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-printf.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-findfp.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-findfp.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fwalk.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fwalk.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-lock.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-lock.o)
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-memset.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-mallocr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-mallocr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-vfprintf.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-vfprintf.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-vfprintf_i.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-vfprintf_i.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-sbrkr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-sbrkr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-stdio.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-stdio.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-wbuf.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-wbuf.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-writer.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-writer.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-wsetup.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-wsetup.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-closer.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-closer.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fflush.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fflush.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fvwrite.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fvwrite.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-lseekr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-lseekr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-makebuf.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-makebuf.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-memchr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-memchr.o)
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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)
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-memmove.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-mlock.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-mlock.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-freer.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-freer.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-reallocr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-reallocr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-readr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-readr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-reent.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-reent.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fstatr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-fstatr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-isattyr.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-isattyr.o)
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-msizer.o) use 16-byte stack aligned but the output use 4-byte stack aligned
c:/program files/gnu mcu eclipse/gcc/xpack-riscv-none-elf-gcc-12.2.0-3/bin/../lib/gcc/riscv-none-elf/12.2.0/../../../../riscv-none-elf/bin/ld.exe: rv32i2p1_m2p0_a2p1_c2p0: standard ISA extension `i' is not in canonical order
c:/program files/gnu mcu eclipse/gcc/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/gcc/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-nano-msizer.o)

@ilg-ul
Copy link
Contributor

ilg-ul commented May 20, 2023

Sorry but I'm no longer involved in the RISC-V development, and I don't know which are the valid combinations, I use only common 32/64 builds for my tests.

The current list was inherited from previous releases, without a thorough analyse.

If you know of a distribution that has a more up to date list, I can make a new release, but otherwise I don't know how to fix your problem. :-(

@jnk0le
Copy link
Author

jnk0le commented May 20, 2023

did more tests and it seems that when there is no match for march string then it defaults to RV32GC libc

e.g. RV32I_Zba pulls in RV32GC, RV32IC_Zba gives a false positive of compiling without any issues until A or M instruction is hit.

If you know of a distribution that has a more up to date list, I can make a new release, but otherwise I don't know how to fix your problem

increasing permutation set for useless things like zicsr, zifencei etc. is not the cleanest solution.
I'll check what upstream says.

@ilg-ul
Copy link
Contributor

ilg-ul commented May 20, 2023

I'll check what upstream says.

Please note that the xPack distribution uses the upstream sources, since SiFive no longer makes their toolchain public.

@jnk0le jnk0le changed the title rv32ec_zicsr tries to link against RVI "libg" rv32ec_zicsr tries to link against RVI libc May 20, 2023
@ilg-ul
Copy link
Contributor

ilg-ul commented May 20, 2023

@TommyMurphyTM1234, any comments on this issue?

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented May 20, 2023

@TommyMurphyTM1234, any comments on this issue?

Sorry, not at the moment. I'll need to try to recap on the latest state of play with regard to multilib generation, reuse, and canonicalised versus non-canonicalised architecture strings. All of which have caused me no end of confusion and which cause problems with building and/or using the toolchain (https://github.com/riscv-collab/riscv-gnu-toolchain) lately.

@TommyMurphyTM1234
Copy link

@TommyMurphyTM1234, any comments on this issue?

Sorry, not at the moment. I'll need to try to recap on the latest state of play with regard to multilib generation, reuse, and canonicalised versus non-canonicalised architecture strings. All of which have caused me no end of confusion and which cause problems with building and/or using the toolchain (https://github.com/riscv-collab/riscv-gnu-toolchain) lately.

See my comments here:

@TommyMurphyTM1234
Copy link

This issue/discussion might also be relevant here.

@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 1, 2023

This is a bit too confusing for me. :-(

Do I have to adjust something in the multilib definition in my scripts?

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented Jun 1, 2023

This is a bit too confusing for me. :-(

For me too! :-|

Do I have to adjust something in the multilib definition in my scripts?

I'm not sure.
These are my observations:

  1. You might want to - and might already plan to - reflect the separation of the Zicsr and Zifencei extensions from the base integer ISA in the project settings GUI? E.g. by adding them as checkbox options and maybe even having Zicsr selected by default?
  2. You might want to review your choice of toolchain default arch/abi of rv32imac/ilp32 especially since it does not include Zicsr?
  3. If the end user selects an arch/abi for which there are no multilibs/startup code then I don't think that you can do much about that and any concomitant link or, worse still, runtime errors when the toolchain default arch/abi libs/startup code are linked instead and they cannot be linked or, worse still, can be but contain instructions not actually supported by the target hardware!
  4. When riscv-gnu-toolchain bumps GCC from 12 to 13 (there's a PR still waiting acceptance) then the latter will include changes to how multilibs are matched. I think it's simply an automatic inference and use of the "multilib sharing" that users could do manually via multilib-generator/t-elf-multilib/t-linux-multilib or (for the bare metal toolchain) using configure ... --with-multilib-generator=.... But I'm still not completely clear on what it all involves or addresses. It may mean that it is possible to generate a smaller than exhaustive list of multilibs albeit at the cost of some programs being linked with multilibs/startup code that may not take full advantage of all available instructions.
  5. As you already know, it's not really practical to generate multilibs for all possible combinations of extensions so some decision has to be taken as to where to draw the line - and there's no correct answer here. The previous point about the GCC 13 multilib handling/matching may be relevant here too. But, again, I still don't fully understand these changes.
  6. The work on RISC-V platforms and (probably more pertinently) profiles may also help ameliorate the multilib combinatorial explosion issues/confusion but it's another thing that I don't fully understand, like other RISC-V things it may be more biased towards larger than embedded targets, and - in any case - it's still work in progress so I don't know that there's anything that you could leverage in the plugins right now.

@TommyMurphyTM1234
Copy link

And we haven't even touched on proprietary extensions here yet! :-D
For example:

@ilg-ul
Copy link
Contributor

ilg-ul commented Jun 1, 2023

You might want to - and might already plan to - reflect the separation of the Zicsr and Zifencei extensions from the base integer ISA in the project settings GUI? E.g. by adding them as checkbox options and maybe even having Zicsr selected by default?

That was the initial plan, but it is not realistic to add check buttons for all new extensions. I was even contemplating to remove all buttons and keep only the string field to enter whatever necessary.

You might want to review your choice of toolchain default arch/abi of rv32imac/ilp32 especially since it does not include Zicsr?

You mean to make it include Zicsr?

Now they are (in application.sh):

XBB_APPLICATION_GCC_ARCH=${XBB_APPLICATION_GCC_ARCH:-"rv32imac"}
XBB_APPLICATION_GCC_ABI=${XBB_APPLICATION_GCC_ABI:-"ilp32"}

How would those two options look like?

As for the long list of multiIibs, if you know how to make them accept more useful cases without increasing the length of the list, I can consider it.

For example why not add Zicsr and Zifencei to all libraries?

@TommyMurphyTM1234
Copy link

TommyMurphyTM1234 commented Jun 1, 2023

You mean to make it include Zicsr?

Yes - on the basis that, as far as I know and have experienced, most or all RISC-V targets will require CSR access instructions in practice. But, as ever, there is no "correct" answer here.

Now they are (in application.sh):

XBB_APPLICATION_GCC_ARCH=${XBB_APPLICATION_GCC_ARCH:-"rv32imac"}
XBB_APPLICATION_GCC_ABI=${XBB_APPLICATION_GCC_ABI:-"ilp32"}

How would those two options look like?

Presumably rv32imac would become rv32imac_zicsr or maybe rv32imac_zicsr_zifencei based on what's mentioned below?

As for the long list of multiIibs, if you know how to make them accept more useful cases without increasing the length of the list, I can consider it.

I think that the GCC 13 changes mean that where a multilib for a specific arch/abi is not available then the toolchain will instead select the "nearest" compatible one - but I am still not certain of the details.

For example why not add Zicsr and Zifencei to all libraries?

I don't know the answer to this question.
But for backward compatibility to when the I integer base ISA subsumed Zicsr and Zifencei perhaps that would make sense.
But then (unless GCC 13 changes things) if somebody selected rv32ima/ilp32 but this multilib does not exist (because the toolchain instead bundles rv32ima_zicsr_zifencei/ilp32) then the toolchain default libs for rv32imac[_zicsr_zifencei?]/ilp32 will be "silently" linked instead and the resulting executable may contain compressed instructions which will obviously trap on a target that does not actually implement the C extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants