[driver] Use the iOS target triple to infer the deployment target.
rdar://11409204
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156489 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index cc1adb1..86fef4f 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -524,8 +524,14 @@
// If no OSX or iOS target has been specified and we're compiling for armv7,
// go ahead as assume we're targeting iOS.
if (OSXTarget.empty() && iOSTarget.empty())
- if (getDarwinArchName(Args) == "armv7")
- iOSTarget = "0.0";
+ if (getDarwinArchName(Args) == "armv7") {
+ std::string iOSVersionMin;
+ unsigned Major, Minor, Micro;
+ getTriple().getiOSVersion(Major, Minor, Micro);
+ llvm::raw_string_ostream(iOSVersionMin)
+ << Major << '.' << Minor << '.' << Micro;
+ iOSTarget = iOSVersionMin;
+ }
// Handle conflicting deployment targets
//