Skip to contentSkip to conversation

libtraceevent: Add dependency on libdl

PATCH In review Sudip Mukherjee 3 participants 4 messages Dec 26, 2019 – Jan 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceevent: Add dependency on libdl

event-plugin.c is calling dl_*() functions but it is not linked with libdl. As a result when we use ldd on the generated libtraceevent.so file, it does not list libdl as one of its dependencies. Add -ldl explicitly as done in tools/lib/lockdep.

---
 tools/lib/traceevent/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/Makefile +1 -1
index c874c017c636..0d0575981cc7 100644
@@ -143,7 +143,7 @@ $(TE_IN): force
 	$(Q)$(MAKE) $(build)=libtraceevent
 
 $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
-	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
+	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -ldl -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
 
Signature · 1 line
2.11.0
#1 lore raw

Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:

Quoted 4 lines

event-plugin.c is calling dl_*() functions but it is not linked with libdl. As a result when we use ldd on the generated libtraceevent.so file, it does not list libdl as one of its dependencies. Add -ldl explicitly as done in tools/lib/lockdep.

Rostedt, can you ack this one? It applies just fine.

- Arnaldo

Quoted 20 lines
---
 tools/lib/traceevent/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/Makefile +1 -1
index c874c017c636..0d0575981cc7 100644
@@ -143,7 +143,7 @@ $(TE_IN): force
 	$(Q)$(MAKE) $(build)=libtraceevent
 
 $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
-	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
+	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -ldl -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
 
Signature · 1 line
2.11.0
Signature · 1 line
- Arnaldo
#2 lore raw
Quoted 7 lines · On Mon, 6 Jan 2020 19:19:55 -0300 Arnaldo Carvalho de Melo…

Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:

Quoted 4 lines

event-plugin.c is calling dl_*() functions but it is not linked with libdl. As a result when we use ldd on the generated libtraceevent.so file, it does not list libdl as one of its dependencies. Add -ldl explicitly as done in tools/lib/lockdep.

Rostedt, can you ack this one? It applies just fine.

I see nothing wrong, but wanted to play with it before acking it. I'll do that in a bit. Thanks for the reminder!

-- Steve

Reviewed-by
#3 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 7 lines · On Mon, 6 Jan 2020 19:19:55 -0300 Arnaldo Carvalho de Melo…

Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:

Quoted 4 lines

event-plugin.c is calling dl_*() functions but it is not linked with libdl. As a result when we use ldd on the generated libtraceevent.so file, it does not list libdl as one of its dependencies. Add -ldl explicitly as done in tools/lib/lockdep.

Rostedt, can you ack this one? It applies just fine.

Thanks!

-- Steve

Quoted 24 lines

- Arnaldo

Quoted 20 lines
---
 tools/lib/traceevent/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/Makefile +1 -1
index c874c017c636..0d0575981cc7 100644
@@ -143,7 +143,7 @@ $(TE_IN): force
 	$(Q)$(MAKE) $(build)=libtraceevent
 
 $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
-	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
+	$(QUIET_LINK)$(CC) --shared $(LDFLAGS) $^ -ldl -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so
 	@ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
 
Signature · 1 line
2.11.0