Skip linkloader, use shared object files
Bug: 18322681
- In rsCpuScript, if property rs.skip.linkloader is set, look for a .so
file in the cache directory and load it. If it is not available, use
bcc to generate relocatable object file and link it to a .so using
ld.mc. Use the embedded symbols in .rs.info and follow steps similar
to the compatibility library to invoke script functions or access
script variables.
- Add rs* symbols like rsGetAllocation to libRSCpuRef (ala
libRSSupport). Do necessary changes to argument types to get mangled
names correct.
- Make 64-bit version of rsSetObject take two pointers instead of a
pointer and a large object. rsIsObject takes a pointer instead of a
large object. Otherwise, we get failures in x86_64 due to calling
convention mismatch. To match the function names in the shared object
path, define these functions as 'extern "C"' with their mangled names.
- Add stubbed Math functions from rsCpuRuntimeMath and
rsCpuRuntimeMathFuncs into libRSCpuRef.so.
- Coalesce separate #ifdef paths in libRSCpuRef. Function parameters
for runtime callbacks and bcc plugin are needed in the
non-compatibilty path, but take default NULL arguments. This patch
introduces these parameters into the compatibility path as well, and
passes default NULL arguments.
Change-Id: I8a853350e39d30b4d852c30e4b5da5a75a2f2820
diff --git a/cpu_ref/Android.mk b/cpu_ref/Android.mk
index e267fe9..6599932 100644
--- a/cpu_ref/Android.mk
+++ b/cpu_ref/Android.mk
@@ -22,6 +22,7 @@
rsCpuCore.cpp \
rsCpuScript.cpp \
rsCpuRuntimeMath.cpp \
+ rsCpuRuntimeMathFuncs.cpp \
rsCpuRuntimeStubs.cpp \
rsCpuScriptGroup.cpp \
rsCpuScriptGroup2.cpp \
@@ -79,7 +80,7 @@
rsCpuIntrinsics_x86.cpp
endif
-LOCAL_SHARED_LIBRARIES += libRS libcutils libutils liblog libsync libc++
+LOCAL_SHARED_LIBRARIES += libRS libcutils libutils liblog libsync libc++ libdl
# these are not supported in 64-bit yet
LOCAL_SHARED_LIBRARIES += libbcc libbcinfo