Commit Graph

3 Commits

Author SHA1 Message Date
Hans Wennborg 5122e82870 [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
2020-02-27 13:48:26 +01:00
Alex Lorenz be88a20c90 [driver][darwin] Use explicit -mlinker-version in the -platform_version tests
The driver actually adds a default -mlinker-version, based on HOST_LINK_VERSION
cmake variable. The tests should be explicit about which version they're using to
trigger the right behavior.
2019-12-17 14:25:22 -08:00
Alex Lorenz 25ce33a6e4 [driver][darwin] Pass -platform_version flag to the linker instead of the -<platform>_version_min flag
In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags.
The new flag allows Clang to pass the SDK version from the driver to the linker.
This patch adopts the new -platform_version flag in Clang, and starts using it by default,
unless a linker version < 520 is passed to the driver.

Differential Revision: https://reviews.llvm.org/D71579
2019-12-17 10:26:32 -08:00