Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ffdad0c authored by Jiyong Park's avatar Jiyong Park
Browse files

Make libselinux a stub library

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.

Also, adbd no longer statically links to it, because doing so brings
libselinux in 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)'.

Change-Id: If418cbe3abdeacb759d59052e6dca4c2067678dd
parent f1e27502
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -592,7 +592,6 @@ cc_binary {
        "libmdnssd",
        "libminijail",
        "libprotobuf-cpp-lite",
        "libselinux",
        "libssl",
    ],

@@ -603,6 +602,7 @@ cc_binary {
        "libadbd_fs",
        "libcrypto",
        "liblog",
        "libselinux",
    ],

    target: {