[Driver] Only link in arclite if deploying to pre-8.0 iOS or pre-10.10 OS X.

<rdar://problem/16749280>

Swift SVN r20663
This commit is contained in:
Jordan Rose
2014-07-29 00:38:26 +00:00
parent d0433fde33
commit c477314b59
2 changed files with 29 additions and 3 deletions

View File

@@ -594,10 +594,12 @@ Job *darwin::Linker::constructJob(const JobAction &JA,
break;
}
assert(Triple.isOSDarwin());
bool wantsObjCRuntime =
Triple.isiOS() ? Triple.isOSVersionLT(8) : Triple.isMacOSXVersionLT(10, 10);
if (Args.hasFlag(options::OPT_link_objc_runtime,
options::OPT_no_link_objc_runtime,
/*default=*/true)) {
// FIXME: Copied from Clang's ToolChains.cpp.
/*default=*/wantsObjCRuntime)) {
llvm::SmallString<128> ARCLiteLib(D.getSwiftProgramPath());
llvm::sys::path::remove_filename(ARCLiteLib); // 'swift'
llvm::sys::path::remove_filename(ARCLiteLib); // 'bin'