aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-04-30 04:22:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-04-30 04:22:58 +0000
commitb7f5ef73aee479b2fa54c30cfebed665be8fccb9 (patch)
treea7e32a35166fe924e3ac2dcc7077c090b1cf535e /lib/Driver/Tools.cpp
parent3fd823b0625eba87153fe592a0fd12e088db3b36 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index b4693010e1..2c805923c5 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -2820,8 +2820,20 @@ void darwin::Link::AddLinkArgs(Compilation &C,
// 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])));