diff --git a/lib/Driver/HostInfo.cpp b/lib/Driver/HostInfo.cpp
index 89a3f8f..305c7cc 100644
--- a/lib/Driver/HostInfo.cpp
+++ b/lib/Driver/HostInfo.cpp
@@ -155,11 +155,18 @@
   if (!TC) {
     llvm::Triple TCTriple(getTriple());
     TCTriple.setArchName(ArchName);
-                          
+
     if (strcmp(ArchName, "i386") == 0 || strcmp(ArchName, "x86_64") == 0)
       TC = new toolchains::Darwin(*this, TCTriple,
                                   DarwinVersion,
-                                  GCCVersion);
+                                  GCCVersion,
+                                  false);
+    else if (strncmp(ArchName, "arm", 3) == 0 ||
+             strncmp(ArchName, "thumb", 5) == 0)
+      TC = new toolchains::Darwin(*this, TCTriple,
+                                  DarwinVersion,
+                                  GCCVersion,
+                                  true);
     else
       TC = new toolchains::Darwin_GCC(*this, TCTriple);
   }
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index 63b629f..d6067af 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -29,7 +29,8 @@
 
 Darwin::Darwin(const HostInfo &Host, const llvm::Triple& Triple,
                const unsigned (&_DarwinVersion)[3],
-               const unsigned (&_GCCVersion)[3])
+               const unsigned (&_GCCVersion)[3],
+               bool _IsIPhone)
   : ToolChain(Host, Triple) {
   DarwinVersion[0] = _DarwinVersion[0];
   DarwinVersion[1] = _DarwinVersion[1];
@@ -37,10 +38,14 @@
   GCCVersion[0] = _GCCVersion[0];
   GCCVersion[1] = _GCCVersion[1];
   GCCVersion[2] = _GCCVersion[2];
+  IsIPhone = _IsIPhone;
 
   llvm::raw_string_ostream(MacosxVersionMin)
     << "10." << DarwinVersion[0] - 4 << '.' << DarwinVersion[1];
 
+  // FIXME: Lift default up.
+  IPhoneOSVersionMin = "3.0";
+
   ToolChainDir = "i686-apple-darwin";
   ToolChainDir += llvm::utostr(DarwinVersion[0]);
   ToolChainDir += "/";
@@ -150,15 +155,21 @@
   } else if (!OSXVersion && !iPhoneVersion) {
     // Chose the default version based on the arch.
     //
-    // FIXME: This will need to be fixed when we merge in arm support.
+    // FIXME: Are there iPhone overrides for this?
 
-    // Look for MACOSX_DEPLOYMENT_TARGET, otherwise use the version
-    // from the host.
-    const char *Version = ::getenv("MACOSX_DEPLOYMENT_TARGET");
-    if (!Version)
-      Version = MacosxVersionMin.c_str();
-    const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
-    DAL->append(DAL->MakeJoinedArg(0, O, Version));
+    if (!isIPhone()) {
+      // Look for MACOSX_DEPLOYMENT_TARGET, otherwise use the version
+      // from the host.
+      const char *Version = ::getenv("MACOSX_DEPLOYMENT_TARGET");
+      if (!Version)
+        Version = MacosxVersionMin.c_str();
+      const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
+      DAL->append(DAL->MakeJoinedArg(0, O, Version));
+    } else {
+      const char *Version = IPhoneOSVersionMin.c_str();
+      const Option *O = Opts.getOption(options::OPT_miphoneos_version_min_EQ);
+      DAL->append(DAL->MakeJoinedArg(0, O, Version));
+    }
   }
   
   for (ArgList::iterator it = Args.begin(), ie = Args.end(); it != ie; ++it) {
diff --git a/lib/Driver/ToolChains.h b/lib/Driver/ToolChains.h
index 3d8632e..b0cc9cb 100644
--- a/lib/Driver/ToolChains.h
+++ b/lib/Driver/ToolChains.h
@@ -53,6 +53,9 @@
   /// GCC version to use.
   unsigned GCCVersion[3];
 
+  /// Whether this is this an iPhone toolchain.
+  bool IsIPhone;
+
   /// The directory suffix for this tool chain.
   std::string ToolChainDir;
 
@@ -60,12 +63,16 @@
   /// initialized.
   mutable std::string MacosxVersionMin;
 
+  /// The default iphoneos-version-min of this tool chain.
+  std::string IPhoneOSVersionMin;
+
   const char *getMacosxVersionMin() const;
 
 public:
   Darwin(const HostInfo &Host, const llvm::Triple& Triple, 
-             const unsigned (&DarwinVersion)[3],
-             const unsigned (&GCCVersion)[3]);
+         const unsigned (&DarwinVersion)[3],
+         const unsigned (&GCCVersion)[3],
+         bool IsIPhone);
   ~Darwin();
 
   void getDarwinVersion(unsigned (&Res)[3]) const {
@@ -84,10 +91,16 @@
     return MacosxVersionMin.c_str();
   }
 
+  const char *getIPhoneOSVersionStr() const {
+    return IPhoneOSVersionMin.c_str();
+  }
+
   const std::string &getToolChainDir() const { 
     return ToolChainDir;
   }
 
+  bool isIPhone() const { return IsIPhone; }
+
   virtual DerivedArgList *TranslateArgs(InputArgList &Args) const;
 
   virtual Tool &SelectTool(const Compilation &C, const JobAction &JA) const;
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index b72d562..27b34c7 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -1457,22 +1457,22 @@
   Args.AddAllArgs(CmdArgs, options::OPT_image__base);
   Args.AddAllArgs(CmdArgs, options::OPT_init);
 
-  if (!Args.hasArg(options::OPT_mmacosx_version_min_EQ)) {
-    if (!Args.hasArg(options::OPT_miphoneos_version_min_EQ)) {
-      // FIXME: I don't understand what is going on here. This is
-      // supposed to come from darwin_ld_minversion, but gcc doesn't
-      // seem to be following that; it must be getting overridden
-      // somewhere.
+  if (!Args.hasArg(options::OPT_mmacosx_version_min_EQ) &&
+      !Args.hasArg(options::OPT_miphoneos_version_min_EQ)) {
+    // Add default version min.
+    if (!getDarwinToolChain().isIPhone()) {
       CmdArgs.push_back("-macosx_version_min");
       CmdArgs.push_back(getDarwinToolChain().getMacosxVersionStr());
+    } else {
+      CmdArgs.push_back("-iphoneos_version_min");
+      CmdArgs.push_back(getDarwinToolChain().getIPhoneOSVersionStr());
     }
-  } else {
-    // Adding all arguments doesn't make sense here but this is what
-    // gcc does.
-    Args.AddAllArgsTranslated(CmdArgs, options::OPT_mmacosx_version_min_EQ,
-                              "-macosx_version_min");
   }
 
+  // Adding all arguments doesn't make sense here but this is what
+  // gcc does.
+  Args.AddAllArgsTranslated(CmdArgs, options::OPT_mmacosx_version_min_EQ,
+                              "-macosx_version_min");
   Args.AddAllArgsTranslated(CmdArgs, options::OPT_miphoneos_version_min_EQ,
                             "-iphoneos_version_min");
   Args.AddLastArg(CmdArgs, options::OPT_nomultidefs);
