From d4cde4925480eb71510bb81e8fc878cf6a5dc4cc Mon Sep 17 00:00:00 2001 From: Dario Freni Date: Mon, 6 Jan 2020 15:57:14 +0000 Subject: [PATCH] AOSP: Allow resize2fs to compile with BUILD_HOST_static Bug: 144477678 Test: BUILD_HOST_static=1 m resize2fs; m resize2fs Change-Id: I0986deccfe496153e662dcc3cc2fb1ffb6973c21 From AOSP commit: 2c767b86591c64cd7b84c5619e8d8b8a0afd557e --- resize/Android.bp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/resize/Android.bp b/resize/Android.bp index d55e24c21..399201c3b 100644 --- a/resize/Android.bp +++ b/resize/Android.bp @@ -13,12 +13,27 @@ cc_binary { "sim_progress.c", "resource_track.c", ], - shared_libs: [ - "libext2fs", - "libext2_com_err", - "libext2_e2p", - "libext2_uuid", - "libext2_blkid", - ], + // Host binaries can be compiled statically to be re-used in other environments. + // For android binaries, we keep shared libraries to keep the binary size smaller. + target: { + host: { + static_libs: [ + "libext2fs", + "libext2_com_err", + "libext2_e2p", + "libext2_uuid", + "libext2_blkid", + ], + }, + android: { + shared_libs: [ + "libext2fs", + "libext2_com_err", + "libext2_e2p", + "libext2_uuid", + "libext2_blkid", + ], + }, + }, system_shared_libs: ["libc", "libdl"], } -- 2.39.2