[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integration of a Perl XS module with an Automake build system

From: Gavin Smith
Subject: Re: Integration of a Perl XS module with an Automake build system
Date: Fri, 3 Jul 2015 13:35:15 +0100

On 30 June 2015 at 23:06, Bob Friesenhahn <address@hidden> wrote:

> If you use a system which supports several completely different compilers
> targeting the same ABI, you immediately find dismay unless you compile
> Perl using the same compiler you plan to use.
> This is quite evident on Solaris systems which use the Sun/Oracle compiler
> to build the bundled Perl so it produces Sun compiler options which don't
> work with GCC.

I attempted to strip out all compiler flags but -I and -D, but that is
not good enough. The problem is not just with compiler flags, it's
also with the Perl "config.h" header, which is created when Perl is
compiled. For example, I was investigating this error:

libtool: compile:  /opt/solarisstudio12.3/bin/c99 -Xc -D_XPG6
-DPACKAGE_NAME=\"texinfo\" -DPACKAGE_TARNAME=\"texinfo\"
-DPACKAGE_VERSION=\"6.0\" "-DPACKAGE_STRING=\"texinfo 6.0\""
-I/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE -I/opt/csw/include -c
XSParagraph.c  -KPIC -DPIC -o .libs/XSParagraph_la-XSParagraph.o
"/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/scope.h", line 221:
syntax error before or at: sigjmp_buf
"/usr/perl5/5.8.4/lib/sun4-solaris-64int/CORE/proto.h", line 199:
syntax error before or at: off64_t

scope.h uses a preprocessor symbol  "Sigjmp_buf" which is defined as
"sigjmp_buf" or "jmp_buf" depending on config.h. In this case as
"sigjmp_buf", which the compiler doesn't recognize. So you really do
have to use the same compiler, unless you want to find some way to
compensate somehow for everything decided in Perl's "config.h".

I managed to compile and use the module fine when using gcc (which is
the opposite of what you might expect).

You see the configure script has selected the compiler
"/opt/solarisstudio12.3/bin/c99", but the value of "cc" in the Perl
configuration is actually just "cc" on the system I tried it on. When
I forced it to use "cc" as the compiler, that worked as well.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]