--enable-perl doesn't like Solaris

Started by PostgreSQL Bugs Listabout 25 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Justin Clift (jclift@iprimus.com.au) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
--enable-perl doesn't like Solaris

Long Description
When testing which 7.1RC1 options are working on Solaris 8 SPARC, I've come across this when using --enable-perl.

It appears that the ./configure script is defining -KPIC somewhere in the perl interface stuff, and this is causing the "make" to bomb out. I'm pretty sure from memory that -KPIC is not something that gcc on Solaris likes, and will need to be -fPIC -shared or something else.

Please note, on this system 'cc' is a soft link to gcc, for those times I forget to set CC (like this time).

Sample Code
./configure --p=/opt/postgresql71 --enable-syslog --with-openssl=/opt/openssl --with-python --with-perl

<snip of successful ./configure stuff>
<snip of general make stuff>
make[3]: Leaving directory `/archive/install/postgresql-7.1RC1/src/interfaces/libpgeasy'
make[3]: Entering directory `/archive/install/postgresql-7.1RC1/src/interfaces/perl5'
make -C ../../../src/interfaces/libpq all
make[4]: Entering directory `/archive/install/postgresql-7.1RC1/src/interfaces/libpq'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/archive/install/postgresql-7.1RC1/src/interfaces/libpq'
make -f Makefile all
make[4]: Entering directory `/archive/install/postgresql-7.1RC1/src/interfaces/perl5'
cc -c -I../libpq -I../../include -xO3 -xdepend -DVERSION=\"1.8.0\" -DXS_VERSION=\"1.8.0\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE Pg.c
cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: Pg.c: linker input file unused since linking not done
Running Mkbootstrap for Pg ()
chmod 644 Pg.bs
LD_RUN_PATH="/archive/install/postgresql-7.1RC1/src/interfaces/perl5/../libpq" cc -o blib/arch/auto/Pg/Pg.so -R/archive/install/postgresql-7.1RC1/src/interfaces/perl5/../libpq -G Pg.o -L/archive/install/postgresql-7.1RC1/src/interfaces/perl5/../libpq -lpq
cc: Pg.o: No such file or directory
make[4]: *** [blib/arch/auto/Pg/Pg.so] Error 1
make[4]: Leaving directory `/archive/install/postgresql-7.1RC1/src/interfaces/perl5'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/archive/install/postgresql-7.1RC1/src/interfaces/perl5'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/archive/install/postgresql-7.1RC1/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/archive/install/postgresql-7.1RC1/src'
make: *** [all] Error 2
$

No file was uploaded with this report

#2Peter Eisentraut
peter_e@gmx.net
In reply to: PostgreSQL Bugs List (#1)
Re: --enable-perl doesn't like Solaris

Justin Clift (jclift@iprimus.com.au) reports a bug with a severity of 3

It appears that the ./configure script is defining -KPIC somewhere in
the perl interface stuff, and this is causing the "make" to bomb out.
I'm pretty sure from memory that -KPIC is not something that gcc on
Solaris likes, and will need to be -fPIC -shared or something else.

The Perl build environment is not provided by us, it comes from the
ExtUtils::MakeMaker module. MakeMaker is misdesigned in that it assumes
that the user will use the same compiler for building his modules as the
one he used for building perl itself. So if you got Perl from Sun, then
it's likely to have been compiled by Sun's cc.

Solution 1 is to hack MakeMaker and/or the Makefile it generates to fix
the options. (Replacing -KPIC by -fPIC might do.)

Solution 2 is to recompile Perl with gcc. This would also give you a
chance to build a shared libperl, so you can use PL/Perl.

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/