summaryrefslogtreecommitdiff
path: root/linker/linker.cpp
diff options
context:
space:
mode:
authorKiyoung Kim <kiyoungkim@google.com>2019-09-26 00:58:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-09-26 00:58:15 +0000
commit34c0043fd84823e7233cb03fb70597b55138eac1 (patch)
treeb6f8e29e5261ab108ee505a9f43d5ae840c60974 /linker/linker.cpp
parentef0adb1275e9af2a23d63fe9dcf048eb28c9ae78 (diff)
parent89b95284455a18bd2ee5d82373842221460ae3ae (diff)
Merge "Use generated linker config by default"
Diffstat (limited to 'linker/linker.cpp')
-rw-r--r--linker/linker.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 94faf2350..37a318916 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -4190,6 +4190,19 @@ static std::string get_ld_config_file_vndk_path() {
return kLdConfigVndkLiteFilePath;
}
+ // Use generated linker config if flag is set
+ // TODO(b/138920271) Do not check property once it is confirmed as stable
+ // TODO(b/139638519) This file should also cover legacy or vndk-lite config
+ if (android::base::GetProperty("ro.vndk.version", "") != "" &&
+ android::base::GetBoolProperty("sys.linker.use_generated_config", true)) {
+ if (file_exists(kLdGeneratedConfigFilePath)) {
+ return kLdGeneratedConfigFilePath;
+ } else {
+ DL_WARN("Warning: failed to find generated linker configuration from \"%s\"",
+ kLdGeneratedConfigFilePath);
+ }
+ }
+
std::string ld_config_file_vndk = kLdConfigFilePath;
size_t insert_pos = ld_config_file_vndk.find_last_of('.');
if (insert_pos == std::string::npos) {
@@ -4209,13 +4222,6 @@ static std::string get_ld_config_file_path(const char* executable_path) {
}
#endif
- // Use generated linker config if flag is set
- // TODO(b/138920271) Do not check property once it is confirmed as stable
- if (android::base::GetBoolProperty("sys.linker.use_generated_config", false) &&
- file_exists(kLdGeneratedConfigFilePath)) {
- return kLdGeneratedConfigFilePath;
- }
-
std::string path = get_ld_config_file_apex_path(executable_path);
if (!path.empty()) {
if (file_exists(path.c_str())) {