Issue with RISC-V Toolchain Build Failure in Chipyard (Step 3)

17 views
Skip to first unread message

surya prabha

unread,
Mar 17, 2026, 4:06:02 PMMar 17
to Chipyard

Hi Chipyard Team,

I am currently setting up Chipyard and encountering an issue during the toolchain build process (Step 3: Building toolchain collateral).

Here is a summary of the problem:

  • The build fails while compiling riscv-pk.

  • During the configure stage, the system is unable to detect the cross-compiler:

    • checking for riscv64-unknown-elf-gcc... no

    • checking for riscv64-unknown-elf-g++... no

  • As a result, the build falls back to the host gcc, which leads to the following errors:

gcc: error: unrecognized argument in option ‘-mcmodel=medany’ gcc: error: unrecognized argument in option ‘-mabi=lp64’

From my understanding, these flags are specific to the RISC-V cross-compiler, which suggests that the correct toolchain is either not built or not being detected in the PATH.

Additional context:

  • $RISCV/bin currently contains only:

    elf2hex spike spike-dasm spike-log-parser termios-xspike xspike

    and does not include riscv64-unknown-elf-gcc.

It appears that the RISC-V GNU toolchain did not build or install correctly, causing Chipyard to use the host compiler instead.

Could you please advise on:

  1. The correct way to build the RISC-V toolchain in a non-sudo environment?

  2. Whether there are recommended prebuilt binaries for such restricted systems?

  3. Any specific environment variables or setup steps I might be missing?

Thank you for your help.

Best regards,
Surya

Reply all
Reply to author
Forward
0 new messages