diff options
author | Evgenii Stepanov | 2015-07-08 17:49:52 -0500 |
---|---|---|
committer | Evgenii Stepanov | 2015-07-08 17:49:52 -0500 |
commit | c2466e6f005e9cbeea7764e9d8864fa6bca17633 (patch) | |
tree | 9c93a7d769dffe3f17bf2ef7d0e8f1f86912c8df | |
parent | dbc2d87a74987db84f6cb3cf1eed9ae7ca450ce7 (diff) | |
download | frameworks-native-c2466e6f005e9cbeea7764e9d8864fa6bca17633.tar.gz frameworks-native-c2466e6f005e9cbeea7764e9d8864fa6bca17633.tar.xz frameworks-native-c2466e6f005e9cbeea7764e9d8864fa6bca17633.zip |
With SANITIZE_TARGET, load EGL libs from the instrumented path.
Bug: 21785137
Change-Id: Iac56419a9ca776c5704bed44d3f0a1a1edd9d172
-rw-r--r-- | opengl/libs/Android.mk | 5 | ||||
-rw-r--r-- | opengl/libs/EGL/Loader.cpp | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 4da9f92a9..cc9b50c4c 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk | |||
@@ -59,6 +59,11 @@ ifneq ($(MAX_EGL_CACHE_SIZE),) | |||
59 | LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) | 59 | LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) |
60 | endif | 60 | endif |
61 | 61 | ||
62 | ifeq (address, $(strip $(SANITIZE_TARGET))) | ||
63 | LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\" | ||
64 | LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\" | ||
65 | endif | ||
66 | |||
62 | LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module) | 67 | LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module) |
63 | egl.cfg_config_module := | 68 | egl.cfg_config_module := |
64 | 69 | ||
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 1fcc048b2..8df9af3e4 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp | |||
@@ -167,6 +167,14 @@ static void* load_wrapper(const char* path) { | |||
167 | return so; | 167 | return so; |
168 | } | 168 | } |
169 | 169 | ||
170 | #ifndef EGL_WRAPPER_DIR | ||
171 | #if defined(__LP64__) | ||
172 | #define EGL_WRAPPER_DIR "/system/lib64" | ||
173 | #else | ||
174 | #define EGL_WRAPPER_DIR "/system/lib" | ||
175 | #endif | ||
176 | #endif | ||
177 | |||
170 | void* Loader::open(egl_connection_t* cnx) | 178 | void* Loader::open(egl_connection_t* cnx) |
171 | { | 179 | { |
172 | void* dso; | 180 | void* dso; |
@@ -187,15 +195,10 @@ void* Loader::open(egl_connection_t* cnx) | |||
187 | 195 | ||
188 | LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation"); | 196 | LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation"); |
189 | 197 | ||
190 | #if defined(__LP64__) | 198 | cnx->libEgl = load_wrapper(EGL_WRAPPER_DIR "/libEGL.so"); |
191 | cnx->libEgl = load_wrapper("/system/lib64/libEGL.so"); | 199 | cnx->libGles2 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv2.so"); |
192 | cnx->libGles2 = load_wrapper("/system/lib64/libGLESv2.so"); | 200 | cnx->libGles1 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv1_CM.so"); |
193 | cnx->libGles1 = load_wrapper("/system/lib64/libGLESv1_CM.so"); | 201 | |
194 | #else | ||
195 | cnx->libEgl = load_wrapper("/system/lib/libEGL.so"); | ||
196 | cnx->libGles2 = load_wrapper("/system/lib/libGLESv2.so"); | ||
197 | cnx->libGles1 = load_wrapper("/system/lib/libGLESv1_CM.so"); | ||
198 | #endif | ||
199 | LOG_ALWAYS_FATAL_IF(!cnx->libEgl, | 202 | LOG_ALWAYS_FATAL_IF(!cnx->libEgl, |
200 | "couldn't load system EGL wrapper libraries"); | 203 | "couldn't load system EGL wrapper libraries"); |
201 | 204 | ||