From 34ad8c8262c82db237a8b9cee0d8046d9cdd6f78 Mon Sep 17 00:00:00 2001 From: davey Date: Tue, 20 Oct 2026 00:22:43 -0700 Subject: [PATCH] libretro: avoid exporting symbols on linux, android and the bsds Export only retro_* from the core, as the osx build does with libretro.osx.def. Symbols the core exports bind to same-named ones the frontend already loaded: RetroArch builds with their builtin glslang made the Vulkan renderer crash in GlslangToSpv on its first shader compile, and with a system glslang loaded (ffmpeg -> libplacebo -> shaderc) 33 glslang entry points, zstd, zlib and stb_image still went to those copies. --- CMakeLists.txt | 4 ++++ shell/libretro/link.T | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 shell/libretro/link.T diff --git a/CMakeLists.txt b/CMakeLists.txt index c5ac6f6e8..fee2357fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,6 +206,10 @@ elseif(LIBRETRO) if(NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") endif() + if(NOT WIN32) + # keep bundled libs like glslang from binding to the frontend's copies + target_link_options(${PROJECT_NAME} PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/shell/libretro/link.T") + endif() endif() set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "flycast_libretro" XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO" diff --git a/shell/libretro/link.T b/shell/libretro/link.T new file mode 100644 index 000000000..9e82b5dd3 --- /dev/null +++ b/shell/libretro/link.T @@ -0,0 +1,4 @@ +{ + global: retro_*; + local: *; +};