mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-05 23:52:45 +00:00
[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
This commit is contained in:
parent
0c83f8ccc7
commit
25ce33a6e4
@ -336,7 +336,10 @@ void darwin::Linker::AddLinkArgs(Compilation &C, const ArgList &Args,
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_init);
|
||||
|
||||
// Add the deployment target.
|
||||
MachOTC.addMinVersionArgs(Args, CmdArgs);
|
||||
if (!Version[0] || Version[0] >= 520)
|
||||
MachOTC.addPlatformVersionArgs(Args, CmdArgs);
|
||||
else
|
||||
MachOTC.addMinVersionArgs(Args, CmdArgs);
|
||||
|
||||
Args.AddLastArg(CmdArgs, options::OPT_nomultidefs);
|
||||
Args.AddLastArg(CmdArgs, options::OPT_multi__module);
|
||||
@ -2515,6 +2518,45 @@ void Darwin::addMinVersionArgs(const ArgList &Args,
|
||||
CmdArgs.push_back(Args.MakeArgString(TargetVersion.getAsString()));
|
||||
}
|
||||
|
||||
static const char *getPlatformName(Darwin::DarwinPlatformKind Platform,
|
||||
Darwin::DarwinEnvironmentKind Environment) {
|
||||
switch (Platform) {
|
||||
case Darwin::MacOS:
|
||||
return "macos";
|
||||
case Darwin::IPhoneOS:
|
||||
if (Environment == Darwin::NativeEnvironment ||
|
||||
Environment == Darwin::Simulator)
|
||||
return "ios";
|
||||
// FIXME: Add macCatalyst support here ("\"mac catalyst\"").
|
||||
llvm_unreachable("macCatalyst isn't yet supported");
|
||||
case Darwin::TvOS:
|
||||
return "tvos";
|
||||
case Darwin::WatchOS:
|
||||
return "watchos";
|
||||
}
|
||||
llvm_unreachable("invalid platform");
|
||||
}
|
||||
|
||||
void Darwin::addPlatformVersionArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const {
|
||||
// -platform_version <platform> <target_version> <sdk_version>
|
||||
// Both the target and SDK version support only up to 3 components.
|
||||
CmdArgs.push_back("-platform_version");
|
||||
std::string PlatformName = getPlatformName(TargetPlatform, TargetEnvironment);
|
||||
if (TargetEnvironment == Darwin::Simulator)
|
||||
PlatformName += "-simulator";
|
||||
CmdArgs.push_back(Args.MakeArgString(PlatformName));
|
||||
VersionTuple TargetVersion = getTargetVersion().withoutBuild();
|
||||
CmdArgs.push_back(Args.MakeArgString(TargetVersion.getAsString()));
|
||||
if (SDKInfo) {
|
||||
VersionTuple SDKVersion = SDKInfo->getVersion().withoutBuild();
|
||||
CmdArgs.push_back(Args.MakeArgString(SDKVersion.getAsString()));
|
||||
} else {
|
||||
// Use a blank SDK version if it's not present.
|
||||
CmdArgs.push_back("0.0.0");
|
||||
}
|
||||
}
|
||||
|
||||
void Darwin::addStartObjectFileArgs(const ArgList &Args,
|
||||
ArgStringList &CmdArgs) const {
|
||||
// Derived from startfile spec.
|
||||
|
@ -167,6 +167,10 @@ public:
|
||||
virtual void addMinVersionArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const {}
|
||||
|
||||
virtual void addPlatformVersionArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const {
|
||||
}
|
||||
|
||||
/// On some iOS platforms, kernel and kernel modules were built statically. Is
|
||||
/// this such a target?
|
||||
virtual bool isKernelStatic() const { return false; }
|
||||
@ -314,6 +318,9 @@ public:
|
||||
void addMinVersionArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const override;
|
||||
|
||||
void addPlatformVersionArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const override;
|
||||
|
||||
void addStartObjectFileArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const override;
|
||||
|
||||
|
1
clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json
Normal file
1
clang/test/Driver/Inputs/WatchOS6.0.sdk/SDKSettings.json
Normal file
@ -0,0 +1 @@
|
||||
{"Version":"6.0.0"}
|
@ -0,0 +1 @@
|
||||
{"Version":"13.0"}
|
@ -4,9 +4,9 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk IPHONEOS_DEPLOYMENT_TARGET=8.0 %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
|
||||
// CHECK-IPHONE: clang
|
||||
// CHECK-IPHONE: "-cc1"
|
||||
@ -17,7 +17,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
|
||||
//
|
||||
// CHECK-SIMULATOR: clang
|
||||
@ -29,9 +29,9 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/WatchOS3.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/WatchOS3.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/WatchOS3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
|
||||
// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -### 2>&1 \
|
||||
// RUN: env WATCHOS_DEPLOYMENT_TARGET=3.0 %clang %s -isysroot %t/SDKs/WatchOS3.0.sdk -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WATCH %s
|
||||
//
|
||||
// CHECK-WATCH: clang
|
||||
@ -43,7 +43,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/WatchSimulator3.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/WatchSimulator3.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/WatchSimulator3.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-WATCH-SIMULATOR %s
|
||||
//
|
||||
// CHECK-WATCH-SIMULATOR: clang
|
||||
@ -55,7 +55,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/AppleTVOS10.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/AppleTVOS10.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/AppleTVOS10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-TV %s
|
||||
//
|
||||
// CHECK-TV: clang
|
||||
@ -67,7 +67,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/AppleTVSimulator10.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/AppleTVSimulator10.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/AppleTVSimulator10.0.sdk %clang %s -mlinker-version=400 -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-TV-SIMULATOR %s
|
||||
//
|
||||
// CHECK-TV-SIMULATOR: clang
|
||||
|
9
clang/test/Driver/darwin-ld-platform-version-ios.c
Normal file
9
clang/test/Driver/darwin-ld-platform-version-ios.c
Normal file
@ -0,0 +1,9 @@
|
||||
// RUN: touch %t.o
|
||||
|
||||
// RUN: %clang -target arm64-apple-ios12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck %s
|
||||
// RUN: %clang -target x86_64-apple-ios13-simulator -isysroot %S/Inputs/iPhoneOS13.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=SIMUL %s
|
||||
|
||||
// CHECK: "-platform_version" "ios" "12.3.0" "13.0"
|
||||
// SIMUL: "-platform_version" "ios-simulator" "13.0.0" "13.0"
|
12
clang/test/Driver/darwin-ld-platform-version-macos.c
Normal file
12
clang/test/Driver/darwin-ld-platform-version-macos.c
Normal file
@ -0,0 +1,12 @@
|
||||
// RUN: touch %t.o
|
||||
|
||||
// RUN: %clang -target x86_64-apple-macos10.13 -isysroot %S/Inputs/MacOSX10.14.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck %s
|
||||
// RUN: env SDKROOT=%S/Inputs/MacOSX10.14.sdk %clang -target x86_64-apple-macos10.13.0.1 -mlinker-version=520 -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck %s
|
||||
|
||||
// CHECK: "-platform_version" "macos" "10.13.0" "10.14"
|
||||
|
||||
// RUN: %clang -target x86_64-apple-macos10.13 -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=NOSDK %s
|
||||
// NOSDK: "-platform_version" "macos" "10.13.0" "0.0.0"
|
9
clang/test/Driver/darwin-ld-platform-version-tvos.c
Normal file
9
clang/test/Driver/darwin-ld-platform-version-tvos.c
Normal file
@ -0,0 +1,9 @@
|
||||
// RUN: touch %t.o
|
||||
|
||||
// RUN: %clang -target arm64-apple-tvos12.3 -isysroot %S/Inputs/iPhoneOS13.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck %s
|
||||
// RUN: %clang -target x86_64-apple-tvos13-simulator -isysroot %S/Inputs/iPhoneOS13.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=SIMUL %s
|
||||
|
||||
// CHECK: "-platform_version" "tvos" "12.3.0" "13.0"
|
||||
// SIMUL: "-platform_version" "tvos-simulator" "13.0.0" "13.0"
|
9
clang/test/Driver/darwin-ld-platform-version-watchos.c
Normal file
9
clang/test/Driver/darwin-ld-platform-version-watchos.c
Normal file
@ -0,0 +1,9 @@
|
||||
// RUN: touch %t.o
|
||||
|
||||
// RUN: %clang -target arm64_32-apple-watchos5.2 -isysroot %S/Inputs/WatchOS6.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck %s
|
||||
// RUN: %clang -target x86_64-apple-watchos6-simulator -isysroot %S/Inputs/WatchOS6.0.sdk -### %t.o 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=SIMUL %s
|
||||
|
||||
// CHECK: "-platform_version" "watchos" "5.2.0" "6.0.0"
|
||||
// SIMUL: "-platform_version" "watchos-simulator" "6.0.0" "6.0.0"
|
@ -11,9 +11,9 @@
|
||||
|
||||
// Check linker changes that came with new linkedit format.
|
||||
// RUN: touch %t.o
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv6 -miphoneos-version-min=3.0 -bundle %t.o 2>> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_0 %s < %t.log
|
||||
|
||||
// LINK_IPHONE_3_0: {{ld(.exe)?"}}
|
||||
@ -30,9 +30,9 @@
|
||||
// LINK_IPHONE_3_0: -lbundle1.o
|
||||
// LINK_IPHONE_3_0: -lSystem
|
||||
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch armv7 -miphoneos-version-min=3.1 -bundle %t.o 2>> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_IPHONE_3_1 %s < %t.log
|
||||
|
||||
// LINK_IPHONE_3_1: {{ld(.exe)?"}}
|
||||
@ -49,9 +49,9 @@
|
||||
// LINK_IPHONE_3_1-NOT: -lbundle1.o
|
||||
// LINK_IPHONE_3_1: -lSystem
|
||||
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -dynamiclib %t.o 2>> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin9 -mlinker-version=400 -### -arch i386 -mios-simulator-version-min=3.0 -bundle %t.o 2>> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_IOSSIM_3_0 %s < %t.log
|
||||
|
||||
// LINK_IOSSIM_3_0: {{ld(.exe)?"}}
|
||||
@ -132,8 +132,8 @@
|
||||
// LINK_LAZY_LIBRARY: {{ld(.exe)?"}}
|
||||
// LINK_LAZY_LIBRARY: "-lazy_library" "Library"
|
||||
|
||||
// RUN: %clang -target x86_64-apple-darwin10 -### %t.o 2> %t.log
|
||||
// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target x86_64-apple-darwin10 -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_VERSION_MIN %s < %t.log
|
||||
// LINK_VERSION_MIN: {{ld(.exe)?"}}
|
||||
// LINK_VERSION_MIN: "-macosx_version_min" "10.6.0"
|
||||
@ -158,7 +158,7 @@
|
||||
// LINK_IOSSIM_PROFILE: libclang_rt.profile_iossim.a
|
||||
// LINK_IOSSIM_PROFILE: libclang_rt.ios.a
|
||||
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_TVOS_ARM64 %s < %t.log
|
||||
// LINK_TVOS_ARM64: {{ld(.exe)?"}}
|
||||
// LINK_TVOS_ARM64: -tvos_version_min
|
||||
@ -166,19 +166,19 @@
|
||||
// LINK_TVOS_ARM64-NOT: lgcc_s.1
|
||||
// LINK_TVOS_ARM64: libclang_rt.tvos.a
|
||||
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -fprofile-instr-generate -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_TVOS_PROFILE %s < %t.log
|
||||
// LINK_TVOS_PROFILE: {{ld(.exe)?"}}
|
||||
// LINK_TVOS_PROFILE: libclang_rt.profile_tvos.a
|
||||
// LINK_TVOS_PROFILE: libclang_rt.tvos.a
|
||||
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
||||
// RUN: %clang -target arm64-apple-tvos8.3 -mlinker-version=400 -mtvos-version-min=8.3 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_TVOS_KEXT %s < %t.log
|
||||
// LINK_TVOS_KEXT: {{ld(.exe)?"}}
|
||||
// LINK_TVOS_KEXT: libclang_rt.cc_kext_tvos.a
|
||||
// LINK_TVOS_KEXT: libclang_rt.tvos.a
|
||||
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_WATCHOS_ARM %s < %t.log
|
||||
// LINK_WATCHOS_ARM: {{ld(.exe)?"}}
|
||||
// LINK_WATCHOS_ARM: -watchos_version_min
|
||||
@ -186,13 +186,13 @@
|
||||
// LINK_WATCHOS_ARM-NOT: lgcc_s.1
|
||||
// LINK_WATCHOS_ARM: libclang_rt.watchos.a
|
||||
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -fprofile-instr-generate -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_WATCHOS_PROFILE %s < %t.log
|
||||
// LINK_WATCHOS_PROFILE: {{ld(.exe)?"}}
|
||||
// LINK_WATCHOS_PROFILE: libclang_rt.profile_watchos.a
|
||||
// LINK_WATCHOS_PROFILE: libclang_rt.watchos.a
|
||||
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
||||
// RUN: %clang -target armv7k-apple-watchos2.0 -mlinker-version=400 -mwatchos-version-min=2.0 -resource-dir=%S/Inputs/resource_dir -### %t.o -lcc_kext 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_WATCHOS_KEXT %s < %t.log
|
||||
// LINK_WATCHOS_KEXT: {{ld(.exe)?"}}
|
||||
// LINK_WATCHOS_KEXT: libclang_rt.cc_kext_watchos.a
|
||||
@ -251,30 +251,30 @@
|
||||
// IPHONEOS_DEPLOYMENT_TARGET variable is used instead of the command-line
|
||||
// deployment target options.
|
||||
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
||||
// RUN: %clang -target arm64-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target arm64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_IPHONEOS_VERSION_MIN %s < %t.log
|
||||
// RUN: env IPHONEOS_DEPLOYMENT_TARGET=7.0 \
|
||||
// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_IOS_SIMULATOR_VERSION_MIN %s < %t.log
|
||||
// LINK_IPHONEOS_VERSION_MIN: -iphoneos_version_min
|
||||
// LINK_IOS_SIMULATOR_VERSION_MIN: -ios_simulator_version_min
|
||||
|
||||
// Ditto for tvOS....
|
||||
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
|
||||
// RUN: %clang -target armv7-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target armv7-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_TVOS_VERSION_MIN %s < %t.log
|
||||
// RUN: env TVOS_DEPLOYMENT_TARGET=7.0 \
|
||||
// RUN: %clang -target x86_64-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target x86_64-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_TVOS_SIMULATOR_VERSION_MIN %s < %t.log
|
||||
// LINK_TVOS_VERSION_MIN: -tvos_version_min
|
||||
// LINK_TVOS_SIMULATOR_VERSION_MIN: -tvos_simulator_version_min
|
||||
|
||||
// ...and for watchOS.
|
||||
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
|
||||
// RUN: %clang -target armv7k-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target armv7k-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_WATCHOS_VERSION_MIN %s < %t.log
|
||||
// RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
|
||||
// RUN: %clang -target i386-apple-darwin -### %t.o 2> %t.log
|
||||
// RUN: %clang -target i386-apple-darwin -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: FileCheck -check-prefix=LINK_WATCHOS_SIMULATOR_VERSION_MIN %s < %t.log
|
||||
// LINK_WATCHOS_VERSION_MIN: -watchos_version_min
|
||||
// LINK_WATCHOS_SIMULATOR_VERSION_MIN: -watchos_simulator_version_min
|
||||
|
@ -43,7 +43,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/iPhoneOS8.0.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/iPhoneOS8.0.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin --sysroot="" %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneOS8.0.0.sdk %clang -target arm64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-IPHONE %s
|
||||
//
|
||||
// CHECK-IPHONE: clang
|
||||
@ -55,7 +55,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/iPhoneSimulator8.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/iPhoneSimulator8.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin --sysroot="" %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/iPhoneSimulator8.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-SIMULATOR %s
|
||||
//
|
||||
// CHECK-SIMULATOR: clang
|
||||
@ -66,7 +66,7 @@
|
||||
//
|
||||
// RUN: rm -rf %t/SDKs/MacOSX10.10.0.sdk
|
||||
// RUN: mkdir -p %t/SDKs/MacOSX10.10.0.sdk
|
||||
// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin --sysroot="" %s -### 2>&1 \
|
||||
// RUN: env SDKROOT=%t/SDKs/MacOSX10.10.0.sdk %clang -target x86_64-apple-darwin -mlinker-version=400 --sysroot="" %s -### 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=CHECK-MACOSX %s
|
||||
//
|
||||
// CHECK-MACOSX: clang
|
||||
|
@ -1,14 +1,14 @@
|
||||
// RUN: touch %t.o
|
||||
// RUN: %clang -target x86_64-apple-macosx10.4 -### %t.o 2> %t.log
|
||||
// RUN: %clang -target x86_64-apple-darwin9 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target x86_64-apple-macosx10.4 -mlinker-version=400 -### %t.o 2> %t.log
|
||||
// RUN: %clang -target x86_64-apple-darwin9 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target x86_64-apple-macosx10.7 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
//
|
||||
// RUN: %clang -target armv7-apple-ios -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios0.0 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios1.2.3 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios5.0 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios7.0 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target arm64-apple-ios -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios0.0 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios1.2.3 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios5.0 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target armv7-apple-ios7.0 -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
// RUN: %clang -target arm64-apple-ios -mlinker-version=400 -### %t.o 2>> %t.log
|
||||
//
|
||||
// RUN: FileCheck %s < %t.log
|
||||
|
||||
|
@ -87,6 +87,13 @@ public:
|
||||
return Build;
|
||||
}
|
||||
|
||||
/// Return a version tuple that contains only the first 3 version components.
|
||||
VersionTuple withoutBuild() const {
|
||||
if (HasBuild)
|
||||
return VersionTuple(Major, Minor, Subminor);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// Determine if two version numbers are equivalent. If not
|
||||
/// provided, minor and subminor version numbers are considered to be zero.
|
||||
friend bool operator==(const VersionTuple &X, const VersionTuple &Y) {
|
||||
|
Loading…
Reference in New Issue
Block a user