liblttng-ctl: use export list to define exported symbols
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 21 Sep 2021 13:40:37 +0000 (09:40 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 Oct 2021 19:43:01 +0000 (15:43 -0400)
commitca806b0b247f89c62ac628a7779ae84049a8c2d7
treeb3bee15a768998c4b48211feef4d26b5b2d4a9f4
parenta4705d55c62276cb913c64832f383e27aa72668b
liblttng-ctl: use export list to define exported symbols

Symbols are currently exported by default by liblttng-ctl.so (usable by
other shared libraries / programs using liblttng-ctl.so), so we must use
LTTNG_HIDDEN on all symbols that are meant to be internal to
liblttng-ctl.so.  Of course, this is easy to forget, so over the years
many symbols that were not meant to be exported were exported, and must
now stay exported to avoid breaking the ABI.

As explained here [1], a better method is to make symbols hidden by
default, and mark those we want to be exported as such.  I have tried to
use this, but when subsequently converting the code to C++, I have
noticed that some symbols related to the STL were exported anyway, which
is bad.

The other alternative, implemented in this patch, is to use an explicit
symbol export list [2], using libtool's -export-symbols (which uses the
linker's -version-script option).  Only the symbols listed here are
exported.

So, in practice, this patch:

 - Adds an liblttng-ctl.sym file with the list of exported symbols and
   adjusts the Makefile to use the -export-symbol option
 - Removes LTTNG_HIDDEN and all its uses

abidiff shows no changes for liblttng-ctl.so between before and after
this patch.

[1] https://gcc.gnu.org/wiki/Visibility
[2] https://www.gnu.org/software/libtool/manual/libtool.html#Link-mode

Change-Id: I5d8c558303894b0ad8113c6e52f79a053bb580e1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
173 files changed:
include/lttng/action/action-internal.h
include/lttng/action/list-internal.h
include/lttng/action/notify-internal.h
include/lttng/action/path-internal.h
include/lttng/action/rate-policy-internal.h
include/lttng/action/rotate-session-internal.h
include/lttng/action/snapshot-session-internal.h
include/lttng/action/start-session-internal.h
include/lttng/action/stop-session-internal.h
include/lttng/condition/buffer-usage-internal.h
include/lttng/condition/condition-internal.h
include/lttng/condition/evaluation-internal.h
include/lttng/condition/event-rule-matches-internal.h
include/lttng/condition/session-consumed-size-internal.h
include/lttng/condition/session-rotation-internal.h
include/lttng/domain-internal.h
include/lttng/error-query-internal.h
include/lttng/event-expr-internal.h
include/lttng/event-field-value-internal.h
include/lttng/event-internal.h
include/lttng/event-rule/event-rule-internal.h
include/lttng/event-rule/jul-logging-internal.h
include/lttng/event-rule/kernel-kprobe-internal.h
include/lttng/event-rule/kernel-syscall-internal.h
include/lttng/event-rule/kernel-tracepoint-internal.h
include/lttng/event-rule/kernel-uprobe-internal.h
include/lttng/event-rule/log4j-logging-internal.h
include/lttng/event-rule/python-logging-internal.h
include/lttng/event-rule/user-tracepoint-internal.h
include/lttng/kernel-probe-internal.h
include/lttng/location-internal.h
include/lttng/log-level-rule-internal.h
include/lttng/notification/notification-internal.h
include/lttng/session-descriptor-internal.h
include/lttng/trigger/trigger-internal.h
include/lttng/userspace-probe-internal.h
src/bin/lttng-relayd/tcp_keep_alive.c
src/bin/lttng-relayd/tcp_keep_alive.h
src/bin/lttng-sessiond/condition-internal.c
src/bin/lttng-sessiond/kernel.c
src/bin/lttng-sessiond/notification-thread-commands.c
src/bin/lttng-sessiond/notification-thread-events.c
src/bin/lttng-sessiond/notification-thread-internal.h
src/bin/lttng-sessiond/sessiond-config.c
src/bin/lttng-sessiond/sessiond-config.h
src/bin/lttng-sessiond/trigger-error-query.c
src/bin/lttng/loglevel.c
src/bin/lttng/loglevel.h
src/bin/lttng/uprobe.c
src/bin/lttng/uprobe.h
src/common/actions/action.c
src/common/actions/list.c
src/common/actions/path.c
src/common/actions/rate-policy.c
src/common/buffer-view.c
src/common/buffer-view.h
src/common/bytecode/bytecode.c
src/common/bytecode/bytecode.h
src/common/compat/compat-fcntl.c
src/common/compat/directory-handle.c
src/common/compat/directory-handle.h
src/common/compat/poll.c
src/common/conditions/buffer-usage.c
src/common/conditions/condition.c
src/common/conditions/event-rule-matches.c
src/common/conditions/session-consumed-size.c
src/common/conditions/session-rotation.c
src/common/config/ini.c
src/common/config/session-config.c
src/common/config/session-config.h
src/common/context.c
src/common/context.h
src/common/credentials.c
src/common/credentials.h
src/common/daemonize.c
src/common/daemonize.h
src/common/defaults.c
src/common/defaults.h
src/common/domain.c
src/common/dynamic-array.c
src/common/dynamic-array.h
src/common/dynamic-buffer.c
src/common/dynamic-buffer.h
src/common/error-query.c
src/common/error.c
src/common/error.h
src/common/evaluation.c
src/common/event-expr/event-expr.c
src/common/event-field-value.c
src/common/event-rule/event-rule.c
src/common/event-rule/jul-logging.c
src/common/event-rule/kernel-kprobe.c
src/common/event-rule/kernel-syscall.c
src/common/event-rule/kernel-tracepoint.c
src/common/event-rule/kernel-uprobe.c
src/common/event-rule/log4j-logging.c
src/common/event-rule/python-logging.c
src/common/event-rule/user-tracepoint.c
src/common/event.c
src/common/fd-handle.c
src/common/fd-handle.h
src/common/fd-tracker/fd-tracker.c
src/common/fd-tracker/fd-tracker.h
src/common/fd-tracker/inode.c
src/common/fd-tracker/inode.h
src/common/fd-tracker/utils.c
src/common/fd-tracker/utils.h
src/common/filter.c
src/common/filter.h
src/common/filter/filter-parser.y
src/common/filter/filter-visitor-generate-bytecode.c
src/common/filter/filter-visitor-generate-ir.c
src/common/filter/filter-visitor-ir-check-binary-op-nesting.c
src/common/filter/filter-visitor-ir-normalize-glob-patterns.c
src/common/filter/filter-visitor-ir-validate-globbing.c
src/common/filter/filter-visitor-ir-validate-string.c
src/common/filter/filter-visitor-xml.c
src/common/fs-handle.c
src/common/fs-handle.h
src/common/futex.c
src/common/hashtable/hashtable.c
src/common/hashtable/hashtable.h
src/common/hashtable/utils.c
src/common/kernel-probe.c
src/common/location.c
src/common/log-level-rule.c
src/common/macros.h
src/common/mi-lttng.c
src/common/mi-lttng.h
src/common/notification.c
src/common/payload-view.c
src/common/payload-view.h
src/common/payload.c
src/common/payload.h
src/common/pipe.c
src/common/pipe.h
src/common/readwrite.c
src/common/readwrite.h
src/common/runas.c
src/common/runas.h
src/common/session-descriptor.c
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
src/common/sessiond-comm/sessiond-comm.c
src/common/sessiond-comm/sessiond-comm.h
src/common/shm.c
src/common/shm.h
src/common/snapshot.c
src/common/snapshot.h
src/common/string-utils/string-utils.c
src/common/string-utils/string-utils.h
src/common/thread.h
src/common/time.c
src/common/time.h
src/common/trace-chunk-registry.h
src/common/trace-chunk.c
src/common/trace-chunk.h
src/common/tracker.c
src/common/tracker.h
src/common/trigger.c
src/common/unix.c
src/common/unix.h
src/common/uri.c
src/common/userspace-probe.c
src/common/utils.c
src/common/utils.h
src/common/uuid.h
src/common/waiter.c
src/common/waiter.h
src/lib/lttng-ctl/Makefile.am
src/lib/lttng-ctl/liblttng-ctl.sym [new file with mode: 0644]
src/lib/lttng-ctl/lttng-ctl-helper.h
src/lib/lttng-ctl/lttng-ctl.c
This page took 0.040919 seconds and 4 git commands to generate.