Since ld.lld doesn't properly support R_RISCV_RELAX relocations, switch the
authorkettenis <kettenis@openbsd.org>
Tue, 11 May 2021 09:36:41 +0000 (09:36 +0000)
committerkettenis <kettenis@openbsd.org>
Tue, 11 May 2021 09:36:41 +0000 (09:36 +0000)
default to -no-relax.

ok drahn@

gnu/llvm/clang/lib/Driver/ToolChains/Arch/RISCV.cpp

index be3f0a0..695d8ac 100644 (file)
@@ -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.