[PATCH] D143598: [gn build] Support building x86/64 Android libraries
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 8 11:06:12 PST 2023
aeubanks created this revision.
aeubanks added a reviewer: thakis.
Herald added subscribers: danielkiss, hiraditya.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143598
Files:
llvm/utils/gn/build/toolchain/BUILD.gn
llvm/utils/gn/build/toolchain/target_flags.gni
llvm/utils/gn/secondary/libunwind/src/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
llvm/utils/gn/secondary/llvm/triples.gni
Index: llvm/utils/gn/secondary/llvm/triples.gni
===================================================================
--- llvm/utils/gn/secondary/llvm/triples.gni
+++ llvm/utils/gn/secondary/llvm/triples.gni
@@ -3,6 +3,8 @@
llvm_current_triple = "i386-unknown-linux-gnu"
} else if (current_os == "win") {
llvm_current_triple = "i386-pc-windows-msvc"
+ } else if (current_os == "android") {
+ llvm_current_triple = "i386-linux-android29"
}
} else if (current_cpu == "x64") {
if (current_os == "freebsd") {
@@ -13,6 +15,8 @@
llvm_current_triple = "x86_64-apple-darwin"
} else if (current_os == "win") {
llvm_current_triple = "x86_64-pc-windows-msvc"
+ } else if (current_os == "android") {
+ llvm_current_triple = "x86_64-linux-android29"
}
} else if (current_cpu == "arm") {
if (current_os == "android") {
Index: llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
===================================================================
--- llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
+++ llvm/utils/gn/secondary/llvm/lib/Target/targets.gni
@@ -114,4 +114,10 @@
supported_android_toolchains +=
[ "//llvm/utils/gn/build/toolchain:stage2_android_arm" ]
}
+ if (llvm_build_X86) {
+ supported_android_toolchains += [
+ "//llvm/utils/gn/build/toolchain:stage2_android_x64",
+ "//llvm/utils/gn/build/toolchain:stage2_android_x86",
+ ]
+ }
}
Index: llvm/utils/gn/secondary/libunwind/src/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/libunwind/src/BUILD.gn
+++ llvm/utils/gn/secondary/libunwind/src/BUILD.gn
@@ -55,6 +55,10 @@
unwind_output_dir = "$crt_current_out_dir/aarch64"
} else if (current_cpu == "arm") {
unwind_output_dir = "$crt_current_out_dir/arm"
+ } else if (current_cpu == "x64") {
+ unwind_output_dir = "$crt_current_out_dir/x86_64"
+ } else if (current_cpu == "x86") {
+ unwind_output_dir = "$crt_current_out_dir/i386"
}
} else {
unwind_output_dir = runtimes_dir
Index: llvm/utils/gn/build/toolchain/target_flags.gni
===================================================================
--- llvm/utils/gn/build/toolchain/target_flags.gni
+++ llvm/utils/gn/build/toolchain/target_flags.gni
@@ -44,5 +44,5 @@
}
if (current_cpu == "x86") {
- target_flags = [ "-m32" ]
+ target_flags += [ "-m32" ]
}
Index: llvm/utils/gn/build/toolchain/BUILD.gn
===================================================================
--- llvm/utils/gn/build/toolchain/BUILD.gn
+++ llvm/utils/gn/build/toolchain/BUILD.gn
@@ -231,6 +231,20 @@
current_cpu = "arm"
}
}
+
+ stage2_unix_toolchain("stage2_android_x64") {
+ toolchain_args = {
+ current_os = "android"
+ current_cpu = "x64"
+ }
+ }
+
+ stage2_unix_toolchain("stage2_android_x86") {
+ toolchain_args = {
+ current_os = "android"
+ current_cpu = "x86"
+ }
+ }
}
if (host_os == "mac") {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143598.495897.patch
Type: text/x-patch
Size: 2960 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230208/0cc4c068/attachment.bin>
More information about the llvm-commits
mailing list