[cfe-commits] r130594 - /cfe/trunk/lib/Driver/Tools.cpp

Daniel Dunbar daniel at zuster.org
Fri Apr 29 21:22:58 PDT 2011


Author: ddunbar
Date: Fri Apr 29 23:22:58 2011
New Revision: 130594

URL: http://llvm.org/viewvc/llvm-project?rev=130594&view=rev
Log:
Driver/Darwin: When using -mios-simulator-version-min, explicitly pass this on
to the linker.
 - Only do this explicitly with the argument for now, the linker will need to
   explicitly add support for this.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=130594&r1=130593&r2=130594&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Apr 29 23:22:58 2011
@@ -2820,8 +2820,20 @@
   // Add the deployment target.
   unsigned TargetVersion[3];
   DarwinTC.getTargetVersion(TargetVersion);
-  CmdArgs.push_back(DarwinTC.isTargetIPhoneOS() ? "-iphoneos_version_min" :
-                    "-macosx_version_min");
+
+  // If we had an explicit -mios-simulator-version-min argument, honor that,
+  // 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))
+    CmdArgs.push_back("-ios_simulator_version_min");
+  else if (DarwinTC.isTargetIPhoneOS())
+    CmdArgs.push_back("-iphoneos_version_min");
+  else
+    CmdArgs.push_back("-macosx_version_min");
   CmdArgs.push_back(Args.MakeArgString(llvm::Twine(TargetVersion[0]) + "." +
                                        llvm::Twine(TargetVersion[1]) + "." +
                                        llvm::Twine(TargetVersion[2])));





More information about the cfe-commits mailing list