Re: [PATCH] perf data: Fix babeltrace detection

From: Andi Kleen
Date: Fri Oct 11 2019 - 11:27:49 EST


On Fri, Oct 11, 2019 at 04:05:48PM +0200, Jiri Olsa wrote:
> On Tue, Oct 08, 2019 at 07:21:44AM -0700, Andi Kleen wrote:
> > On Tue, Oct 08, 2019 at 01:52:40PM +0200, Jiri Olsa wrote:
> > > On Mon, Oct 07, 2019 at 10:41:20AM -0700, Andi Kleen wrote:
> > > > From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> > > >
> > > > The symbol the feature file checks for is now actually in -lbabeltrace,
> > > > not -lbabeltrace-ctf, at least as of libbabeltrace-1.5.6-2.fc30.x86_64
> > > >
> > > > Always add both libraries to fix the feature detection.
> > >
> > > well, we link with libbabeltrace-ctf.so which links with libbabeltrace.so
> > >
> > > I guess we can link it as well, but where do you see it fail?
> >
> > On FC30 the .so file is just a symlink, so it doesn't pull
> > in the other library.
> >
> > $ gcc test-libbabeltrace.c -lbabeltrace-ctf
> > /usr/bin/ld:
> > /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libbabeltrace-ctf.so:
> > undefined reference to `bt_packet_seek_get_error'
> > /usr/bin/ld:
> > /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/libbabeltrace-ctf.so:
> > undefined reference to `bt_packet_seek_set_error'
> > collect2: error: ld returned 1 exit status
>
> I'm confused,
> the test-libbabeltrace.c checks for bt_ctf_stream_class_get_packet_context_type
> which is in libbabeltrace-ctf:

AFAIK libbabeltrace-ctf uses these symbols from the object containing
bt_ctf_stream_class_get_packet_context_type

I assume you have FC30 so you should be able to reproduce it

-Andi