perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Ananiev" <>
Subject Fix buggy boot_ statements in modperl_xsinit.c
Date Thu, 05 Oct 2006 10:10:43 GMT
I spotted this on cygwin and perl 5.8.7, but it might happen on other
platforms too.
The problem is that $Config{static_ext} contains  ' Win32CORE' (with a
leading space)
and when ExtUtils::Embed::static_ext() splits the value we get an array with
elements - the space and Win32CORE.
Then ExtUtils::Embed::xsinit doesn't check the array and directly generates
which contains the following buggy lines:

EXTERN_C void boot_ (pTHX_ CV* cv);


newXS("::bootstrap", boot_, file);

Generally speaking, this is a problem with ExtUtils::Embed and not with
mod_perl and I will send a
patch for the module to p5p, but fixing this stuff in modperl for the old
versions of ExtUtils::Embed won't cost

--- (revision 453125)
+++ (working copy)
@@ -777,7 +777,14 @@

     my $xsinit = "$self->{path}/modperl_xsinit.c";
     debug "generating...$xsinit";
+    # There's a possibility that $Config{static_ext} may contain spaces and
+    # ExtUtils::Embed::xsinit won't handle the situation right. In this
+    # we'll get buggy "boot_" statements in modperl_xsinit.c. Fix this by
+    # the @Extensions array.
+    ExtUtils::Embed::static_ext(); # Loads @Extensions if not loaded
+    @ExtUtils::Embed::Extensions = grep{$_} @ExtUtils::Embed::Extensions;
     #create bootstrap method for static xs modules
     my $static_xs = [keys %{ $build->{XS} }];
     ExtUtils::Embed::xsinit($xsinit, 1, $static_xs);

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message