Whamcloud - gitweb
AOSP: Allow resize2fs to compile with BUILD_HOST_static
authorDario Freni <dariofreni@google.com>
Mon, 6 Jan 2020 15:57:14 +0000 (15:57 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 21 Mar 2020 03:00:14 +0000 (23:00 -0400)
Bug: 144477678
Test: BUILD_HOST_static=1 m resize2fs; m resize2fs
Change-Id: I0986deccfe496153e662dcc3cc2fb1ffb6973c21
From AOSP commit: 2c767b86591c64cd7b84c5619e8d8b8a0afd557e

resize/Android.bp

index d55e24c..399201c 100644 (file)
@@ -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"],
 }