Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [PATCH] arm64: Disable LLD linker ASSERT()s for the time being
@ 2025-05-29  7:35 Ard Biesheuvel
  2025-05-30  2:30 ` Nathan Chancellor
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Ard Biesheuvel @ 2025-05-29  7:35 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: llvm, linux-kernel, will, catalin.marinas, nathan, Ard Biesheuvel

From: Ard Biesheuvel <ardb@kernel.org>

It turns out that the way LLD handles ASSERT()s in the linker script can
result in spurious failures, so disable them for the newly introduced
BSS symbol export checks.

Link: https://github.com/ClangBuiltLinux/linux/issues/2094
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/arm64/kernel/image-vars.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h
index c5266430284b..86f088a16147 100644
--- a/arch/arm64/kernel/image-vars.h
+++ b/arch/arm64/kernel/image-vars.h
@@ -10,6 +10,10 @@
 #error This file should only be included in vmlinux.lds.S
 #endif
 
+#if defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 210000
+#define ASSERT(...)
+#endif
+
 #define PI_EXPORT_SYM(sym)		\
 	__PI_EXPORT_SYM(sym, __pi_ ## sym, Cannot export BSS symbol sym to startup code)
 #define __PI_EXPORT_SYM(sym, pisym, msg)\
@@ -142,4 +146,6 @@ KVM_NVHE_ALIAS(kvm_protected_mode_initialized);
 _kernel_codesize = ABSOLUTE(__inittext_end - _text);
 #endif
 
+#undef ASSERT
+
 #endif /* __ARM64_KERNEL_IMAGE_VARS_H */
-- 
2.49.0.1238.gf8c92423fb-goog


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-06-02 13:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29  7:35 [PATCH] arm64: Disable LLD linker ASSERT()s for the time being Ard Biesheuvel
2025-05-30  2:30 ` Nathan Chancellor
2025-05-30 13:38 ` Will Deacon
2025-05-30 14:23   ` Ard Biesheuvel
2025-06-02 10:09     ` Will Deacon
2025-06-02 10:18       ` Ard Biesheuvel
2025-06-02 11:43         ` Will Deacon
2025-05-30 15:03 ` Arnd Bergmann
2025-06-02 13:42 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox