Skip to content

Commit 91f2e15

Browse files
rpigotttohojo
authored andcommitted
configure: update libbpf check for modern api
The system libbpf check would unconditionally fail with a modern libbpf because the example program used outdated and removed library functions. Update the test program so that system libbpf check can pass again. Signed-off-by: Ronan Pigott <ronan@rjp.ie>
1 parent eeb154d commit 91f2e15

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

configure

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,17 @@ check_libbpf()
106106
int main(int argc, char **argv) {
107107
void *ptr;
108108
DECLARE_LIBBPF_OPTS(bpf_object_open_opts, opts, .pin_root_path = "/path");
109-
DECLARE_LIBBPF_OPTS(bpf_xdp_set_link_opts, lopts, .old_fd = -1);
110109
(void) bpf_object__open_file("file", &opts);
111110
(void) bpf_program__name(ptr);
112111
(void) bpf_map__set_initial_value(ptr, ptr, 0);
113-
(void) bpf_set_link_xdp_fd_opts(0, 0, 0, &lopts);
112+
(void) bpf_xdp_attach(0, 0, 0, NULL);
114113
(void) bpf_tc_attach(ptr, ptr);
115114
(void) bpf_object__next_program(ptr, ptr);
116115
return 0;
117116
}
118117
EOF
119118

120-
libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c $LIBBPF_CFLAGS -lbpf 2>&1)
119+
libbpf_err=$($CC -o $TMPDIR/libbpftest $LIBBPF_CFLAGS $LIBBPF_LDLIBS $TMPDIR/libbpftest.c 2>&1)
121120
if [ "$?" -eq "0" ]; then
122121
echo "SYSTEM_LIBBPF:=y" >>$CONFIG
123122
echo 'CFLAGS += ' $LIBBPF_CFLAGS >> $CONFIG

0 commit comments

Comments
 (0)