From 093fd351fa21cc7bce7911dc6d6e4642fbdd3c76 Mon Sep 17 00:00:00 2001 From: Akilesh Kailash Date: Thu, 29 Aug 2024 20:55:07 -0700 Subject: [PATCH] libsnapshot: static link libselinux libsnapshot_init is linked by microdroid. Adding libselinux as whole_static_libs in `libsnapshot_defaults` will bloat the super image of microdroid. Instead, statically link libselinux for libsnapshot_init. On Pixel 7 Pro: Microdroid super image: 47173836 Baseline (Without this change): 47161548 Bug: 362839899 Test: Build, verify microdroid super image size. Change-Id: I3c589097173b305c1d39af9edbfb8c5e29f21410 Signed-off-by: Akilesh Kailash --- fs_mgr/libsnapshot/Android.bp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/fs_mgr/libsnapshot/Android.bp b/fs_mgr/libsnapshot/Android.bp index 4828c4c15..fabb72ddb 100644 --- a/fs_mgr/libsnapshot/Android.bp +++ b/fs_mgr/libsnapshot/Android.bp @@ -46,7 +46,6 @@ cc_defaults { "libfstab", "libsnapuserd_client", "libz", - "libselinux", ], header_libs: [ "libfiemap_headers", @@ -112,6 +111,9 @@ cc_library_static { static_libs: [ "libfs_mgr_binder", ], + whole_static_libs: [ + "libselinux", + ], } cc_library { @@ -130,6 +132,9 @@ cc_library { static_libs: [ "libsnapshot_cow", ], + whole_static_libs: [ + "libselinux", + ], } cc_library_static { @@ -144,6 +149,7 @@ cc_library_static { ], static_libs: [ "libfs_mgr", + "libselinux", ], } @@ -161,6 +167,9 @@ cc_library_static { static_libs: [ "libfs_mgr", ], + whole_static_libs: [ + "libselinux", + ], } cc_defaults { @@ -243,6 +252,7 @@ cc_library_static { "libfs_mgr", "libgmock", "libgtest", + "libselinux", ], }