On Wed, May 15, 2019 at 2:17 PM Arnd Bergmann arnd@arndb.de wrote:
On Wed, May 15, 2019 at 11:06 PM 'Nick Desaulniers' via Clang Built Linux clang-built-linux@googlegroups.com wrote:
On Wed, May 15, 2019 at 1:57 PM Arnd Bergmann arnd@arndb.de wrote:
On Wed, May 15, 2019 at 7:54 PM 'Nick Desaulniers' via Clang Built
Looks like most of the below are suffering from a similar problem that I understand pretty well and will send patches later this week.
Right. What is actually going on here?
Those are compiler helper routines that you'd find in libgcc (these are distinct from compiler builtins; maybe there's a more correct name than "compiler helper routines"). It's not possible to tell the compiler not to emit libcalls to these. You see these frequently for 64b operations on 32b hosts. Typically, these are copied from libgcc into the kernel. See the sources under arch/arm/lib/ for a few examples.
Yes, I know what these functions are, but from what I can tell, the link failure is for functions that are actually part of the kernel (__aeabi_idivmod, __aeabi_uidivmod), and exported from armksyms.c, so they should not cause the link failure.
Interesting, filed https://github.com/ClangBuiltLinux/linux/issues/482, lets follow up there. Seems like s3c2410_defconfig is a culprit (not sure yet if it's the only one, I need to look through the rest of the kernelCI build logs).
Ah, I see the problem now: most of the failed configs do not enable CONFIG_AEABI, which controls the missing symbols.
clang does not support OABI, so it fails in non-EABI configurations.
The best fix should be to hide CONFIG_AEABI when building with clang and force-enable it.
The reason I did not notice this in my own tests is that I have a different patch that force-enables AEABI when building with CONFIG_COMPILE_TEST.
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 9aed25a6019b..fa9a34e579bc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1547,8 +1547,8 @@ config ARM_PATCH_IDIV code to do integer division.
config AEABI
bool "Use the ARM EABI to compile the kernel" if !CPU_V7 &&
!CPU_V7M && !CPU_V6 && !CPU_V6K
default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K
bool "Use the ARM EABI to compile the kernel" if !CPU_V7 &&
!CPU_V7M && !CPU_V6 && \
!CPU_V6K && !CC_IS_CLANG
default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K || CC_IS_CLANG help This option allows for the kernel to be compiled using the latest ARM ABI (aka EABI). This is only useful if you are using a user
Arnd
Heh, https://github.com/ClangBuiltLinux/linux/issues/482#issuecomment-492828082 what's the difference between OABI and AEABI (honestly don't know enough about anything less than ARMv8)?
I don't understand kbuild enough to know why the line that starts with `bool` you added has `&& !CC_IS_CLANG`, but the default line you added is `|| CC_IS_CLANG`.
Is the implication of your patch to always build w/ AEABI when building w/ clang? If so, what are the implications for the resulting image? Or do I have that wrong?