[driver][darwin] Pass -platform_version flag to the linker instead of the -<platform...
authorAlex Lorenz <arphaman@gmail.com>
Tue, 17 Dec 2019 00:46:41 +0000 (16:46 -0800)
committerAlex Lorenz <arphaman@gmail.com>
Tue, 17 Dec 2019 18:26:32 +0000 (10:26 -0800)
commit25ce33a6e4f3b13732c0f851e68390dc2acb9123
treef3c0a7c2916e4c77d452a71d88efca3df40b0362
parent0c83f8ccc745522d2a25bcef2067bde295be9f75
[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
13 files changed:
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Driver/ToolChains/Darwin.h
clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json [new file with mode: 0644]
clang/test/Driver/Inputs/iPhoneOS13.0.sdk/SDKSettings.json [new file with mode: 0644]
clang/test/Driver/darwin-infer-simulator-sdkroot.c
clang/test/Driver/darwin-ld-platform-version-ios.c [new file with mode: 0644]
clang/test/Driver/darwin-ld-platform-version-macos.c [new file with mode: 0644]
clang/test/Driver/darwin-ld-platform-version-tvos.c [new file with mode: 0644]
clang/test/Driver/darwin-ld-platform-version-watchos.c [new file with mode: 0644]
clang/test/Driver/darwin-ld.c
clang/test/Driver/darwin-sdkroot.c
clang/test/Driver/target-triple-deployment.c
llvm/include/llvm/Support/VersionTuple.h