[erlang-bugs] Unable to build OTP with static crypto for Win32

Patrik Nyblom pan@REDACTED
Fri Dec 7 16:45:50 CET 2012


Hi!

Oh, I think I mislead you with variables from my weirdly set up 
development machine. Using the build instructions, you will only get 
static libraries with that OpenSSL version, libraries named libeay32.lib 
and ssleay32.lib. Look in the Makefile, what it has found out, and check 
that those libraries are present. Check that the found files have the 
approximate right size (see below). Then clean and rebuild everything, 
don't forget otp_build release and otp_build installer_win32. Send a 
link to the new build log if it still fails.

You should see libraries in e.g. /c/OpenSSL with approximately the 
following sizes (on win32):
libeay32.lib: 3,921 KB
ssleay32.lib: 706 KB
or (on win64)
libeay32.lib: 5243 KB
ssleay32.lib: 884 KB

- while dynamic libraries would be much smaller, for example the dynamic 
libraries I have on my development machines are only 756 end 56 KB 
respectively.

Cheers,
/Patrik

On 12/07/2012 03:12 PM, Dave Cottlehuber wrote:
> Hi Patrik!
>
> Thanks for making the entire build chain work on mingw, it is
> noticeably faster than cygwin for building OTP for me.
>
>>> As far as I can tell, I'm configuring correctly with
>>> `--disable-dynamic-ssl-lib` but the resulting installer doesn't
>>> function without the two OpenSSL DLLs present. In fact, I've never had
>>> this working, ever. Is it actually possible?
> Please accept my apologies, what I should have said was "I'm not able
> to create an OTP release that supports static OpenSSL"!
>
> I'm doing almost the same as OTP, just with the assembler
> optimisations using nasm instead of the MS non-optimised one..
>
>      https://github.com/dch/glazier/blob/master/bin/build_openssl.cmd#L26-L30
>
>> $ERL_TOP/HOWTO/INSTALL-WIN32.md, you have a huge instruction on how to build
>> a static OpenSSL lib using the MSVC command prompt. You then use that static
>> lib in your build of Erlang/OTP. You will never need to install any OpenSSL
>> dynamic libs. Verify that you got the lib files and that the correct OpenSSL
>> installation reside in the directory where configure think it  should be (in
>> your case /c/OpenSSL) . You can point out the correct installation directory
>> during configure (otp_build configure --with-ssl-dir=...) Then *clean the
>> crypto application* (cd lib/crypto && make clean), the build logs you
>> provide does not rebuild so it's hard to see if the build does the right
>> thing. Then do do otp_build configure, otp_build boot -a , otp_build release
>> -a  and otp_build installer_win32.
>> Also, if you look at lib/crypto/c_src/win32/Makefile after configure is run
>> , you should see lines looking like:
>> SSL_LIBDIR = /c/OpenSSL/lib/VC/static
>> SSL_CRYPTO_LIBNAME = libeay32MD
>>
>> etc.
>> Verify that there are files named i.e.
>> /c/OpenSSL/lib/VC/static/libeay32MD.lib on your system.
> Aha. This appears to be the issue, I don't have MD.lib.
>
> Reverting to following the OTP instructions verbatim, on a fresh
> VS2012  & 0.9.8r still doesn't produce the required files, nor using
> SDK 7.1 either.
>
> I've been using a script to build OpenSSL, and the only difference is
> that I've called `call ms\do_nasm` instead of your `ms\do_ms`. Both
> have same result.
>
> Any suggestions on what I might be missing?
>
> A+
> Dave




More information about the erlang-bugs mailing list