r257543 - [Darwin] Fix deployment target detection

Frederic Riss via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 12 15:47:59 PST 2016


Author: friss
Date: Tue Jan 12 17:47:59 2016
New Revision: 257543

URL: http://llvm.org/viewvc/llvm-project?rev=257543&view=rev
Log:
[Darwin] Fix deployment target detection

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).

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/test/Driver/appletvos-version-min.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=257543&r1=257542&r2=257543&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Jan 12 17:47:59 2016
@@ -526,7 +526,7 @@ void Darwin::AddDeploymentTarget(Derived
     // 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

Modified: cfe/trunk/test/Driver/appletvos-version-min.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/appletvos-version-min.c?rev=257543&r1=257542&r2=257543&view=diff
==============================================================================
--- cfe/trunk/test/Driver/appletvos-version-min.c (original)
+++ cfe/trunk/test/Driver/appletvos-version-min.c Tue Jan 12 17:47:59 2016
@@ -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




More information about the cfe-commits mailing list