dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Luca Boccassi <bluca@debian.org>
Cc: dwarves@vger.kernel.org,
	Dominique Martinet <asmadeus@codewreck.org>,
	Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	Deepak Kumar Mishra <deepakkumar.mishra@arm.com>,
	Qais Yousef <qais.yousef@arm.com>, Jiri Olsa <jolsa@kernel.org>,
	siudin@fb.com, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] CMakeLists.txt: enable SHARED and STATIC lib creation
Date: Fri, 11 Jun 2021 16:43:20 -0700	[thread overview]
Message-ID: <CAEf4BzYH9G77gRK18czfQaWkNSUwZReuBKLns3henJpzt9WEzA@mail.gmail.com> (raw)
In-Reply-To: <4ec3aa68d7f608dd6f389e3ef192b5f86c71e93b.camel@debian.org>

On Fri, Jun 11, 2021 at 4:07 PM Luca Boccassi <bluca@debian.org> 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@debian.org>
>     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@debian.org>
>         Cc: dwarves@vger.kernel.org
>         Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
>     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

  reply	other threads:[~2021-06-11 23:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 19:20 [PATCH v2 0/2] dwarves: enable-SHARED-and-STATIC-lib-creation Deepak Kumar Mishra
2021-06-07 19:20 ` [PATCH v2 1/2] CMakeLists.txt: enable SHARED and STATIC lib creation Deepak Kumar Mishra
2021-06-10 17:31   ` Arnaldo Carvalho de Melo
2021-06-11 19:34     ` Andrii Nakryiko
2021-06-11 19:54       ` Andrii Nakryiko
2021-06-11 20:00       ` Arnaldo Carvalho de Melo
2021-06-11 20:08         ` Andrii Nakryiko
2021-06-11 22:17           ` Luca Boccassi
2021-06-11 22:20             ` Luca Boccassi
2021-06-11 22:45               ` Luca Boccassi
2021-06-11 22:53                 ` Dominique Martinet
2021-06-11 23:06                   ` Dominique Martinet
2021-06-11 23:07                   ` Luca Boccassi
2021-06-11 23:43                     ` Andrii Nakryiko [this message]
2021-06-07 19:20 ` [PATCH v2 2/2] README: add documentation for -DBUILD_SHARED_LIBS Deepak Kumar Mishra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEf4BzYH9G77gRK18czfQaWkNSUwZReuBKLns3henJpzt9WEzA@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=arnaldo.melo@gmail.com \
    --cc=asmadeus@codewreck.org \
    --cc=bluca@debian.org \
    --cc=bpf@vger.kernel.org \
    --cc=deepakkumar.mishra@arm.com \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=qais.yousef@arm.com \
    --cc=siudin@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).