loader: do not set RTLD_DEEPBIND
authorChia-I Wu <olv@lunarg.com>
Wed, 18 Feb 2015 21:39:54 +0000 (14:39 -0700)
committerChia-I Wu <olv@lunarg.com>
Thu, 19 Feb 2015 03:56:32 +0000 (11:56 +0800)
Instead, build layers with -Bsymbolic.  This should fix (or hide) a reported
crash with overriden malloc()/free().

layers/CMakeLists.txt
loader/loader_platform.h

index 0655fa0..774574c 100644 (file)
@@ -31,6 +31,7 @@ else()
        add_library(XGLLayer${target} SHARED ${ARGN})
         target_link_Libraries(XGLLayer${target} layer_utils)
        add_dependencies(XGLLayer${target} generate_xgl_layer_helpers)
+       set_target_properties(XGLLayer${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic")
     endmacro()
 endif()
 
index 9686b65..d3fe4d7 100644 (file)
 typedef void * loader_platform_dl_handle;
 static inline loader_platform_dl_handle loader_platform_open_library(const char* libPath)
 {
-    // NOTE: The prior (Linux only) loader code always used RTLD_LAZY.  In one
-    // place, it used RTLD_DEEPBIND.  It probably doesn't hurt to always use
-    // RTLD_DEEPBIND, and so that is what is being done.
-    return dlopen(libPath, RTLD_LAZY | RTLD_DEEPBIND | RTLD_LOCAL);
+    return dlopen(libPath, RTLD_LAZY | RTLD_LOCAL);
 }
 static inline char * loader_platform_open_library_error(const char* libPath)
 {