From cbf276b7dc9d8a9b0d50c46fd48ebfc293dd809b Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 27 Nov 2020 20:40:59 +0100 Subject: [PATCH] Hide all symbols by default As mentioned by @abique. Could prevent issues caused by symbol clashes, and it also greatly reduces the size of all binaries. --- CHANGELOG.md | 2 ++ meson.build | 10 +++++++--- src/wine-host/group-host.cpp | 3 ++- src/wine-host/individual-host.cpp | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 001ce820..788e4f2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ Versioning](https://semver.org/spec/v2.0.0.html). - When `YABRIDGE_DEBUG_LEVEL` is set to 2 or higher and a plugin asks the host for the current position in the song, yabridge will now print that position in quarter notes and samples as part of the debug output. +- Symbols in all `libyabridge.so` and all Winelib `.so` files are now hidden by + default. ## [2.1.0] - 2020-11-20 diff --git a/meson.build b/meson.build index 71da689b..9859efd6 100644 --- a/meson.build +++ b/meson.build @@ -26,9 +26,13 @@ individual_host_name_32bit = 'yabridge-host-32' group_host_name_64bit = 'yabridge-group' group_host_name_32bit = 'yabridge-group-32' -# Disable the use of concepts in Boost.Asio until Boost 1.73 gets released -# https://github.com/boostorg/asio/issues/312 -compiler_options = ['-DBOOST_ASIO_DISABLE_CONCEPTS'] +compiler_options = [ + '-fvisibility=hidden', + '-fvisibility-inlines-hidden', + # Disable the use of concepts in Boost.Asio until Boost 1.73 gets released + # https://github.com/boostorg/asio/issues/312 + '-DBOOST_ASIO_DISABLE_CONCEPTS' +] with_bitbridge = get_option('with-bitbridge') with_static_boost = get_option('with-static-boost') diff --git a/src/wine-host/group-host.cpp b/src/wine-host/group-host.cpp index b19e3b4a..d5fa2aef 100644 --- a/src/wine-host/group-host.cpp +++ b/src/wine-host/group-host.cpp @@ -39,7 +39,8 @@ * The explicit calling convention is needed to work around a bug introduced in * Wine 5.7: https://bugs.winehq.org/show_bug.cgi?id=49138 */ -int __cdecl main(int argc, char* argv[]) { +int __cdecl __attribute__((visibility("default"))) +main(int argc, char* argv[]) { set_realtime_priority(); // Instead of directly hosting a plugin, this process will receive a UNIX diff --git a/src/wine-host/individual-host.cpp b/src/wine-host/individual-host.cpp index 8c7f4dd7..09874e9e 100644 --- a/src/wine-host/individual-host.cpp +++ b/src/wine-host/individual-host.cpp @@ -32,7 +32,8 @@ * The explicit calling convention is needed to work around a bug introduced in * Wine 5.7: https://bugs.winehq.org/show_bug.cgi?id=49138 */ -int __cdecl main(int argc, char* argv[]) { +int __cdecl __attribute__((visibility("default"))) +main(int argc, char* argv[]) { set_realtime_priority(); // We pass the name of the VST plugin .dll file to load and the base