[sysprof] build: remove symbol visibility from capture static library
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] build: remove symbol visibility from capture static library
- Date: Mon, 22 Mar 2021 21:49:50 +0000 (UTC)
commit 3f2b486741920e17dbe9ba9fc13718656cecf8d1
Author: Christian Hergert <chergert redhat com>
Date: Mon Mar 22 14:49:00 2021 -0700
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(+)
---
diff --git a/config.h.meson b/config.h.meson
new file mode 100644
index 0000000..a84a926
--- /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 b877dea..834ded8 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
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]