Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2020 18:39:56 +0000 (UTC)
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362235 - head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch
Message-ID:  <202006161839.05GIdua2084930@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Tue Jun 16 18:39:56 2020
New Revision: 362235
URL: https://svnweb.freebsd.org/changeset/base/362235

Log:
  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

Modified:
  head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
==============================================================================
--- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp	Tue Jun 16 18:16:45 2020	(r362234)
+++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp	Tue Jun 16 18:39:56 2020	(r362235)
@@ -426,8 +426,9 @@ void riscv::getRISCVTargetFeatures(const Driver &D, co
   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");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006161839.05GIdua2084930>