diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-06-21 10:27:24 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-06-21 10:27:24 +0000 |
commit | 71d72135b05c85c81745f25801fb137d02a3e796 (patch) | |
tree | 0ea8f6e7571165d560e5fbed3581f1ebb857d5ee /clang/lib/Driver/ToolChains/Darwin.cpp | |
parent | 200b3289726fc93f1344a0b1677e7013185c9440 (diff) | |
download | bcm5719-llvm-71d72135b05c85c81745f25801fb137d02a3e796.tar.gz bcm5719-llvm-71d72135b05c85c81745f25801fb137d02a3e796.zip |
Revert r305678: [driver][macOS] Pick the system version for the
deployment target if the SDK is newer than the system
This commit also reverts follow-up commits r305680 and r305685 that have
buildbot fixes.
The change in r305678 wasn't correct because it relied on
`llvm::sys::getProcessTriple`, which uses a pre-configured OS version. We should
lookup the actual macOS version of the system on which the compiler is running.
llvm-svn: 305891
Diffstat (limited to 'clang/lib/Driver/ToolChains/Darwin.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Darwin.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index b47df960dd9..e41b50c40b2 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -1118,27 +1118,6 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args, } } -/// Returns the most appropriate macOS target version for the current process. -/// -/// If the macOS SDK version is the same or earlier than the system version, -/// then the SDK version is returned. Otherwise the system version is returned. -static std::string getSystemOrSDKMacOSVersion(StringRef MacOSSDKVersion) { - unsigned Major, Minor, Micro; - llvm::Triple SystemTriple(llvm::sys::getProcessTriple()); - if (!SystemTriple.isMacOSX()) - return MacOSSDKVersion; - SystemTriple.getMacOSXVersion(Major, Minor, Micro); - VersionTuple SystemVersion(Major, Minor, Micro); - bool HadExtra; - if (!Driver::GetReleaseVersion(MacOSSDKVersion, Major, Minor, Micro, - HadExtra)) - return MacOSSDKVersion; - VersionTuple SDKVersion(Major, Minor, Micro); - if (SDKVersion > SystemVersion) - return SystemVersion.getAsString(); - return MacOSSDKVersion; -} - void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { const OptTable &Opts = getDriver().getOpts(); @@ -1231,7 +1210,7 @@ void Darwin::AddDeploymentTarget(DerivedArgList &Args) const { SDK.startswith("iPhoneSimulator")) iOSTarget = Version; else if (SDK.startswith("MacOSX")) - OSXTarget = getSystemOrSDKMacOSVersion(Version); + OSXTarget = Version; else if (SDK.startswith("WatchOS") || SDK.startswith("WatchSimulator")) WatchOSTarget = Version; |