From 4be92df27bcfaff898fe948882b54a9a91ab2c94 Mon Sep 17 00:00:00 2001 From: Remi NGUYEN VAN Date: Wed, 24 Mar 2021 01:49:39 +0000 Subject: [PATCH] Build connectivity JNI against libc++_static Instead of including the whole libc++ library by linking it dynamically, use the static version so that unused symbols can be stripped. This allows reducing the APEX size by 1MB (3.7MB -> 2.7MB), as otherwise libc++ is included twice for 32 and 64 bit variants. Original change (project moved): Ia66d795cf23d6f45997278300c103976433f7c5c Bug: 171540887 Test: Device boots and has connectivity, size reduced Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f Change-Id: Ie1c5b2ea274238a226ad2d827148439fd5758bb5 --- framework/Android.bp | 1 + service/Android.bp | 1 + 2 files changed, 2 insertions(+) diff --git a/framework/Android.bp b/framework/Android.bp index 2a03b73687..4fa9ccbc02 100644 --- a/framework/Android.bp +++ b/framework/Android.bp @@ -137,6 +137,7 @@ cc_library_shared { "jni/onload.cpp", ], shared_libs: ["libandroid"], + stl: "libc++_static", apex_available: [ "//apex_available:platform", "com.android.tethering", diff --git a/service/Android.bp b/service/Android.bp index b6adf7985a..8c46dea6f5 100644 --- a/service/Android.bp +++ b/service/Android.bp @@ -32,6 +32,7 @@ cc_library_shared { "jni/com_android_server_TestNetworkService.cpp", "jni/onload.cpp", ], + stl: "libc++_static", shared_libs: [ "libbase", "liblog",