• Alexander Lobakin's avatar
    samples: bpf: Fix linking xdp_router_ipv4 after migration · fc843ccd
    Alexander Lobakin authored
    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: 85bf1f51 ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
    Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
    Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20220404115451.1116478-1-alexandr.lobakin@intel.com
    fc843ccd
Makefile 16.2 KB