[lld] [lld][LoongArch] Default disable linker relaxation in LoongArch. (PR #123017)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 21:57:14 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lld

Author: Zhaoxin Yang (ylzsx)

<details>
<summary>Changes</summary>

In the upcoming patches, we will add support for relaxation in LoongArch. However, it will remain disabled by default. After sufficient testing, we will enable it by default.

---
Full diff: https://github.com/llvm/llvm-project/pull/123017.diff


1 Files Affected:

- (modified) lld/ELF/Driver.cpp (+4) 


``````````diff
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp
index 13e8f8ce6df207..71aa291c05de11 100644
--- a/lld/ELF/Driver.cpp
+++ b/lld/ELF/Driver.cpp
@@ -1893,6 +1893,10 @@ static void setConfigs(Ctx &ctx, opt::InputArgList &args) {
       ErrAlways(ctx) << "cannot open --why-extract= file " << ctx.arg.whyExtract
                      << ": " << e.message();
   }
+
+  // Default disable LoongArch linker relaxation
+  if (ctx.arg.emachine == EM_LOONGARCH)
+    ctx.arg.relax = args.hasFlag(OPT_relax, OPT_no_relax, false);
 }
 
 static bool isFormatBinary(Ctx &ctx, StringRef s) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/123017


More information about the llvm-commits mailing list