[PATCH] D146266: gn build: Fix Android build.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 18:57:10 PDT 2023


pcc updated this revision to Diff 505968.
pcc edited the summary of this revision.
pcc added a comment.
Herald added a subscriber: hiraditya.

After an out of band discussion with Arthur, we figured out the root cause of his problem and I was able to reproduce. This fixes it for me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146266/new/

https://reviews.llvm.org/D146266

Files:
  llvm/utils/gn/build/libs/implicit/BUILD.gn
  llvm/utils/gn/build/toolchain/target_flags.gni
  llvm/utils/gn/secondary/libunwind/src/BUILD.gn
  llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn


Index: llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
+++ llvm/utils/gn/secondary/llvm/lib/Support/BUILD.gn
@@ -4,6 +4,7 @@
     "BLAKE3",
     "//llvm/include/llvm/Config:config",
     "//llvm/lib/Demangle",
+    "//llvm/utils/gn/build/libs/implicit",
     "//llvm/utils/gn/build/libs/pthread",
     "//llvm/utils/gn/build/libs/terminfo",
     "//llvm/utils/gn/build/libs/zlib",
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
@@ -58,7 +58,7 @@
   } 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/i686"
+    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
@@ -15,10 +15,7 @@
     "--sysroot=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
     "--gcc-toolchain=$android_ndk_path/toolchains/llvm/prebuilt/linux-x86_64",
   ]
-  target_ldflags += [
-    "-static-libstdc++",
-    "--unwindlib=none",
-  ]
+  target_ldflags += [ "-static-libstdc++" ]
   if (current_cpu == "arm") {
     target_flags += [ "-march=armv7-a" ]
   }
Index: llvm/utils/gn/build/libs/implicit/BUILD.gn
===================================================================
--- /dev/null
+++ llvm/utils/gn/build/libs/implicit/BUILD.gn
@@ -0,0 +1,10 @@
+# This target represents the library dependencies that are implicitly linked by
+# the compiler.
+group("implicit") {
+  if (current_os == "android") {
+    deps = [
+      "//compiler-rt/lib/builtins",
+      "//libunwind/src:unwind_static",
+    ]
+  }
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146266.505968.patch
Type: text/x-patch
Size: 2102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230317/d4c6159f/attachment.bin>


More information about the llvm-commits mailing list