Skip Menu |

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

Report information
The Basics
Id: 98897
Status: resolved
Priority: 0/
Queue: Net-SSLeay

People
Owner: MIKEM [...] cpan.org
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.66
Fixed in: 1.67



Subject: [PATCH] Bad sequence when OPENSSL_PREFIX is used
Consider a system that has multiple versions of OpenSSL installed. When using OPENSSL_PREFIX, it is used to *add* the library path(s) to the required build options and flags, causing a bad call when libraries of a different version are found *before* the version required by OPENSSL_PREFIX. Without the patch: $ echo "n" | perl Makefi le.PL ; grep -- -L Makefile *** Found OpenSSL-1.0.1i installed in /usr/local/ssl *** Be sure to use the same compiler and options to compile your OpenSSL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. Do you want to run external tests? These tests *will* *fail* if you do not have network connectivity. [n] Generating a Unix-style Makefile Writing Makefile for Net::SSLeay Writing MYMETA.yml and MYMETA.json # LIBS => [q[-L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz]] # These definitions are from config.sh (via /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/Config.pm). LDDLFLAGS = -b +vnocompatwarnings -L/pro/local/lib -L/usr/lib/hpux64 LDFLAGS = -L/pro/local/lib +DD64 -L/usr/lib/hpux64 SITEARCHEXP = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld INSTALLARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld INSTALLSITEARCH = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld PERL_ARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld PERL_INC = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE EXTRALIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz LDLOADLIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="IA64.ARCHREV_0-LP64-ld-5.14" />' >> $(DISTNAME).ppd Note that LDDLFLAGS and LDFLAGS have -L options that, when building, will be placed *IN FRONT OF* what is denoted in EXTRALIBS. If - in this case - /pro/local/lib or /usr/lib/hpux64 feature a libcrypto.so that matches the architecture but not the version (e.g. 0.9.7 or 0.9.8 when compiling against 1.0.1), the build will fail. The patch below will force the required library paths to precede the default path $ echo "n" | perl Makefi le.PL ; grep -- -L Makefile *** Found OpenSSL-1.0.1i installed in /usr/local/ssl *** Be sure to use the same compiler and options to compile your OpenSSL, perl, and Net::SSLeay. Mixing and matching compilers is not supported. Do you want to run external tests? These tests *will* *fail* if you do not have network connectivity. [n] Generating a Unix-style Makefile Writing Makefile for Net::SSLeay Writing MYMETA.yml and MYMETA.json # LDDLFLAGS => q[-b +vnocompatwarnings -L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib -L/usr/lib/hpux64] # LDFLAGS => q[-L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib +DD64 -L/usr/lib/hpux64] # LIBS => [q[-L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz]] # These definitions are from config.sh (via /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/Config.pm). LDDLFLAGS = -b +vnocompatwarnings -L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib -L/usr/lib/hpux64 LDFLAGS = -L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib +DD64 -L/usr/lib/hpux64 SITEARCHEXP = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld INSTALLARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld INSTALLSITEARCH = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld PERL_ARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld PERL_INC = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE EXTRALIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz LDLOADLIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz $(NOECHO) $(ECHO) ' <ARCHITECTURE NAME="IA64.ARCHREV_0-LP64-ld-5.14" />' >> $(DISTNAME).ppd --8<--- --- inc/Module/Install/PRIVATE/Net/SSLeay.pm.org 2014-09-15 15:02:54 +0200 +++ inc/Module/Install/PRIVATE/Net/SSLeay.pm 2014-09-15 15:02:57 +0200 @@ -140,6 +140,10 @@ EOM } } + if (my $lp = join " " => map { "-L$_" } @{$opts->{lib_paths} || []}) { + my $mma = $self->makemaker_args; + ($mma->{uc $_} = $Config{$_}) =~ s/-L/$lp -L/ for qw( lddlflags ldflags ); + } return $opts; } -->8---
Subject: Re: [rt.cpan.org #98897] [PATCH] Bad sequence when OPENSSL_PREFIX is used
Date: Thu, 18 Sep 2014 11:41:55 +1000
To: bug-Net-SSLeay [...] rt.cpan.org
From: Mike McCauley <mikem [...] airspayce.com>
Thanks for the patch Its now in SVN 427 Cheers. On Monday, September 15, 2014 09:04:21 AM you wrote: Show quoted text
> Mon Sep 15 09:04:20 2014: Request 98897 was acted upon. > Transaction: Ticket created by HMBRAND > Queue: Net-SSLeay > Subject: [PATCH] Bad sequence when OPENSSL_PREFIX is used > Broken in: 1.66 > Severity: Critical > Owner: Nobody > Requestors: HMBRAND@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=98897 > > > > Consider a system that has multiple versions of OpenSSL installed. > > When using OPENSSL_PREFIX, it is used to *add* the library path(s) to the > required build options and flags, causing a bad call when libraries of a > different version are found *before* the version required by > OPENSSL_PREFIX. > > Without the patch: > > $ echo "n" | perl Makefi > le.PL ; grep -- -L Makefile > *** Found OpenSSL-1.0.1i installed in /usr/local/ssl > *** Be sure to use the same compiler and options to compile your OpenSSL, > perl, and Net::SSLeay. Mixing and matching compilers is not supported. Do > you want to run external tests? > These tests *will* *fail* if you do not have network connectivity. [n] > Generating a Unix-style Makefile Writing Makefile for Net::SSLeay > Writing MYMETA.yml and MYMETA.json > # LIBS => [q[-L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz]] > # These definitions are from config.sh (via > /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/Config.pm). LDDLFLAGS = -b > +vnocompatwarnings -L/pro/local/lib -L/usr/lib/hpux64 LDFLAGS = > -L/pro/local/lib +DD64 -L/usr/lib/hpux64 > SITEARCHEXP = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld > INSTALLARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld > INSTALLSITEARCH = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld > PERL_ARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld > PERL_INC = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE > EXTRALIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz > LDLOADLIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz > $(NOECHO) $(ECHO) ' <ARCHITECTURE > NAME="IA64.ARCHREV_0-LP64-ld-5.14" />' >> $(DISTNAME).ppd > > > > Note that LDDLFLAGS and LDFLAGS have -L options that, when building, will be > placed *IN FRONT OF* what is denoted in EXTRALIBS. If - in this case - > /pro/local/lib or /usr/lib/hpux64 feature a libcrypto.so that matches the > architecture but not the version (e.g. 0.9.7 or 0.9.8 when compiling > against 1.0.1), the build will fail. > > The patch below will force the required library paths to precede the default > path > > $ echo "n" | perl Makefi > le.PL ; grep -- -L Makefile > *** Found OpenSSL-1.0.1i installed in /usr/local/ssl > *** Be sure to use the same compiler and options to compile your OpenSSL, > perl, and Net::SSLeay. Mixing and matching compilers is not supported. Do > you want to run external tests? > These tests *will* *fail* if you do not have network connectivity. [n] > Generating a Unix-style Makefile Writing Makefile for Net::SSLeay > Writing MYMETA.yml and MYMETA.json > # LDDLFLAGS => q[-b +vnocompatwarnings -L/usr/local/ssl > -L/usr/local/ssl/lib -L/pro/local/lib -L/usr/lib/hpux64] # LDFLAGS => > q[-L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib +DD64 > -L/usr/lib/hpux64] # LIBS => [q[-L/usr/local/ssl -L/usr/local/ssl/lib > -lssl -lcrypto -lz]] # These definitions are from config.sh (via > /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/Config.pm). LDDLFLAGS = -b > +vnocompatwarnings -L/usr/local/ssl -L/usr/local/ssl/lib -L/pro/local/lib > -L/usr/lib/hpux64 LDFLAGS = -L/usr/local/ssl -L/usr/local/ssl/lib > -L/pro/local/lib +DD64 -L/usr/lib/hpux64 SITEARCHEXP = > /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld INSTALLARCHLIB = > /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld > INSTALLSITEARCH = /pro/lib/perl5/site_perl/5.14.2/IA64.ARCHREV_0-LP64-ld > PERL_ARCHLIB = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld > PERL_INC = /pro/lib/perl5/5.14.2/IA64.ARCHREV_0-LP64-ld/CORE > EXTRALIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz > LDLOADLIBS = -L/usr/local/ssl -L/usr/local/ssl/lib -lssl -lcrypto -lz > $(NOECHO) $(ECHO) ' <ARCHITECTURE > NAME="IA64.ARCHREV_0-LP64-ld-5.14" />' >> $(DISTNAME).ppd > > --8<--- > --- inc/Module/Install/PRIVATE/Net/SSLeay.pm.org 2014-09-15 15:02:54 > +0200 +++ inc/Module/Install/PRIVATE/Net/SSLeay.pm 2014-09-15 15:02:57 > +0200 @@ -140,6 +140,10 @@ EOM > } > } > > + if (my $lp = join " " => map { "-L$_" } @{$opts->{lib_paths} || []}) { > + my $mma = $self->makemaker_args; > + ($mma->{uc $_} = $Config{$_}) =~ s/-L/$lp -L/ for qw( lddlflags > ldflags ); + } > return $opts; > } > > -->8---
-- Mike McCauley VK4AMM mikem@airspayce.com Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.airspayce.com Phone +61 7 5598-7474