[PATCH v2 0/2] libtraceevent: Fix static library to hide hidden functions

Steven Rostedt <[email protected]> Wed, 12 Nov 2025 09:45:05 -0500
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

When the static library uses the objects directly to be created, it makes
all the hidden functions visible to applications that link to it.

To fix this, create a helper function in the Makefile (redefine_local) that
will search for all the global functions within the shared library, and if
they do not start with "tep_", they are renamed to start with "_tep_local_".
This will keep these function from colliding with the namespace of
applications that may link to the static library.

Changes since v1: https://lore.kernel.org/all/[email protected]/

- Instead of playing tricks to what to add to the static library, just
  change the static library directly.

- Modified the meson build to have this as well.

Steven Rostedt (Google) (2):
  libtraceevent: Have static library to hide hidden functions
  libtraceevent: Have meson build rename hidden global functions

 Makefile.meson          |  15 +-
 scripts/utils.mk        |   5 +
 src/Makefile            |   8 +-
 src/event-parse-api.c   |   6 +-
 src/event-parse-local.h |  24 ++--
 src/event-parse.c       | 298 ++++++++++++++++++++--------------------
 src/event-plugin.c      |   2 +-
 src/parse-filter.c      |  22 +--
 8 files changed, 200 insertions(+), 180 deletions(-)

-- 
2.51.0