babeltrace2: don't install static modules

There's no point building or installing static plugins, so apply a patch
to only build shared plugins.

Poky passes --disable-static via no-static-libs.inc, but anyone building
babeltrace2 with nodistro or another distro that doesn't use
no-static-libs.inc will fail to build babeltrace2 because of packaging
errors around the static version of the python plugin.

(From OE-Core rev: cf5ef8a2b6f509c348b9cf800a8534a4e8702103)

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2025-08-21 12:58:29 +01:00
committed by Richard Purdie
parent dae1dcaa8f
commit 672c55172d
2 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,70 @@
From 3f43a0554c73287973047b44ae5e196b7c995c60 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Thu, 21 Aug 2025 12:42:20 +0100
Subject: [PATCH] src: explicitly only build shared plugins
For some reason, libtool builds static libraries for libs which have
been marked as modules. These are pointless: you can't dlopen() a static
library.
Avoid wasting compile time and disk space by passing -shared to libtool
so that the static libraries are not built.
Upstream-Status: Submitted [https://github.com/efficios/babeltrace/pull/121]
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
src/Makefile.am | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 0567131b..7aa46b20 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -619,7 +619,7 @@ nodist_EXTRA_python_plugin_provider_babeltrace2_python_plugin_provider_la_SOURCE
python_plugin_provider_babeltrace2_python_plugin_provider_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LT_NO_UNDEFINED) \
- -avoid-version -module \
+ -avoid-version -module -shared \
$(PYTHON_LDFLAGS)
python_plugin_provider_babeltrace2_python_plugin_provider_la_CPPFLAGS = \
@@ -669,7 +669,7 @@ plugins_utils_babeltrace_plugin_utils_la_SOURCES = \
plugins_utils_babeltrace_plugin_utils_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LT_NO_UNDEFINED) \
- -avoid-version -module $(LD_NOTEXT)
+ -avoid-version -module -shared $(LD_NOTEXT)
plugins_utils_babeltrace_plugin_utils_la_LIBADD = \
plugins/common/muxing/libmuxing.la
@@ -775,7 +775,7 @@ plugins_ctf_babeltrace_plugin_ctf_la_SOURCES = \
plugins_ctf_babeltrace_plugin_ctf_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LT_NO_UNDEFINED) \
- -avoid-version -module $(LD_NOTEXT)
+ -avoid-version -module -shared $(LD_NOTEXT)
plugins_ctf_babeltrace_plugin_ctf_la_LIBADD = \
plugins/ctf/common/metadata/libctf-parser.la \
@@ -816,7 +816,7 @@ plugins_text_babeltrace_plugin_text_la_SOURCES = \
plugins_text_babeltrace_plugin_text_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LT_NO_UNDEFINED) \
- -avoid-version -module $(LD_NOTEXT)
+ -avoid-version -module -shared $(LD_NOTEXT)
plugins_text_babeltrace_plugin_text_la_LIBADD =
@@ -840,7 +840,7 @@ plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_SOURCES = \
plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_LDFLAGS = \
$(AM_LDFLAGS) \
$(LT_NO_UNDEFINED) \
- -avoid-version -module $(LD_NOTEXT) \
+ -avoid-version -module -shared $(LD_NOTEXT) \
$(ELFUTILS_LIBS)
plugins_lttng_utils_babeltrace_plugin_lttng_utils_la_LIBADD = \
--
2.43.0

View File

@@ -14,6 +14,7 @@ SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.1;protocol=http
file://0001-tests-set-the-correct-plugin-directory.patch \
file://0001-Make-bt_field_blob_get_length-return-size_t-instead-.patch \
file://external-python-tests.patch \
file://0001-src-explicitly-only-build-shared-plugins.patch \
"
SRCREV = "7f2f8cd6dac497cbb466efb31219b531c62013f5"
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
@@ -27,7 +28,6 @@ export DISTSETUPOPTS = " --install-lib=${PYTHON_SITEPACKAGES_DIR}"
PACKAGECONFIG ??= "manpages"
PACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native"
FILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a"
FILES:${PN} += "${libdir}/babeltrace2/plugins/*.so ${PYTHON_SITEPACKAGES_DIR}/*"
ASNEEDED = ""