Skip to contentSkip to conversation

Statically linking LTTng to an application built with MUSL toolchain

lttng-dev Mousa, Anas via lttng-dev 1 participant 2 messages Jan 11, 2023 – Jan 19, 2023

lore
Share & tools
lore
#0 lore raw

Hello,

I've built the urcu, lttng-ust and lttng-tools with the musl toolchain, and upon statically linking the application with the lttng-ust

archive (just as documented here: https://lttng.org/docs/v2.13/#doc-building-tracepoint-providers-and-user-application),

the trace-point constructors attempting to dlopen() of liblttng-ust-tracepoint.so.1 fail as the debug logs show:

lttng-ust-tracepoint [1581544]: dlopen() failed to find 'liblttng-ust-tracepoint.so.1', tracepoints in this binary won't be registered. (at addr=0x400490 in lttng_ust_tracepoints_print_disabled_message() at /usr/aarch64-unknown-linux-musl/sys-root//include/lttng/tracepoint.h:426)

although that shared object does exist in the system, and dlerror() returned Dynamic loading not supported

(Note: When linking dynamically, the dlopen() succeeds but other platform-dependent issues arise).

I need to link statically rather than dynamically, do statically linked programs using musl libc support dlopen()?

if there's no such support, is there any way around?

Would appreciate any input,

Best Regards,

Anas.

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

#1 lore raw

Bumping.

Appreciate your comments on this

Yehuda

Hello,

I've built the urcu, lttng-ust and lttng-tools with the musl toolchain, and upon statically linking the application with the lttng-ust

archive (just as documented here: https://lttng.org/docs/v2.13/#doc-building-tracepoint-providers-and-user-application),

the trace-point constructors attempting to dlopen() of liblttng-ust-tracepoint.so.1 fail as the debug logs show:

lttng-ust-tracepoint [1581544]: dlopen() failed to find 'liblttng-ust-tracepoint.so.1', tracepoints in this binary won't be registered. (at addr=0x400490 in lttng_ust_tracepoints_print_disabled_message() at /usr/aarch64-unknown-linux-musl/sys-root//include/lttng/tracepoint.h:426)

although that shared object does exist in the system, and dlerror() returned Dynamic loading not supported

(Note: When linking dynamically, the dlopen() succeeds but other platform-dependent issues arise).

I need to link statically rather than dynamically, do statically linked programs using musl libc support dlopen()?

if there's no such support, is there any way around?

Would appreciate any input,

Best Regards,

Anas.

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev