summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHungming Chen <nuccachen@google.com>2022-01-05 19:14:53 +0800
committerNucca Chen <nuccachen@google.com>2022-01-05 13:32:49 +0000
commit98e86faad93b7a8cdbecebdbcbb0fb93fb68446c (patch)
tree6394ea4876ab8930727c010139032c4b5d525bb7
parent9e718f44be83fefbb42324f48edeb5a144922049 (diff)
downloadandroid-clat-98e86faad93b7a8cdbecebdbcbb0fb93fb68446c.tar.gz
[RFCLAT#14] replace "libcutils" with "libcutils_headers"
replacing "libcutils" with "libcutils_headers" can save the apex size ~356KiB (libbase.so + libcutils.so). clatd only needs the definition AID_CLAT in the libcutils exported headers. It would be more appropriate for using libcutils_headers. before: $ deapexer extract out/target/product/raven/system/apex/com.google.android.tethering.apex apex_with_clat_uses_libcutils $ ls -all out/target/product/raven/system/apex/com.google.android.tethering.apex -rw-r--r-- 1 nuccachen primarygroup 4083712 Jan 3 21:51 out/target/product/raven/system/apex/com.google.android.tethering.apex after: $ deapexer extract out/target/product/raven/system/apex/com.google.android.tethering.apex apex_with_clat_uses_libcutils_headers $ ls -all out/target/product/raven/system/apex/com.google.android.tethering.apex -rw-r--r-- 1 nuccachen primarygroup 3719168 Jan 5 18:40 out/target/product/raven/system/apex/com.google.android.tethering.apex Both libbase.so and libcutils.so are removed from the apex which is using clatd with libcutils_headers: $ diff -r apex_with_clat_uses_libcutils apex_with_clat_uses_libcutils_headers Only in apex_with_clat_uses_libcutils/lib64: libbase.so (263.4 kB) Only in apex_with_clat_uses_libcutils/lib64: libcutils.so (91.0 kB) Bug: 212345928 Test: atest clatd_test Change-Id: Ia286c1d50be758685e92a6e86faa57b675e9cc54
-rw-r--r--Android.bp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index aca8481..4e3c162 100644
--- a/Android.bp
+++ b/Android.bp
@@ -53,6 +53,10 @@ filegroup {
cc_binary {
name: "clatd",
defaults: ["clatd_defaults"],
+ // TODO: remove once drop_root_and_caps() is removed.
+ header_libs: [
+ "libcutils_headers", // for AID_CLAT
+ ],
srcs: [
":clatd_common",
"main.c"
@@ -61,7 +65,6 @@ cc_binary {
"libip_checksum",
],
shared_libs: [
- "libcutils",
"liblog",
],