add back runtime libraries used on 10.4 and 10.5
removed in https://github.com/llvm/llvm-project/commit/3434ade2b7ca351b61522f7da4b55070d811b83f

related, the following code used to add libclang_rt_10.4.a to Tiger, but this library
is no longer built in the runtime library collections. If building for Tiger, it
may be required to replace this library at some point.
The line below this, adding "builtins" adds libclang_rt.osx.a, does the second part of this.
it may be easiest to just add Tiger functions to libclang_rt.osx.a directly
   // if (isMacosxVersionLT(10, 5))
   //   AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.10.4.a");
   // else
   //   AddLinkRuntimeLib(Args, CmdArgs, "libclang_rt.osx.a");

diff --git a/tools/clang/lib/Driver/ToolChains/Darwin.cpp b/tools/clang/lib/Driver/ToolChains/Darwin.cpp
index bea877ae9..26f1ad714 100644
--- a/tools/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/tools/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -1140,6 +1140,12 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
         getTriple().getArch() != llvm::Triple::aarch64)
       CmdArgs.push_back("-lgcc_s.1");
   }
+  if (isTargetMacOS()) {
+    if (isMacosxVersionLT(10, 5))
+      CmdArgs.push_back("-lgcc_s.10.4");
+    else if (isMacosxVersionLT(10, 6))
+      CmdArgs.push_back("-lgcc_s.10.5");
+  }
   AddLinkRuntimeLib(Args, CmdArgs, "builtins");
 }
 
