OSDN Git Service

Make libseliux a stub library
authorJiyong Park <jiyong@google.com>
Wed, 11 Mar 2020 04:59:38 +0000 (13:59 +0900)
committerJiyong Park <jiyong@google.com>
Thu, 12 Mar 2020 03:24:43 +0000 (12:24 +0900)
libselinux is currently being copied to APEXes. This is risky because
the library is not designed to be portable; part of it is tied to the
specific version of the Android that it was developed for.

This change fixes the problem by declaring that the library supports
a stub with the list of C APIs that are included in the stub. Then there
is only one copy of libselinux in /system/lib and other APEXes use the
copy by dynamically linking to it.

Bug: 151053366
Test: m com.android.adbd. It doesn't include libselinux in it.
Test: m com.android.adbd-deps-info. then inspect
out/soong/com.android.adbd-deps-info.txt. The dependency to libselinux
is shown as '(external)'.

Merged-In: I445db2d0c5103b8b3267caa094f5d91259f1f491
(cherry picked from commit 74d75a773d200542ac3439fc166aa87ef40e0104)
Change-Id: I445db2d0c5103b8b3267caa094f5d91259f1f491

generator/variableloader.cc

index f7be9af..b64b474 100644 (file)
@@ -70,6 +70,7 @@ std::vector<std::string> stub_libraries = {
     "libsync.so",
     "libvndksupport.so",
     "libvulkan.so",
+    "libselinux.so",
 };
 
 void LoadVndkVersionVariable() {