From e15071f8abee7f13d1a7093171d170e7b38b9568 Mon Sep 17 00:00:00 2001 From: kettenis Date: Tue, 11 May 2021 09:36:41 +0000 Subject: [PATCH] Since ld.lld doesn't properly support R_RISCV_RELAX relocations, switch the default to -no-relax. ok drahn@ --- gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp index be3f0a07b57..695d8ac83b5 100644 --- a/gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp +++ b/gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp @@ -536,11 +536,19 @@ void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple, if (Args.hasArg(options::OPT_ffixed_x31)) Features.push_back("+reserve-x31"); +#ifdef __OpenBSD__ + // -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"); +#else // -mrelax is default, unless -mno-relax is specified. if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true)) Features.push_back("+relax"); else Features.push_back("-relax"); +#endif // GCC Compatibility: -mno-save-restore is default, unless -msave-restore is // specified. -- 2.20.1