[PATCH] D138944: [AIX][LTO] Properly respect LDR_CNTRL and set MAXDATA32 to 0xA0000000 at DSA

wael yehia via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 14:16:19 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd4cb39287c50: [AIX][LTO] Properly respect LDR_CNTRL and set MAXDATA32 to 0xA0000000 at DSA. (authored by w2yehia).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138944/new/

https://reviews.llvm.org/D138944

Files:
  llvm/lib/LTO/LTOCodeGenerator.cpp


Index: llvm/lib/LTO/LTOCodeGenerator.cpp
===================================================================
--- llvm/lib/LTO/LTOCodeGenerator.cpp
+++ llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -261,13 +261,18 @@
     }
   }
 
+  // Setup the LDR_CNTRL variable
+  std::string LDR_CNTRL_var = "LDR_CNTRL=MAXDATA32=0xA0000000 at DSA";
+  if (Optional<std::string> V = sys::Process::GetEnv("LDR_CNTRL"))
+    LDR_CNTRL_var += ("@" + *V);
+
   // Prepare inputs for the assember.
   const auto &Triple = TargetMach->getTargetTriple();
   const char *Arch = Triple.isArch64Bit() ? "-a64" : "-a32";
   std::string ObjectFileName(AssemblyFile);
   ObjectFileName[ObjectFileName.size() - 1] = 'o';
   SmallVector<StringRef, 8> Args = {
-      "/bin/env",     "LDR_CNTRL=MAXDATA32=0x80000000@${LDR_CNTRL}",
+      "/bin/env",     LDR_CNTRL_var,
       AssemblerPath,  Arch,
       "-many",        "-o",
       ObjectFileName, AssemblyFile};


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138944.478723.patch
Type: text/x-patch
Size: 924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221129/a44257a9/attachment.bin>


More information about the llvm-commits mailing list