[clang] Make armv6 iOS by default instead of macOS when targeting Darwin (PR #117243)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 21 14:02:27 PST 2024
https://github.com/Un1q32 updated https://github.com/llvm/llvm-project/pull/117243
>From a15d1120fc54059eb009b6da7d81ffae79cbd868 Mon Sep 17 00:00:00 2001
From: Un1q32 <joey.t.reinhart at gmail.com>
Date: Thu, 21 Nov 2024 16:25:12 -0500
Subject: [PATCH 1/2] Make armv6 iOS by default
---
clang/lib/Driver/ToolChains/Darwin.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp
index 87380869f6fdab..3b858577ce625b 100644
--- a/clang/lib/Driver/ToolChains/Darwin.cpp
+++ b/clang/lib/Driver/ToolChains/Darwin.cpp
@@ -2145,7 +2145,8 @@ inferDeploymentTargetFromArch(DerivedArgList &Args, const Darwin &Toolchain,
StringRef MachOArchName = Toolchain.getMachOArchName(Args);
if (MachOArchName == "arm64" || MachOArchName == "arm64e")
OSTy = llvm::Triple::MacOSX;
- else if (MachOArchName == "armv7" || MachOArchName == "armv7s")
+ else if (MachOArchName == "armv7" || MachOArchName == "armv7s" ||
+ MachOArchName == "armv6")
OSTy = llvm::Triple::IOS;
else if (MachOArchName == "armv7k" || MachOArchName == "arm64_32")
OSTy = llvm::Triple::WatchOS;
>From 26d79ab4dfd90c733822c58b943d686073b8bad7 Mon Sep 17 00:00:00 2001
From: Un1q32 <joey.t.reinhart at gmail.com>
Date: Thu, 21 Nov 2024 17:02:16 -0500
Subject: [PATCH 2/2] fix test
---
clang/test/Driver/darwin-version.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Driver/darwin-version.c b/clang/test/Driver/darwin-version.c
index ff05d4c10c4877..772ac5d240608a 100644
--- a/clang/test/Driver/darwin-version.c
+++ b/clang/test/Driver/darwin-version.c
@@ -1,6 +1,6 @@
// RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-VERSION-OSX %s
-// CHECK-VERSION-OSX: "armv6k-apple-macosx10.5.0"
+// CHECK-VERSION-IOS: "armv6k-apple-ios5.0.0"
// RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -c %s -### 2>&1 | \
// RUN: FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
// CHECK-VERSION-IOS2: "armv6k-apple-ios2.0.0"
More information about the cfe-commits
mailing list