From 3941e4fe246d138d3e8164331f6c9285236988d2 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 18 Oct 2021 00:12:28 +0200 Subject: [PATCH] Ports: Prevent exporting symbols for ScummVM Both LibGUI and ScummVM have a GUI::Widget class. This interferes with normal operation of LibGUI, since the wrong GUI::Widget::~Widget() is invoked when SerenitySDLWidget (from the SDL2 port) is destructed. By adding `-fvisibility=hidden` to the compiler flags, we set the symbol visibility to hidden by default and the correct destructor is invoked again. --- Ports/scummvm/package.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Ports/scummvm/package.sh b/Ports/scummvm/package.sh index dce2b079eb..c50d3b8e05 100755 --- a/Ports/scummvm/package.sh +++ b/Ports/scummvm/package.sh @@ -17,5 +17,14 @@ launcher_category=Games launcher_command=/usr/local/bin/scummvm icon_file=icons/scummvm.ico -export FREETYPE2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/freetype2" -export SDL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2" +function pre_configure() { + export CPPFLAGS="-fvisibility=hidden" + export FREETYPE2_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/freetype2" + export SDL_CFLAGS="-I${SERENITY_INSTALL_ROOT}/usr/local/include/SDL2" +} + +function post_configure() { + unset CPPFLAGS + unset FREETYPE2_CFLAGS + unset SDL_CFLAGS +}