Skip to content

Commit 382bb8b

Browse files
author
git apple-llvm automerger
committed
Merge commit '793707cd85af' from swift/release/5.3 into swift/master
2 parents bc068a6 + 793707c commit 382bb8b

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

clang/lib/Driver/ToolChains/Darwin.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,11 @@ class LLVM_LIBRARY_VISIBILITY Darwin : public MachO {
457457
bool isMacosxVersionLT(unsigned V0, unsigned V1 = 0, unsigned V2 = 0) const {
458458
assert(isTargetMacOS() && getTriple().isMacOSX() &&
459459
"Unexpected call for non OS X target!");
460-
VersionTuple MinVers = getTriple().getMinimumSupportedOSVersion();
460+
// The effective triple might not be initialized yet, so construct a
461+
// pseudo-effective triple to get the minimum supported OS version.
462+
VersionTuple MinVers =
463+
llvm::Triple(getTriple().getArchName(), "apple", "macos")
464+
.getMinimumSupportedOSVersion();
461465
return (!MinVers.empty() && MinVers > TargetVersion
462466
? MinVers
463467
: TargetVersion) < VersionTuple(V0, V1, V2);
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang -### -arch arm64 -mmacosx-version-min=10.7 %s 2>&1 | FileCheck -check-prefix=ARM64-10_7 %s
2+
// RUN: %clang -### -arch x86_64 -mmacosx-version-min=10.7 %s 2>&1 | FileCheck -check-prefix=x86_64-10_7 %s
3+
// REQUIRES: system-darwin
4+
5+
// ARM64-10_7-NOT: -lcrt1.10.6.o
6+
// x86_64-10_7: -lcrt1.10.6.o

clang/test/Driver/macos-apple-silicon-slice-link-libs.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: %clang -### -target arm64-apple-macos10.7 %s 2>&1 | FileCheck -check-prefix=ARM64-10_7 %s
22
// RUN: %clang -### -target x86_64-apple-macos10.7 %s 2>&1 | FileCheck -check-prefix=x86_64-10_7 %s
3+
// RUN: %clang -### -target arm64-apple-darwin6 %s 2>&1 | FileCheck -check-prefix=ARM64-10_7 %s
34

45
// RUN: %clang -### -target arm64-apple-macos10.5 %s 2>&1 | FileCheck -check-prefix=ARM64-10_5 %s
56
// RUN: %clang -### -target x86_64-apple-macos10.5 %s 2>&1 | FileCheck -check-prefix=x86_64-10_5 %s

0 commit comments

Comments
 (0)