summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-11-22 12:01:57 +0100
committerThomas Weißschuh <linux@weissschuh.net>2025-11-22 12:35:02 +0100
commit682bf67529fd9d63a94af658b779f9cce549c6d1 (patch)
treeddc6a467ae437d8485a8ee9bc116e46b281f719c
parent31b4d3af63f9afcb2661b9be554f0cf55c86573b (diff)
selftests/nolibc: use lld to link loongarch binaries
LLVM 21 switched to -mcmodel=medium for LoongArch64 compilations. This code model uses R_LARCH_ECALL36 relocations which might not be supported by GNU ld which to nolibc testsuite uses by default. ld will not resolve the relocation and all function calls will end up as busy loops. Use lld instead. We can not switch to lld for all LLVM builds, as it does not support all necessary architectures. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--tools/testing/selftests/nolibc/Makefile.nolibc1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/nolibc/Makefile.nolibc b/tools/testing/selftests/nolibc/Makefile.nolibc
index 330e000baeb1..9423f4a959b2 100644
--- a/tools/testing/selftests/nolibc/Makefile.nolibc
+++ b/tools/testing/selftests/nolibc/Makefile.nolibc
@@ -230,6 +230,7 @@ CFLAGS_mipsn32le = -EL -mabi=n32 -fPIC -march=mips64r2
CFLAGS_mipsn32be = -EB -mabi=n32 -march=mips64r6
CFLAGS_mips64le = -EL -mabi=64 -march=mips64r6
CFLAGS_mips64be = -EB -mabi=64 -march=mips64r2
+CFLAGS_loongarch = $(if $(LLVM),-fuse-ld=lld)
CFLAGS_sparc32 = $(call cc-option,-m32)
CFLAGS_sh4 = -ml -m4
ifeq ($(origin XARCH),command line)