Use generated linker config by default
Use generated linker config by default, but with some back up plan (sys.linker.use_generated_config property). Linker config generator still does not support non-treblelized devices and vndk-lite, so these cases should be handled later. Bug: 138920271 Test: m -j && atest passed Test: Tested from cuttlefish Change-Id: I39e9d089a82f9409eccdcaa4fb26660caf3f5779
This commit is contained in:
parent
14d5c12ed6
commit
89b9528445
1 changed files with 13 additions and 7 deletions
|
@ -4191,6 +4191,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) {
|
||||
|
@ -4210,13 +4223,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())) {
|
||||
|
|
Loading…
Reference in a new issue