linux-stable/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 SPDX patches for 5.7-rc1. 2020-04-03 13:12:26 -07:00
aes-ce-core.S crypto: arm/aes-ce - work around Cortex-A57/A72 silion errata 2020-12-04 18:13:14 +11:00
aes-ce-glue.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
aes-cipher-core.S crypto: arm/aes-scalar - switch to common rev_l/mov_l macros 2021-03-19 21:59:46 +11:00
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 crypto: arm/blake2b - add NEON-accelerated BLAKE2b 2021-01-03 08:41:39 +11:00
blake2b-neon-glue.c crypto: arm/blake2b - drop unnecessary return statement 2021-03-07 15:13:14 +11:00
blake2s-core.S lib/crypto: blake2s: include as built-in 2022-01-07 00:25:25 +01:00
blake2s-glue.c lib/crypto: blake2s: include as built-in 2022-01-07 00:25:25 +01:00
chacha-glue.c crypto: arm/chacha-neon - add missing counter increment 2021-01-03 08:35:35 +11:00
chacha-neon-core.S crypto: arm/chacha-neon - optimize for non-block size multiples 2020-11-13 20:38:44 +11:00
chacha-scalar-core.S crypto: arm/chacha-scalar - switch to common rev_l macro 2021-03-19 21:59:46 +11:00
crc32-ce-core.S crypto: Replace HTTP links with HTTPS ones 2020-07-23 17:34:20 +10:00
crc32-ce-glue.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
crct10dif-ce-core.S crypto: arm - use Kconfig based compiler checks for crypto opcodes 2019-10-23 19:46:56 +11:00
crct10dif-ce-glue.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
curve25519-core.S crypto: arm/curve25519 - Move '.fpu' after '.arch' 2021-04-16 21:16:34 +10:00
curve25519-glue.c crypto: arm/curve25519 - rename 'mod_init' & 'mod_exit' functions to be module-specific 2021-07-16 15:49:35 +08:00
ghash-ce-core.S crypto: arm/ghash-ce - define fpu before fpu registers are referenced 2020-03-06 12:28:25 +11:00
ghash-ce-glue.c crypto: arm/ghash - use variably sized key struct 2020-07-09 22:14:33 +10:00
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 crypto: arm/poly1305 - incorporate OpenSSL/CRYPTOGAMS NEON implementation 2019-11-17 09:02:42 +08:00
poly1305-glue.c crypto: poly1305 - fix poly1305_core_setkey() declaration 2021-04-02 18:28:12 +11:00
sha1-armv4-large.S crypto: Replace HTTP links with HTTPS ones 2020-07-23 17:34:20 +10:00
sha1-armv7-neon.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sha1-ce-core.S crypto: arm - use Kconfig based compiler checks for crypto opcodes 2019-10-23 19:46:56 +11:00
sha1-ce-glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha1.h crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha1_glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha1_neon_glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha2-ce-core.S crypto: arm - use Kconfig based compiler checks for crypto opcodes 2019-10-23 19:46:56 +11:00
sha2-ce-glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha256-armv4.pl crypto: arm/sha256-neon - avoid ADRL pseudo instruction 2020-09-25 17:48:13 +10:00
sha256_glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha256_glue.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sha256_neon_glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha512-armv4.pl crypto: arm/sha512-neon - avoid ADRL pseudo instruction 2020-09-25 17:48:14 +10:00
sha512-glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha512-neon-glue.c crypto: sha - split sha.h into sha1.h and sha2.h 2020-11-20 14:45:33 +11:00
sha512.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00