[lld] 84c52f3 - [lld-macho] arm64_32 executables are always PIE

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 08:55:53 PDT 2021


Author: Jez Ng
Date: 2021-04-13T11:55:45-04:00
New Revision: 84c52f3a19cb9a822c4a073dede1be1642453a65

URL: https://github.com/llvm/llvm-project/commit/84c52f3a19cb9a822c4a073dede1be1642453a65
DIFF: https://github.com/llvm/llvm-project/commit/84c52f3a19cb9a822c4a073dede1be1642453a65.diff

LOG: [lld-macho] arm64_32 executables are always PIE

This should fix the assert that's currently breaking the build.

Added: 
    

Modified: 
    lld/MachO/Driver.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/Driver.cpp b/lld/MachO/Driver.cpp
index 397157d8bb57..0d4768f99964 100644
--- a/lld/MachO/Driver.cpp
+++ b/lld/MachO/Driver.cpp
@@ -680,12 +680,15 @@ static const char *getReproduceOption(InputArgList &args) {
 static bool isPie(InputArgList &args) {
   if (config->outputType != MH_EXECUTE || args.hasArg(OPT_no_pie))
     return false;
-  if (config->target.Arch == AK_arm64 || config->target.Arch == AK_arm64e)
+  if (config->target.Arch == AK_arm64 || config->target.Arch == AK_arm64e ||
+      config->target.Arch == AK_arm64_32)
     return true;
 
   // TODO: add logic here as we support more archs. E.g. i386 should default
   // to PIE from 10.7
-  assert(config->target.Arch == AK_x86_64 || config->target.Arch == AK_x86_64h);
+  assert(config->target.Arch == AK_x86_64 ||
+         config->target.Arch == AK_x86_64h ||
+         config->target.Arch == AK_arm64_32);
 
   PlatformKind kind = config->target.Platform;
   if (kind == PlatformKind::macOS &&


        


More information about the llvm-commits mailing list