]> granicus.if.org Git - clang/commitdiff
[Darwin] Fix deployment target detection
authorFrederic Riss <friss@apple.com>
Tue, 12 Jan 2016 23:47:59 +0000 (23:47 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 12 Jan 2016 23:47:59 +0000 (23:47 +0000)
There was a thinko in the deployment target detection code that
made the -isysroot parsing have precedence over the environment
variable for tvOS. This patch makes this logic symetric for all
platforms (the env variable must have precedence).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257543 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp
test/Driver/appletvos-version-min.c

index b9768a42fdf144336a06e0faecf9ae243a6a3b5c..beede2e0580467a0d79b3b493d188a9f48544a2f 100644 (file)
@@ -526,7 +526,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
     // no environment variable defined, see if we can set the default based
     // on -isysroot.
     if (OSXTarget.empty() && iOSTarget.empty() && WatchOSTarget.empty() &&
-        Args.hasArg(options::OPT_isysroot)) {
+        TvOSTarget.empty() && Args.hasArg(options::OPT_isysroot)) {
       if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
         StringRef isysroot = A->getValue();
         // Assume SDK has path: SOME_PATH/SDKs/PlatformXX.YY.sdk
index 9ff8297fe9eb078fbfc5a6ff6472768a2a1fbac7..7cbb2001a3ec215a5c30d56a5876f74cd15bc923 100644 (file)
@@ -2,6 +2,7 @@
 // REQUIRES: aarch64-registered-target
 // RUN: %clang -target i386-apple-darwin10 -mappletvsimulator-version-min=9.0 -arch x86_64 -S -o - %s | FileCheck %s
 // RUN: %clang -target armv7s-apple-darwin10 -mappletvos-version-min=9.0 -arch arm64 -S -o - %s | FileCheck %s
+// RUN: env TVOS_DEPLOYMENT_TARGET=9.0 %clang -isysroot SDKs/MacOSX10.9.sdk -target i386-apple-darwin10  -arch x86_64 -S -o - %s | FileCheck %s
 
 int main() { return 0; }
 // CHECK: .tvos_version_min 9, 0