Skip to content

Commit 5651544

Browse files
authored
Make armv6 iOS by default instead of macOS when targeting Darwin (#117243)
AFAIK the only publicly released armv6 devices that ran Darwin were the iPhone 2G, iPhone 3G, iPod touch 1, and the iPod touch 2, all of which were iOS devices.
1 parent bfafbe3 commit 5651544

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,8 @@ inferDeploymentTargetFromArch(DerivedArgList &Args, const Darwin &Toolchain,
21642164
StringRef MachOArchName = Toolchain.getMachOArchName(Args);
21652165
if (MachOArchName == "arm64" || MachOArchName == "arm64e")
21662166
OSTy = llvm::Triple::MacOSX;
2167-
else if (MachOArchName == "armv7" || MachOArchName == "armv7s")
2167+
else if (MachOArchName == "armv7" || MachOArchName == "armv7s" ||
2168+
MachOArchName == "armv6")
21682169
OSTy = llvm::Triple::IOS;
21692170
else if (MachOArchName == "armv7k" || MachOArchName == "arm64_32")
21702171
OSTy = llvm::Triple::WatchOS;

clang/test/Driver/darwin-version.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
2-
// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX %s
3-
// CHECK-VERSION-OSX: "armv6k-apple-macosx10.5.0"
2+
// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS %s
3+
// CHECK-VERSION-IOS: "armv6k-apple-ios5.0.0"
44
// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -c %s -### 2>&1 | \
55
// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
66
// CHECK-VERSION-IOS2: "armv6k-apple-ios2.0.0"

0 commit comments

Comments
 (0)