rzer10 has asked for the wisdom of the Perl Monks concerning the following question:

I have build a number of XS based Perl modules used by many in my organization. Recently, we migrated from Perl 5.6 to 5.8. Now, the very same modules that compiled and ran under 5.6 croak under 5.8. Can't get through compilation using 5.8.6. On 5.8.8 all modules fail for "make test". Error message is "make: Fatal error: Command failed for target 'test_dynamic'". Tried running scripts anyway but they do not work. Is anyone having similar problems? If so, any ideas?
  • Comment on XS module build not working for Perl 5.8

Replies are listed 'Best First'.
Re: XS module build not working for Perl 5.8
by ysth (Canon) on Aug 18, 2006 at 23:23 UTC
    Could you provide more information about what you are doing and at what point things seem to start going wrong? What were the compile errors on 5.8.6? You are rebuilding your Makefiles, aren't you?

      With regards to 5.8.8, please see reply above. The error occurs at "make test".

      With regards to 5.8.6, the error occurs at "make". I have attached the fail log below:

      sunscape% make cp lib/MyPackage.pm blib/lib/MyPackage.pm /usr/bin/perl /usr/local/lib/perl5/5.8.6/ExtUtils/xsubpp -C++ -typema +p /usr/local/lib/perl5/5.8.6/ExtUtils/typemap -typemap perlobject.map + -typemap typemap MyPackage.xs > MyPackage.xsc && mv MyPackage.xsc M +yPackage.c Please specify prototyping behavior for MyPackage.xs (see perlxs manua +l) CC -c -I. -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFI +LE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"0.01\" -DXS_VERSI +ON=\"0.01\" -fPIC "-I/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE" +MyPackage.c CC: Warning: Option -fno-strict-aliasing passed to ld, if ld is invoke +d, ignored otherwise CC: Warning: Option -pipe passed to ld, if ld is invoked, ignored othe +rwise CC: Warning: Option -fPIC passed to ld, if ld is invoked, ignored othe +rwise "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 102: Erro +r: "{" expected instead of "__attribute__". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 102: Erro +r: The function __attribute__ must have a prototype. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 102: Erro +r: noreturn is not defined. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 104: Erro +r: Badly formed expression. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 104: Erro +r: Multiple declaration for pat. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 104: Erro +r: va_list must be initialized. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 104: Erro +r: "," expected instead of "*". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: The type "void" is incomplete. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: There is no matching ")". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: Multiple declaration for pat. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: Multiple declaration for va_list. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: va_list must be initialized. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 153: Erro +r: "," expected instead of "*". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 163: Erro +r: There is no matching ")". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 163: Erro +r: Multiple declaration for pat. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 163: Erro +r: Multiple declaration for va_list. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 163: Erro +r: va_list must be initialized. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 163: Erro +r: "," expected instead of "*". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 230: Erro +r: There is no matching ")". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 230: Erro +r: Multiple declaration for pat. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 230: Erro +r: Multiple declaration for va_list. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 230: Erro +r: va_list must be initialized. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 230: Erro +r: "," expected instead of "*". "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 360: Erro +r: The type "void" is incomplete. "/usr/local/lib/perl5/5.8.6/sun4-solaris/CORE/proto.h", line 360: Erro +r: Unexpected type name "U32" encountered. Compilation aborted, too many Error messages. *** Error code 1 make: Fatal error: Command failed for target `MyPackage.o'

      20060821 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips

        The "Command failed for target 'test_dynamic'" is just make telling you something previously got an error; what was that?

        Are you building these perls yourself or getting them from some binary distribution? If the latter, do you have the same compiler as was used to build perl?

Re: XS module build not working for Perl 5.8
by Joost (Canon) on Aug 18, 2006 at 23:03 UTC

      Ran h2xs -A -n XXX... This creates a new ppport.h file so I assume it is the latest. I have gone back and generated a very simple XS file to see if I still see the problem and I do. The error messages I get when I run "make test" is as follows:

      "sunscape% make test PERL_DL_NONLAZY=1 /eng/proj/pacsun/TOOLS/bin/perl "-MExtUtils::Command +::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
      > t/MyPackage.... # Failed test 'use MyPackage;' # in t/MyPackage.t at line 9. t/MyPackage....NOK 1# Tried to use 'MyPackage'. + # Error: Can't load '/eng/proj/pacsun/DEV/MyPackage/blib/arch/aut +o/MyPackage/MyPackage.so' for module MyPackage: ld.so.1: /eng/proj/pa +csun/TOOLS/bin/perl: fatal: relocation error: file /eng/proj/pacsun/D +EV/MyPackage/blib/arch/auto/MyPackage/MyPackage.so: symbol cout: refe +renced symbol not found at /eng/proj/pacsun/TOOLS/lib/5.8.8/sun4-sola +ris-thread-multi/DynaLoader.pm line 230. # at (eval 3) line 2 # Compilation failed in require at (eval 3) line 2. # BEGIN failed--compilation aborted at t/MyPackage.t line 9. # Looks like you failed 1 test of 1. t/MyPackage....dubious + Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- t/MyPackage.t 1 256 1 1 100.00% 1 Failed 1/1 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay. *** Error code 1 make: Fatal error: Command failed for target `test_dynamic' "

      It doesn't mean much to me. Anyone? Seemes to complain about a "relocation" error. Coincidentally, this is the same error I get when I try to use similar modules created using Swig.

      20060821 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips