Google+ ZACARÉS: OpenSSL Heartbleed bug updates - compile openssl 1.0.1g using TDM-GCC

Translate

2014/04/12

OpenSSL Heartbleed bug updates - compile openssl 1.0.1g using TDM-GCC

Due to the OpenSSL Heartbleed issue, you should update openssl to the latest 1.0.1g. But searching the web, there is no suitable precompile version for Windows that suit my need. So I have to get my hand dirty to compile by myself.

To compile, you need the following tools on hand.
I've install the above stuff into the following folders respectively.
  • ActivePerl: c:\dev\perl
  • TDM-GCC: c:\dev\tdm\x32
  • TDM64-GCC: c:\dev\tdm\x64
  • MSYS: c:\dev\msys
Of course, you will need to have openssl-1.0.1g.tar.gz and I've placed it under c:\dev\openssl.


All the steps below should be carried out inside the MSYS prompt, so you need to start MSYS first by double-click the msys.bat inside MSYS installation folder.

export PATHBACKUP=$PATH
export PATH="/c/dev/tdm/x32/bin:/c/dev/perl/bin:$PATHBACKUP"
cd "/c/dev/openssl"
tar -zxvf openssl-1.0.1g.tar.gz
mv openssl-1.0.1g x32
cd x32
./Configure --prefix=$PWD/dist no-idea no-mdc2 no-rc5 shared mingw
make depend && make && make install

export PATH="/c/dev/tdm/x64/bin:/c/dev/perl/bin:$PATHBACKUP"
cd "/c/dev/openssl"
tar -zxvf openssl-1.0.1g.tar.gz
mv openssl-1.0.1g x64
cd x32
./Configure --prefix=$PWD/dist no-idea no-mdc2 no-rc5 shared mingw64
make depend && make && make install

NOTE: You should not extract the openssl-1.0.1g.tar.gz with any archiver, e.g. 7zip under Windows. You should extract using the tar command inside MSYS prompt instead.

The reason why I need to have both TDM64-GCC and TDM-GCC is that I cannot find a way to tell MSYS to use x32 libraries and toolchains with TDM64-GCC. The work around is to set the PATH for different toolchains folder with different architectures.

If you don't want to compiled by yourself, you may download my precompiled openssl-1.0.1g-tdm-tdm64.7z which use tdm-gcc to build with both x32 and x64 libraries included.

Name :openssl-1.0.1g-tdm-tdm64.7z
Size :3715883 bytes
MD5  :A9D23198AA4F6A41DA7954AB7CE8ABFE
SHA1 :9E225DAA6A793618009CFD729420AD5CDEB0A38D



No comments:

Post a Comment