summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorHans Wennborg <hans@chromium.org>2020-02-27 13:48:26 +0100
committerHans Wennborg <hans@chromium.org>2020-02-27 13:54:19 +0100
commit38ee10d08cb5982bfc02dc4eea9a22743dccc6b6 (patch)
tree00996a57d8e668cda8c9c7c723afdb9a002abef8 /clang/lib
parentb2b41bc3b51a083fb9e36e50d0131dfbd79e00ce (diff)
downloadbcm5719-llvm-38ee10d08cb5982bfc02dc4eea9a22743dccc6b6.tar.gz
bcm5719-llvm-38ee10d08cb5982bfc02dc4eea9a22743dccc6b6.zip
[driver][darwin] Don't use -platform_version flag by default (PR44813)
The code in llvmorg-10-init-12188-g25ce33a6e4f is a breaking change for users of older linkers who don't pass a version parameter, which prevents a drop-in clang upgrade. Old tools can't know about what future tools will do, so as a general principle the burden should be new tools to be compatible by default. Also, for comparison, none of the other tests of Version within AddLinkArgs add any new behaviors unless the version is explicitly specified. Therefore, this patch changes the -platform_version behavior from opt-out to opt-in. Patch by David Major! Differential revision: https://reviews.llvm.org/D74784 (cherry picked from commit 5122e828701c88f8d53ee881bc68f3904454d154)
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/ToolChains/Darwin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 344a14fe1ea..220bc8f9835 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -335,7 +335,7 @@ void darwin::Linker::AddLinkArgs(Compilation &C, const ArgList &Args,
Args.AddAllArgs(CmdArgs, options::OPT_init);
// Add the deployment target.
- if (!Version[0] || Version[0] >= 520)
+ if (Version[0] >= 520)
MachOTC.addPlatformVersionArgs(Args, CmdArgs);
else
MachOTC.addMinVersionArgs(Args, CmdArgs);
OpenPOWER on IntegriCloud