Skip to content

Commit fd526e1

Browse files
guidosarduccianakryiko
authored andcommitted
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: 08c79c9 ("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
1 parent 3f2ac59 commit fd526e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/bpf/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ $(OUTPUT)/%:%.c
264264
ifeq ($(SRCARCH),$(filter $(SRCARCH),x86 riscv))
265265
LLD := lld
266266
else
267-
LLD := ld
267+
LLD := $(shell command -v $(LD))
268268
endif
269269

270270
# Filter out -static for liburandom_read.so and its dependent targets so that static builds

0 commit comments

Comments
 (0)