Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17eaba5c authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Lee Jones
Browse files

UPSTREAM: crypto: arm/curve25519 - Move '.fpu' after '.arch'

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, #7
 ^
arch/arm/crypto/curve25519-core.S:27:2: error: instruction requires: NEON
 vshr.u64 q0, q0, #8
 ^
arch/arm/crypto/curve25519-core.S:28:2: error: instruction requires: NEON
 vmov.i32 d4, #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.

Bug: 254441685
Cc: stable@vger.kernel.org
Fixes: d8f1308a025f ("crypto: arm/curve25519 - wire up NEON implementation")
Link: https://github.com/ClangBuiltLinux/continuous-integration2/issues/118


Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
Suggested-by: default avatarJessica Clarke <jrtc27@jrtc27.com>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Acked-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Tested-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
(cherry picked from commit 44200f2d9b8b52389c70e6c7bbe51e0dc6eaf938)
Signed-off-by: default avatarLee Jones <joneslee@google.com>
Change-Id: I2a55fa2141daa99e4ee259acd0660f505c3415ce
parent 4d69883e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment