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
This commit is contained in:
Jooyung Han 2019-09-26 14:57:07 +09:00
parent 87a10ac108
commit e30a7f5d1f
3 changed files with 6 additions and 6 deletions

View file

@ -4208,7 +4208,7 @@ static std::string get_ld_config_file_vndk_path() {
if (insert_pos == std::string::npos) { if (insert_pos == std::string::npos) {
insert_pos = ld_config_file_vndk.length(); insert_pos = ld_config_file_vndk.length();
} }
ld_config_file_vndk.insert(insert_pos, Config::get_vndk_version_string('.')); ld_config_file_vndk.insert(insert_pos, Config::get_vndk_version_string("."));
return ld_config_file_vndk; return ld_config_file_vndk;
} }

View file

@ -408,7 +408,7 @@ class Properties {
params.push_back({ "SDK_VER", buf }); 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 }); params.push_back({ "VNDK_VER", vndk });
for (auto& path : paths) { for (auto& path : paths) {
@ -596,11 +596,11 @@ bool Config::read_binary_config(const char* ld_config_file_path,
return true; 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", ""); std::string version = android::base::GetProperty("ro.vndk.version", "");
if (version != "" && version != "current") { if (version != "" && version != "current") {
//add the delimiter char in front of the string and return it. //add the prefix in front of the string and return it.
return version.insert(0, 1, delimiter); return version.insert(0, prefix);
} }
return ""; return "";
} }

View file

@ -164,7 +164,7 @@ class Config {
const Config** config, const Config** config,
std::string* error_msg); std::string* error_msg);
static std::string get_vndk_version_string(const char delimiter); static std::string get_vndk_version_string(const std::string& prefix);
private: private:
void clear(); void clear();