freebsd-ports/devel/freebsd-sysroot/files/riscv64-cc.in
Tobias Kortkamp 3dd789ff4a
devel/freebsd-sysroot: Add -mno-relax to the riscv64 wrapper scripts
$ FREEBSD_SYSROOT_CC=clang13 /usr/local/freebsd-sysroot/riscv64/bin/cc test.c
ld: error: test.c:(.text+0x0): relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax

On riscv64 base clang defaults to -mno-relax (per D25210). This
patch has not been applied to ports LLVM. In the wrapper scripts
pass -mno-relax explicitly to make it work as expected when
FREEBSD_SYSROOT_CC is set to ports clang.
2021-11-13 10:08:42 +01:00

4 lines
221 B
Bash

#!/bin/sh
: ${FREEBSD_SYSROOT_CC:="%%FREEBSD_SYSROOT_CC%%"}
: ${FREEBSD_SYSROOT:="%%FREEBSD_SYSROOT%%"}
exec "${FREEBSD_SYSROOT_CC}" --sysroot="${FREEBSD_SYSROOT}" --target=%%FREEBSD_SYSROOT_LLVM_TRIPLE%% -mno-relax "$@"