From e01e228270dff753c7eaf06d3315dac8230b39d3 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 9 Mar 2020 16:24:11 +0900 Subject: [PATCH 1/2] Make ndk_prebuilt_* be available to any apex The NDK prebuilts are implicitly used when building with sdk_version set. Make the module types be available to any apex so that we don't need to manually add apex_available property to the module definitions manually. Bug: 150999716 Test: m Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9 --- apex/apex.go | 16 ---------------- cc/ndk_prebuilt.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/apex/apex.go b/apex/apex.go index 6cd28154a..3e7328397 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -819,22 +819,6 @@ func makeApexAvailableWhitelist() map[string][]string { "libprofile-extras", "libprofile-extras_ndk", "libunwind_llvm", - "ndk_crtbegin_dynamic.27", - "ndk_crtbegin_so.16", - "ndk_crtbegin_so.19", - "ndk_crtbegin_so.21", - "ndk_crtbegin_so.24", - "ndk_crtbegin_so.27", - "ndk_crtend_android.27", - "ndk_crtend_so.16", - "ndk_crtend_so.19", - "ndk_crtend_so.21", - "ndk_crtend_so.24", - "ndk_crtend_so.27", - "ndk_libandroid_support", - "ndk_libc++_static", - "ndk_libc++abi", - "ndk_libunwind", } return m } diff --git a/cc/ndk_prebuilt.go b/cc/ndk_prebuilt.go index e849aeea4..3a630d2c0 100644 --- a/cc/ndk_prebuilt.go +++ b/cc/ndk_prebuilt.go @@ -90,6 +90,11 @@ func (c *ndkPrebuiltObjectLinker) link(ctx ModuleContext, flags Flags, return ndkPrebuiltModuleToPath(ctx, flags.Toolchain, objectExtension, ctx.sdkVersion()) } +func (*ndkPrebuiltObjectLinker) availableFor(what string) bool { + // ndk prebuilt objects are available to everywhere + return true +} + type ndkPrebuiltStlLinker struct { *libraryDecorator } @@ -103,6 +108,11 @@ func (*ndkPrebuiltStlLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { return deps } +func (*ndkPrebuiltStlLinker) availableFor(what string) bool { + // ndk prebuilt objects are available to everywhere + return true +} + // ndk_prebuilt_shared_stl exports a precompiled ndk shared standard template // library (stl) library for linking operation. The soong's module name format // is ndk_.so where the library is located under From 3a0db5ef4e1eacfe9888644524e95abda20a5141 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 10 Mar 2020 18:31:53 +0900 Subject: [PATCH 2/2] Remove some apex_available whitelist for the adbd APEX The marked library(ies) were available to the adbd APEX via the hand-written whitelist in build/soong/apex/apex.go. Trying to remove the whitelist by adding apex_available property to the Android.bp of the libraries. Bug: 150999716 Test: m Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5 --- apex/apex.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apex/apex.go b/apex/apex.go index 3e7328397..1d67e0bea 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -94,16 +94,9 @@ func makeApexAvailableWhitelist() map[string][]string { // Module separator // m["com.android.adbd"] = []string{ - "adbd", - "libadbconnection_server", - "libadbd", "libadbd_auth", - "libadbd_core", - "libadbd_services", - "libasyncio", "libbuildversion", "libcap", - "libdiagnose_usb", "libmdnssd", "libminijail", "libminijail_gen_constants", @@ -114,7 +107,6 @@ func makeApexAvailableWhitelist() map[string][]string { "libpackagelistparser", "libpcre2", "libprocessgroup_headers", - "libqemu_pipe", } // // Module separator