The current RISC-V instructions didn't play nicely for me with the multilib toolchain, causing a range of linker issues from mismatching architectures and ABIs.
A successful build required defining ld and its corresponding architecture, emulation mode, and the matching libm.a for the chosen -march=...,-mabi=... combination.
The following command ran successfully for me:
./build_all.py --arch riscv32 --chip generic --board ri5cyverilator --cc $RISCV/bin/riscv64-unknown-elf-gcc --ld $RISCV/bin/riscv64-unknown-elf-ld --cflags="-c -O2 -ffunction-sections -march=rv32imac -mabi=ilp32" --ldflags="-gc-sections --architecture=rv32imac -melf32lriscv -Lm" --user-libs="$RISCV/riscv64-unknown-elf/lib/rv32imac/ilp32/libm.a"
The current RISC-V instructions didn't play nicely for me with the multilib toolchain, causing a range of linker issues from mismatching architectures and ABIs.
A successful build required defining
ldand its corresponding architecture, emulation mode, and the matchinglibm.afor the chosen-march=...,-mabi=...combination.The following command ran successfully for me:
./build_all.py --arch riscv32 --chip generic --board ri5cyverilator --cc $RISCV/bin/riscv64-unknown-elf-gcc --ld $RISCV/bin/riscv64-unknown-elf-ld --cflags="-c -O2 -ffunction-sections -march=rv32imac -mabi=ilp32" --ldflags="-gc-sections --architecture=rv32imac -melf32lriscv -Lm" --user-libs="$RISCV/riscv64-unknown-elf/lib/rv32imac/ilp32/libm.a"