public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Allow pre-ARMv5 builds with ld.lld 16.0.0 and newer
@ 2023-01-18 19:22 Nathan Chancellor
  2023-01-27 21:56 ` Arnd Bergmann
  2023-01-30 18:10 ` kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Nathan Chancellor @ 2023-01-18 19:22 UTC (permalink / raw)
  To: linux, arnd
  Cc: ndesaulniers, trix, linux-arm-kernel, linux-kernel, llvm, patches,
	Nathan Chancellor

Commit 6a7ee50f8f56 ("ARM: disallow pre-ARMv5 builds with ld.lld")
prevented v4 or v4t kernels when ld.lld will link the kernel due to
inserting unsupported blx instructions.

ld.lld has been fixed in current main (16.0.0) to avoid inserting these
instructions by inserting position independent thunks instead. Allow
these configurations to be enabled when ld.lld 16.0.0 is used to link
the kernel.

Additionally, add a link to the upstream LLVM issue so that the reason
for this dependency is clearly documented.

Link: https://github.com/ClangBuiltLinux/linux/issues/964
Link: https://github.com/llvm/llvm-project/commit/6f9ff1beee9d12aca0c9caa9ae0051dc6d0a718c
Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
I just build tested:

- multi_v4t_defconfig without 6a7ee50f8f56 with LLVM 15: warning
- multi_v4t_defconfig with this patch with LLVM 16: no warning

and the configuration cannot be selected under the old and new conditions
still.
---
 arch/arm/Kconfig | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43c7773b89ae..874c5b56cf9a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -345,14 +345,16 @@ comment "CPU Core family selection"
 config ARCH_MULTI_V4
 	bool "ARMv4 based platforms (FA526, StrongARM)"
 	depends on !ARCH_MULTI_V6_V7
-	depends on !LD_IS_LLD
+	# https://github.com/llvm/llvm-project/issues/50764
+	depends on !LD_IS_LLD || LLD_VERSION >= 160000
 	select ARCH_MULTI_V4_V5
 	select CPU_FA526 if !(CPU_SA110 || CPU_SA1100)
 
 config ARCH_MULTI_V4T
 	bool "ARMv4T based platforms (ARM720T, ARM920T, ...)"
 	depends on !ARCH_MULTI_V6_V7
-	depends on !LD_IS_LLD
+	# https://github.com/llvm/llvm-project/issues/50764
+	depends on !LD_IS_LLD || LLD_VERSION >= 160000
 	select ARCH_MULTI_V4_V5
 	select CPU_ARM920T if !(CPU_ARM7TDMI || CPU_ARM720T || \
 		CPU_ARM740T || CPU_ARM9TDMI || CPU_ARM922T || \

---
base-commit: 5dc4c995db9eb45f6373a956eb1f69460e69e6d4
change-id: 20230118-v4-v4t-lld-16-96d5d5cc36c2

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-30 22:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18 19:22 [PATCH] ARM: Allow pre-ARMv5 builds with ld.lld 16.0.0 and newer Nathan Chancellor
2023-01-27 21:56 ` Arnd Bergmann
2023-01-29 14:51   ` Nathan Chancellor
2023-01-30 18:10 ` kernel test robot
2023-01-30 18:19   ` Arnd Bergmann
2023-01-30 22:03     ` Nick Desaulniers

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