aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-08-18 13:55:29 -0700
committerColin Cross <ccross@android.com>2021-08-24 16:32:33 -0700
commit826625d95f30b001cef64959e624e5d7076ed507 (patch)
treebfb4c65af9635ed2256fe88ce99f042c7de2c077
parent5717c6e5808b6eb129aacec0e9b54060cb7c6b47 (diff)
downloadninja-826625d95f30b001cef64959e624e5d7076ed507.tar.gz
Build ninja statically when using musl
The aosp-llvm-toolchain build uses LD_LIBRARY_PATH to affect the processes run inside ninja, but that affects ninja too. There's no way to use a different LD_LIBRARY_PATH for ninja and its subprocesses, so just make ninja static instead. Bug: 190084016 Test: aosp-build-tools linux_musl build Change-Id: Ifd6d871ccb973f97eab76cd9ada58df1af175d9f
-rw-r--r--Android.bp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 65358e4..12f1247 100644
--- a/Android.bp
+++ b/Android.bp
@@ -88,9 +88,17 @@ cc_binary_host {
// Use jemalloc for better multithreaded allocation performance. e.g. Using
// jemalloc can improve the overall runtime by 10x vs the default allocator.
target: {
- linux_glibc: {
+ glibc: {
shared_libs: ["libjemalloc5"],
},
+ musl: {
+ static_libs: ["libjemalloc5"],
+ // LLVM toolchain builds use LD_LIBRARY_PATH when running ninja
+ // to affect subprocesses of ninja, but that breaks ninja
+ // when it uses an incompatible libc. Making ninja static avoids
+ // the problem.
+ static_executable: true,
+ },
},
}