dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
@ 2021-06-11 23:01 Luca Boccassi
  2021-06-11 23:42 ` Andrii Nakryiko
  0 siblings, 1 reply; 6+ messages in thread
From: Luca Boccassi @ 2021-06-11 23:01 UTC (permalink / raw)
  To: dwarves; +Cc: arnaldo.melo

The original "libbpf: allow to use packaged version" had a symlink
as suggested during review:

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

This patch was reverted, and then re-added manually.
But the re-add dropped the symlink, which causes the system bpf/btf.h
to be picked up instead of the local one. Re-add it.

Signed-off-by: Luca Boccassi <bluca@debian.org>
---
 lib/include/bpf | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 lib/include/bpf

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
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
  2021-06-11 23:01 [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink Luca Boccassi
@ 2021-06-11 23:42 ` Andrii Nakryiko
  2021-06-13 13:14   ` Arnaldo Carvalho de Melo
  2021-06-13 13:27   ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 6+ messages in thread
From: Andrii Nakryiko @ 2021-06-11 23:42 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dwarves, Arnaldo Carvalho de Melo

On Fri, Jun 11, 2021 at 4:03 PM Luca Boccassi <bluca@debian.org> wrote:
>
> The original "libbpf: allow to use packaged version" had a symlink
> as suggested during review:
>
> 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
>
> This patch was reverted, and then re-added manually.
> But the re-add dropped the symlink, which causes the system bpf/btf.h
> to be picked up instead of the local one. Re-add it.
>
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---

This fixes the issue for me in my local setup:

Acked-by: Andrii Nakryiko <andrii@kernel.org>


Arnaldo,

Locally I have still another issue, which I don't believe is related
to Luca's changes. I get this error:

$ make -j60
[ 25%] Built target bpf
[ 26%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
In file included from /usr/include/sys/stat.h:106:0,
                 from /home/andriin/local/pahole/btf_encoder.c:24:
/usr/include/bits/stat.h:106:31: error: expected identifier or ‘(’
before ‘[’ token
     __syscall_slong_t __unused[3];
                               ^
/usr/include/bits/stat.h:164:31: error: expected identifier or ‘(’
before ‘[’ token
     __syscall_slong_t __unused[3];
                               ^
make[2]: *** [CMakeFiles/dwarves.dir/btf_encoder.c.o] Error 1
make[1]: *** [CMakeFiles/dwarves.dir/all] Error 2
make: *** [all] Error 2


I think it's some new interplay with dutil.h header defining its own

#define __unused __attribute__ ((unused))

Given __unused is used in vmlinux.h and /usr/include/bits/stat.h as
field names, I think it would be better to rename __unused macro
within pahole source code to avoid such confusing problems.


>  lib/include/bpf | 1 +
>  1 file changed, 1 insertion(+)
>  create mode 120000 lib/include/bpf
>
> 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
> --
> 2.30.2
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
  2021-06-11 23:42 ` Andrii Nakryiko
@ 2021-06-13 13:14   ` Arnaldo Carvalho de Melo
  2021-06-13 13:17     ` Arnaldo Carvalho de Melo
  2021-06-13 13:21     ` Arnaldo Carvalho de Melo
  2021-06-13 13:27   ` Arnaldo Carvalho de Melo
  1 sibling, 2 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-06-13 13:14 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: Luca Boccassi, dwarves, Arnaldo Carvalho de Melo

Em Fri, Jun 11, 2021 at 04:42:24PM -0700, Andrii Nakryiko escreveu:
> On Fri, Jun 11, 2021 at 4:03 PM Luca Boccassi <bluca@debian.org> wrote:
> >
> > The original "libbpf: allow to use packaged version" had a symlink
> > as suggested during review:
> >
> > 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
> >
> > This patch was reverted, and then re-added manually.
> > But the re-add dropped the symlink, which causes the system bpf/btf.h
> > to be picked up instead of the local one. Re-add it.
> >
> > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > ---
> 
> This fixes the issue for me in my local setup:
> 
> Acked-by: Andrii Nakryiko <andrii@kernel.org>

That is really interesting, as it breaks the build for me on a freshly
cloned pahole tree where I added the symlink by hand before running
cmake, see below, trying to figure this out...

⬢[acme@toolbox pahole]$ git show
commit 576f43abe5b4bd94b894614d7204af5e3469e15b (HEAD -> master)
Author: Luca Boccassi <bluca@debian.org>
Date:   Sun Jun 13 10:07:39 2021 -0300

    libbpf: Fixup patch to allow to use packaged version

    The original "libbpf: allow to use packaged version" had a symlink as
    suggested during review, that got mistakenly dropped by Arnaldo when
    applying the patch by hand to fixup conflicts, add it back.

    Committer notes:

    This caused mixups with libbpf-devel files that ended up breaking the
    build as reported by Andrii.

    Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
    Tested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
    Signed-off-by: Luca Boccassi <bluca@debian.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 0000000000000000..b76dda3adf57d87d
--- /dev/null
+++ b/lib/include/bpf
@@ -0,0 +1 @@
+../src/bpf
\ No newline at end of file
⬢[acme@toolbox pahole]$

⬢[acme@toolbox pahole]$ ls -la lib/bpf
total 0
drwxr-xr-x. 1 acme acme   0 Jun 13 10:04 .
drwxr-xr-x. 1 acme acme 132 Jun 13 10:06 ..
⬢[acme@toolbox pahole]$ rm -rf build ; mkdir build ; cd build ; cmake -DCMAKE_BUILD_TYPE=Release -DLIBBPF_EMBEDDED=Off .. ; cd ..
-- The C compiler identification is GNU 11.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Checking for module 'libbpf>=0.3.0'
--   Package 'libbpf', required by 'virtual:world', not found
-- Setting BUILD_SHARED_LIBS = ON
-- Checking availability of DWARF and ELF development libraries
-- Looking for dwfl_module_build_id in elf
-- Looking for dwfl_module_build_id in elf - found
-- Found dwarf.h header: /usr/include
-- Found elfutils/libdw.h header: /usr/include
-- Found libdw library: /usr/lib64/libdw.so
-- Found libelf library: /usr/lib64/libelf.so
-- Checking availability of DWARF and ELF development libraries - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Submodule update
Submodule 'lib/bpf' (https://github.com/libbpf/libbpf) registered for path 'lib/bpf'
Cloning into '/var/home/acme/git/pahole/lib/bpf'...
Submodule path 'lib/bpf': checked out '986962fade5dfa89c2890f3854eb040d2a64ab38'
-- Submodule update - done
-- Performing Test HAVE_REALLOCARRAY_SUPPORT
-- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /var/home/acme/git/pahole/build
⬢[acme@toolbox pahole]$ ls -la lib/bpf
total 68
drwxr-xr-x. 1 acme acme   280 Jun 13 10:11 .
drwxr-xr-x. 1 acme acme   132 Jun 13 10:06 ..
-rw-r--r--. 1 acme acme    41 Jun 13 10:11 BPF-CHECKPOINT-COMMIT
-rw-r--r--. 1 acme acme    41 Jun 13 10:11 CHECKPOINT-COMMIT
-rw-r--r--. 1 acme acme    35 Jun 13 10:11 .git
drwxr-xr-x. 1 acme acme    24 Jun 13 10:11 include
-rw-r--r--. 1 acme acme   471 Jun 13 10:11 .lgtm.yml
-rw-r--r--. 1 acme acme    25 Jun 13 10:11 LICENSE
-rw-r--r--. 1 acme acme  1641 Jun 13 10:11 LICENSE.BSD-2-Clause
-rw-r--r--. 1 acme acme 27413 Jun 13 10:11 LICENSE.LGPL-2.1
-rw-r--r--. 1 acme acme  6568 Jun 13 10:11 README.md
drwxr-xr-x. 1 acme acme    50 Jun 13 10:11 scripts
drwxr-xr-x. 1 acme acme   692 Jun 13 10:11 src
drwxr-xr-x. 1 acme acme    28 Jun 13 10:11 travis-ci
-rw-r--r--. 1 acme acme  5555 Jun 13 10:11 .travis.yml
⬢[acme@toolbox pahole]$ ls -la lib/include/bpf
lrwxrwxrwx. 1 acme acme 10 Jun 13 10:07 lib/include/bpf -> ../src/bpf
⬢[acme@toolbox pahole]$ m
make: Entering directory '/var/home/acme/git/pahole/build'
make[1]: Entering directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target bpf
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[  1%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf_prog_linfo.c.o
[  3%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf.c.o
[  7%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf_dump.c.o
[  7%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf.c.o
[ 11%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf.c.o
[ 11%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/hashmap.c.o
[ 13%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_probes.c.o
[ 15%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_errno.c.o
[ 17%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/netlink.c.o
[ 19%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/nlattr.c.o
[ 23%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/ringbuf.c.o
[ 23%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/str_error.c.o
[ 25%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/xsk.c.o
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 25%] Built target bpf
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target dwarves
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 36%] Building C object CMakeFiles/dwarves.dir/ctf_encoder.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/strings.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/libctf.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/gobuffer.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/dwarves.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/dwarves_fprintf.c.o
[ 38%] Building C object CMakeFiles/dwarves.dir/ctf_loader.c.o
[ 40%] Building C object CMakeFiles/dwarves.dir/dwarf_loader.c.o
[ 42%] Building C object CMakeFiles/dwarves.dir/btf_loader.c.o
[ 44%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
[ 46%] Building C object CMakeFiles/dwarves.dir/elf_symtab.c.o
[ 48%] Building C object CMakeFiles/dwarves.dir/dutil.c.o
[ 50%] Building C object CMakeFiles/dwarves.dir/rbtree.c.o
In file included from /var/home/acme/git/pahole/strings.c:7:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:121: CMakeFiles/dwarves.dir/strings.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/btf_encoder.c:12:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:173: CMakeFiles/dwarves.dir/btf_encoder.c.o] Error 1
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/ctf_encoder.c:8:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:134: CMakeFiles/dwarves.dir/ctf_encoder.c.o] Error 1
In file included from /var/home/acme/git/pahole/libctf.c:22:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
/var/home/acme/git/pahole/btf_loader.c:24:10: fatal error: bpf/libbpf.h: No such file or directory
   24 | #include <bpf/libbpf.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:160: CMakeFiles/dwarves.dir/libctf.c.o] Error 1
make[2]: *** [CMakeFiles/dwarves.dir/build.make:186: CMakeFiles/dwarves.dir/btf_loader.c.o] Error 1
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/dwarves_fprintf.c:19:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/dwarf_loader.c:23:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:95: CMakeFiles/dwarves.dir/dwarves_fprintf.c.o] Error 1
make[2]: *** [CMakeFiles/dwarves.dir/build.make:199: CMakeFiles/dwarves.dir/dwarf_loader.c.o] Error 1
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/ctf_loader.c:25:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:147: CMakeFiles/dwarves.dir/ctf_loader.c.o] Error 1
In file included from /var/home/acme/git/pahole/dwarves.h:20,
                 from /var/home/acme/git/pahole/dwarves.c:28:
/var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
    9 | #include <bpf/btf.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/dwarves.dir/build.make:82: CMakeFiles/dwarves.dir/dwarves.c.o] Error 1
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[1]: *** [CMakeFiles/Makefile2:283: CMakeFiles/dwarves.dir/all] Error 2
make[1]: Leaving directory '/var/home/acme/git/pahole/build'
make: *** [Makefile:149: all] Error 2
make: Leaving directory '/var/home/acme/git/pahole/build'
⬢[acme@toolbox pahole]$



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
  2021-06-13 13:14   ` Arnaldo Carvalho de Melo
@ 2021-06-13 13:17     ` Arnaldo Carvalho de Melo
  2021-06-13 13:21     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-06-13 13:17 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: Luca Boccassi, dwarves, Arnaldo Carvalho de Melo

Em Sun, Jun 13, 2021 at 10:14:00AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Jun 11, 2021 at 04:42:24PM -0700, Andrii Nakryiko escreveu:
> > On Fri, Jun 11, 2021 at 4:03 PM Luca Boccassi <bluca@debian.org> wrote:
> > >
> > > The original "libbpf: allow to use packaged version" had a symlink
> > > as suggested during review:
> > >
> > > 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
> > >
> > > This patch was reverted, and then re-added manually.
> > > But the re-add dropped the symlink, which causes the system bpf/btf.h
> > > to be picked up instead of the local one. Re-add it.
> > >
> > > Signed-off-by: Luca Boccassi <bluca@debian.org>
> > > ---
> > 
> > This fixes the issue for me in my local setup:
> > 
> > Acked-by: Andrii Nakryiko <andrii@kernel.org>
> 
> That is really interesting, as it breaks the build for me on a freshly
> cloned pahole tree where I added the symlink by hand before running
> cmake, see below, trying to figure this out...
> 
> ⬢[acme@toolbox pahole]$ git show
> commit 576f43abe5b4bd94b894614d7204af5e3469e15b (HEAD -> master)
> Author: Luca Boccassi <bluca@debian.org>
> Date:   Sun Jun 13 10:07:39 2021 -0300
> 
>     libbpf: Fixup patch to allow to use packaged version
> 
>     The original "libbpf: allow to use packaged version" had a symlink as
>     suggested during review, that got mistakenly dropped by Arnaldo when
>     applying the patch by hand to fixup conflicts, add it back.
> 
>     Committer notes:
> 
>     This caused mixups with libbpf-devel files that ended up breaking the
>     build as reported by Andrii.
> 
>     Reported-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
>     Tested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
>     Signed-off-by: Luca Boccassi <bluca@debian.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 0000000000000000..b76dda3adf57d87d
> --- /dev/null
> +++ b/lib/include/bpf
> @@ -0,0 +1 @@
> +../src/bpf


Thinko, I got it swapped, fixed it and it works, nevermind :-)

- Arnaldo

> \ No newline at end of file
> ⬢[acme@toolbox pahole]$
> 
> ⬢[acme@toolbox pahole]$ ls -la lib/bpf
> total 0
> drwxr-xr-x. 1 acme acme   0 Jun 13 10:04 .
> drwxr-xr-x. 1 acme acme 132 Jun 13 10:06 ..
> ⬢[acme@toolbox pahole]$ rm -rf build ; mkdir build ; cd build ; cmake -DCMAKE_BUILD_TYPE=Release -DLIBBPF_EMBEDDED=Off .. ; cd ..
> -- The C compiler identification is GNU 11.1.1
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /usr/bin/cc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
> -- Checking for module 'libbpf>=0.3.0'
> --   Package 'libbpf', required by 'virtual:world', not found
> -- Setting BUILD_SHARED_LIBS = ON
> -- Checking availability of DWARF and ELF development libraries
> -- Looking for dwfl_module_build_id in elf
> -- Looking for dwfl_module_build_id in elf - found
> -- Found dwarf.h header: /usr/include
> -- Found elfutils/libdw.h header: /usr/include
> -- Found libdw library: /usr/lib64/libdw.so
> -- Found libelf library: /usr/lib64/libelf.so
> -- Checking availability of DWARF and ELF development libraries - done
> -- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
> -- Submodule update
> Submodule 'lib/bpf' (https://github.com/libbpf/libbpf) registered for path 'lib/bpf'
> Cloning into '/var/home/acme/git/pahole/lib/bpf'...
> Submodule path 'lib/bpf': checked out '986962fade5dfa89c2890f3854eb040d2a64ab38'
> -- Submodule update - done
> -- Performing Test HAVE_REALLOCARRAY_SUPPORT
> -- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /var/home/acme/git/pahole/build
> ⬢[acme@toolbox pahole]$ ls -la lib/bpf
> total 68
> drwxr-xr-x. 1 acme acme   280 Jun 13 10:11 .
> drwxr-xr-x. 1 acme acme   132 Jun 13 10:06 ..
> -rw-r--r--. 1 acme acme    41 Jun 13 10:11 BPF-CHECKPOINT-COMMIT
> -rw-r--r--. 1 acme acme    41 Jun 13 10:11 CHECKPOINT-COMMIT
> -rw-r--r--. 1 acme acme    35 Jun 13 10:11 .git
> drwxr-xr-x. 1 acme acme    24 Jun 13 10:11 include
> -rw-r--r--. 1 acme acme   471 Jun 13 10:11 .lgtm.yml
> -rw-r--r--. 1 acme acme    25 Jun 13 10:11 LICENSE
> -rw-r--r--. 1 acme acme  1641 Jun 13 10:11 LICENSE.BSD-2-Clause
> -rw-r--r--. 1 acme acme 27413 Jun 13 10:11 LICENSE.LGPL-2.1
> -rw-r--r--. 1 acme acme  6568 Jun 13 10:11 README.md
> drwxr-xr-x. 1 acme acme    50 Jun 13 10:11 scripts
> drwxr-xr-x. 1 acme acme   692 Jun 13 10:11 src
> drwxr-xr-x. 1 acme acme    28 Jun 13 10:11 travis-ci
> -rw-r--r--. 1 acme acme  5555 Jun 13 10:11 .travis.yml
> ⬢[acme@toolbox pahole]$ ls -la lib/include/bpf
> lrwxrwxrwx. 1 acme acme 10 Jun 13 10:07 lib/include/bpf -> ../src/bpf
> ⬢[acme@toolbox pahole]$ m
> make: Entering directory '/var/home/acme/git/pahole/build'
> make[1]: Entering directory '/var/home/acme/git/pahole/build'
> make[2]: Entering directory '/var/home/acme/git/pahole/build'
> Scanning dependencies of target bpf
> make[2]: Leaving directory '/var/home/acme/git/pahole/build'
> make[2]: Entering directory '/var/home/acme/git/pahole/build'
> [  1%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf_prog_linfo.c.o
> [  3%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf.c.o
> [  7%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf_dump.c.o
> [  7%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf.c.o
> [ 11%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf.c.o
> [ 11%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/hashmap.c.o
> [ 13%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_probes.c.o
> [ 15%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_errno.c.o
> [ 17%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/netlink.c.o
> [ 19%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/nlattr.c.o
> [ 23%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/ringbuf.c.o
> [ 23%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/str_error.c.o
> [ 25%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/xsk.c.o
> make[2]: Leaving directory '/var/home/acme/git/pahole/build'
> [ 25%] Built target bpf
> make[2]: Entering directory '/var/home/acme/git/pahole/build'
> Scanning dependencies of target dwarves
> make[2]: Leaving directory '/var/home/acme/git/pahole/build'
> make[2]: Entering directory '/var/home/acme/git/pahole/build'
> [ 36%] Building C object CMakeFiles/dwarves.dir/ctf_encoder.c.o
> [ 36%] Building C object CMakeFiles/dwarves.dir/strings.c.o
> [ 36%] Building C object CMakeFiles/dwarves.dir/libctf.c.o
> [ 36%] Building C object CMakeFiles/dwarves.dir/gobuffer.c.o
> [ 36%] Building C object CMakeFiles/dwarves.dir/dwarves.c.o
> [ 36%] Building C object CMakeFiles/dwarves.dir/dwarves_fprintf.c.o
> [ 38%] Building C object CMakeFiles/dwarves.dir/ctf_loader.c.o
> [ 40%] Building C object CMakeFiles/dwarves.dir/dwarf_loader.c.o
> [ 42%] Building C object CMakeFiles/dwarves.dir/btf_loader.c.o
> [ 44%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
> [ 46%] Building C object CMakeFiles/dwarves.dir/elf_symtab.c.o
> [ 48%] Building C object CMakeFiles/dwarves.dir/dutil.c.o
> [ 50%] Building C object CMakeFiles/dwarves.dir/rbtree.c.o
> In file included from /var/home/acme/git/pahole/strings.c:7:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:121: CMakeFiles/dwarves.dir/strings.c.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/btf_encoder.c:12:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:173: CMakeFiles/dwarves.dir/btf_encoder.c.o] Error 1
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/ctf_encoder.c:8:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:134: CMakeFiles/dwarves.dir/ctf_encoder.c.o] Error 1
> In file included from /var/home/acme/git/pahole/libctf.c:22:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> /var/home/acme/git/pahole/btf_loader.c:24:10: fatal error: bpf/libbpf.h: No such file or directory
>    24 | #include <bpf/libbpf.h>
>       |          ^~~~~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:160: CMakeFiles/dwarves.dir/libctf.c.o] Error 1
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:186: CMakeFiles/dwarves.dir/btf_loader.c.o] Error 1
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/dwarves_fprintf.c:19:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/dwarf_loader.c:23:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:95: CMakeFiles/dwarves.dir/dwarves_fprintf.c.o] Error 1
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:199: CMakeFiles/dwarves.dir/dwarf_loader.c.o] Error 1
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/ctf_loader.c:25:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:147: CMakeFiles/dwarves.dir/ctf_loader.c.o] Error 1
> In file included from /var/home/acme/git/pahole/dwarves.h:20,
>                  from /var/home/acme/git/pahole/dwarves.c:28:
> /var/home/acme/git/pahole/pahole_strings.h:9:10: fatal error: bpf/btf.h: No such file or directory
>     9 | #include <bpf/btf.h>
>       |          ^~~~~~~~~~~
> compilation terminated.
> make[2]: *** [CMakeFiles/dwarves.dir/build.make:82: CMakeFiles/dwarves.dir/dwarves.c.o] Error 1
> make[2]: Leaving directory '/var/home/acme/git/pahole/build'
> make[1]: *** [CMakeFiles/Makefile2:283: CMakeFiles/dwarves.dir/all] Error 2
> make[1]: Leaving directory '/var/home/acme/git/pahole/build'
> make: *** [Makefile:149: all] Error 2
> make: Leaving directory '/var/home/acme/git/pahole/build'
> ⬢[acme@toolbox pahole]$
> 
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
  2021-06-13 13:14   ` Arnaldo Carvalho de Melo
  2021-06-13 13:17     ` Arnaldo Carvalho de Melo
@ 2021-06-13 13:21     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-06-13 13:21 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dwarves, Andrii Nakryiko


So, while testing this I noticed that if I _don't_ have
libbpf-devel/libbpf installed and ask for it _not_ to use the embedded
libbpf, it will build just file, using the embedded libbpf, shouldn't it
flatly fail in this case instead of just making this note:

-- Checking for module 'libbpf>=0.3.0'
--   Package 'libbpf', required by 'virtual:world', not found

?

- Arnaldo

⬢[acme@toolbox pahole]$ sudo rpm -e libbpf-devel
⬢[acme@toolbox pahole]$ sudo rpm -e libbpf
⬢[acme@toolbox pahole]$ rm -rf build ; mkdir build ; cd build ; cmake -D__LIB=lib -DCMAKE_BUILD_TYPE=Release -DLIBBPF_EMBEDDED=Off .. ; cd ..
-- The C compiler identification is GNU 11.1.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.7.3")
-- Checking for module 'libbpf>=0.3.0'
--   Package 'libbpf', required by 'virtual:world', not found
-- Setting BUILD_SHARED_LIBS = ON
-- Checking availability of DWARF and ELF development libraries
-- Looking for dwfl_module_build_id in elf
-- Looking for dwfl_module_build_id in elf - found
-- Found dwarf.h header: /usr/include
-- Found elfutils/libdw.h header: /usr/include
-- Found libdw library: /usr/lib64/libdw.so
-- Found libelf library: /usr/lib64/libelf.so
-- Checking availability of DWARF and ELF development libraries - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Submodule update
-- Submodule update - done
-- Performing Test HAVE_REALLOCARRAY_SUPPORT
-- Performing Test HAVE_REALLOCARRAY_SUPPORT - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /var/home/acme/git/pahole/build
⬢[acme@toolbox pahole]$ make -C build
make: Entering directory '/var/home/acme/git/pahole/build'
make[1]: Entering directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target bpf
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[  1%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf.c.o
[  3%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/bpf_prog_linfo.c.o
[  5%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf.c.o
[  7%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/btf_dump.c.o
[  9%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/hashmap.c.o
[ 11%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf.c.o
[ 13%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_errno.c.o
[ 15%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/libbpf_probes.c.o
[ 17%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/netlink.c.o
[ 19%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/nlattr.c.o
[ 21%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/ringbuf.c.o
[ 23%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/str_error.c.o
[ 25%] Building C object CMakeFiles/bpf.dir/lib/bpf/src/xsk.c.o
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 25%] Built target bpf
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target dwarves
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 26%] Building C object CMakeFiles/dwarves.dir/dwarves.c.o
[ 28%] Building C object CMakeFiles/dwarves.dir/dwarves_fprintf.c.o
[ 30%] Building C object CMakeFiles/dwarves.dir/gobuffer.c.o
[ 32%] Building C object CMakeFiles/dwarves.dir/strings.c.o
[ 34%] Building C object CMakeFiles/dwarves.dir/ctf_encoder.c.o
[ 36%] Building C object CMakeFiles/dwarves.dir/ctf_loader.c.o
[ 38%] Building C object CMakeFiles/dwarves.dir/libctf.c.o
[ 40%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
[ 42%] Building C object CMakeFiles/dwarves.dir/btf_loader.c.o
[ 44%] Building C object CMakeFiles/dwarves.dir/dwarf_loader.c.o
[ 46%] Building C object CMakeFiles/dwarves.dir/dutil.c.o
[ 48%] Building C object CMakeFiles/dwarves.dir/elf_symtab.c.o
[ 50%] Building C object CMakeFiles/dwarves.dir/rbtree.c.o
[ 51%] Linking C shared library libdwarves.so
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 51%] Built target dwarves
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target syscse
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 53%] Building C object CMakeFiles/syscse.dir/syscse.c.o
[ 55%] Linking C executable syscse
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 55%] Built target syscse
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target codiff
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 57%] Building C object CMakeFiles/codiff.dir/codiff.c.o
[ 59%] Linking C executable codiff
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 59%] Built target codiff
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target dtagnames
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 61%] Building C object CMakeFiles/dtagnames.dir/dtagnames.c.o
[ 63%] Linking C executable dtagnames
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 63%] Built target dtagnames
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target scncopy
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 65%] Building C object CMakeFiles/scncopy.dir/scncopy.c.o
[ 67%] Building C object CMakeFiles/scncopy.dir/elfcreator.c.o
[ 69%] Linking C executable scncopy
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 69%] Built target scncopy
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target dwarves_emit
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 71%] Building C object CMakeFiles/dwarves_emit.dir/dwarves_emit.c.o
[ 73%] Linking C shared library libdwarves_emit.so
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 73%] Built target dwarves_emit
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target dwarves_reorganize
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 75%] Building C object CMakeFiles/dwarves_reorganize.dir/dwarves_reorganize.c.o
[ 76%] Linking C shared library libdwarves_reorganize.so
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 76%] Built target dwarves_reorganize
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target ctracer
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 78%] Building C object CMakeFiles/ctracer.dir/ctracer.c.o
[ 80%] Linking C executable ctracer
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 80%] Built target ctracer
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target pdwtags
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 82%] Building C object CMakeFiles/pdwtags.dir/pdwtags.c.o
[ 84%] Linking C executable pdwtags
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 84%] Built target pdwtags
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target pahole
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 86%] Building C object CMakeFiles/pahole.dir/pahole.c.o
[ 88%] Linking C executable pahole
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 88%] Built target pahole
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target pfunct
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 90%] Building C object CMakeFiles/pfunct.dir/pfunct.c.o
[ 92%] Linking C executable pfunct
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 92%] Built target pfunct
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target pglobal
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 94%] Building C object CMakeFiles/pglobal.dir/pglobal.c.o
[ 96%] Linking C executable pglobal
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[ 96%] Built target pglobal
make[2]: Entering directory '/var/home/acme/git/pahole/build'
Scanning dependencies of target prefcnt
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
make[2]: Entering directory '/var/home/acme/git/pahole/build'
[ 98%] Building C object CMakeFiles/prefcnt.dir/prefcnt.c.o
[100%] Linking C executable prefcnt
make[2]: Leaving directory '/var/home/acme/git/pahole/build'
[100%] Built target prefcnt
make[1]: Leaving directory '/var/home/acme/git/pahole/build'
make: Leaving directory '/var/home/acme/git/pahole/build'
⬢[acme@toolbox pahole]$

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink
  2021-06-11 23:42 ` Andrii Nakryiko
  2021-06-13 13:14   ` Arnaldo Carvalho de Melo
@ 2021-06-13 13:27   ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-06-13 13:27 UTC (permalink / raw)
  To: Andrii Nakryiko; +Cc: Luca Boccassi, dwarves, Arnaldo Carvalho de Melo

Em Fri, Jun 11, 2021 at 04:42:24PM -0700, Andrii Nakryiko escreveu:
> Locally I have still another issue, which I don't believe is related
> to Luca's changes. I get this error:
> 
> $ make -j60
> [ 25%] Built target bpf
> [ 26%] Building C object CMakeFiles/dwarves.dir/btf_encoder.c.o
> In file included from /usr/include/sys/stat.h:106:0,
>                  from /home/andriin/local/pahole/btf_encoder.c:24:
> /usr/include/bits/stat.h:106:31: error: expected identifier or ‘(’
> before ‘[’ token
>      __syscall_slong_t __unused[3];
>                                ^
> /usr/include/bits/stat.h:164:31: error: expected identifier or ‘(’
> before ‘[’ token
>      __syscall_slong_t __unused[3];
>                                ^
> make[2]: *** [CMakeFiles/dwarves.dir/btf_encoder.c.o] Error 1
> make[1]: *** [CMakeFiles/dwarves.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> I think it's some new interplay with dutil.h header defining its own
> 
> #define __unused __attribute__ ((unused))
> 
> Given __unused is used in vmlinux.h and /usr/include/bits/stat.h as
> field names, I think it would be better to rename __unused macro
> within pahole source code to avoid such confusing problems.

I'll fix this adopting the kernel __maybe_unused jargon.

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-13 13:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 23:01 [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink Luca Boccassi
2021-06-11 23:42 ` Andrii Nakryiko
2021-06-13 13:14   ` Arnaldo Carvalho de Melo
2021-06-13 13:17     ` Arnaldo Carvalho de Melo
2021-06-13 13:21     ` Arnaldo Carvalho de Melo
2021-06-13 13:27   ` Arnaldo Carvalho de Melo

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).