I was trying to make a static binarys of perl for Win32 (without the use of the perl5x.dll). After a hard work, since this wasn't supported for Win32 in the makefiles and ExtUtils::MakeMaker, I got a unic perl.exe with 628Kb, with all the resources of the perl5x.dll inside. But I have a big problem, XS modules doesn't load! I can load Dynaloader, and the "bootstrap" of him are ok too. But any other .dll can't be loaded! I get a access memory error!

Some one already have worked with XS and static library on Perl (in other OS too)? Or know a better way to make a static binarys of perl on Win32?

Maybe I need to rebuild the .dll of the ext... I don't know, I'm lost now!

Here's the code used to compile the binary (see comments for compilation):

/* COMPILE (VC6++): NOTE: Path in use for cmds: - Source: F:\compile\perl-5.8.0 - Perl Installation: c:\perl cl -c "-IF:\compile\perl-5.8.0\lib\CORE" -nologo -Gf -W3 -MD -DNDE +BUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL_IMPLICIT_CONTEXT -DPERL +_IMPLICIT_SYS -DPERL_MSVCRT_READFIX -MD -DNDEBUG -O1 "-IF:\compile\pe +rl-5.8.0\lib\CORE" perlmain.c cl -nologo -Gf -nodefaultlib -release -libpath:"c:\perl\lib\CORE" -m +achine:x86 -o embperl -MD -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT + -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DPERL_MSVCRT_READFIX ./ +perlmain.obj F:\compile\perl-5.8.0\win32\perllib.obj F:\compile\perl- +5.8.0\perlio.obj F:\compile\perl-5.8.0\av.obj F:\compile\perl-5.8.0\d +eb.obj F:\compile\perl-5.8.0\doio.obj F:\compile\perl-5.8.0\doop.obj +F:\compile\perl-5.8.0\dump.obj F:\compile\perl-5.8.0\globals.obj F:\c +ompile\perl-5.8.0\gv.obj F:\compile\perl-5.8.0\hv.obj F:\compile\perl +-5.8.0\locale.obj F:\compile\perl-5.8.0\mg.obj F:\compile\perl-5.8.0\ +numeric.obj F:\compile\perl-5.8.0\op.obj F:\compile\perl-5.8.0\perl.o +bj F:\compile\perl-5.8.0\perlapi.obj F:\compile\perl-5.8.0\perly.obj +F:\compile\perl-5.8.0\pp.obj F:\compile\perl-5.8.0\pp_ctl.obj F:\comp +ile\perl-5.8.0\pp_hot.obj F:\compile\perl-5.8.0\win32\mini\pp_pack.ob +j F:\compile\perl-5.8.0\pp_sort.obj F:\compile\perl-5.8.0\pp_sys.obj +F:\compile\perl-5.8.0\reentr.obj F:\compile\perl-5.8.0\regcomp.obj F: +\compile\perl-5.8.0\regexec.obj F:\compile\perl-5.8.0\run.obj F:\comp +ile\perl-5.8.0\scope.obj F:\compile\perl-5.8.0\sv.obj F:\compile\perl +-5.8.0\taint.obj F:\compile\perl-5.8.0\toke.obj F:\compile\perl-5.8.0 +\universal.obj F:\compile\perl-5.8.0\utf8.obj F:\compile\perl-5.8.0\u +til.obj F:\compile\perl-5.8.0\xsutils.obj F:\compile\perl-5.8.0\ext\D +ynaLoader\DynaLoader.obj F:\compile\perl-5.8.0\win32\win32.obj F:\com +pile\perl-5.8.0\win32\win32sck.obj F:\compile\perl-5.8.0\win32\win32t +hread.obj oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netap +i32.lib uuid.lib wsock32.lib mpr.lib winmm.lib version.lib odbc32.li +b odbccp32.lib msvcrt.lib */ #include "EXTERN.h" #include "perl.h" #ifdef __GNUC__ /* Mingw32 defaults to globing command line * This is inconsistent with other Win32 ports and * seems to cause trouble with passing -DXSVERSION=\"1.6\" * So we turn it off like this: */ int _CRT_glob = 0; #endif int main(int argc, char **argv, char **env) { return RunPerl(argc, argv, env); }

Graciliano M. P.
"The creativity is the expression of the liberty".


In reply to Perl static binary (no perl5x.dll) & XS problem on Win32! by gmpassos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.