Open nabla-c0d3 opened 8 years ago
Hi @nabla-c0d3 , are you using the most recent version ? There was a change around a week ago (?) which improved the build process for VS ?
Yes I did; the line causing the problem is this one: https://github.com/PeterMosmans/openssl/blob/1.0.2-chacha/crypto/evp/e_chacha20poly1305.c#L51 For various reasons I have to use Visual Studio 9.0, which doesn't have stdint.h (it was added to VS 10.0). However, the official OpenSSL 1.0.2 builds fine with it. Thanks!
Could you check whether you can compile with either a 'standard' stdint.h (see e.g. http://msinttypes.googlecode.com/svn/trunk/stdint.h ), or monkey-patch the offending lines like this ? These are probably the only types necessary...
#if (_MSC_VER == 1500)
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
If it works, I'll patch the 'official' version. Thanks in advance
I got 32 bits builds to work (and will open a pull request) but it's still failing for Windows 64 bits:
Building OpenSSL
perl .\util\copy-if-different.pl ".\crypto\buildinf.h" "tmp32\buildinf.h"
Copying: ./crypto/buildinf.h to tmp32/buildinf.h
perl .\util\copy-if-different.pl ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h"
NOT copying: ./crypto/opensslconf.h to inc32/openssl/opensslconf.h
cl /Fotmp32\chacha_vec.obj -Iinc32 -Itmp32 -DZLIB_WINAPI /MT /Ox -DZLIB -DOPENSSL_THREADS -DDSO_WIN32 -DZLIB_
WINAPI -W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_
NO_DEPRECATE -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_
ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DOPENSSL_NO
_KRB5 -DOPENSSL_NO_JPAKE -DZLIB -DOPENSSL_NO_DYNAMIC_ENGINE -IC:\Users\user\Documents\builds\nassl64\zlib-1.2.8 /Zl /Zi
/Fdtmp32/lib -c .\crypto\chacha\chacha_vec.c
chacha_vec.c
.\crypto\chacha\chacha_vec.c(74) : error C2061: syntax error : identifier '__attribute__'
.\crypto\chacha\chacha_vec.c(74) : error C2059: syntax error : ';'
.\crypto\chacha\chacha_vec.c(74) : error C2143: syntax error : missing ')' before 'constant'
.\crypto\chacha\chacha_vec.c(74) : error C2143: syntax error : missing ')' before 'constant'
.\crypto\chacha\chacha_vec.c(127) : fatal error C1189: #error : -- Implementation supports only machines with neon or S
SE2
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.EXE"' : return code '0x2
'
Stop.
I can get rid of the __attribute__
syntax error using a #define but not sure what to do about the fatal error.
Hmm, the current ChaCha implementation needs either ARM neon or SSE2 extensions. On what type of (processor) architecture are you building ? SSE2 should be 'fairly common' since 2003 ?
The usual Windows 7 64 bits VM. I think the giant #if / #else in this file is just wrong or missing a case for win64?
I looked at what's on the OpenSSL 1.1.0 branch but that file is gone there.
Yeah, that's the reason this fork is created :wink: - Weird, as it compiles perfect on Windows/MSYS , and with newer Visual Studios. I'll look into it later this week, thanks for troubleshooting so far
Issue closed for x86, still open for x64
Hello Peter,
Have you made any headway on the x64 build? I am still getting this issue with both VS2012 and VS2015. I have no issue building x86 but the x64 build will fail.
Hi @irakhlin - openssl-1.0.2 compiles successfully on msys2 / mingw(64) on Windows. Today I added continuous integation using Appveyor to check other platforms (VS2012 / 2015 / ...) - see https://ci.appveyor.com/project/PeterMosmans/openssl/build/1.0.2
So now I can finally reproduce your issues.. stay tuned !
Thank you for the prompt reply! I can indeed build x86/x64 versions using both msys2 and mingw64 without any issue. I am building with VS2012/2015 because I am hoping to use the built library files to link for http://tomcat.apache.org/native-doc (tomcat-native) to run in a windows native version of tomcat. I have been able to do this thus far with Linux x86/x64 and windows x86. The result seems to be a working version of tomcat w/ chacha ciphers!
If you need any help testing please let me know.
Ouch, the MSVS compiler doesn't support the __attribute__
syntax. I fiddled around, but this isn't easy to rewrite. Allow me some more time to look further into it..
Hi, I'd like to use your fork of OpenSSL for an SSL scanner I'm working on, but I'm getting a build error when targeting Windows 32 bits with Visual Studio (for 1.0.2-chacha):
It looks like stdint.h does not exist within Visual Studio, but I do not know how OpenSSL usually handles this. Is there a tag or commit that is known to build fine with Visual Studio ? Thanks!