diff options
author | Tony Ambardar <tony.ambardar@gmail.com> | 2024-10-09 07:07:20 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-11-01 04:02:25 +0300 |
commit | 35f3ba73c0ccc660c2a95b4c9cbc6a2b31b8a7e7 (patch) | |
tree | 6d7f0df62ab5c1e38693d6b2bc06698d598f16e2 /tools | |
parent | c8e725bdd50299bfcea1378007892d84b3f7113b (diff) | |
download | linux-35f3ba73c0ccc660c2a95b4c9cbc6a2b31b8a7e7.tar.xz |
selftests/bpf: Fix cross-compiling urandom_read
[ Upstream commit fd526e121c4d6f71aed82d21a8b8277b03e60b43 ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/bpf/Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile index 848fffa25022..555fd34c6e1f 100644 --- a/tools/testing/selftests/bpf/Makefile +++ b/tools/testing/selftests/bpf/Makefile @@ -221,7 +221,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 |