diff mbox series

[2/9] lltng-tools: Fix build with lld linker

Message ID 20250821064528.754633-2-raj.khem@gmail.com
State New
Headers show
Series [v2,1/9] m4: Fix ptest on musl | expand

Commit Message

Khem Raj Aug. 21, 2025, 6:45 a.m. UTC
liblttng-ctl is exposting undefined symbols which are provided by
libcommon-gpl.a and is not linked into liblttng-ctl.so

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...p-index-allocator-symbols-from-versi.patch | 43 +++++++++++++++++++
 .../lttng/lttng-tools_2.14.0.bb               |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch
diff mbox series

Patch

diff --git a/meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch b/meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch
new file mode 100644
index 00000000000..3a535470dae
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch
@@ -0,0 +1,43 @@ 
+From adafa15a0ea145e1e98f68e2a56512e83f1f6798 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 19 Aug 2025 20:06:21 -0700
+Subject: [PATCH] liblttng-ctl: drop index allocator symbols from version
+ script
+
+The lttng_index_allocator_* functions are implemented in libcommon-gpl,
+not in liblttng-ctl. Since liblttng-ctl does not link against
+libcommon-gpl and does not export these symbols, referencing them in
+liblttng-ctl.sym causes link failures with LLD:
+
+  ld.lld: error: version script assignment of 'global' to symbol
+  'lttng_index_allocator_alloc' failed: symbol not defined
+  ...
+
+Remove these entries from the version script to align the exported ABI
+with the actual symbols provided by liblttng-ctl.
+
+This fixes builds with clang + lld.
+
+Upstream-Status: Submitted [https://review.lttng.org/c/lttng-tools/+/15156]
+Change-Id: I27f40f3d38af7014cf5356230e06aa291c9a3c5f
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/lib/lttng-ctl/liblttng-ctl.sym | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/lib/lttng-ctl/liblttng-ctl.sym b/src/lib/lttng-ctl/liblttng-ctl.sym
+index 27900ca44..641084750 100644
+--- a/src/lib/lttng-ctl/liblttng-ctl.sym
++++ b/src/lib/lttng-ctl/liblttng-ctl.sym
+@@ -336,11 +336,6 @@ lttng_health_state
+ lttng_health_thread_name
+ lttng_health_thread_state
+ lttng_ht_seed
+-lttng_index_allocator_alloc
+-lttng_index_allocator_create
+-lttng_index_allocator_destroy
+-lttng_index_allocator_get_index_count
+-lttng_index_allocator_release
+ lttng_kernel_probe_location_address_create
+ lttng_kernel_probe_location_address_get_address
+ lttng_kernel_probe_location_destroy
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
index a3faf1e758c..5bb6033b12c 100644
--- a/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb
@@ -52,6 +52,7 @@  SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
            file://0001-gen-ust-events-constructor-change-rpath-to-libdir-li.patch \
            file://0001-eventfd.cpp-Remove-the-scope-resolution-operator.patch \
            file://disable-tests2.patch \
+           file://0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch \
            "
 
 SRC_URI[sha256sum] = "d8c39c26cec13b7bd82551cd52a22efc358b888e36ebcf9c1b60ef1c3a3c2fd3"