in reply to XS module build not working for Perl 5.8

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?
  • Comment on Re: XS module build not working for Perl 5.8

Replies are listed 'Best First'.
Re^2: XS module build not working for Perl 5.8
by Anonymous Monk on Aug 21, 2006 at 16:23 UTC

    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?

        The error is: "Error: Can't load '/eng/proj/pacsun/DEV/MyPackage/blib/arch/auto/MyPackage/MyPackage.so' for module MyPackage: ld.so.1: /eng/proj/pacsun/TOOLS/bin/perl: fatal: relocation error: file /eng/proj/pacsun/DEV/MyPackage/blib/arch/auto/MyPackage/MyPackage.so: symbol cout: referenced symbol not found at /eng/proj/pacsun/TOOLS/lib/5.8.8/sun4-solaris-thread-multi/DynaLoader.pm line 230."

        I think you might be educating me here ... I downloaded the Perl binary for 5.8.8 from ActiveState. This is the Perl that I am running and trying to build XS based modules in. Are you telling me that I must use the same compiler as ActiveState used to generate the binary? If so, how do I know what compiler they used?

        I'm not sure I completely understand if this is true. While running 5.6, I would routinely create XS modules using C++ code. Typically I would compile using gcc. But Perl is compiled using some C compiler i.e. not gcc. I thought the XS generated library just created machine code and that the typemap dealt with passing data to and from the C/Perl object to your C++/XS object.