[Lldb-commits] [PATCH] D109464: gn build: Add support for building lldb-server on Android.

Peter Collingbourne via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 8 13:54:59 PDT 2021


pcc created this revision.
pcc added a reviewer: thakis.
Herald added a subscriber: danielkiss.
pcc requested review of this revision.
Herald added a project: LLVM.

The cross-compiled lldb-server targets are added to the top-level
lldb target if Android cross compilation is enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109464

Files:
  llvm/utils/gn/build/libs/xml/enable.gni
  llvm/utils/gn/secondary/lldb/BUILD.gn
  llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn


Index: llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
+++ llvm/utils/gn/secondary/lldb/tools/lldb-server/BUILD.gn
@@ -1,3 +1,4 @@
+import("//compiler-rt/target.gni")
 import("//llvm/utils/TableGen/tablegen.gni")
 
 tablegen("LLGSOptions") {
@@ -57,4 +58,8 @@
     "lldb-platform.cpp",
     "lldb-server.cpp",
   ]
+
+  if (current_os == "android") {
+    output_dir = "$root_build_dir/runtimes_ndk_cxx/$crt_current_target_arch"
+  }
 }
Index: llvm/utils/gn/secondary/lldb/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/lldb/BUILD.gn
+++ llvm/utils/gn/secondary/lldb/BUILD.gn
@@ -1,6 +1,19 @@
+import("//llvm/utils/gn/build/toolchain/compiler.gni")
+
+supported_toolchains = []
+if (android_ndk_path != "") {
+  supported_toolchains += [
+    "//llvm/utils/gn/build/toolchain:stage2_android_aarch64",
+    "//llvm/utils/gn/build/toolchain:stage2_android_arm",
+  ]
+}
+
 group("lldb") {
   deps = [ "tools/driver:lldb" ]
   if (current_os == "linux") {
     deps += [ "tools/lldb-server" ]
   }
+  foreach (toolchain, supported_toolchains) {
+    deps += [ "tools/lldb-server($toolchain)" ]
+  }
 }
Index: llvm/utils/gn/build/libs/xml/enable.gni
===================================================================
--- llvm/utils/gn/build/libs/xml/enable.gni
+++ llvm/utils/gn/build/libs/xml/enable.gni
@@ -1,4 +1,4 @@
 declare_args() {
   # Whether to include code that links against libxml2.
-  llvm_enable_libxml2 = host_os != "win"
+  llvm_enable_libxml2 = current_os != "win" && current_os != "android"
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109464.371438.patch
Type: text/x-patch
Size: 1704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210908/98a9556e/attachment.bin>


More information about the lldb-commits mailing list