Change linker config variable: VNDK_VER
With VNDK APEX, the path for VNDK libs has been changed
from /system/lib/vndk-VER to /apex/com.android.vndk.vVER/lib
Previously, VNDK_VER is replaced with prefix(e.g. "-29"). We could
still prepend prefix("v") to the vndk version, but this change uses a
raw vndk version as the value of VNKD_VER.
Bug: 141451661
Test: m && boot (tested with cuttlefish)
Change-Id: Ibf4cf5e29b7f28e733d4b3bc15171f4359e1d2f2
diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp
index 46c91a3..450d0e6 100644
--- a/linker/linker_config.cpp
+++ b/linker/linker_config.cpp
@@ -408,7 +408,7 @@
params.push_back({ "SDK_VER", buf });
}
- static std::string vndk = Config::get_vndk_version_string('-');
+ static std::string vndk = Config::get_vndk_version_string("");
params.push_back({ "VNDK_VER", vndk });
for (auto& path : paths) {
@@ -596,11 +596,11 @@
return true;
}
-std::string Config::get_vndk_version_string(const char delimiter) {
+std::string Config::get_vndk_version_string(const std::string& prefix) {
std::string version = android::base::GetProperty("ro.vndk.version", "");
if (version != "" && version != "current") {
- //add the delimiter char in front of the string and return it.
- return version.insert(0, 1, delimiter);
+ //add the prefix in front of the string and return it.
+ return version.insert(0, prefix);
}
return "";
}