summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJooyung Han <jooyung@google.com>2020-03-25 21:46:54 +0900
committerJooyung Han <jooyung@google.com>2020-03-27 10:12:20 +0900
commitdc42cee700bf2ae1b9fb789455ea5110b30f69ad (patch)
tree30c219c7bcbc5b51b0163cd5aaad6b6102f1934d
parent16ad2184467c2ab589b8b4ad756943fbc18d90b3 (diff)
downloadrs-dc42cee700bf2ae1b9fb789455ea5110b30f69ad.tar.gz
Fix VNDK path
Previously, isRunningInVndkNamespace returns true if the shared object is loaded from the path including "/vndk-sp". This change fixes it to use a new VNDK path. And also getVndkSysLibPath() is amended as well. Bug: 151635128 Test: build Change-Id: Ic2d5040a14b960562ffcba0d5589d120bd27c6aa
-rw-r--r--cpu_ref/rsCpuExecutable.cpp2
-rw-r--r--cpu_ref/rsCpuScript.h13
2 files changed, 6 insertions, 9 deletions
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index 63008ba1..82e3738f 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -103,7 +103,7 @@ static bool isRunningInVndkNamespace() {
Dl_info info;
if (dladdr(reinterpret_cast<const void*>(&isRunningInVndkNamespace), &info) != 0) {
std::string filename = std::string(info.dli_fname);
- return filename.find("/vndk-sp") != std::string::npos;
+ return filename.find("/apex/com.android.vndk") != std::string::npos;
} else {
ALOGW("Can't determine whether this lib is running in vndk namespace or not. Assuming it is in vndk namespace.");
}
diff --git a/cpu_ref/rsCpuScript.h b/cpu_ref/rsCpuScript.h
index a8f0db6e..e9feb1c9 100644
--- a/cpu_ref/rsCpuScript.h
+++ b/cpu_ref/rsCpuScript.h
@@ -157,17 +157,14 @@ uint32_t constructBuildChecksum(uint8_t const *bitcode, size_t bitcodeSize,
#ifdef __LP64__
#define SYSLIBPATH "/system/lib64"
-#define SYSLIBPATH_VNDK "/system/lib64/vndk-sp"
#define SYSLIBPATH_BC "/system/lib64"
#define SYSLIBPATH_VENDOR "/system/vendor/lib64"
#elif defined(BUILD_ARM_FOR_X86) && defined(__arm__)
#define SYSLIBPATH "/system/lib/arm"
-#define SYSLIBPATH_VNDK "/system/lib/arm/vndk-sp"
#define SYSLIBPATH_BC "/system/lib"
#define SYSLIBPATH_VENDOR "/system/vendor/lib/arm"
#else
#define SYSLIBPATH "/system/lib"
-#define SYSLIBPATH_VNDK "/system/lib/vndk-sp"
#define SYSLIBPATH_BC "/system/lib"
#define SYSLIBPATH_VENDOR "/system/vendor/lib"
#endif
@@ -197,11 +194,11 @@ inline bool is_force_recompile() {
inline std::string getVndkSysLibPath() {
char buf[PROP_VALUE_MAX];
android::renderscript::property_get("ro.vndk.version", buf, "");
- std::string versionStr = buf;
- if (versionStr != "" && versionStr != "current") {
- return SYSLIBPATH_VNDK "-" + versionStr;
- }
- return SYSLIBPATH_VNDK;
+ std::string vndk_path = "/apex/com.android.vndk.v" + std::string(buf) + "/lib";
+ #ifdef __LP64__
+ vndk_path += "64";
+ #endif
+ return vndk_path;
}
} // anonymous namespace