diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-04-11 09:32:34 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-04-13 00:09:11 -0400 |
commit | 3abafaf2192b1712079edfd4232b19877d6f41a5 (patch) | |
tree | ddc0c6456b60f130a94dd2c86e0832292221e512 | |
parent | b48321def4c506057e22845f8e0dcdce2214dbfa (diff) |
crypto: arm - workaround for building with old binutils
Old versions of binutils (before 2.23) do not yet understand the
crypto-neon-fp-armv8 fpu instructions, and an attempt to build these
files results in a build failure:
arch/arm/crypto/aes-ce-core.S:133: Error: selected processor does not support ARM mode `vld1.8 {q10-q11},[ip]!'
arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aese.8 q0,q8'
arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aesmc.8 q0,q0'
arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aese.8 q0,q9'
arch/arm/crypto/aes-ce-core.S:133: Error: bad instruction `aesmc.8 q0,q0'
Since the affected versions are still in widespread use, and this breaks
'allmodconfig' builds, we should try to at least get a successful kernel
build. Unfortunately, I could not come up with a way to make the Kconfig
symbol depend on the binutils version, which would be the nicest solution.
Instead, this patch uses the 'as-instr' Kbuild macro to find out whether
the support is present in the assembler, and otherwise emits a non-fatal
warning indicating which selected modules could not be built.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: http://storage.kernelci.org/next/next-20150410/arm-allmodconfig/build.log
Fixes: 864cbeed4ab22d ("crypto: arm - add support for SHA1 using ARMv8 Crypto Instructions")
[ard.biesheuvel:
- omit modules entirely instead of building empty ones if binutils is too old
- update commit log accordingly]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | arch/arm/crypto/Makefile | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/arch/arm/crypto/Makefile b/arch/arm/crypto/Makefile index ef46e898f98b..6ea828241fcb 100644 --- a/arch/arm/crypto/Makefile +++ b/arch/arm/crypto/Makefile | |||
@@ -4,14 +4,25 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o | 5 | obj-$(CONFIG_CRYPTO_AES_ARM) += aes-arm.o |
6 | obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o | 6 | obj-$(CONFIG_CRYPTO_AES_ARM_BS) += aes-arm-bs.o |
7 | obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o | ||
8 | obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o | 7 | obj-$(CONFIG_CRYPTO_SHA1_ARM) += sha1-arm.o |
9 | obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o | 8 | obj-$(CONFIG_CRYPTO_SHA1_ARM_NEON) += sha1-arm-neon.o |
10 | obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o | 9 | obj-$(CONFIG_CRYPTO_SHA256_ARM) += sha256-arm.o |
11 | obj-$(CONFIG_CRYPTO_SHA512_ARM_NEON) += sha512-arm-neon.o | 10 | obj-$(CONFIG_CRYPTO_SHA512_ARM_NEON) += sha512-arm-neon.o |
12 | obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o | 11 | |
13 | obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o | 12 | ce-obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o |
14 | obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o | 13 | ce-obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o |
14 | ce-obj-$(CONFIG_CRYPTO_SHA2_ARM_CE) += sha2-arm-ce.o | ||
15 | ce-obj-$(CONFIG_CRYPTO_GHASH_ARM_CE) += ghash-arm-ce.o | ||
16 | |||
17 | ifneq ($(ce-obj-y)$(ce-obj-m),) | ||
18 | ifeq ($(call as-instr,.fpu crypto-neon-fp-armv8,y,n),y) | ||
19 | obj-y += $(ce-obj-y) | ||
20 | obj-m += $(ce-obj-m) | ||
21 | else | ||
22 | $(warning These ARMv8 Crypto Extensions modules need binutils 2.23 or higher) | ||
23 | $(warning $(ce-obj-y) $(ce-obj-m)) | ||
24 | endif | ||
25 | endif | ||
15 | 26 | ||
16 | aes-arm-y := aes-armv4.o aes_glue.o | 27 | aes-arm-y := aes-armv4.o aes_glue.o |
17 | aes-arm-bs-y := aesbs-core.o aesbs-glue.o | 28 | aes-arm-bs-y := aesbs-core.o aesbs-glue.o |