Re: [PATCH v2 1/2] CMakeLists.txt: enable SHARED and STATIC lib creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 11, 2021 at 4:07 PM Luca Boccassi <bluca@xxxxxxxxxx> wrote:
>
> On Sat, 2021-06-12 at 07:53 +0900, Dominique Martinet wrote:
> > Luca Boccassi wrote on Fri, Jun 11, 2021 at 11:45:25PM +0100:
> > > Actually that was my mistake, used the wrong build tree (sorry,
> > > it's
> > > late!). I can however reproduce the issue in a chroot running the
> > > libbpf CI script. Still looking.
> >
> > with the ci script I get
> >
> > $ /usr/lib64/ccache/cc -DDWARVES_MAJOR_VERSION=1 -
> > DDWARVES_MINOR_VERSION=21 -D_GNU_SOURCE -Ddwarves_EXPORTS -
> > I/path/to/pahole/build -I/path/to/pahole -
> > I/path/to/pahole/lib/include -I/path/to/pahole/lib/bpf/include/uapi -
> > D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DNDEBUG -fPIC -MD
> > -MT CMakeFiles/dwarves.dir/btf_encoder.c.o -MF
> > CMakeFiles/dwarves.dir/btf_encoder.c.o.d -o
> > CMakeFiles/dwarves.dir/btf_encoder.c.o -c
> > /path/to/pahole/btf_encoder.c
> > /path/to/pahole/btf_encoder.c: In function ‘btf_encoder__add_float’:
> > /path/to/pahole/btf_encoder.c:224:22: warning: implicit declaration
> > of function ‘btf__add_float’; did you mean ‘btf__add_var’? [-
> > Wimplicit-function-declaration]
> >   224 |         int32_t id = btf__add_float(encoder->btf, name,
> > BITS_ROUNDUP_BYTES(bt->bit_size));
> >       |                      ^~~~~~~~~~~~~~
> >       |                      btf__add_var
> >
> >
> >
> > with btf__add_float defined in .../pahole/lib/bpf/src/btf.h
> > and btf_encoder.c including linux/btf.h
> >
> >
> > changing btf_loader.c to include bpf/btf.h instead fixes the issue
> > for me:
> >
> > diff --git a/btf_loader.c b/btf_loader.c
> > index 75ec674b3b3e..272c73bca7fe 100644
> > --- a/btf_loader.c
> > +++ b/btf_loader.c
> > @@ -20,7 +20,7 @@
> >  #include <string.h>
> >  #include <limits.h>
> >  #include <libgen.h>
> > -#include <linux/btf.h>
> > +#include <bpf/btf.h>
> >  #include <bpf/libbpf.h>
> >  #include <zlib.h>
>
> I've just sent a patch - the issue is that the original commit included
> a symlink lib/include/bpf -> ../bpf/src as suggested by Andrii here:
>
> https://www.spinics.net/lists/dwarves/msg00738.html
>
> git show 82749180b23d3c9c060108bc290ae26507fc324e -- lib/include
>     commit 82749180b23d3c9c060108bc290ae26507fc324e
>     Author: Luca Boccassi <bluca@xxxxxxxxxx>
>     Date:   Mon Jan 4 22:16:22 2021 +0000
>
>         libbpf: allow to use packaged version
>
>         Add a new CMake option, LIBBPF_EMBEDDED, to switch between the
>         embedded version and the system version (searched via pkg-config)
>         of libbpf. Set the embedded version as the default.
>
>         Signed-off-by: Luca Boccassi <bluca@xxxxxxxxxx>
>         Cc: dwarves@xxxxxxxxxxxxxxx
>         Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
>     diff --git a/lib/include/bpf b/lib/include/bpf
>     new file mode 120000
>     index 0000000..4c41b71
>     --- /dev/null
>     +++ b/lib/include/bpf
>     @@ -0,0 +1 @@
>     +../bpf/src
>     \ No newline at end of file
>
> When the patch was reverted and re-added, the symlink was dropped.
>
> It stayed in my local tree, and I completely missed it - that's why the
> build was working fine for me! D'oh!
> Adding the symlink back fixes the build with the libbpf CI script. I
> would be grateful if folks who are seeing the issue could apply the
> patch (or create the symlink) and confirm whether it fixes the problem
> or not. Thanks!

It does fix it for me locally (apart from another unrelated build
problem), thanks! I can't really test CI beyond what you did, so this
will need to be applied to pahole master for us to know for sure.

>
> --
> Kind regards,
> Luca Boccassi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux