]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
lltng-tools: Fix build with lld linker
authorKhem Raj <raj.khem@gmail.com>
Thu, 21 Aug 2025 06:45:19 +0000 (23:45 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Aug 2025 16:46:38 +0000 (17:46 +0100)
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>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/recipes-kernel/lttng/lttng-tools/0001-liblttng-ctl-drop-index-allocator-symbols-from-versi.patch [new file with mode: 0644]
meta/recipes-kernel/lttng/lttng-tools_2.14.0.bb

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 (file)
index 0000000..3a53547
--- /dev/null
@@ -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
index b3383accd9a2dd3214a742bc96483fa6554b9b6f..ed420384bf8553aa04f9600825826e621f4ab90a 100644 (file)
@@ -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"