diff options
author | Colin Cross <ccross@android.com> | 2021-08-18 13:55:29 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2021-08-24 16:32:33 -0700 |
commit | 826625d95f30b001cef64959e624e5d7076ed507 (patch) | |
tree | bfb4c65af9635ed2256fe88ce99f042c7de2c077 | |
parent | 5717c6e5808b6eb129aacec0e9b54060cb7c6b47 (diff) | |
download | ninja-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.bp | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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, + }, }, } |