Hi,
For quite a few years I have been building various (and numerous) perl extensions on MinGW-built perl, and then installing those builds on ActivePerl. This has always worked fine - and I can't think of any reason that it shouldn't work fine.
Disturbingly, however, I've now come across a situation where a MinGW-built extension exhibits different behaviour when run on ActivePerl. This applies only to perls 5.10.0 and 5.10.1. Afaict, earlier perls are fine.
Here's the Inline::C demo:
use warnings;
use Inline C => Config =>
BUILD_NOISY => 1;
use Inline C => <<'EOC';
void foo() {
printf("%d\n", GIMME_V == G_ARRAY);
}
EOC
my $x = [foo()];
To see what I'm getting, you'll need ActivePerl 5.10.x (set up to use the MinGW compiler), MinGW-built perl 5.10.x (Strawberry Perl 5.10.x will do), along with Inline-0.45 installed on both of those perls.
Then you'll find that if you run that script using the MinGW-built perl 5.10.x, it will compile and output 1. If you then run the very same script (in the very same location) on ActivePerl 5.10.x, then the script does not get re-compiled (nor should it), and the output is 0. ("x" can be either 0 or 1, but it's important that "x" has the same value for both perls - otherwise you'll get separate compilations, in which case the output will always be 1.)
Alternatively, you can first run (and compile) the script with ActivePerl, and then re-run the script on MinGW-built perl. If you do that, the outputs are reversed - ActivePerl now outputs 1, and MinGW-built perl outputs 0. That is, the output toggles, depending upon which perl actually compiles the script.
This completely baffles me - it is the only instance I have ever come across where the behaviour changes from one platform to the other. Does anyone have any insight into why this happens ?
I came across this while building Net::SSH2. That is, I built Net-SSH2-0.28 on MinGW-built 5.10.0 where it built and passed its test suite, and then installed that build onto ActivePerl 5.10.0 where it failed some of the tests in the test suite (because GIMME_V == G_ARRAY in an XSub was being evaluated differently from one perl to the other). This strikes me as very peculiar - identical site/lib/Net/SSH2.pm and site/lib/auto/Net/SSH2/SSH2.dll files behaving differently. How can this be ? Why does it happen only with 5.10 ? Why haven't I been bitten by this type of thing before ?
Cheers,
Rob
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.