]> granicus.if.org Git - clang/commitdiff
Force the OS X version to 10.6 for old-style simulator builds.
authorBob Wilson <bob.wilson@apple.com>
Thu, 19 Jul 2012 01:35:55 +0000 (01:35 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 19 Jul 2012 01:35:55 +0000 (01:35 +0000)
The hack of recognizing a -D__IPHONE_OS_VERSION_MIN_REQUIRED option
in place of -mios-simulator-version-min leaves the Darwin version
unspecified.  It can be set separately with -mmacosx-version-min (which
makes no sense) or inferred to match the host version (which is unpredictable
and usually wrong).  This really needs to get cleaned up, but in the
meantime, force the OS X version to 10.6 so that the behavior is sane for
the iOS simulator.  Thanks for Argyrios for the patch.
<rdar://problem/11858187>

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

lib/Driver/ToolChains.cpp
test/Driver/ios-simulator-arcruntime.c

index b858c3e42872dc6735a25d489c5bc2a36616979d..4f3d33e901d7ab89fe286f982e63174a88792e46 100644 (file)
@@ -461,6 +461,11 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const {
             Major < 10 && Minor < 100 && Micro < 100) {
           TargetSimulatorVersionFromDefines = VersionTuple(Major, Minor, Micro);
         }
+        // When using the define to indicate the simulator, we force
+        // 10.6 macosx target.
+        const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
+        OSXVersion = Args.MakeJoinedArg(0, O, "10.6");
+        Args.append(OSXVersion);
         break;
       }
     }
index ffe3a9d3e76623f4b7e444514802d08267626c5f..33d34924ced1826d2e9bcc65d234f1d92653a1b5 100644 (file)
@@ -1,6 +1,8 @@
 // RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=40201 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s
-// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -mmacosx-version-min=10.6 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
+// RUN: %clang -### -x objective-c -target i386-apple-darwin10 -arch i386 -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -fobjc-arc -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s
 // 
 
+// CHECK-OPTIONS1: i386-apple-macosx10.6.0
 // CHECK-OPTIONS1: -fobjc-runtime=ios-4.2.1
+// CHECK-OPTIONS2: i386-apple-macosx10.6.0
 // CHECK-OPTIONS2: -fobjc-runtime=ios-5.0.0