You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Explicitly set PREFIX=/ when installing libbpf headers
When xdp-tools builds the embedded copy of libbpf, it invokes the libbpf
build system to installs it headers, and then constructs a path to
those embedded libbpf headers [0] based on the assumption that libbpf
installed its headers into its default PREFIX value of /usr.
However, if PREFIX is passed to the xdp-tools build system, this
variable gets passed down to the invocation of the libbpf build system
as well, and libbpf installs its headers into a different directory
that doesn't match xdp-tools' LIBBPF_INCLUDE_DIR variable, and the build
fails like this:
$ make PREFIX=/usr/local
[…]
libbpf support: Submodule 'libbpf' (https://github.com/libbpf/libbpf.git) registered for path 'lib/libbpf'
Cloning into '/home/edmonds/src/xdp-tools/lib/libbpf'...
Submodule path 'lib/libbpf': checked out 'fdf402b384cc42ce29bb9e27011633be3cbafe1e'
submodule v1.4.0
[…]
lib
libbpf
CC libbpf/src/libbpf.a
INSTALL libbpf/src/libbpf.a
libxdp
CC staticobjs/libxdp.o
libxdp.c:31:10: fatal error: bpf/libbpf.h: No such file or directory
31 | #include <bpf/libbpf.h>
| ^~~~~~~~~~~~~~
compilation terminated.
This commit explicitly passes PREFIX=/ to the libbpf build system
when installing the embedded libbpf headers, and also updates the
LIBBPF_INCLUDE_DIR variable in the xdp-tools build system to match the
resulting include path, so that the embedded libbpf headers are
installed into a fixed location.
[0]: https://github.com/xdp-project/xdp-tools/blob/7b3bbe2f6f16d658bb09a7b7e5958f4a49825ee6/configure#L382
Signed-off-by: Robert Edmonds <[email protected]>
0 commit comments