From 3f38c6a3da61d0d66bb57475645103b8b4c6be4e Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 1 Dec 2020 11:02:41 -0500 Subject: [PATCH] fix: undefined symbols for tracepoints in lgpl source Move the new internal 'urcu-ust' urcu flavor symbols to a separate library named 'liblttng-ust-common.so' and link 'liblttng-ust.so' and 'liblttng-ust-tracepoint.so' on it. Add this common library to the pkgconfig file which should handle the transition for client code using it in its build system. LGPL_SOURCE client code which doesn't use pkgconfig in its build system will need to link with '-llttng-ust-common' instead of '-lurcu-bp' like prior ust versions. Change-Id: I807f997a2a94cb4f8d1bdf72002c1ae1b9fedf8d Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- liblttng-ust/Makefile.am | 14 ++++++++++---- lttng-ust.pc.in | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/liblttng-ust/Makefile.am b/liblttng-ust/Makefile.am index 2b25cfc5..ca81ba6d 100644 --- a/liblttng-ust/Makefile.am +++ b/liblttng-ust/Makefile.am @@ -2,7 +2,13 @@ AM_CFLAGS += -I$(srcdir) -fno-strict-aliasing noinst_LTLIBRARIES = liblttng-ust-runtime.la liblttng-ust-support.la -lib_LTLIBRARIES = liblttng-ust-tracepoint.la liblttng-ust.la +lib_LTLIBRARIES = liblttng-ust-common.la liblttng-ust-tracepoint.la liblttng-ust.la + +liblttng_ust_common_la_SOURCES = \ + lttng-ust-urcu.c \ + lttng-ust-urcu-pointer.c + +liblttng_ust_common_la_LDFLAGS = -no-undefined -version-info $(LTTNG_UST_LIBRARY_VERSION) liblttng_ust_tracepoint_la_SOURCES = \ tracepoint.c \ @@ -10,11 +16,10 @@ liblttng_ust_tracepoint_la_SOURCES = \ tracepoint-internal.h \ lttng-tracer-core.h \ jhash.h \ - error.h \ - lttng-ust-urcu.c \ - lttng-ust-urcu-pointer.c + error.h liblttng_ust_tracepoint_la_LIBADD = \ + liblttng-ust-common.la \ $(top_builddir)/snprintf/libustsnprintf.la \ $(DL_LIBS) @@ -125,6 +130,7 @@ liblttng_ust_support_la_LIBADD = \ liblttng_ust_la_LIBADD = \ -lrt \ + liblttng-ust-common.la \ $(top_builddir)/snprintf/libustsnprintf.la \ $(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \ liblttng-ust-tracepoint.la \ diff --git a/lttng-ust.pc.in b/lttng-ust.pc.in index 45d1a8d4..6aee46ef 100644 --- a/lttng-ust.pc.in +++ b/lttng-ust.pc.in @@ -7,6 +7,6 @@ Name: LTTng Userspace Tracer Description: The LTTng Userspace Tracer (UST) is a library accompanied by a set of tools to trace userspace code. Version: @PACKAGE_VERSION@ Requires: -Libs: -L${libdir} -llttng-ust -ldl +Libs: -L${libdir} -llttng-ust -llttng-ust-common -ldl Cflags: -I${includedir} -- 2.34.1