Commit Graph

3 Commits

Author SHA1 Message Date
baldurk da5cefbac2 Add workaround for when vulkan ICD is libGL.so and we repoint it to us
* Some distribution packages (Ubuntu at least I think) point the nvidia
  vulkan ICD registration at libGL.so. Since for libGL hooking we have
  to redirect dlopen("libGL.so") to ourselves, this means the vulkan
  loader loads librenderdoc instead of libGL. If we don't export the VK
  ICD entry points, it will fail to load that ICD.
* This solution isn't perfect - we export all three main ICD entry
  points. If the real ICD doesn't export one, we will fail and cause
  problems, since the loader won't fall back to older paths unless the
  symbol is completely missing. For now though this is fine since the
  nvidia ICD exports all three.
* The only way to solve that properly would be to intercept all calls to
  dlsym and redirect these functions by name to go to the real handle
  instead of ourselves - vastly overcomplicated for this edge case.
2018-01-11 13:48:34 +00:00
Peter Gal ca2b12be4d Export the egl* symbols via linker script
The egl symbols should be exported so applications
using it can correctly run with RenderDoc.
2017-07-20 09:50:46 -07:00
baldurk 389cff23f3 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.
2017-07-17 16:34:13 +01:00