Use more shared libraries in adb and init.
fs_mgr is used by several different
processes in both system and recovery,
so it makes sense for it to be a shared
library to save space.
libadbd is used by adbd, recovery (as minadbd)
and fastbootd so it should be shared as well.
Bug: 78793464
Test: compiles
Change-Id: I4225f4d1a44e6e5811c68a55595d1f94f0773114
Merged-In: I4225f4d1a44e6e5811c68a55595d1f94f0773114
(cherry picked from commit aacfc68acfb6f9432e741fa25a68d9336cc7c401)
diff --git a/adb/Android.bp b/adb/Android.bp
index 2a9a579..d35c3a3 100644
--- a/adb/Android.bp
+++ b/adb/Android.bp
@@ -277,7 +277,7 @@
},
}
-cc_library_static {
+cc_library {
name: "libadbd",
defaults: ["adb_defaults"],
recovery_available: true,
@@ -288,16 +288,36 @@
"daemon/auth.cpp",
"daemon/usb.cpp",
"daemon/jdwp_service.cpp",
+ "daemon/mdns.cpp",
+ "daemon/file_sync_service.cpp",
+ "daemon/framebuffer_service.cpp",
+ "daemon/remount_service.cpp",
+ "daemon/set_verity_enable_state_service.cpp",
+ "daemon/shell_service.cpp",
+ "shell_service_protocol.cpp",
],
static_libs: [
+ "libavb_user",
+ "libdiagnose_usb",
+ "libfec",
+ "libfec_rs",
+ "libfs_mgr",
+ "libmdnssd",
+ "libqemu_pipe",
+ "libsquashfs_utils",
+ "libselinux",
+ ],
+
+ shared_libs: [
"libasyncio",
"libbootloader_message",
+ "libbase",
"libcrypto_utils",
"libcrypto",
- "libdiagnose_usb",
- "libqemu_pipe",
- "libbase",
+ "libcutils",
+ "libext4_utils",
+ "liblog",
],
export_include_dirs: [
@@ -313,13 +333,6 @@
srcs: [
"daemon/main.cpp",
- "daemon/mdns.cpp",
- "daemon/file_sync_service.cpp",
- "daemon/framebuffer_service.cpp",
- "daemon/remount_service.cpp",
- "daemon/set_verity_enable_state_service.cpp",
- "daemon/shell_service.cpp",
- "shell_service_protocol.cpp",
],
cflags: [
@@ -331,27 +344,19 @@
keep_symbols: true,
},
- static_libs: [
+ shared_libs: [
"libadbd",
"libasyncio",
- "libavb_user",
+ "libbase",
"libbootloader_message",
+ "libcap",
"libcrypto_utils",
"libcrypto",
- "libdiagnose_usb",
- "libfec",
- "libfec_rs",
- "libfs_mgr",
- "liblog",
+ "libcutils",
"libext4_utils",
- "libmdnssd",
+ "liblog",
"libminijail",
"libselinux",
- "libsquashfs_utils",
- "libqemu_pipe",
-
- "libbase",
- "libcutils",
],
}