riscv-software-src / homebrew-riscv

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

use cmodel=medany when multilib build is enabled #57

Closed cfriedt closed 3 years ago

cfriedt commented 3 years ago

Even when building the homebrew-riscv toolchain via the command below, there are a few different circumstances where certain relocations are unsupported.

brew install riscv-gnu-toolchain --enable-multilib

A number of tickets can be found here that highlight the various relocation errors: https://github.com/riscv/riscv-gnu-toolchain/issues?q=is%3Aissue+relocation+%22--with-cmodel=medany%22

I propose using --with-cmodel=medany additionally when --enable-multilib is passed in to brew, as that solved the relocation issues for me.

There is a 1-liner fixup forthcoming.

cfriedt commented 3 years ago

Examples of relocation errors of the sort described here can be found in riscv/riscv-gnu-toolchain#784 and riscv/riscv-gnu-toolchain#457

sbeamer commented 3 years ago

Hopefully fixed by #59