selftests/bpf: Fix cross-compiling urandom_read
authorTony Ambardar <tony.ambardar@gmail.com>
Wed, 9 Oct 2024 04:07:20 +0000 (21:07 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 11 Oct 2024 02:08:14 +0000 (19:08 -0700)
commitfd526e121c4d6f71aed82d21a8b8277b03e60b43
treebe76788645fcc46191d7d86a2332b70683e875a0
parent3f2ac59c0d7b4d9f0e87371662a6ba8273b07818
selftests/bpf: Fix cross-compiling urandom_read

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>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20241009040720.635260-1-tony.ambardar@gmail.com
tools/testing/selftests/bpf/Makefile