From f44aa68a265bb27d9c8c23585f8a2723a27124c5 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 31 Oct 2014 15:48:19 -0400 Subject: [PATCH] Fix standalone Win64 build. generic.c still needs to include generic implementations in Win64. Those are currently done with inline assembly and won't work on MSVC. Change-Id: Ifeb5470872d8c97b2ccffeae6f3ccb5661051de3 Reviewed-on: https://boringssl-review.googlesource.com/2102 Reviewed-by: Adam Langley --- crypto/bn/asm/x86_64-gcc.c | 2 ++ crypto/bn/generic.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crypto/bn/asm/x86_64-gcc.c b/crypto/bn/asm/x86_64-gcc.c index be119aab..1de0f425 100644 --- a/crypto/bn/asm/x86_64-gcc.c +++ b/crypto/bn/asm/x86_64-gcc.c @@ -56,6 +56,8 @@ * machine. */ + /* TODO(davidben): Get this file working on Windows x64. */ + #undef mul #undef mul_add diff --git a/crypto/bn/generic.c b/crypto/bn/generic.c index c60cfd97..52aad8e0 100644 --- a/crypto/bn/generic.c +++ b/crypto/bn/generic.c @@ -61,8 +61,13 @@ #include "internal.h" +/* Generic implementations of most operations are needed for: + * - Configurations without inline assembly. + * - Architectures other than x86 or x86_64. + * - Windows x84_64; x86_64-gcc.c does not build on MSVC. */ #if defined(OPENSSL_NO_ASM) || \ - (!defined(OPENSSL_X86_64) && !defined(OPENSSL_X86)) + (!defined(OPENSSL_X86_64) && !defined(OPENSSL_X86)) || \ + (defined(OPENSSL_X86_64) && defined(OPENSSL_WINDOWS)) #if defined(OPENSSL_WINDOWS) #define alloca _alloca