develooper Front page | perl.perl5.porters | Postings from June 2007

RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32

Thread Previous
From:
Jan Dubois
Date:
June 25, 2007 09:49
Subject:
RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32
Message ID:
01ce01c7b748$b7d1d960$27758c20$@com
On Mon, 25 Jun 2007, Steve Hay wrote:
> [Moved here from par@perl.org]
>
> Jan Dubois wrote:
> > I think it is better to call boot_Win32CORE() from
> > init_os_extras(), unless you can find a way to call it from
> > xs_init() under Cygwin too.
> >
> > Since boot_Win32CORE() is called without "use Win32CORE" (which is
> > the whole reason Win32CORE exists in the first place), there is no
> > point in having an entry for Win32CORE in perllibst.h. I most ways
> > it should be treated the same way as DynaLoader, which is also
> > bootstrapped specially.
> >
> > The existence of Win32CORE.pm is really bogus. We should rename it
> > to Win32CORE.pod and get rid of the executable code. There is simply
> > no reason to ever have a "use Win32CORE" statement in your code.
> >
> > Feel free to leave this issue alone for now; I'll try to come up
> > with a proper patch early next week. But let me know if you continue
> > to hack on it so that we don't duplicate the effort.
>
> OK, my last hack is attached. This handles Win32CORE similarly to
> DynaLoader and fixes the PAR-Packer problems for me on Win32. I
> haven't done anything about a -DPERL_MINIPERL compile flag for Cygwin
> because I don't know where to put it, but I think it should still
> build on Cygwin with this patch exactly as it currently does without
> it (i.e. presumably with the PAR-Packer build problem). I also
> haven't changed Win32CORE.pm to .pod yet, but I agree that's probably
> worth doing.
>
> So how does this look? It would be nice to get this sorted out before
> 5.9.5 is released, but we could be too late already...

I haven't tried it yet, but here are some quick comments:

* The changes to win32/perllib.c should not be necessary. Win32CORE should
  not be loaded by DynaLoader because the boot_Win32CORE() has already been
  called during interpreter initialization.  This is different from
  DynaLoader, which still needs to load DynaLoader.pm before it can be used.

  This becomes more obvious when Win32CORE.pm gets changed to Win32CORE.pod.

* The CV* argument to boot_Win32CORE() isn't needed.  I assume you left it
  in for Cygwin compatibility.

I've looked into this a little more and now I think the best place to
put the call to boot_Win32CORE() is in xs_init() instead of
os_init_extras(). For MSWin32 we can hardcode it into win32/perllib.c,
and for Cygwin we can add it to writemain.SH. This automatically takes
care of the miniperl issue and we don't need the define anymore.

I'll create a patch later today myself unless you want to do this.

Unrelated observation:

Listing DynaLoader::boot_DynaLoader in win32/perllib.c seems bogus; the
staticlinkmodules[] array is only used by DynaLoader::dl_load_file(),
which is used by DynaLoader::bootstrap().  But DynaLoader.pm already
has special code to avoid calling bootstrap() on itself.

Cheers,
-Jan


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About