Add libc_malloc_debug and _hooks to the runtime APEX

The two libraries share implementation details with libc.so, therefore
they should be bundled in the runtime APEX together with libc.so

Bug: 122566199
Test: m
Test: /art/tools/dist_linux_bionic.sh -j50 com.android.runtime.host

Merged-In: I2ee0b93855144bcc509c61b7db956c64528921f9
Change-Id: I2ee0b93855144bcc509c61b7db956c64528921f9
(cherry picked from commit a11e03c5073382227fa054f4e1191469cd0c5f13)
diff --git a/build/apex/Android.bp b/build/apex/Android.bp
index 3d5d039..95aea3c 100644
--- a/build/apex/Android.bp
+++ b/build/apex/Android.bp
@@ -48,6 +48,14 @@
     "libm",
     "libdl",
 ]
+
+bionic_native_shared_libs_device = [
+    // ... and their internal dependencies
+    // These are available only on device
+    "libc_malloc_debug",
+    "libc_malloc_hooks",
+]
+
 bionic_binaries_both = [
     "linker",
 ]
@@ -231,6 +239,7 @@
 apex {
     name: "com.android.runtime.release",
     defaults: ["com.android.runtime-defaults"],
+    native_shared_libs: bionic_native_shared_libs_device,
     certificate: ":com.android.runtime.release.certificate",
 }
 
@@ -241,7 +250,8 @@
     name: "com.android.runtime.debug",
     defaults: ["com.android.runtime-defaults"],
     native_shared_libs: art_runtime_debug_native_shared_libs
-        + libcore_debug_native_shared_libs,
+        + libcore_debug_native_shared_libs
+        + bionic_native_shared_libs_device,
     multilib: {
         prefer32: {
             binaries: art_runtime_debug_binaries_prefer32