linux-bl808/arch/arm/crypto
Nathan Chancellor 2f62847cf6 ARM: 9287/1: Reduce __thumb2__ definition to crypto files that require it
Commit 1d2e9b67b0 ("ARM: 9265/1: pass -march= only to compiler") added
a __thumb2__ define to ASFLAGS to avoid build errors in the crypto code,
which relies on __thumb2__ for preprocessing. Commit 59e2cf8d21 ("ARM:
9275/1: Drop '-mthumb' from AFLAGS_ISA") followed up on this by removing
-mthumb from AFLAGS so that __thumb2__ would not be defined when the
default target was ARMv7 or newer.

Unfortunately, the second commit's fix assumes that the toolchain
defaults to -mno-thumb / -marm, which is not the case for Debian's
arm-linux-gnueabihf target, which defaults to -mthumb:

  $ echo | arm-linux-gnueabihf-gcc -dM -E - | grep __thumb
  #define __thumb2__ 1
  #define __thumb__ 1

This target is used by several CI systems, which will still see
redefined macro warnings, despite '-mthumb' not being present in the
flags:

  <command-line>: warning: "__thumb2__" redefined
  <built-in>: note: this is the location of the previous definition

Remove the global AFLAGS __thumb2__ define and move it to the crypto
folder where it is required by the imported OpenSSL algorithms; the rest
of the kernel should use the internal CONFIG_THUMB2_KERNEL symbol to
know whether or not Thumb2 is being used or not. Be sure that __thumb2__
is undefined first so that there are no macro redefinition warnings.

Link: https://github.com/ClangBuiltLinux/linux/issues/1772

Reported-by: "kernelci.org bot" <bot@kernelci.org>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Fixes: 59e2cf8d21 ("ARM: 9275/1: Drop '-mthumb' from AFLAGS_ISA")
Fixes: 1d2e9b67b0 ("ARM: 9265/1: pass -march= only to compiler")
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2023-01-23 14:31:18 +00:00
..
.gitignore
aes-ce-core.S
aes-ce-glue.c
aes-cipher-core.S
aes-cipher-glue.c crypto: Prepare to move crypto_tfm_ctx 2022-12-02 18:12:40 +08:00
aes-neonbs-core.S crypto: arm/aes-neonbs-ctr - deal with non-multiples of AES block size 2022-02-05 15:10:51 +11:00
aes-neonbs-glue.c crypto: arm/aes-neonbs-ctr - deal with non-multiples of AES block size 2022-02-05 15:10:51 +11:00
blake2b-neon-core.S
blake2b-neon-glue.c
blake2s-core.S
blake2s-glue.c
chacha-glue.c
chacha-neon-core.S
chacha-scalar-core.S
crc32-ce-core.S
crc32-ce-glue.c
crct10dif-ce-core.S
crct10dif-ce-glue.c
curve25519-core.S
curve25519-glue.c
ghash-ce-core.S
ghash-ce-glue.c
Kconfig crypto: move gf128mul library into lib/crypto 2022-11-11 18:14:59 +08:00
Makefile ARM: 9287/1: Reduce __thumb2__ definition to crypto files that require it 2023-01-23 14:31:18 +00:00
nh-neon-core.S crypto: arm/nhpoly1305 - eliminate unnecessary CFI wrapper 2022-11-25 17:39:19 +08:00
nhpoly1305-neon-glue.c crypto: arm/nhpoly1305 - eliminate unnecessary CFI wrapper 2022-11-25 17:39:19 +08:00
poly1305-armv4.pl
poly1305-glue.c
sha1-armv4-large.S
sha1-armv7-neon.S
sha1-ce-core.S
sha1-ce-glue.c
sha1.h
sha1_glue.c
sha1_neon_glue.c
sha2-ce-core.S
sha2-ce-glue.c
sha256-armv4.pl
sha256_glue.c
sha256_glue.h
sha256_neon_glue.c
sha512-armv4.pl
sha512-glue.c
sha512-neon-glue.c
sha512.h