mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-24 20:00:41 +02:00
Thunks: Make GL guest thunks implicitly load libX11.so
Steam's gameoverlayrenderer.so relies on libX11 symbols to be available without actually loading that library directly. This works on an unthunked system since libGL.so depends on libGLX.so, which in turn pulls in libX11.so at load-time. Adding a fake libX11 dependency to the libGL-guest thunks reproduces this behavior.
This commit is contained in:
1 parent
f5e18ccea6
commit
cd05cdaa57
3 files changed
+15
No files matched your search
@@ -91,6 +91,10 @@ add_guest_lib(EGL)
|
||||
generate(libGL ${CMAKE_CURRENT_SOURCE_DIR}/../libGL/libGL_interface.cpp thunks function_packs function_packs_public symbol_list)
|
||||
add_guest_lib(GL)
|
||||
|
||||
# libGL must pull in libX11.so, so generate a placeholder libX11.so to link against
|
||||
add_library(X11 SHARED ../libX11/libX11_NativeGuest.cpp)
|
||||
target_link_libraries(GL-guest PRIVATE X11)
|
||||
|
||||
# disabled for now, headers are platform specific
|
||||
# find_package(SDL2 REQUIRED)
|
||||
# generate(libSDL2 thunks function_packs function_packs_public)
|
||||
|
||||
@@ -65,4 +65,8 @@ extern "C" {
|
||||
}
|
||||
}
|
||||
|
||||
// libGL.so must pull in libX11.so as a dependency. Referencing some libX11
|
||||
// symbol here prevents the linker from optimizing away the unused dependency
|
||||
auto implicit_libx11_dependency = XSetErrorHandler;
|
||||
|
||||
LOAD_LIB(libGL)
|
||||
@@ -0,0 +1,7 @@
|
||||
// This file only exists to create a placeholder library to link against for
|
||||
// libraries that are supposed to implicitly load libX11. At runtime, the guest
|
||||
// linker will select the library from the RootFS instead, which is then
|
||||
// replaced by libX11-guest.so.
|
||||
|
||||
// Define some symbol so that the linker doesn't consider this library unused
|
||||
extern "C" void XSetErrorHandler() {}
|
||||
Reference in new issue
Block a user