* [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration
@ 2022-04-04 11:54 Alexander Lobakin
2022-04-04 21:45 ` Andrii Nakryiko
2022-04-04 21:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Lobakin @ 2022-04-04 11:54 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
Cc: Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
Lorenzo Bianconi, Maciej Fijalkowski, netdev, bpf, linux-kernel,
Alexander Lobakin
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: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
---
samples/bpf/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index b4fa0e69aa14..342a41a10356 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -219,6 +219,7 @@ TPROGLDLIBS_xdp_redirect += -lm
TPROGLDLIBS_xdp_redirect_cpu += -lm
TPROGLDLIBS_xdp_redirect_map += -lm
TPROGLDLIBS_xdp_redirect_map_multi += -lm
+TPROGLDLIBS_xdp_router_ipv4 += -lm
TPROGLDLIBS_tracex4 += -lrt
TPROGLDLIBS_trace_output += -lrt
TPROGLDLIBS_map_perf_test += -lrt
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration
2022-04-04 11:54 [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration Alexander Lobakin
@ 2022-04-04 21:45 ` Andrii Nakryiko
2022-04-05 10:32 ` Alexander Lobakin
2022-04-04 21:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Andrii Nakryiko @ 2022-04-04 21:45 UTC (permalink / raw)
To: Alexander Lobakin
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
KP Singh, David S. Miller, Jakub Kicinski, Jesper Dangaard Brouer,
Lorenzo Bianconi, Maciej Fijalkowski, Networking, bpf, open list
On Mon, Apr 4, 2022 at 4:57 AM Alexander Lobakin
<alexandr.lobakin@intel.com> wrote:
>
> 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
> [...]
I actually don't get these, but applied to bpf-next anyway.
>
> 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: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
> Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> ---
> samples/bpf/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> index b4fa0e69aa14..342a41a10356 100644
> --- a/samples/bpf/Makefile
> +++ b/samples/bpf/Makefile
> @@ -219,6 +219,7 @@ TPROGLDLIBS_xdp_redirect += -lm
> TPROGLDLIBS_xdp_redirect_cpu += -lm
> TPROGLDLIBS_xdp_redirect_map += -lm
> TPROGLDLIBS_xdp_redirect_map_multi += -lm
> +TPROGLDLIBS_xdp_router_ipv4 += -lm
> TPROGLDLIBS_tracex4 += -lrt
> TPROGLDLIBS_trace_output += -lrt
> TPROGLDLIBS_map_perf_test += -lrt
> --
> 2.35.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration
2022-04-04 11:54 [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration Alexander Lobakin
2022-04-04 21:45 ` Andrii Nakryiko
@ 2022-04-04 21:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-04 21:50 UTC (permalink / raw)
To: Alexander Lobakin
Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
kpsingh, davem, kuba, hawk, lorenzo, maciej.fijalkowski, netdev,
bpf, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Mon, 4 Apr 2022 13:54:51 +0200 you wrote:
> 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
> [...]
>
> [...]
Here is the summary with links:
- [bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration
https://git.kernel.org/bpf/bpf-next/c/fc843ccd8e4c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration
2022-04-04 21:45 ` Andrii Nakryiko
@ 2022-04-05 10:32 ` Alexander Lobakin
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Lobakin @ 2022-04-05 10:32 UTC (permalink / raw)
To: Andrii Nakryiko
Cc: Alexander Lobakin, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, David S. Miller, Jakub Kicinski,
Jesper Dangaard Brouer, Lorenzo Bianconi, Maciej Fijalkowski,
Networking, bpf, open list
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Date: Mon, 4 Apr 2022 14:45:43 -0700
> On Mon, Apr 4, 2022 at 4:57 AM Alexander Lobakin
> <alexandr.lobakin@intel.com> wrote:
> >
> > 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
> > [...]
>
> I actually don't get these, but applied to bpf-next anyway.
Depends on the compiler/linker I guess. They appear on `make LLVM=1`
on my setup.
Thanks!
>
> >
> > 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: 85bf1f51691c ("samples: bpf: Convert xdp_router_ipv4 to XDP samples helper")
> > Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> > ---
> > samples/bpf/Makefile | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
> > index b4fa0e69aa14..342a41a10356 100644
> > --- a/samples/bpf/Makefile
> > +++ b/samples/bpf/Makefile
> > @@ -219,6 +219,7 @@ TPROGLDLIBS_xdp_redirect += -lm
> > TPROGLDLIBS_xdp_redirect_cpu += -lm
> > TPROGLDLIBS_xdp_redirect_map += -lm
> > TPROGLDLIBS_xdp_redirect_map_multi += -lm
> > +TPROGLDLIBS_xdp_router_ipv4 += -lm
> > TPROGLDLIBS_tracex4 += -lrt
> > TPROGLDLIBS_trace_output += -lrt
> > TPROGLDLIBS_map_perf_test += -lrt
> > --
> > 2.35.1
Al
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-06 1:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-04 11:54 [PATCH bpf-next] samples: bpf: fix linking xdp_router_ipv4 after migration Alexander Lobakin
2022-04-04 21:45 ` Andrii Nakryiko
2022-04-05 10:32 ` Alexander Lobakin
2022-04-04 21:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox