From 3cf06bfc6b8ededcfff8b8e432dec853ad56a76f Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 7 Sep 2021 19:32:37 -0400 Subject: [PATCH] libnetservices: Set -fvisibility=hidden (on non-legacy GCC.) Otherwise, the symbols will be re-exported into whatever shared libraries the static library is linked into, and potentially conflict with other applications that also linked against some other version of the same library and symbols. Fixes #17134, or at least the crash portion. I couldn't get any audio or video to play here, they seemed to just cause WebKit to stutter and hang a lot when trying to load pages with them. Maybe that's expected behavior, though? --- src/kits/network/libnetservices/JamCommon | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/network/libnetservices/JamCommon b/src/kits/network/libnetservices/JamCommon index 2f92c299f3..366dea90c2 100644 --- a/src/kits/network/libnetservices/JamCommon +++ b/src/kits/network/libnetservices/JamCommon @@ -54,6 +54,13 @@ for architectureObject in [ MultiArchSubDirSetup ] { : <$(architecture)>libshared.a ; } else { + if $(HAIKU_CC_IS_LEGACY_GCC_$(architecture)) = 0 { + # In order to not have conflicts between libraries built against + # different versions of libnetservices.a, prevent symbols from + # being re-exported from the static library. + SubDirC++Flags -fvisibility=hidden ; + } + StaticLibrary [ MultiArchDefaultGristFiles libnetservices.a ] : $(sources) Geolocation.cpp