-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lld uses blx instruction, no object with architecture supporting feature detected #964
Comments
Seems expected given the config. If we had a config for |
yes, maybe a way forward is to upstream Android's CONFIG_LD_IS_ patches (cc @samitolvanen ) then we can disable certain configs when it's selected. cc @masahir0y for thoughts on that. We could also just mark CONFIG_CPU_32v4 disabled for Clang. I think your report above is the furthest anyone's testing Linux ARMv4 w/ Clang. |
I am fine with LD_IS_LLD if it is useful. |
I wonder whether this can also benefit big-endian powerpc64 #602. There is no interest to support elfv1. If we enable elfv2 ("Power Architecture 64-Bit ELF V2 ABI Specification") via some config, then this config should always to y if linked with lld. |
Hmmm, looking over this, fixing this up is going to be rather invasive. Reason being is that
We could just never select The real solution it seems is to avoid selecting the machines that select these configs in arch/arm/Kconfig but it gets reallllly messy from there. |
// Architectures prior to v5 do not support BLX instruction but there's also a FIXME in llvm-project/lld/ELF/Driver.cpp: // FIXME: These warnings can be removed when lld only uses these features
// when the input objects have been compiled with an architecture that
// supports them. Indeed, it looks like a Kconfig fix is going to be quite invasive to disable LLD pre-ARMv5. |
That's kind of frustrating. That means then that we have to add |
Easily reproducible with llvm commit 57eb0469847b ("[ELF] Read ARM BuildAttributes section to determine supported features.") has more context. To silence any warning for diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e6e08d8a45fc..3379ae750a84 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -459,6 +459,7 @@ config ARCH_RPC
config ARCH_SA1100
bool "SA1100-based"
+ depends on !LD_IS_LLD
select ARCH_MTD_XIP
select ARCH_SPARSEMEM_ENABLE
select CLKSRC_MMIO It builds but it's obviously going to not boot/work properly, since that disables |
reported upstream: https://llvm.org/pr51422 |
lld cannot build for ARMv4/v4T targets because it inserts 'blx' instructions that are unsupported there: ld.lld: warning: lld uses blx instruction, no object with architecture supporting feature detected Add a Kconfig time dependency to prevent those targets from being selected in randconfig builds. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: llvm/llvm-project#50764 Link: ClangBuiltLinux#964 Link: https://lore.kernel.org/r/20221215162635.3750763-1-arnd@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
I wonder if https://reviews.llvm.org/rG62c605771a30 is relevant? |
llvm/llvm-project#50764 was just closed out. We should see if we can update intel-lab-lkp@6a7ee50 for lld-16. |
Patch submitted for the kernel: https://lore.kernel.org/20230118-v4-v4t-lld-16-v1-1-e3d9a00ae47c@kernel.org/ |
Commit 6a7ee50 ("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: ClangBuiltLinux#964 Link: llvm/llvm-project@6f9ff1b Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Patch submitted to Russell's patch tracker: https://www.armlinux.org.uk/developer/patches/viewpatch.php?id=9289/1 |
Commit 6a7ee50 ("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: ClangBuiltLinux#964 Link: llvm/llvm-project@6f9ff1b Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Patch is now available in mainline: https://git.kernel.org/linus/5eb6e280432ddc9b755193552f3a070da8d7455c |
0day bot reported this arm randconfig: https://groups.google.com/g/clang-built-linux/c/n7DXLyrlo-0/m/GTTaxotDBwAJ
The text was updated successfully, but these errors were encountered: