From 2383ba26fccfab209aadfe475ca4ee342a91ad6e Mon Sep 17 00:00:00 2001 From: jackun Date: Sat, 11 Apr 2020 13:05:53 +0300 Subject: [PATCH] Tell GCC to stop exporting static library functions Should fix crashes where games using Dear ImGui link to ours. --- include/elfhacks.h | 3 ++- src/meson.build | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/elfhacks.h b/include/elfhacks.h index 3d9417f2..4fdbfe3c 100644 --- a/include/elfhacks.h +++ b/include/elfhacks.h @@ -37,7 +37,8 @@ extern "C" { #endif -#define __PUBLIC __attribute__ ((visibility ("default"))) +//#define __PUBLIC __attribute__ ((visibility ("default"))) +#define __PUBLIC #if UINTPTR_MAX == 0xffffffffffffffff # define __elf64 diff --git a/src/meson.build b/src/meson.build index f78ccc94..220c29b7 100644 --- a/src/meson.build +++ b/src/meson.build @@ -129,7 +129,7 @@ vklayer_mesa_overlay = shared_library( dep_pthread, dep_vulkan], include_directories : [inc_common], - link_args : cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro']), + link_args : cc.get_supported_link_arguments(['-Wl,-Bsymbolic-functions', '-Wl,-z,relro', '-Wl,--exclude-libs,ALL']), install_dir : libdir_mangohud, install : true )