Help with install from CPAN

D

Dave Saville

Is the underscore prefix usual on OS/2? Was it usual when using real
EMX, since I get the impression the last time anyone who knew much about
perl looked at all this that was state-of-the-art?

EMX did not use the underscore prefix. Most OS/2 developers have
switched to gcc which does.
I ask because if you look at the source for ExtUtils::Mksymlists (the
module which writes the .def file), you will see that the Win32 section
makes allowances for symbols with an underscore prefix, but the OS/2
section does not.

Ha Ha
I don't believe either of those options will work. DynaLoader assumes it
can pass a function name, with no underscore, to DosQueryProcAddr, and
get a C-convention function address. If _System changes the calling
convention, that will obviously lead to segfaults; and unless
DosQueryProcAddr silently prepends an underscore, changing the export
list will just mean DynaLoader can't find the symbol.

There is code in EU::Mksymlists to handle bcc on Win32, which apparently
prepends underscores; it builds a .def file which maps the underscore-
prefixed symbol in the object file to a non-prefixed symbol in the DLL.
If your build system has changed to require this then presumably the
OS/2 code could be patched to do the same thing, but that feels like
moving backwards to me...

After a quick look are we not going to still have the same problem
with Dynaloader?
Presumably you have prebuilt DLLs with your perl install, which
presumably load properly? (Can you use List::Util?) If you find
os2/auto/List/Util/Util.dll under your @INC and print out the dynamic
symbol table (nm -D on my system; there may be a specialised tool on
yours), does the symbol boot_List__Util have an initial underscore or
not? Is there any way you can see its intended calling convention (I
suspect there isn't)?

All the prebuilt dll's have _'s - At least all the ones I looked at
have :)
[I haven't forgotten about your test results xthread, I'm just not
entirely sure what to do with them yet...]

No problem.
 
D

Dave Saville

Config_Heavy always thinks there is one; apparently ExtUtils::CBuilder
doesn't agree. What does this give you?

#!usr/bin/perl

use ExtUtils::CBuilder;
use File::Temp;

my $B = ExtUtils::CBuilder->new;
my $T = File::Temp::tempdir;

print "Tempdir is [$T]\n";

{
my $c = "$T/lib.c";
open my $C, ">", $c;
print $C "int boot_compilet() { return 1; }\n";
close $C;

my $o = $B->compile(source => $c);
my @l = $B->link(objects => $o, module_name => "compilet");
}
{
my $c = "$T/exe.c";
open $C, ">", $c;
print $C "int main() { return 0; }\n";
close $C;

my $o = $B->compile(source => $c);
my $e = $B->link_executable(objects => $o);
print "$e\n";
my $x = system $e;
print "Exe returned [$x]\n";
}

(It will leave a tempdir you will need to clean up by hand.)

Exe returned [0]

I inserted
foreach (@{$data->{FUNCLIST}}) { $_ = '_'.$_; }
after
print $def "EXPORTS\n ";
in _write_os2 in Mksymlists.pm

Which then generates a lib.def that gcc builds the dll correctly with.
 
D

Dave Saville

Hi Ben,


Yes, he did. I missed it the first time I looked at the .diff.

Actually I just diff'ed the updated install against Pauls MKsymlists
and the only difference apart from Paul's patch is the version number.

So this just gets us back to all tests failing or not even attempted
which is what seems to be happening and the missing os2ish.h &
os2thyread.h which are links in the distro that go nowhere.

I wonder how many other patrches Paul has put into the packaged perl
modules that wlii get dropped by an update from CPAN?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top