From e30a7f5d1f00f4571c4a6ea9766fd22a6be27904 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Thu, 26 Sep 2019 14:57:07 +0900 Subject: [PATCH] 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 --- linker/linker.cpp | 2 +- linker/linker_config.cpp | 8 ++++---- linker/linker_config.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/linker/linker.cpp b/linker/linker.cpp index 37a318916..cee9c3b31 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -4208,7 +4208,7 @@ static std::string get_ld_config_file_vndk_path() { if (insert_pos == std::string::npos) { 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; } diff --git a/linker/linker_config.cpp b/linker/linker_config.cpp index 46c91a3dd..450d0e6d3 100644 --- a/linker/linker_config.cpp +++ b/linker/linker_config.cpp @@ -408,7 +408,7 @@ class Properties { 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 @@ bool Config::read_binary_config(const char* ld_config_file_path, 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 ""; } diff --git a/linker/linker_config.h b/linker/linker_config.h index 75d93789b..547c62ebd 100644 --- a/linker/linker_config.h +++ b/linker/linker_config.h @@ -164,7 +164,7 @@ class Config { const Config** config, 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: void clear();