Skip to content

RISC-V Multilib Docs #208

Description

@cgshep

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions