* [PATCH bpf v1] selftests/bpf: Fix cross-compiling urandom_read
@ 2024-10-09 4:07 Tony Ambardar
2024-10-11 2:20 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Tony Ambardar @ 2024-10-09 4:07 UTC (permalink / raw)
To: bpf
Cc: Tony Ambardar, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Mykola Lysenko, Shuah Khan, linux-kselftest
Linking of urandom_read and liburandom_read.so prefers LLVM's 'ld.lld' but
falls back to using 'ld' if unsupported. However, this fallback discards
any existing makefile macro for LD and can break cross-compilation.
Fix by changing the fallback to use the target linker $(LD), passed via
'-fuse-ld=' using an absolute path rather than a linker "flavour".
Fixes: 08c79c9cd67f ("selftests/bpf: Don't force lld on non-x86 architectures")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
tools/testing/selftests/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 5e366f2fc02a..f2a0f912e038 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -263,7 +263,7 @@ $(OUTPUT)/%:%.c
ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 riscv))
LLD := lld
else
-LLD := ld
+LLD := $(shell command -v $(LD))
endif
# Filter out -static for liburandom_read.so and its dependent targets so that static builds
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf v1] selftests/bpf: Fix cross-compiling urandom_read
2024-10-09 4:07 [PATCH bpf v1] selftests/bpf: Fix cross-compiling urandom_read Tony Ambardar
@ 2024-10-11 2:20 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-11 2:20 UTC (permalink / raw)
To: Tony Ambardar
Cc: bpf, ast, daniel, andrii, martin.lau, eddyz87, song,
yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
mykolal, shuah, linux-kselftest
Hello:
This patch was applied to bpf/bpf.git (master)
by Andrii Nakryiko <andrii@kernel.org>:
On Tue, 8 Oct 2024 21:07:20 -0700 you wrote:
> Linking of urandom_read and liburandom_read.so prefers LLVM's 'ld.lld' but
> falls back to using 'ld' if unsupported. However, this fallback discards
> any existing makefile macro for LD and can break cross-compilation.
>
> Fix by changing the fallback to use the target linker $(LD), passed via
> '-fuse-ld=' using an absolute path rather than a linker "flavour".
>
> [...]
Here is the summary with links:
- [bpf,v1] selftests/bpf: Fix cross-compiling urandom_read
https://git.kernel.org/bpf/bpf/c/fd526e121c4d
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] 2+ messages in thread
end of thread, other threads:[~2024-10-11 2:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 4:07 [PATCH bpf v1] selftests/bpf: Fix cross-compiling urandom_read Tony Ambardar
2024-10-11 2:20 ` 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