Skip to contentSkip to conversation

libtracefs: Library building fixes

PATCH New Steven Rostedt 1 participant 3 messages Dec 3, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

cover libtracefs: Library building fixes

Steven Rostedt (VMware) (2):
libtracefs: Remove useless LIBS = -ldl in Makefile
libtracefs: Add $(LIBS) to building of shared object library

----

 Makefile         | 2 --
 scripts/utils.mk | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
#1 lore raw

PATCH 1/2 libtracefs: Remove useless LIBS = -ldl in Makefile

From: "Steven Rostedt (VMware)" <[email protected]>

The Makefile includes a LIBS = -ldl, which was copied over from trace-cmd and is not needed for libtracefs as there's no dynamic linking going on.

---
 Makefile | 2 --
 1 file changed, 2 deletions(-)
Makefile +0 -2
index c5b13ca869b7..ff95748c0684 100644
@@ -124,8 +124,6 @@ bdir		:= $(obj)/lib/tracefs
 
 export prefix bindir src obj
 
-LIBS = -ldl
-
 LIBTRACEFS_DIR = $(obj)/lib/tracefs
 LIBTRACEFS_STATIC = $(LIBTRACEFS_DIR)/libtracefs.a
 LIBTRACEFS_SHARED = $(LIBTRACEFS_DIR)/libtracefs.so.$(TRACEFS_VERSION)
Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/2 libtracefs: Add $(LIBS) to building of shared object library

In reply to Steven Rostedt

From: "Steven Rostedt (VMware)" <[email protected]>

libtracefs.so relies on libtraceevent.so, but it an application were to include libtracefs.so, it should not be required to include libtraceevent.so if that application is not using it. Add the libtraceevent library to the build of libtracefs.so so that what libtracefs.so uses is included in that code.

---
 scripts/utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/utils.mk +1 -1
index d1d5135063fc..1ee283fe4393 100644
@@ -61,7 +61,7 @@ do_build_static_lib =				\
 
 do_compile_shared_library =			\
 	($(print_shared_lib_compile)		\
-	$(CC) --shared $^ -Wl,-soname,$(@F) -o $@)
+	$(CC) --shared $^ -Wl,-soname,$(@F) -o $@ $(LIBS))
 
 do_compile_plugin_obj =				\
 	($(print_plugin_obj_compile)		\
Signature · 1 line
2.28.0