Use versioned VNDK directories

VNDK directories will have "-$VER" as their suffix, where $VER is set
by the property "ro.vndk.version".
For example, if the $VER is "28", the vndk-sp directory is
"system/lib[64]/vndk-sp-28/".

Bug: 69984421
Test: Check if the apps that uses RS works without problem.
Change-Id: I24a9b0ca51f12ab5562a661761401d057d6346a0
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index 9dcc842..3c62d05 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -137,16 +137,20 @@
     linkDriverName.erase(linkDriverName.length() - 3);
     linkDriverName.replace(0, 3, "-l");
 
+    static const std::string vndkLibCompilerRt =
+        getVndkSysLibPath() + "/libcompiler_rt.so";
     const char *compiler_rt = isRunningInVndkNamespace() ?
-        SYSLIBPATH_VNDK "/libcompiler_rt.so" : SYSLIBPATH "/libcompiler_rt.so";
+        vndkLibCompilerRt.c_str() : SYSLIBPATH "/libcompiler_rt.so";
     const char *mTriple = "-mtriple=" DEFAULT_TARGET_TRIPLE_STRING;
     const char *libPath = "--library-path=" SYSLIBPATH;
     // vndk path is only added when RS framework is running in vndk namespace.
     // If we unconditionally add the vndk path to the library path, then RS
     // driver in the vndk-sp directory will always be used even for CPU fallback
     // case, where RS framework is loaded from the default namespace.
+    static const std::string vndkLibPathString =
+        "--library-path=" + getVndkSysLibPath();
     const char *vndkLibPath = isRunningInVndkNamespace() ?
-        "--library-path=" SYSLIBPATH_VNDK : "";
+        vndkLibPathString.c_str() : "";
     const char *vendorLibPath = "--library-path=" SYSLIBPATH_VENDOR;
 
     // The search path order should be vendor -> vndk -> system