summaryrefslogtreecommitdiff
path: root/contrib/llvm-project
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-08-06 19:24:17 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-08-06 19:24:17 +0000
commit82343267e32c24c6c577bc9cdae394d84c623507 (patch)
tree7a7599e8a390d1761c16c633ac0a81aced1630b0 /contrib/llvm-project
parentec280e9ec4b825ae73cdeccffeb8e72ce7dcc99d (diff)
downloadsrc-test-82343267e32c24c6c577bc9cdae394d84c623507.tar.gz
src-test-82343267e32c24c6c577bc9cdae394d84c623507.zip
Reapply r362235 (by kp):
llvm: Default to -mno-relax on RISC-V Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN requires unimplemented linker relaxation; recompile with -mno-relax'. Our default linker (ld.lld) doesn't support relaxation, so default to no-relax so we don't generate object files the linker can't handle. Reviewed by: mhorne Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25210
Notes
Notes: svn path=/projects/clang1100-import/; revision=363981
Diffstat (limited to 'contrib/llvm-project')
-rw-r--r--contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index be3f0a07b5763..b1ddd3d83909c 100644
--- a/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -536,8 +536,9 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,
if (Args.hasArg(options::OPT_ffixed_x31))
Features.push_back("+reserve-x31");
- // -mrelax is default, unless -mno-relax is specified.
- if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
+ // FreeBSD local, because ld.lld doesn't support relaxations
+ // -mno-relax is default, unless -mrelax is specified.
+ if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, false))
Features.push_back("+relax");
else
Features.push_back("-relax");