aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiyoung Kim <kiyoungkim@google.com>2020-04-01 01:15:13 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-01 01:15:13 +0000
commita2c1589b8b4bc982b2760fe78564538d6a07dd35 (patch)
tree4ce1c02633aa73baf656371a03b9dc50a860ffa5
parent9aee519b305035dc090eb4275517d68dc1626b9f (diff)
parentb38d2f5ff392ed33e540ebb879c976614b7c8a2f (diff)
downloadlinkerconfig-a2c1589b8b4bc982b2760fe78564538d6a07dd35.tar.gz
Move libz from VNDKSP to LLNDK in case of VNDK Lite am: b38d2f5ff3
Change-Id: I41447d9cd032afe9db263d2251a849e77cfafe54
-rw-r--r--contents/namespace/sphal.cc6
-rw-r--r--generator/librarylistloader.cc12
2 files changed, 15 insertions, 3 deletions
diff --git a/contents/namespace/sphal.cc b/contents/namespace/sphal.cc
index 71f41a7..07bf2a8 100644
--- a/contents/namespace/sphal.cc
+++ b/contents/namespace/sphal.cc
@@ -50,10 +50,10 @@ Namespace BuildSphalNamespace([[maybe_unused]] const Context& ctx) {
Var("VNDK_SAMEPROCESS_LIBRARIES_VENDOR", ""));
ns.GetLink(ctx.GetSystemNamespaceName())
.AddSharedLib(Var("LLNDK_LIBRARIES_VENDOR", ""));
+ } else {
+ // Add a link for libz.so which is llndk on devices where VNDK is not enforced.
+ ns.GetLink(ctx.GetSystemNamespaceName()).AddSharedLib("libz.so");
}
-
- // 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/generator/librarylistloader.cc b/generator/librarylistloader.cc
index 7ee7262..7481e8d 100644
--- a/generator/librarylistloader.cc
+++ b/generator/librarylistloader.cc
@@ -25,6 +25,7 @@
#include <sstream>
#include <unordered_map>
+#include "linkerconfig/environment.h"
#include "linkerconfig/log.h"
using LibraryList = std::set<std::string>;
@@ -54,6 +55,17 @@ Result<LibraryList> GetLibrariesFromFile(std::string file_path) {
}
}
+ // TODO (b/122954981) : Remove this part when VNDK Lite is deprecated
+ // In case of VNDK-lite devices, libz should be included in LLNDK rather than
+ // VNDK-SP libraries
+ if (android::linkerconfig::modules::IsVndkLiteDevice()) {
+ if (file_path.find("llndk") != std::string::npos) {
+ library_list.insert("libz.so");
+ } else if (file_path.find("vndksp") != std::string::npos) {
+ library_list.erase("libz.so");
+ }
+ }
+
library_file_cache.insert({file_path, library_list});
return library_list;