-
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
Debian LLVM patches causing failures for LLVM_IAS=1 in android tree builds #1355
Comments
@arndb 's comment even mentions
Neither of those were set that way in the reported build config. |
@nickdesaulniers can you share the tuxbuild link instead (i.e. the folder with all artifacts)? the links you posted don't work for me |
This is reproducible with However, if I build upstream LLVM at the hash that the current version of clang-nightly is built from (
|
One of these patches might be relevant? https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/patches/930008-arm.diff |
Yup, it's the first one: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/patches/clang-arm-default-vfp3-on-armv7a.patch which was added because of these two bugs: https://bugs.debian.org/841474 https://bugs.debian.org/842142 In response to this patch in LLVM, which defaulted I do not really understand though, Assuming Debian does not want to remove this patch, we will probably need to work around this in the kernel. |
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841474#22 says:
llvm/llvm-project@4adcb73#diff-239adc65a4d98655f5b95d1f6f72605518c540115d81e2198d7a360714ca5439R79-R86 shows that NEON is indeed not required for ARMv7, but can be enabled if
So it sounds to me like the fix would be to ensure that builds of those projects set @sylvestre can AFL now be built with that patch dropped? I assume either:
https://reviews.llvm.org/rGe17c58003498b06572cf0e56cb6eac65fe7e1014 looks interesting but landed before Debian's issue was filed. |
A-class and M-class are entirely different. Debian's armel is armv5te and armhf is armv7 with VFPv3-D16 but optional NEON (https://wiki.debian.org/ArchitectureSpecificsMemo#armel).
|
@jrtc27 is correct, do not pick I believe this is a buildbot that still uses the NVidia boards that don't have NEON, and the option is The default being NEON (unlike GCC) is an old discussion that I lost a long time ago. My rationale was to avoid precisely this problem, but the counter argument was that most people don't really care and the number of ARMv7A devices without NEON are very very limited. |
Test case:
builds just fine with $ clang --target=arm-linux-gnueabi neon.s -c but with Debian's diff diff --git a/llvm/include/llvm/Support/ARMTargetParser.def b/llvm/include/llvm/Support/ARMTargetParser.def
index 37cf0a93bb04..b3e4e2351273 100644
--- a/llvm/include/llvm/Support/ARMTargetParser.def
+++ b/llvm/include/llvm/Support/ARMTargetParser.def
@@ -76,7 +76,7 @@ ARM_ARCH("armv6kz", ARMV6KZ, "6KZ", "v6kz", ARMBuildAttrs::CPUArch::v6KZ,
ARM_ARCH("armv6-m", ARMV6M, "6-M", "v6m", ARMBuildAttrs::CPUArch::v6_M,
FK_NONE, ARM::AEK_NONE)
ARM_ARCH("armv7-a", ARMV7A, "7-A", "v7", ARMBuildAttrs::CPUArch::v7,
- FK_NEON, ARM::AEK_DSP)
+ FK_VFPV3_D16, ARM::AEK_DSP)
ARM_ARCH("armv7ve", ARMV7VE, "7VE", "v7ve", ARMBuildAttrs::CPUArch::v7,
FK_NEON, (ARM::AEK_SEC | ARM::AEK_MP | ARM::AEK_VIRT |
ARM::AEK_HWDIVARM | ARM::AEK_HWDIVTHUMB | ARM::AEK_DSP))
diff --git a/llvm/lib/Target/ARM/ARM.td b/llvm/lib/Target/ARM/ARM.td
index 9da2bdbbb103..8ce70cf5d8c9 100644
--- a/llvm/lib/Target/ARM/ARM.td
+++ b/llvm/lib/Target/ARM/ARM.td
@@ -725,7 +725,8 @@ def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps,
FeatureStrictAlign]>;
def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops,
- FeatureNEON,
+ FeatureVFP3,
+ FeatureVFP3_D16,
FeatureDB,
FeatureDSP,
FeatureAClass]>; produces the error observed:
I'm not sure how we could build that (with additional compiler flags, or assembler source changes). |
Swap the order of the lines; |
diff --git a/arch/arm/crypto/curve25519-core.S b/arch/arm/crypto/curve25519-core.S
index be18af52e7dc..b697fa5d059a 100644
--- a/arch/arm/crypto/curve25519-core.S
+++ b/arch/arm/crypto/curve25519-core.S
@@ -10,8 +10,8 @@
#include <linux/linkage.h>
.text
-.fpu neon
.arch armv7-a
+.fpu neon
.align 4
ENTRY(curve25519_neon) fixes the issue for me. |
Cool. @nathanchance you have the diff handy and did the debugging. Do you mind sending that as a kernel patch with @arndb 's reported by and @jrtc27 's suggested by? |
Sounds good, I will write up the patch now. @jrtc27 is it okay that I include the |
Sure; |
Patch submitted: https://lore.kernel.org/r/[email protected]/ |
Debian's clang carries a patch that makes the default FPU mode 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON instructions on hardware that does not support them: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch https://bugs.debian.org/841474 https://bugs.debian.org/842142 https://bugs.debian.org/914268 This results in the following build error when clang's integrated assembler is used because the '.arch' directive overrides the '.fpu' directive: arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON vmov.i32 q0, #1 ^ arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON vshr.u64 q1, q0, torvalds#7 ^ arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON vshr.u64 q0, q0, torvalds#8 ^ arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON vmov.i32 d4, torvalds#19 ^ Shuffle the order of the '.arch' and '.fpu' directives so that the code builds regardless of the default FPU mode. This has been tested against both clang with and without Debian's patch and GCC. Cc: [email protected] Fixes: d8f1308 ("crypto: arm/curve25519 - wire up NEON implementation") Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118 Reported-by: Arnd Bergmann <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Suggested-by: Jessica Clarke <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]>
Debian's clang carries a patch that makes the default FPU mode 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON instructions on hardware that does not support them: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch https://bugs.debian.org/841474 https://bugs.debian.org/842142 https://bugs.debian.org/914268 This results in the following build error when clang's integrated assembler is used because the '.arch' directive overrides the '.fpu' directive: arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON vmov.i32 q0, #1 ^ arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON vshr.u64 q1, q0, torvalds#7 ^ arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON vshr.u64 q0, q0, torvalds#8 ^ arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON vmov.i32 d4, torvalds#19 ^ Shuffle the order of the '.arch' and '.fpu' directives so that the code builds regardless of the default FPU mode. This has been tested against both clang with and without Debian's patch and GCC. Cc: [email protected] Fixes: d8f1308 ("crypto: arm/curve25519 - wire up NEON implementation") Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118 Reported-by: Arnd Bergmann <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Suggested-by: Jessica Clarke <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Acked-by: Jason A. Donenfeld <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
Debian's clang carries a patch that makes the default FPU mode 'vfp3-d16' instead of 'neon' for 'armv7-a' to avoid generating NEON instructions on hardware that does not support them: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/raw/5a61ca6f21b4ad8c6ac4970e5ea5a7b5b4486d22/debian/patches/clang-arm-default-vfp3-on-armv7a.patch https://bugs.debian.org/841474 https://bugs.debian.org/842142 https://bugs.debian.org/914268 This results in the following build error when clang's integrated assembler is used because the '.arch' directive overrides the '.fpu' directive: arch/arm/crypto/curve25519-core.S:25:2: error: instruction requires: NEON vmov.i32 q0, raspberrypi#1 ^ arch/arm/crypto/curve25519-core.S:26:2: error: instruction requires: NEON vshr.u64 q1, q0, raspberrypi#7 ^ arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON vshr.u64 q0, q0, raspberrypi#8 ^ arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON vmov.i32 d4, raspberrypi#19 ^ Shuffle the order of the '.arch' and '.fpu' directives so that the code builds regardless of the default FPU mode. This has been tested against both clang with and without Debian's patch and GCC. Cc: [email protected] Fixes: d8f1308 ("crypto: arm/curve25519 - wire up NEON implementation") Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118 Reported-by: Arnd Bergmann <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Suggested-by: Jessica Clarke <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]>
Merged into mainline: https://git.kernel.org/torvalds/c/44200f2d9b8b This will find its way to the stable trees automatically. |
…ilds to LLVM=1 The fix for ClangBuiltLinux/linux#1355 has been merged into mainline but due to the nature of the merge window and the stable trees, we will not see that patch in the stable trees for at least two weeks (after 5.13-rc1). To move the build back to green, disable the integrated assembler for these files. As the patch trickles down into the Android trees, we can re-enable this. Signed-off-by: Nathan Chancellor <[email protected]>
cc @terceiro @ivoire
Since upgrading our builds of android kernels to use clang's integrated assembler for 32b ARM targets, our CI has been red with errors I cannot reproduce locally. example
All of the Android kernel tiles on https://clangbuiltlinux.github.io/ are demonstrating this issue.
It looks like from the log that the invocation of the build was:
Even if I checkout clang-12 (release/12.x branch of llvm-project) I cannot reproduce. Same for clang-11.
We do have a one off comment from @arndb about the error, but I think it might have been that CONFIG_THUMB2_KERNEL=y was enabled, which was not in our invocation of tuxmake.
Without being able to reproduce locally, I don't know whether there's an issue with ccache perhaps, or tuxmake not using the configs requested, or the wrong version of clang, or what.
The text was updated successfully, but these errors were encountered: