Skip to content

Commit 03c21bc

Browse files
committed
Make arm64e compiler-rt for iOS
1 parent c71b8a8 commit 03c21bc

File tree

7 files changed

+25
-3
lines changed

7 files changed

+25
-3
lines changed

llvm/utils/gn/build/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ config("compiler_defaults") {
356356
}
357357
if ((current_os == "ios" || current_os == "mac") &&
358358
(clang_base_path != "" || sysroot != "")) {
359-
if (current_os == "ios" && current_cpu == "arm64") {
359+
if (current_os == "ios" && (current_cpu == "arm64" || current_cpu == "arm64e")) {
360360
sdk_path = ios_sdk_path
361361
} else if (current_os == "ios" && current_cpu == "x64") {
362362
sdk_path = iossim_sdk_path

llvm/utils/gn/build/toolchain/BUILD.gn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ if (host_os == "mac") {
244244
}
245245
}
246246

247+
stage2_unix_toolchain("stage2_ios_arm64e") {
248+
toolchain_args = {
249+
current_os = "ios"
250+
current_cpu = "arm64e"
251+
}
252+
}
253+
247254
stage2_unix_toolchain("stage2_iossim_x64") {
248255
toolchain_args = {
249256
current_os = "ios"

llvm/utils/gn/build/toolchain/target_flags.gni

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ if (current_os == "android") {
3232
"-arch",
3333
"arm64",
3434
]
35+
} else if (current_cpu == "arm64e") {
36+
target_flags += [
37+
"-arch",
38+
"arm64e",
39+
]
40+
target_ldflags += [
41+
"-arch",
42+
"arm64e",
43+
]
3544
} else if (current_cpu == "x64") {
3645
target_flags += [
3746
"-arch",

llvm/utils/gn/secondary/compiler-rt/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ group("compiler-rt") {
2828
# That would match the cmake build.
2929
if (host_os == "mac" && have_ios_sdks) {
3030
if (llvm_build_AArch64) {
31-
deps += [ "//compiler-rt/lib/builtins(//llvm/utils/gn/build/toolchain:stage2_ios_aarch64)" ]
31+
deps += [ "//compiler-rt/lib/builtins(//llvm/utils/gn/build/toolchain:stage2_ios_arm64e)" ]
3232
}
3333
if (llvm_build_X86) {
3434
deps += [ "//compiler-rt/lib/builtins(//llvm/utils/gn/build/toolchain:stage2_iossim_x64)" ]

llvm/utils/gn/secondary/compiler-rt/lib/builtins/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static_library("builtins") {
5454
output_dir = crt_current_out_dir
5555
if (current_os == "mac") {
5656
output_name = "clang_rt.osx"
57-
} else if (current_os == "ios" && current_cpu == "arm64") {
57+
} else if (current_os == "ios" && current_cpu == "arm64e") {
5858
output_name = "clang_rt.ios"
5959
} else if (current_os == "ios" && current_cpu == "x64") {
6060
output_name = "clang_rt.iossim"

llvm/utils/gn/secondary/compiler-rt/target.gni

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ if (current_cpu == "x86") {
1313
crt_current_target_arch = "arm"
1414
} else if (current_cpu == "arm64") {
1515
crt_current_target_arch = "aarch64"
16+
} else if (current_cpu == "arm64e") {
17+
crt_current_target_arch = "arm64e"
1618
} else if (current_cpu == "ppc64") {
1719
crt_current_target_arch = "powerpc64le"
1820
} else {

llvm/utils/gn/secondary/llvm/triples.gni

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ if (current_cpu == "x86") {
3636
if (current_os == "linux") {
3737
llvm_current_triple = "powerpc64le-unknown-linux-gnu"
3838
}
39+
} else if (current_cpu == "arm64e") {
40+
if (current_os == "ios" || current_os == "mac") {
41+
llvm_current_triple = "arm64e-apple-darwin"
42+
}
3943
}
4044

4145
if (!defined(llvm_current_triple)) {

0 commit comments

Comments
 (0)