From 0558c957e881e23f268aa4db0cb254c45efc19da Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 21 Dec 2024 12:25:30 +0100 Subject: [PATCH] libretro: set an SDL hint to keep flycast SIGSEGV handler Thanks to mrfixit2001 for helping troubleshoot the issue. --- shell/libretro/libretro.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shell/libretro/libretro.cpp b/shell/libretro/libretro.cpp index 6c6fccb78..cc80eac56 100644 --- a/shell/libretro/libretro.cpp +++ b/shell/libretro/libretro.cpp @@ -27,6 +27,8 @@ #include #include #include "nswitch.h" +#elif defined(__linux__) || defined(__FreeBSD__) +#include #endif #include @@ -348,6 +350,11 @@ void retro_init() if (!addrspace::reserve()) ERROR_LOG(VMEM, "Cannot reserve memory space"); +#if defined(__linux__) || defined(__FreeBSD__) + // SDL evdev keyboard driver installs a SIGSEGV signal handler by default, which replaces flycast's one. + // Make sure to avoid this if SDL is initialized after the core (which happens). + setenv("SDL_NO_SIGNAL_HANDLERS", "1", 1); +#endif os_InstallFaultHandler(); MapleConfigMap::UpdateVibration = updateVibration;