Add a zip package containing the crt*.o objects
The ndk sysroot does not include the crt*.o objects, package them
separately for use in the llvm toolchain build.
Test: lunch aosp_riscv64-userdebug && m bionic_sysroot_crt_objects
Change-Id: I0bda12b7979a026441bb67387709ee94b3249b6b
diff --git a/libc/Android.bp b/libc/Android.bp
index 02f0513..9321633 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -2886,3 +2886,53 @@
tools: ["soong_zip"],
cmd: "includes=($(in)) && $(location soong_zip) -o $(out) -P include/asm -j -D $$(dirname $${includes[0]})",
}
+
+cc_genrule {
+ name: "bionic_sysroot_crt_objects",
+ visibility: ["//visibility:private"],
+ out: ["bionic_sysroot_crt_objects.zip"],
+ tools: ["soong_zip"],
+ srcs: [
+ ":crtbegin_dynamic",
+ ":crtbegin_so",
+ ":crtbegin_static",
+ ":crtend_android",
+ ":crtend_so",
+ ],
+ cmd: "$(location soong_zip) -o $(out) -j " +
+ "-f $(location :crtbegin_dynamic) " +
+ "-f $(location :crtbegin_so) " +
+ "-f $(location :crtbegin_static) " +
+ "-f $(location :crtend_android) " +
+ "-f $(location :crtend_so)",
+ dist: {
+ targets: ["bionic_sysroot_crt_objects"],
+ },
+ arch: {
+ arm: {
+ dist: {
+ suffix: "_arm",
+ },
+ },
+ arm64: {
+ dist: {
+ suffix: "_arm64",
+ },
+ },
+ riscv64: {
+ dist: {
+ suffix: "_riscv64",
+ },
+ },
+ x86: {
+ dist: {
+ suffix: "_x86",
+ },
+ },
+ x86_64: {
+ dist: {
+ suffix: "_x86_64",
+ },
+ },
+ },
+}