[PATCH libgcypt 2/2] cipher/poly1305: Fix 32-bit x86 compilation
David Michael
fedora.dm0 at gmail.com
Thu Jan 21 20:58:26 CET 2021
* cipher/poly1305.c [HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS]: Also
conditionalize on whether __arm__ is defined.
--
When building for i686, configure detects that the assembler can
use the different architectures, so it defined everything under the
HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS conditional block. Since that
block is first and the following x86 block only defines UMUL_ADD_32
if it's not already defined, the lto-wrapper failed during linking
with a pile of "no such instruction: umlal ..." errors. Gating on
__arm__ prevents that initial defintion and fixes the errors.
---
cipher/poly1305.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cipher/poly1305.c b/cipher/poly1305.c
index 6cb4d2b7..d9706ced 100644
--- a/cipher/poly1305.c
+++ b/cipher/poly1305.c
@@ -289,7 +289,7 @@ static unsigned int poly1305_final (poly1305_context_t *ctx,
#ifdef USE_MPI_32BIT
-#ifdef HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS
+#if defined (__arm__) && defined (HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS)
/* HI:LO += A * B (arm) */
#define UMUL_ADD_32(HI, LO, A, B) \
@@ -308,7 +308,7 @@ static unsigned int poly1305_final (poly1305_context_t *ctx,
: "r" (B0), "r" (B1), "r" (B2), "r" (B3), "r" (B4) \
: "cc" )
-#endif /* HAVE_COMPATIBLE_GCC_ARM_PLATFORM_AS */
+#endif /* __arm__ */
#if defined (__i386__) && __GNUC__ >= 4
--
2.26.2
More information about the Gnupg-devel
mailing list