Skip to contentSkip to conversation

lttng-libust: disable on musl

PATCH New Thomas Petazzoni 2 participants 2 messages Feb 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lttng-libust: disable on musl

Since version v2.9.0, lttng-libust has a tracepoint for the C library dlmopen() function, and uses some types such as Lmid_t, related to dlmopen(). However, musl doesn't provide dlmopen(), which causes a build failure.

The Alpine Linux distribution has a patch [1] to remove this code completely, but while this is a reasonable solution for a musl-only distribution, it is not for a build system that also supports glibc and uClibc. Therefore, we instead disable lttng-libust for the musl C library.

The problem has been reported upstream (no mailing list archive link available at the time of this commit).

Fixes:

http://autobuild.buildroot.net/results/113fa95a054df183014b43ec36b329f9c59bd356/

[1] http://git.alpinelinux.org/cgit/aports/tree/testing/lttng-ust/musl-has-no-dlmopen.patch

---
 package/lttng-libust/Config.in | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
package/lttng-libust/Config.in +5 -2
index 4aba188..8600888 100644
@@ -8,6 +8,8 @@ config BR2_PACKAGE_LTTNG_LIBUST
 	depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on !BR2_STATIC_LIBS
+	# musl doesn't provide dlmopen() functionality
+	depends on !BR2_TOOLCHAIN_USES_MUSL
 	help
 	  Userspace tracing library for the LTTng 2.x tracing
 	  infrastructure. It allows userspace programs to create
@@ -16,6 +18,7 @@ config BR2_PACKAGE_LTTNG_LIBUST
 
 	  http://lttng.org
 
-comment "lttng-libust needs a toolchain w/ dynamic library, wchar, threads"
+comment "lttng-libust needs a glibc or uClibc toolchain w/ dynamic library, wchar, threads"
 	depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
-	depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
+		BR2_TOOLCHAIN_USES_MUSL
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 lttng-libust: disable on musl

Quoted 13 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Since version v2.9.0, lttng-libust has a tracepoint for the C library dlmopen() function, and uses some types such as Lmid_t, related to dlmopen(). However, musl doesn't provide dlmopen(), which causes a build failure.

The Alpine Linux distribution has a patch [1] to remove this code completely, but while this is a reasonable solution for a musl-only distribution, it is not for a build system that also supports glibc and uClibc. Therefore, we instead disable lttng-libust for the musl C library.

Quoted 6 lines

The problem has been reported upstream (no mailing list archive link available at the time of this commit).

Fixes:

http://autobuild.buildroot.net/results/113fa95a054df183014b43ec36b329f9c59bd356/

I was confused why it worked on uclibc-ng which also doesn't provide dlmopen / the Lmid_t type (well it does, but it is inside and #if 0) - And it turns out that the dlmopen tracepoint doesn't get built when building against uclibc-ng as dlfcn.h doesn't provide RTLD_DI_LINKMAP.

So an alternative is to convince the configure script that musl doesn't have RTLD_DI_LINKMAP.

Signature · 1 line
Bye, Peter Korsgaard