Subject: | ExtUtils::MakeMaker generate duplicate --image-base with gcc on windows. |
Hi.
I tried to compiler "Coro-5.132" using gcc on windows. And I found a bug
in "ExtUtils::MakeMaker". When compiler is "gcc", "MM_Win32.pm" generate
forcely "--image-base" linker option.
ExtUtils::MM_Win32.pm:302
if ($GCC) {
my $dllname = $self->{BASEEXT} . "." . $self->{DLEXT};
$dllname =~ /(....)(.{0,4})/;
my $baseaddr = unpack("n", $1 ^ $2);
$otherldflags .= sprintf("-Wl,--image-base,0x%x0000 ", $baseaddr);
}
"Coro::Event" is using "Event" that is XS.
"Event"s is generated "--image-base" as unpack("n", "Even", "t.dl").
And "Coro::Event" is generated it also as unpack("n", "Even", "t.dll").
Thus, Coro::Event can't load "auto/Coro/Evnt/Event.dll"
I think that it should use another logic for generating "--image-base".
For example, using $self->{FULLEXT} instead of $self->{BASEEXT}.
It will be unpack("n", "Even", "t.dl") and unpack("n", "Coro", "::Ev").
Or, exclude the logic from 'WW_Win32.pm' for enable auto generate
"-image-base".
Best Regards, Thanks.
- Yasuhiro Matsumoto