From 3f2b486741920e17dbe9ba9fc13718656cecf8d1 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 22 Mar 2021 14:49:00 -0700 Subject: [PATCH] build: remove symbol visibility from capture static library The visibility of symbols was getting extracted from the .a into the libraries that link_whole the archive. We can simply disable the visibility from the .a with a custom config.h.meson which avoids it for the capture library. Since we already double-compile those sources for the shared library, the shared library visibility is not affected. This was tested by compiling a simple library which calls sysprof_clock_init() and ensuring that no extra symbols were found with `nm libfoo.so | grep ' T '`. Fixes #60 --- config.h.meson | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ meson.build | 1 + 2 files changed, 56 insertions(+) create mode 100644 config.h.meson diff --git a/config.h.meson b/config.h.meson new file mode 100644 index 00000000..a84a9268 --- /dev/null +++ b/config.h.meson @@ -0,0 +1,55 @@ +#mesondefine API_VERSION_S + +#mesondefine DEBUGDIR + +#mesondefine DEVELOPMENT_BUILD + +#mesondefine ENABLE_LIBUNWIND + +#mesondefine ENABLE_NLS + +#mesondefine GETTEXT_PACKAGE + +#mesondefine HAVE_EXECINFO_H + +#mesondefine HAVE_PERF_CLOCKID + +#mesondefine HAVE_POLKIT + +#mesondefine HAVE_POLKIT_AGENT + +#mesondefine HAVE_REALLOCARRAY + +#mesondefine HAVE_STDATOMIC_H + +#mesondefine HAVE_STRLCPY + +#mesondefine HAVE_UNW_SET_CACHE_SIZE + +#mesondefine LOCALEDIR + +#mesondefine PACKAGE + +#mesondefine PACKAGE_BUGREPORT + +#mesondefine PACKAGE_LIBDIR + +#mesondefine PACKAGE_LIBEXECDIR + +#mesondefine PACKAGE_LOCALE_DIR + +#mesondefine PACKAGE_NAME + +#mesondefine PACKAGE_STRING + +#mesondefine PACKAGE_TARNAME + +#mesondefine PACKAGE_VERSION + +#mesondefine SYMBOLIC_VERSION + +#mesondefine VERSION + +#ifndef SYSPROF_CAPTURE_COMPILATION +#mesondefine _SYSPROF_EXTERN +#endif diff --git a/meson.build b/meson.build index b877deab..834ded8b 100644 --- a/meson.build +++ b/meson.build @@ -201,6 +201,7 @@ subdir('help') subdir('po') configure_file( + input: 'config.h.meson', output: 'config.h', configuration: config_h )