From bdf5fe7af5f9b2f0427e6aa91763f6ab4b7e2791 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 25 Feb 2022 18:30:07 -0800 Subject: [PATCH] Export libc++ headers for musl sysroot Export the libc++ headers for inclusion in the musl sysroot so that the clang runtimes can link against them. Bug: 215802826 Test: musl llvm build Change-Id: Ia661da7ad7158e09b3e956ab93159e3e42855424 --- Android.bp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Android.bp b/Android.bp index 2fd04d37f..4b01aa28a 100644 --- a/Android.bp +++ b/Android.bp @@ -294,3 +294,32 @@ python_test { }, }, } + +// Export libc++ headers for inclusion in the musl sysroot. +genrule { + name: "libc_musl_sysroot_libc++_headers", + visibility: ["//external/musl"], + srcs: [ + "NOTICE", + "include/**/*", + ], + out: ["libc_musl_sysroot_libc++_headers.zip"], + tools: [ + "soong_zip", + "zip2zip", + ], + cmd: "LIBCXX_DIR=$$(dirname $(location NOTICE)) && " + + "$(location soong_zip) -o $(genDir)/sysroot.zip -symlinks=false" + + // NOTICE + " -j -f $(location NOTICE) " + + // headers + " -P include/c++ " + + " -C $${LIBCXX_DIR}/include " + + " -D $${LIBCXX_DIR}/include " + + " && " + + "$(location zip2zip) -i $(genDir)/sysroot.zip -o $(out) " + + " -x include/c++/CMakeLists.txt" + + " -x include/c++/module.modulemap " + + " include/**/*:include " + + " NOTICE:NOTICE.libc++", +}