]> granicus.if.org Git - clang/commitdiff
Remove a FIXME: use the ios_simulator_version_min linker option consistently.
authorBob Wilson <bob.wilson@apple.com>
Fri, 10 Oct 2014 19:38:34 +0000 (19:38 +0000)
committerBob Wilson <bob.wilson@apple.com>
Fri, 10 Oct 2014 19:38:34 +0000 (19:38 +0000)
This was previously only used when explicitly requested with a command line
option because it had to work with some old versions of the linker when it
was first introduced. That is ancient history now, and it should be safe to
use the correct option even when using the IPHONEOS_DEPLOYMENT_TARGET
environment variable to specify that the target is the iOS simulator.
Besides updating the test for this, I also added a few more tests for the
iOS linker options.

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

lib/Driver/ToolChains.cpp
test/Driver/darwin-ld.c

index 384b995386a8edf60bcee87f0b44498130402029..d98f4fb503eeb3a60ff2b0e2d7d028ef333578bf 100644 (file)
@@ -984,10 +984,7 @@ void Darwin::addMinVersionArgs(const llvm::opt::ArgList &Args,
   // otherwise use the traditional deployment targets. We can't just check the
   // is-sim attribute because existing code follows this path, and the linker
   // may not handle the argument.
-  //
-  // FIXME: We may be able to remove this, once we can verify no one depends on
-  // it.
-  if (Args.hasArg(options::OPT_mios_simulator_version_min_EQ))
+  if (isTargetIOSSimulator())
     CmdArgs.push_back("-ios_simulator_version_min");
   else if (isTargetIOSBased())
     CmdArgs.push_back("-iphoneos_version_min");
index 2da0d30b500812220aa299b2517924c85743c52b..d3d0f1da197b2f1e07fbb25337eb1cd9e1cb9b94 100644 (file)
@@ -17,6 +17,8 @@
 // RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
 
 // LINK_IPHONE_3_0: {{ld(.exe)?"}}
+// LINK_IPHONE_3_0: -iphoneos_version_min
+// LINK_IPHONE_3_0: 3.0.0
 // LINK_IPHONE_3_0-NOT: -lcrt1.3.1.o
 // LINK_IPHONE_3_0: -lcrt1.o
 // LINK_IPHONE_3_0: -lSystem
@@ -34,6 +36,8 @@
 // RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
 
 // LINK_IPHONE_3_1: {{ld(.exe)?"}}
+// LINK_IPHONE_3_1: -iphoneos_version_min
+// LINK_IPHONE_3_1: 3.1.0
 // LINK_IPHONE_3_1-NOT: -lcrt1.o
 // LINK_IPHONE_3_1: -lcrt1.3.1.o
 // LINK_IPHONE_3_1: -lSystem
@@ -51,6 +55,8 @@
 // RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
 
 // LINK_IOSSIM_3_0: {{ld(.exe)?"}}
+// LINK_IOSSIM_3_0: -ios_simulator_version_min
+// LINK_IOSSIM_3_0: 3.0.0
 // LINK_IOSSIM_3_0-NOT: -lcrt1.o
 // LINK_IOSSIM_3_0: -lSystem
 // LINK_IOSSIM_3_0: {{ld(.exe)?"}}
 // LINK_X86_64H_MULTIARCH: {{ld(.exe)?"}}
 // LINK_X86_64H_MULTIARCH: "x86_64h"
 
-// Check that clang passes -iphoneos_version_min to the linker when building
-// for the iOS simulator but when -mios-simulator-version-min is not
-// explicitly specified (<rdar://problem/15959009>).
+// Check for the linker options to specify the iOS version when the
+// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
+// deployment target options.
 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
-// RUN:   %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN:   %clang -target arm64-apple-darwin -### %t.o 2> %t.log
 // RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
+// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
+// RUN:   %clang -target i386-apple-darwin -### %t.o 2> %t.log
+// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
 // LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
+// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min