diff mbox series

libtraceevent: Add dependency on libdl

Message ID 20191226224931.3458-1-sudipm.mukherjee@gmail.com (mailing list archive)
State Handled Elsewhere
Headers show
Series libtraceevent: Add dependency on libdl | expand

Commit Message

Sudip Mukherjee Dec. 26, 2019, 10:49 p.m. UTC
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.

Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 tools/lib/traceevent/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnaldo Carvalho de Melo Jan. 6, 2020, 10:19 p.m. UTC | #1
Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:
> 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
 
> Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> ---
>  tools/lib/traceevent/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> index c874c017c636..0d0575981cc7 100644
> --- a/tools/lib/traceevent/Makefile
> +++ b/tools/lib/traceevent/Makefile
> @@ -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)
>  
> -- 
> 2.11.0
Steven Rostedt Jan. 6, 2020, 10:40 p.m. UTC | #2
On Mon, 6 Jan 2020 19:19:55 -0300
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> wrote:

> Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:
> > 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
Steven Rostedt Jan. 7, 2020, 8:14 p.m. UTC | #3
On Mon, 6 Jan 2020 19:19:55 -0300
Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com> wrote:

> Em Thu, Dec 26, 2019 at 10:49:31PM +0000, Sudip Mukherjee escreveu:
> > 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.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Thanks!

-- Steve

> 
> - Arnaldo
>  
> > Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> > ---
> >  tools/lib/traceevent/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
> > index c874c017c636..0d0575981cc7 100644
> > --- a/tools/lib/traceevent/Makefile
> > +++ b/tools/lib/traceevent/Makefile
> > @@ -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)
> >  
> > -- 
> > 2.11.0  
>
diff mbox series

Patch

diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index c874c017c636..0d0575981cc7 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -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)