Skip Menu |

This queue is for tickets about the Net-SSLeay CPAN distribution.

Report information
The Basics
Id: 75960
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Net-SSLeay

People
Owner: MIKEM [...] cpan.org
Requestors: kmx [...] volny.cz
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Strawberry perl does not work correctly with OPENSSL_PREFIX
Date: Thu, 22 Mar 2012 09:48:32 +0100
To: bug-Net-SSLeay [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
This is not critical bug as it affects only users trying to use strawberry perl with other openssl version than strawberry perl comes with (which is what I am trying now). I want just to record info I have gathered. Sample scenario: Z:\Net-SSleay-src> set OPENSSL_PREFIX=z:/dev_openssl/gcc32-1.0.1-beta3 Z:\Net-SSleay-src> perl Makefile.PL Z:\Net-SSleay-src> dmake test Will end up with openssl (1.0.1) DLL not found (or worse loading DLL from wrong openssl version) Workaround for this is: Z:\Net-SSleay-src> set OPENSSL_PREFIX=z:/dev_openssl/gcc32-1.0.1-beta3 Z:\Net-SSleay-src> set PATH=z:\dev_openssl\gcc32-1.0.1-beta3\bin;%PATH% Z:\Net-SSleay-src> perl Makefile.PL Z:\Net-SSleay-src> dmake test However we still have an issue as the resulting SSLeay.DLL is wrongly linked (unfortunately without an error, unfortunately it is "somehow" working) The trouble is with linker option detection routines passes the following LIBS option to ExtUtils::MakeMaker: LIBS => [q[-Lz:/dev_openssl/gcc32-1.0.1-beta3 -Lz:/dev_openssl/gcc32-1.0.1-beta3/lib -Lz:/dev_openssl/gcc32-1.0.1-beta3/out32dll -Lz:/dev_openssl/gcc32-1.0.1-beta3/lib/VC -llibeay32MD -lssleay32MD -llibeay32 -lssleay32 -llibssl32]] which subsequently ExtUtils::MakeMaker turns into this g++ command (added newlines to make it more clear): g++ -o blib\arch\auto\Net\SSLeay\SSLeay.dll -Wl,--base-file -Wl,dll.base -mdll -s -L"Z:\strawberry32\perl\lib\CORE" -L"Z:\strawberry32\c\lib" SSLeay.o Z:\strawberry32\perl\lib\CORE\libperl514.a z:\dev_openssl\gcc32-1.0.1-beta3\lib\libeay32.a Z:\strawberry32\c\lib\libssleay32.a <<<<<<< this is a trouble z:\dev_openssl\gcc32-1.0.1-beta3\lib\libssl32.a Z:\strawberry32\c\i686-w64-mingw32\lib\libmoldname.a Z:\strawberry32\c\i686-w64-mingw32\lib\libkernel32.a ... many other Win32 related *.a Z:\strawberry32\c\i686-w64-mingw32\lib\libcomctl32.a dll.exp The workaroud was to temporarily remove/rename Z:\strawberry32\c\lib\libssleay32.a The proper fix should be IMHO improving library detection routine SSLeay() in ext/Module/Install/PRIVATE/Net/SSLeay.pm Unfortunately the fix will not be easy due to chaos in naming of libraries (*.a) for Win32+gcc/mingw. The trouble is that openssl has 2 different way for building MSWindows/gcc libraries - one via Configure+make; the second via mingw32.bat. Unfortunately each way creates *.a files with different names */ Configure+make creates - libcrypto.dll.a - libcrypto.a - libssl.dll.a - libssl.a */ mingw32.bat creates - libeay32.a (= libcrypto.dll.a) - libcrypto.a - libssl32.a (= libssl.dll.a) - libssl.a On top of that you have also MS compiler (cl/msvc) in MS Windows world which uses also different library names: libeay32*.lib ssleay32*.lib (from here probably comes "-lssleay32 -llibeay32" and "-llibeay32MD -lssleay32MD" which should be fine with MS compiler). Things get a little bit more complicated by the fact that the more-or-less official openssl Win32 binaries distribution (see http://www.openssl.org/related/binaries.html) contains also mingw/gcc *.a libraries - however named: libeay32.a + ssleay32.a (which does not correspond to the results produced by the mingw.bat from official openssl tarball). Please note that ssleay32.a is not libssleay32.a thus gcc linker will not find it when given -lssleay32 On top of that strawberry perl duplicates libssl32.a to libssleay32.a to satisfy some perl modules with hardcoded -lssleay32 options (this is exactly the reason of the troubles above) -- kmx P.S. The good news is that Net::SSLeay svn rev324 builds fine + passes all tests with openssl-1.0.1-beta3
Subject: Re: [rt.cpan.org #75960] AutoReply: Strawberry perl does not work correctly with OPENSSL_PREFIX
Date: Thu, 29 Mar 2012 13:56:49 +0200
To: bug-Net-SSLeay [...] rt.cpan.org
From: kmx <kmx [...] volny.cz>
See enclosed fix

Message body is not shown because sender requested not to inline it.

Just a note - after applying the patch above it is necessary to delete inc dir and regenerate it by running Makefile.PL

--
kmx

Subject: Re: [rt.cpan.org #75960] Strawberry perl does not work correctly with OPENSSL_PREFIX
Date: Mon, 02 Apr 2012 18:39:23 +1000
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] open.com.au>
Thanks, committed in 334. Cheers. On Monday, April 02, 2012 03:14:15 AM you wrote: Show quoted text
> Queue: Net-SSLeay > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=75960 > > > Just a note - after applying the patch above it is necessary to delete inc > dir and regenerate it by running Makefile.PL > > -- > kmx
-- Mike McCauley mikem@open.com.au Open System Consultants Pty. Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au Phone +61 7 5598-7474 Fax +61 7 5598-7070 Radiator: the most portable, flexible and configurable RADIUS server anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald, Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS, TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP, DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.