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
Jan Dubois
June 25, 2007 09:49
RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32
Message ID:
On Mon, 25 Jun 2007, Steve Hay wrote:
> [Moved here from]
> 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 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 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 before it can be used.

  This becomes more obvious when 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 already
has special code to avoid calling bootstrap() on itself.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About