riscv-software-src / homebrew-riscv

homebrew (macOS) packages for RISC-V toolchain
https://riscv.org
304 stars 50 forks source link

Multilib #121

Closed nutcakes closed 5 months ago

nutcakes commented 7 months ago

When I run the command riscv64-unknown-elf-gcc -O1 -mabi=lp64 -march=rv64i -o sum1ton.o sum1ton.c riscv64-unknown-elf-gcc: fatal error: Cannot find suitable multilib set for '-march=rv64i'/'-mabi=lp64' compilation terminated. I get this error. Also when running spike pk sum1ton.o with command riscv64-unknown-elf-gcc -Ofast -o sum1ton.o sum1ton.c I get the error libc++abi: terminating due to uncaught exception of type std::invalid_argument: Specified ELF can't be mapped: Invalid argument. Would anybody help out? Thanks in advance.

sbeamer commented 6 months ago

Not all combinations of arch and abi are compiled by default. The "multilib" support this repo provides is the same as https://github.com/riscv-collab/riscv-gnu-toolchain provides by default. If there is a combination of abi/arch you want that is not part of the default multilib, you will need to build the tools manually from the repo, and specify that abi/arch combo when you configure the build.