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;
}
}