Skip to content

Commit fc843cc

Browse files
alobakinanakryiko
authored andcommitted
samples: bpf: Fix linking xdp_router_ipv4 after migration
Users of the xdp_sample_user infra should be explicitly linked with the standard math library (`-lm`). Otherwise, the following happens: /usr/bin/ld: xdp_sample_user.c:(.text+0x59fc): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5a0d): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5adc): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x5b01): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x5c1e): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x5c43): undefined reference to `ceil [...] That happened previously, so there's a block of linkage flags in the Makefile. xdp_router_ipv4 has been transferred to this infra quite recently, but hasn't been added to it. Fix. Fixes: 85bf1f5 ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper") Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 35f91d1 commit fc843cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

samples/bpf/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ TPROGLDLIBS_xdp_redirect += -lm
219219
TPROGLDLIBS_xdp_redirect_cpu += -lm
220220
TPROGLDLIBS_xdp_redirect_map += -lm
221221
TPROGLDLIBS_xdp_redirect_map_multi += -lm
222+
TPROGLDLIBS_xdp_router_ipv4 += -lm
222223
TPROGLDLIBS_tracex4 += -lrt
223224
TPROGLDLIBS_trace_output += -lrt
224225
TPROGLDLIBS_map_perf_test += -lrt

0 commit comments

Comments
 (0)