mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
configure: Make sure libxdp is before libbpf in linker arguments
When libxdp is linked against the submodule libbpf, the order of linker arguments is important because libxdp.a needs symbols from libbpf.a. Fix up configure so it ensures this. Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
This commit is contained in:
8
configure
vendored
8
configure
vendored
@@ -196,12 +196,18 @@ check_libxdp()
|
||||
LIBBPF_INCLUDE_DIR="$(readlink -m lib/install/include)" \
|
||||
LIBBPF_UNBUILT=1;
|
||||
cd lib/xdp-tools; ./configure)
|
||||
|
||||
# libxdp.a has to come before libbpf.a so the former can pick up symbols
|
||||
# from the latter
|
||||
sed -i 's/-l:libbpf.a/-l:libxdp.a -l:libbpf.a/' $CONFIG
|
||||
else
|
||||
echo "Configuring libxdp without our libbpf"
|
||||
(cd lib/xdp-tools; ./configure)
|
||||
|
||||
echo 'LDLIBS += -l:libxdp.a' >>$CONFIG
|
||||
fi
|
||||
|
||||
echo 'LDFLAGS += -L$(LIB_DIR)/install/lib' >>$CONFIG
|
||||
echo 'LDLIBS += -l:libxdp.a' >>$CONFIG
|
||||
echo 'OBJECT_LIBXDP = $(LIB_DIR)/install/lib/libxdp.a' >>$CONFIG
|
||||
if ! [ -d "lib/xdp-tools/lib" ] && [ -f ".gitmodules" ] && [ -e ".git" ]; then
|
||||
git submodule init && git submodule update
|
||||
|
Reference in New Issue
Block a user