tsee / extutils-cppguess

Guess the C++ compiler for Perl modules
6 stars 9 forks source link

loadable library and perl binaries are mismatched (5.22.0) #9

Closed kmx closed 9 years ago

kmx commented 9 years ago

While building ExtUtils-CppGuess-0.09 on strawberry perl 5.22.0 (both 32/64bit) I got the following test failure:

# CppGuessTest.c: loadable library and perl binaries are mismatched (got handshake key 0AD00080, needed 0AF00080)
# t/001_load.t ..
# Dubious, test returned 1 (wstat 256, 0x100)
# Failed 1/1 subtests

Possible fix:

diff -ru ExtUtils-CppGuess-0.09/lib/ExtUtils/CppGuess.pm ExtUtils-CppGuess-0.09_patched/lib/ExtUtils/CppGuess.pm
--- ExtUtils-CppGuess-0.09/lib/ExtUtils/CppGuess.pm 2015-04-11 17:08:52.000000000 +0200
+++ ExtUtils-CppGuess-0.09_patched/lib/ExtUtils/CppGuess.pm 2015-06-05 09:21:52.027845500 +0200
@@ -133,6 +133,7 @@
         $self->_guess_unix() or return();
     }

+    $self->{guess}{extra_cflags} .= ' -DPERL_IMPLICIT_SYS' if $Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/;
     return $self->{guess};
 }
swiftgeek commented 9 years ago

Seems to work for ArchLinux

askerlee commented 9 years ago

This fix works for me. My OS is Windows 7 64bit. But the added line is put in _guess_win32().

llluis commented 9 years ago

strawberry-perl-5.22.0.1-64bit-portable Windows 7 64bits Same problem!

The fix worked flawlessly, thanks!

bulk88 commented 9 years ago

That patch by kmx isn't going to work for any win32 perl build but strawberry perl. Every single -D in Config.pm's CCFLAGS must be included on the command line to the CC, if you want to link with libperl. I see additional problems at

https://github.com/tsee/extutils-cppguess/blob/master/lib/ExtUtils/CppGuess.pm#L256