diff options
author | Jan Dubois <jand@activestate.com> | 2007-06-27 08:34:12 -0700 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2007-06-28 10:11:15 +0000 |
commit | 9fb265f7d587e571375a3a5fdb05c24fd9d10d91 (patch) | |
tree | 44de97dd1d5136d4f06948e9d7aec6ec5937de19 /cygwin | |
parent | 5be5c7a687aa37f2ea9dec7988eb57cad1f1ec24 (diff) | |
download | perl-9fb265f7d587e571375a3a5fdb05c24fd9d10d91.tar.gz |
RE: Problem in Win32CORE when building PAR-Packer-0.975 with bleadperl on Win32
From: "Jan Dubois" <jand@activestate.com>
Message-ID: <02bd01c7b90b$49863720$dc92a560$@com>
Rearranges the initialization of Win32CORE. The Perl interpreter isn't
fully initialized when Perl_init_os_extras() in win32/win32.c is called,
so it is not safe to use the Perl calling mechanism yet. Fixes a problem
building PAR-Packer on Win32.
p4raw-id: //depot/perl@31490
Diffstat (limited to 'cygwin')
-rw-r--r-- | cygwin/cygwin.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index b774394c7c..2f6e2248b8 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -11,6 +11,7 @@ #include <process.h> #include <sys/cygwin.h> #include <alloca.h> +#include <dlfcn.h> /* * pp_system() implemented via spawn() @@ -196,17 +197,21 @@ XS(XS_Cygwin_winpid_to_pid) void init_os_extras(void) { - char *file = __FILE__; - CV *cv; dTHX; + char *file = __FILE__; + void *handle; newXS("Cwd::cwd", Cygwin_cwd, file); newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file); newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file); - if ((cv = get_cv("Win32CORE::bootstrap", 0))) { - dSP; - PUSHMARK(SP); - (void)call_sv((SV *)cv, G_EVAL|G_DISCARD|G_VOID); + /* Initialize Win32CORE if it has been statically linked. */ + handle = dlopen(NULL, RTLD_LAZY); + if (handle) { + void (*pfn_init)(pTHX); + pfn_init = (void (*)(pTHX))dlsym(handle, "init_Win32CORE"); + if (pfn_init) + pfn_init(aTHX); + dlclose(handle); } } |