Re: [PATCH dwarves] Add missing lib/include/bpf -> ../bpf/src symlink

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

 



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@xxxxxxxxxx> 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@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
> > >
> > > 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@xxxxxxxxxx>
> > > ---
> > 
> > This fixes the issue for me in my local setup:
> > 
> > Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
> 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@xxxxxxxxx>
>     Tested-by: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx>
>     Signed-off-by: Luca Boccassi <bluca@xxxxxxxxxx>
>     Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> 
> 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



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux