Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 75278
Status: open
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: shmuel+bitcard.org [...] patriot.net
Cc:
AdminCc:

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



Subject: ExtUtils::Mksymlist builds bad def file in OS/2
Builds of Crypt-OpenSSL-Random-0.04 and Crypt-OpenSSL-RSA-0.28 fail in OS/2 because of unresolved symbols, e.g., weakld: error: Unresolved symbol (UNDEF EXPORT) 'boot_Crypt__OpenSSL__Random'. weakld: info: The symbol is referenced by: H:/Vendors/CPAN/Crypt-OpenSSL-Random-0.04/Random.def Ignoring unresolved externals reported from weak prelinker. ILink : error LNK2022: boot_Crypt__OpenSSL__Random (alias boot_Crypt__OpenSSL__R andom) : export undefined ExtUtils::Mksymlists is 5.006; Perl is 5.10.0; OS is eComStation 2.0 GA (rebranded OS/2 4.52). Do you need the output of perl -V? See RT tickets 75181 and 75182 for background. A couple of notes on the patch. 1. It will not work on anything older that Perl 5.10.0 unless the version module is installed. 2. I'm assuming that the underscore is only needed for the exports of the boot_foo symbols; if it is needed for all exported symbols then the change would have to go into _write_os2 3. Todd Rinaldo has asked me to download and attempt installing DBD::SQLite, YAML::Syck, XML::LibXML, XML::Parser and XML::LibXSLT as further tests of the patch; I will update the record to reflect the results.
Subject: Mksymlists.diff
--- h:\temp\Mksymlists.pm.base 2011-10-23 19:44:10.000000000 -0400 +++ q:\PROGRAMS\PERL\lib\5.10.0\extutils\Mksymlists.pm 2012-02-24 09:48:44.000000000 -0500 @@ -27,19 +27,23 @@ unless ( ($spec{DL_FUNCS} and keys %{$spec{DL_FUNCS}}) or @{$spec{FUNCLIST}}); if (defined $spec{DL_FUNCS}) { + use version; + $Config{gccversion} =~ /^(\d++(\.\d++)++)\s.*+/; + my $gccversion = version->parse($1); + my $bootpfx = $^O eq 'os2' && $Config{cc} =~ /^gcc/i && $gccversion >= '3.2.2' ? '_' : ''; foreach my $package (keys %{$spec{DL_FUNCS}}) { my($packprefix,$bootseen); ($packprefix = $package) =~ s/\W/_/g; foreach my $sym (@{$spec{DL_FUNCS}->{$package}}) { if ($sym =~ /^boot_/) { - push(@{$spec{FUNCLIST}},$sym); + push(@{$spec{FUNCLIST}},$bootpfx.$sym); $bootseen++; } else { push(@{$spec{FUNCLIST}},"XS_${packprefix}_$sym"); } } - push(@{$spec{FUNCLIST}},"boot_$packprefix") unless $bootseen; + push(@{$spec{FUNCLIST}},"${bootpfx}boot_$packprefix") unless $bootseen; } }
From: shmuel+bitcard.org [...] patriot.net
On Fri Feb 24 11:12:58 2012, shmuel wrote: Show quoted text
> A couple of notes on the patch.
Show quoted text
> 2. I'm assuming that the underscore is only needed for the > exports of the boot_foo symbols; if it is needed for all > exported symbols then the change would have to go > into _write_os2
I found <http://svn.netlabs.org/libc/wiki/Faq#Whatsthestorywiththeunderscore>, which implies that OS/2 needs the same logic that was earlier added for win32, rather than my minimal patch. Show quoted text
> 3. Todd Rinaldo has asked me to download and attempt installing > DBD::SQLite, YAML::Syck, XML::LibXML, XML::Parser and > XML::LibXSLT as further tests of the patch; I will update > the record to reflect the results.
The ones I tried all worked, but see above.
Subject: Re: [rt.cpan.org #75278] ExtUtils::Mksymlist builds bad def file in OS/2
Date: Thu, 01 Mar 2012 15:50:21 -0800
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
On 2012.2.24 8:12 AM, Shmuel (Seymour J.) Metz via RT wrote: Show quoted text
> ExtUtils::Mksymlists is 5.006; Perl is 5.10.0; OS is eComStation 2.0 GA > (rebranded OS/2 4.52). Do you need the output of perl -V?
That would be helpful. What you should try is upgrading to the latest stable version of EUMM which has EU::Mksymlists 6.62, see if that changes anything and make sure your patch works against that please. To be honest we've got nobody to work on OS/2 so we're going to have to trust you know what you're doing. No pressure! :) Also, Mksymlists is mysterious to a lot of people, including me, so please continue to be as verbose as possible about what you've discovered and your changes. Show quoted text
> A couple of notes on the patch. > > 1. It will not work on anything older that Perl 5.10.0 unless the > version module is installed.
EUMM bundles version.pm, so that's ok. Show quoted text
> 2. I'm assuming that the underscore is only needed for the > exports of the boot_foo symbols; if it is needed for all > exported symbols then the change would have to go > into _write_os2
Your reply implied you're going to need to refine the patch? If you're comfortable with Github, it would be easier to review and discuss the patch as a pull request on https://github.com/perl-toolchain-gang/ExtUtils-MakeMaker Otherwise feel free to submit diffs here on this ticket. Show quoted text
> 3. Todd Rinaldo has asked me to download and attempt installing > DBD::SQLite, YAML::Syck, XML::LibXML, XML::Parser and > XML::LibXSLT as further tests of the patch; I will update > the record to reflect the results.
Excellent, that's a very good idea.
Subject: Re: [rt.cpan.org #75278] ExtUtils::Mksymlist builds bad def file in OS/2
Date: Fri, 02 Mar 2012 10:23:26 -0500
To: "Michael G Schwern via RT" <bug-ExtUtils-MakeMaker [...] rt.cpan.org>
From: Shmuel (Seymour J.) Metz <shmuel+gen [...] patriot.net>
In <rt-3.8.HEAD-10813-1330645831-1752.75278-6-0@rt.cpan.org>, on 03/01/2012 at 06:50 PM, "Michael G Schwern via RT" <bug-ExtUtils-MakeMaker@rt.cpan.org> said: Show quoted text
>That would be helpful.
The attached perlDashV is the output of perl -V. Show quoted text
>What you should try is upgrading to the latest stable version of >EUMM which has EU::Mksymlists 6.62, see if that changes anything and >make sure your patch works against that please.
The relevant code hasn't changed. I get a number of test failures; see the attached ExtUtils-MakeMaker.bld. Is it safe to ignore them? Show quoted text
>Also, Mksymlists is mysterious to a lot of people, including me,
Me also. Show quoted text
>Your reply implied you're going to need to refine the patch?
The attached Mksymlists.diff is the reworked patch. Show quoted text
>If you're comfortable with Github,
I'm not, and I only[1] have dialup access, which greatly limits the tools I use. [1] Well, I can use a library computer to download and upload large files. -- Shmuel (Seymour J.) Metz, SysProg and JOAT Atid/2 <http://patriot.net/~shmuel> We don't care. We don't have to care, we're Congress. (S877: The Shut up and Eat Your spam act of 2003)
Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=os2, osvers=2.45, archname=os2 uname='os2 dev.smedley.inf 1 2.45 i386 i386 authenticamd os2 ' config_args='-Dprefix=Q:/PROGRAMS/PERL' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DDOSISH -DOS2=2 -DEMBED -I. -fno-strict-aliasing -pipe -I/usr/local/include', optimize='-O2 -fomit-frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=2 -s', cppflags='-DDOSISH -DOS2=2 -DEMBED -I. -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='3.3.5 (Bird Build 2007-06-10 14:30)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags ='-Zomf -Zhigh-mem -Zstack 32000 ' libpth=/usr/lib /usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5 /extras/lib /dev/qt/trunk/lib /openldap/lib /cups/lib Q:/os2tk45/lib q:/usr/local/OPENSL/lib Q:/os2tk45/lib q:/usr/local/OPENSSL/lib libs=-lsocket perllibs=-lsocket libc=/usr/lib/libc_dll.a, so=dll, useshrplib=true, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-Zdll', lddlflags='-Zdll -Zomf ' Characteristics of this binary (from libperl): Compile-time options: MYMALLOC PERL_DONT_CREATE_GVSV PERL_USES_PL_PIDSTATUS USE_LARGE_FILES USE_PERLIO Built under os2 Compiled at Dec 26 2007 13:37:17 %ENV: PERLDIR="Q:\PROGRAMS\PERL" PERLLIB="Q:\PROGRAMS\PERL\lib" PERLLIB_PREFIX="u:/perl5/lib;Q:/PROGRAMS/PERL/lib" PERLLOC=" Q:\PROGRAMS\PERL" PERLLOC2="U:/PERL" PERL_SH_DIR="Q:/PROGRAMS/PERL/bin" @INC: Q:\PROGRAMS\PERL\lib /perl5/lib/5.10.0/os2 /perl5/lib/5.10.0 /perl5/lib/site_perl/5.10.0/os2 /perl5/lib/site_perl/5.10.0 .

Message body is not shown because it is too large.

--- H:\vendors\cpan\ExtUtils-MakeMaker-6.62\lib\ExtUtils\Mksymlists.pm.base 2012-03-02 09:45:12.000000000 -0500 +++ H:\vendors\cpan\ExtUtils-MakeMaker-6.62\lib\ExtUtils\Mksymlists.pm 2012-03-02 09:59:30.000000000 -0500 @@ -104,8 +104,24 @@ print $def "CODE LOADONCALL\n"; print $def "DATA LOADONCALL NONSHARED MULTIPLE\n"; print $def "EXPORTS\n "; - print $def join("\n ",@{$data->{DL_VARS}}, "\n") if @{$data->{DL_VARS}}; - print $def join("\n ",@{$data->{FUNCLIST}}, "\n") if @{$data->{FUNCLIST}}; + my @syms; + # Export public symbols both with and without underscores to + # ensure compatibility between DLLs from different compilers + # Starting from gcc 3.2.2, OS/2 requires the leading underscore. + use version; + $Config{gccversion} =~ /^(\d++(\.\d++)++)\s.*+/; + my $gccversion = version->parse($1); + if ($Config{cc} =~ /^gcc/i && $gccversion >= '3.2.2') { + for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) { + push @syms, "_$_", "$_ = _$_"; + } + } + else { + for (@{$data->{DL_VARS}}, @{$data->{FUNCLIST}}) { + push @syms, "$_", "_$_ = $_"; + } + } + print $def join("\n ",@syms, "\n") if @syms; if (%{$data->{IMPORTS}}) { print $def "IMPORTS\n"; my ($name, $exp);