aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-27 17:43:11 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-02-27 17:43:11 +0000
commitb47b871b126178ef6f31f5b5fafa1006e22907fe (patch)
tree5b7aa37cbe564b6b59d1cce13b61946559fc56dd
parent5f53f24715cee65f7a2356cca546f0ff9de4ab19 (diff)
parentc016d99023ae6560c1833b91b134ef1e15c2f3eb (diff)
downloadlinkerconfig-b47b871b126178ef6f31f5b5fafa1006e22907fe.tar.gz
Make sphal and vndk namespace available from legacy devices am: c016d99023
Change-Id: I876b27b10320f77097fbf4b6402de2889a5da01d
-rw-r--r--contents/namespace/sphal.cc16
-rw-r--r--contents/section/apexdefault.cc5
2 files changed, 13 insertions, 8 deletions
diff --git a/contents/namespace/sphal.cc b/contents/namespace/sphal.cc
index 74858fb..71f41a7 100644
--- a/contents/namespace/sphal.cc
+++ b/contents/namespace/sphal.cc
@@ -45,13 +45,15 @@ Namespace BuildSphalNamespace([[maybe_unused]] const Context& ctx) {
ns.AddPermittedPath("/system/vendor/${LIB}", AsanPath::NONE);
if (ctx.IsApexBinaryConfig()) {
- ns.GetLink("vndk").AddSharedLib(
- Var("VNDK_SAMEPROCESS_LIBRARIES_VENDOR", ""));
- ns.GetLink(ctx.GetSystemNamespaceName())
- .AddSharedLib(Var("LLNDK_LIBRARIES_VENDOR", ""),
- // Add a link for libz.so which is llndk on
- // devices where VNDK is not enforced.
- "libz.so");
+ if (ctx.IsVndkAvailable()) {
+ ns.GetLink("vndk").AddSharedLib(
+ Var("VNDK_SAMEPROCESS_LIBRARIES_VENDOR", ""));
+ ns.GetLink(ctx.GetSystemNamespaceName())
+ .AddSharedLib(Var("LLNDK_LIBRARIES_VENDOR", ""));
+ }
+
+ // Add a link for libz.so which is llndk on devices where VNDK is not enforced.
+ ns.GetLink(ctx.GetSystemNamespaceName()).AddSharedLib("libz.so");
} else {
// Once in this namespace, access to libraries in /system/lib is restricted.
// Only libs listed here can be used. Order is important here as the
diff --git a/contents/section/apexdefault.cc b/contents/section/apexdefault.cc
index 041fe80..24b2834 100644
--- a/contents/section/apexdefault.cc
+++ b/contents/section/apexdefault.cc
@@ -43,7 +43,10 @@ Section BuildApexDefaultSection(Context& ctx, const ApexInfo& apex_info) {
// namespace(s)
if (apex_info.name == "com.android.media.swcodec") {
namespaces.emplace_back(BuildSphalNamespace(ctx));
- namespaces.emplace_back(BuildVndkNamespace(ctx, VndkUserPartition::Vendor));
+ if (ctx.IsVndkAvailable()) {
+ namespaces.emplace_back(
+ BuildVndkNamespace(ctx, VndkUserPartition::Vendor));
+ }
}
return BuildSection(ctx, apex_info.name, std::move(namespaces), {});