mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add linker version script to explicitly expose symbols. Refs #683
* When statically linking libstdc++ by default the symbols are all default visibility. This causes a problem if you statically link an old libstdc++ then inject librenderdoc.so, and the application starts using the old libstdc++ instead of the system's. * Really we only want to use the static one for calls from librenderdoc.so. In theory -Wl,--exclude-libs,libstdc++ should do this for us, but it starts to cause bizarre crashes. * Instead, we have to resort to a manual linker script which whitelists which symbols should be visible. Normally we can do this just for our own symbols with -fvisibility=hidden and __attribute__((visibility)) but that doesn't work for linked symbols apparently.
This commit is contained in:
@@ -307,6 +307,10 @@ target_compile_definitions(renderdoc ${RDOC_DEFINITIONS})
|
||||
target_include_directories(renderdoc ${RDOC_INCLUDES})
|
||||
target_link_libraries(renderdoc ${RDOC_LIBRARIES})
|
||||
|
||||
if(UNIX AND NOT ANDROID)
|
||||
set_target_properties(renderdoc PROPERTIES LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/renderdoc.version")
|
||||
endif()
|
||||
|
||||
install (TARGETS renderdoc DESTINATION lib${LIB_SUFFIX})
|
||||
|
||||
# Copy in application API header to include
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
global:
|
||||
_init;
|
||||
_fini;
|
||||
gl[A-Z]*;
|
||||
dlopen;
|
||||
_exit;
|
||||
RENDERDOC_*;
|
||||
VK_LAYER_RENDERDOC_*;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
Reference in New Issue
Block a user