2010/8/24 Steffen Mueller <smueller@cpan.org>:
Reini Urban wrote:
The cflags part is the only blocking issue on cygwin. Needed since 5.10.0
I'm not sure I follow the second part of your patch. In DynaLoader's
Makefile.PL, you add:
+sub MY::cflags {
+ package MY;
+ my $flags = shift->SUPER::cflags(@_);
+ if ($flags =~ /-DUSEIMPORTLIB/m) {
+ $flags =~ s/-DUSEIMPORTLIB/-UUSEIMPORTLIB/m;
+ }
+ $flags;
+}
I wonder
a) what USEIMPORTLIB does in the first place (grep doesn't come up with
copious docs)
With -DUSEIMPORTLIB it simply fails, because the importlib symbolnames
are used,
e.g. __imp__PL_stack_sp and not the direct name _PL_stack_sp.
g++-4 -o cygperl5_13_4-nt.dll --shared -Wl,--enable-auto-import
-Wl,--export-all-symbols -Wl,--stack,8388608
-Wl,--enable-auto-image-base -L/usr/local/lib -fstack-protector
-Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000 op.o perl.o
madly.o malloc.o gv.o toke.o perly.o pad.o regcomp.o dump.o util.o
mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o
universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o
pp_pack.o pp_sort.o cygwin.o DynaLoader.o Win32CORE.o -ldl -lcrypt
Creating library file: libperl.dll.a
DynaLoader.o: In function `XS_DynaLoader_dl_undef_symbols':
/usr/src/perl/blead/buildnothreads/ext/DynaLoader/DynaLoader.c:346:
undefined reference to `__imp__PL_stack_sp'
/usr/src/perl/blead/buildnothreads/ext/DynaLoader/DynaLoader.c:346:
undefined reference to `__imp__PL_markstack_ptr'
/usr/src/perl/blead/buildnothreads/ext/DynaLoader/DynaLoader.c:346:
undefined reference to `__imp__PL_stack_base'
DynaLoader.o: In function `XS_DynaLoader_dl_error':
b) if it is wise to more or less unconditionally remove it.
Yes. Using the importlib names can only link against the importlib
(the .dll.a), but not against the libperl objects directly.
From outside linking against libperl (the dll) is faster, and more
flexible. All modern gcc linkers
can link directly against a dll. Only Module::Build links against the
.dll.a, all other extutils against libperl.
c) why you're doing the if() if s/// simply not matching has the same
effect.
Just to be clear.
Finally, could you add a somewhat more descriptive commit message? It's not
clear to me and I believe that will apply to a lot of other people as well.
Sure.