gn build: Do not build libunwind.so for Android.
authorPeter Collingbourne <peter@pcc.me.uk>
Fri, 7 Oct 2022 03:52:22 +0000 (20:52 -0700)
committerPeter Collingbourne <peter@pcc.me.uk>
Fri, 7 Oct 2022 03:53:15 +0000 (20:53 -0700)
Android does not use a shared libunwind.so and its presence in the build
directory can be harmful, for example it can end up being dynamically
linked against while not being present on the device.

llvm/utils/gn/secondary/libunwind/src/BUILD.gn

index 6605e43..d5e15f2 100644 (file)
@@ -74,7 +74,7 @@ config("unwind_config") {
   }
 }
 
-if (libunwind_enable_shared) {
+if (libunwind_enable_shared && target_os != "android") {
   shared_library("unwind_shared") {
     output_dir = unwind_output_dir
     output_name = "unwind"
@@ -138,7 +138,7 @@ if (libunwind_enable_static) {
 
 group("src") {
   deps = []
-  if (libunwind_enable_shared) {
+  if (libunwind_enable_shared && target_os != "android") {
     deps += [ ":unwind_shared" ]
   }
   if (libunwind_enable_static) {