Page MenuHome GnuPG

0001-cipher-sha512.c-fix-build-without-arm-neon-asm.patch

Authored By
ffontaine
Jan 22 2021, 10:18 PM
Size
2 KB
Subscribers
None

0001-cipher-sha512.c-fix-build-without-arm-neon-asm.patch

From 3547170ed2913da00b94e74e5df23add00b6b75a Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri, 22 Jan 2021 11:29:11 +0100
Subject: [PATCH] cipher/sha512.c: fix build without arm neon asm
Build is broken since commit
8a44c55d2fb758f726b8b436aa5c0b88a6c6f112 because
_gcry_sha512_transform_armv7_neon is undefined when !USE_ARM_NEON_ASM
but it is used as soon as USE_ARM_ASM is defined resulting in the
following build failure:
/bin/bash ../libtool --tag=CC --mode=link /home/giuliobenetti/autobuild/run/instance-0/output-1/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -o mpicalc mpicalc-mpicalc.o libgcrypt.la -lgpg-error
libtool: link: /home/giuliobenetti/autobuild/run/instance-0/output-1/host/bin/arm-linux-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fvisibility=hidden -fno-delete-null-pointer-checks -Wall -o mpicalc mpicalc-mpicalc.o ./.libs/libgcrypt.so -lgpg-error -Wl,-rpath -Wl,/home/giuliobenetti/autobuild/run/instance-0/output-1/build/libgcrypt-1.9.0/src/.libs
/home/giuliobenetti/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ./.libs/libgcrypt.so: undefined reference to `_gcry_sha512_transform_armv7_neon'
To fix this build failure, replace USE_ARM_ASM by USE_ARM_NEON_ASM
Fixes:
- http://autobuild.buildroot.org/results/341e720e9e3fcdaaa7e30f02fe2c26d145653240
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
cipher/sha512.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/cipher/sha512.c b/cipher/sha512.c
index f70cdf42..4afd9381 100644
--- a/cipher/sha512.c
+++ b/cipher/sha512.c
@@ -66,13 +66,6 @@
#endif /*ENABLE_NEON_SUPPORT*/
-/* USE_ARM_ASM indicates whether to enable ARM assembly code. */
-#undef USE_ARM_ASM
-#if defined(__ARMEL__) && defined(HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS)
-# define USE_ARM_ASM 1
-#endif
-
-
/* USE_SSSE3 indicates whether to compile with Intel SSSE3 code. */
#undef USE_SSSE3
#if defined(__x86_64__) && defined(HAVE_GCC_INLINE_ASM_SSSE3) && \
@@ -282,7 +275,7 @@ do_sha512_transform_i386_ssse3(void *ctx, const unsigned char *data,
#endif
-#ifdef USE_ARM_ASM
+#ifdef USE_ARM_NEON_ASM
unsigned int _gcry_sha512_transform_arm (SHA512_STATE *hd,
const unsigned char *data,
const u64 k[], size_t num_blks);
@@ -495,7 +488,7 @@ sha512_224_init (void *context, unsigned int flags)
-#ifndef USE_ARM_ASM
+#ifndef USE_ARM_NEON_ASM
static inline u64
ROTR (u64 x, u64 n)
@@ -764,7 +757,7 @@ do_transform_generic (void *context, const unsigned char *data, size_t nblks)
return (8 + 16) * sizeof(u64) + sizeof(u32) + 3 * sizeof(void*);
}
-#endif /*!USE_ARM_ASM*/
+#endif /*!USE_ARM_NEON_ASM*/
/* The routine final terminates the computation and
--
2.29.2

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1345335

Event Timeline