[PATCH libgcypt 2/2] cipher/poly1305: Fix 32-bit x86 compilation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH libgcypt 2/2] cipher/poly1305: Fix 32-bit x86 compilation

GnuPG - Dev mailing list
* 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

_______________________________________________
Gnupg-devel mailing list
[hidden email]
http://lists.gnupg.org/mailman/listinfo/gnupg-devel