From de75064288205f2c92f4f2691e663f838b5f382f Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 2 Dec 2014 00:27:35 +0000 Subject: [PATCH] Remove special case for aarch64 static vs. PIC code in iOS kernel code. I added this check a while back but then made a note to myself that it should be completely unnecessary since iOS always uses PIC code-gen for aarch64. Since I could never come up with any reason why it would be necessary, I'm just going to remove it and we'll see if anything breaks. rdar://problem/13627985 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223097 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains.cpp | 3 +-- lib/Driver/Tools.cpp | 3 +-- test/Driver/pic.c | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 10079cde4b..99f4c9dfea 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -902,8 +902,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, // FIXME: It would be far better to avoid inserting those -static arguments, // but we can't check the deployment target in the translation code until // it is set here. - if (isTargetIOSBased() && !isIPhoneOSVersionLT(6, 0) && - getTriple().getArch() != llvm::Triple::aarch64) { + if (isTargetIOSBased() && !isIPhoneOSVersionLT(6, 0)) { for (ArgList::iterator it = DAL->begin(), ie = DAL->end(); it != ie; ) { Arg *A = *it; ++it; diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 7e30273110..d70be30982 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2753,8 +2753,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Note that these flags are trump-cards. Regardless of the order w.r.t. the // PIC or PIE options above, if these show up, PIC is disabled. llvm::Triple Triple(TripleStr); - if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6) || - Triple.getArch() == llvm::Triple::aarch64)) + if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6))) PIC = PIE = false; if (Args.hasArg(options::OPT_static)) PIC = PIE = false; diff --git a/test/Driver/pic.c b/test/Driver/pic.c index 3629cc4735..576b08e260 100644 --- a/test/Driver/pic.c +++ b/test/Driver/pic.c @@ -195,6 +195,8 @@ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 // RUN: %clang -c %s -target armv7-apple-ios -mkernel -miphoneos-version-min=6.0.0 -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-PIC2 +// RUN: %clang -c %s -target arm64-apple-ios -mkernel -miphoneos-version-min=7.0.0 -### 2>&1 \ +// RUN: | FileCheck %s --check-prefix=CHECK-PIC2 // RUN: %clang -c %s -target armv7-apple-ios -fapple-kext -miphoneos-version-min=5.0.0 -### 2>&1 \ // RUN: | FileCheck %s --check-prefix=CHECK-NO-PIC // RUN: %clang -c %s -target armv7-apple-ios -fapple-kext -miphoneos-version-min=6.0.0 -static -### 2>&1 \ -- 2.40.0