diff options
| author | 2015-07-08 15:49:52 -0700 | |
|---|---|---|
| committer | 2015-07-08 15:49:52 -0700 | |
| commit | c2466e6f005e9cbeea7764e9d8864fa6bca17633 (patch) | |
| tree | 9c93a7d769dffe3f17bf2ef7d0e8f1f86912c8df | |
| parent | dbc2d87a74987db84f6cb3cf1eed9ae7ca450ce7 (diff) | |
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 4da9f92a98..cc9b50c4c5 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -59,6 +59,11 @@ ifneq ($(MAX_EGL_CACHE_SIZE),) LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE) endif +ifeq (address, $(strip $(SANITIZE_TARGET))) + LOCAL_CFLAGS_32 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib\" + LOCAL_CFLAGS_64 += -DEGL_WRAPPER_DIR=\"/$(TARGET_COPY_OUT_DATA)/lib64\" +endif + LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module) egl.cfg_config_module := diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 1fcc048b28..8df9af3e44 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -167,6 +167,14 @@ static void* load_wrapper(const char* path) { return so; } +#ifndef EGL_WRAPPER_DIR +#if defined(__LP64__) +#define EGL_WRAPPER_DIR "/system/lib64" +#else +#define EGL_WRAPPER_DIR "/system/lib" +#endif +#endif + void* Loader::open(egl_connection_t* cnx) { void* dso; @@ -187,15 +195,10 @@ void* Loader::open(egl_connection_t* cnx) LOG_ALWAYS_FATAL_IF(!hnd, "couldn't find an OpenGL ES implementation"); -#if defined(__LP64__) - cnx->libEgl = load_wrapper("/system/lib64/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib64/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib64/libGLESv1_CM.so"); -#else - cnx->libEgl = load_wrapper("/system/lib/libEGL.so"); - cnx->libGles2 = load_wrapper("/system/lib/libGLESv2.so"); - cnx->libGles1 = load_wrapper("/system/lib/libGLESv1_CM.so"); -#endif + cnx->libEgl = load_wrapper(EGL_WRAPPER_DIR "/libEGL.so"); + cnx->libGles2 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv2.so"); + cnx->libGles1 = load_wrapper(EGL_WRAPPER_DIR "/libGLESv1_CM.so"); + LOG_ALWAYS_FATAL_IF(!cnx->libEgl, "couldn't load system EGL wrapper libraries"); |