Compiling PL/Perl and Pl/Python on x86_64 - Mailing list pgsql-hackers

From imacat
Subject Compiling PL/Perl and Pl/Python on x86_64
Date
Msg-id 20060508005327.FE2B.IMACAT@mail.imacat.idv.tw
Whole thread Raw
Responses Re: Compiling PL/Perl and Pl/Python on x86_64
List pgsql-hackers
Dear all,
   I cannot compile PL/Perl and PL/Python under x86_64.  I'm running
Intel Pentium D 3.2GHz Dual-core, Debian GNU/Linux AMD64 port, kernel
2.6.16.14, gcc 3.4.4, glibc 2.3.2, perl 5.8.8, Python 2.4.3.

imacat@yuki ~ % uname -a
Linux yuki 2.6.16.14-allmods #1 SMP Sat May 6 18:25:11 CST 2006 x86_64 GNU/Linux
   To complie PL/Perl:

imacat@yuki /tmp/postgresql-8.1.3 % ./configure --prefix=/usr
--sysconfdir=/etc  --localstatedir=/var --mandir=/usr/share/man
--enable-nls --with-docdir=/usr/sha re/doc/postgresql --with-perl
--with-pam
checking build system type... x86_64-unknown-linux-gnu
...
config.status: linking ./src/makefiles/Makefile.linux to
src/Makefile.port
imacat@yuki /tmp/postgresql-8.1.3 % make
make -C doc all
...
tsort: -: input contains a loop:
tsort: SPI.o
tsort: plperl.o
ranlib libplperl.a
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after- statement -Wendif-labels -fno-strict-aliasing -fpic
-shared -Wl,-soname,libplper l.so.0  plperl.o spi_internal.o SPI.o
-L/usr/local/lib -L/usr/lib/perl5/5.8.8/x8
6_64-linux-thread-multi-ld/CORE -L../../../src/port
/usr/lib/perl5/5.8.8/x86_64-
linux-thread-multi-ld/auto/DynaLoader/DynaLoader.a -lperl -lnsl -ldl -lm
-lcrypt  -lutil -lpthread -lc
-Wl,-rpath,/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi- ld/CORE -o
libplperl.so.0.0
/usr/bin/ld:
/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/auto/DynaLoader/D
ynaLoader.a(DynaLoader.o): relocation R_X86_64_32 can not be used when
making a  shared object; recompile with -fPIC
/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/auto/DynaLoader/DynaLoader.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libplperl.so.0.0] Error 1
make[3]: Leaving directory `/tmp/postgresql-8.1.3/src/pl/plperl'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/tmp/postgresql-8.1.3/src/pl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/postgresql-8.1.3/src'
make: *** [all] Error 2
imacat@yuki /tmp/postgresql-8.1.3 %
   The same goes for PL/Python:

imacat@yuki /tmp/postgresql-8.1.3 % ./configure --prefix=/usr
--sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man
--enable-nls --with-docdir=/usr/share/doc/postgresql --with-python
--with-pam
checking build system type... x86_64-unknown-linux-gnu
...
config.status: linking ./src/makefiles/Makefile.linux to
src/Makefile.port
imacat@yuki /tmp/postgresql-8.1.3 % make
make -C doc all
...
make[3]: Entering directory `/tmp/postgresql-8.1.3/src/pl/plpython'
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fpic
-I. -I/usr/include/python2.4 -I../../../src/include -D_GNU_SOURCE   -c
-o plpython.o plpython.c
ar crs libplpython.a `lorder plpython.o | tsort`
ranlib libplpython.a
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fpic
-shared -Wl,-soname,libplpython.so.0  plpython.o
-L/usr/lib/python2.4/config -L../../../src/port -lpython2.4 -lpthread
-ldl -lutil -lm -Wl,-rpath,/usr/lib/python2.4/config -o
libplpython.so.0.0
/usr/bin/ld: /usr/lib/python2.4/config/libpython2.4.a(abstract.o):
relocation R_X86_64_32 can not be used when making a shared object;
recompile with -fPIC
/usr/lib/python2.4/config/libpython2.4.a: could not read symbols: Bad
value
collect2: ld returned 1 exit status
make[3]: *** [libplpython.so.0.0] Error 1
make[3]: Leaving directory `/tmp/postgresql-8.1.3/src/pl/plpython'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/tmp/postgresql-8.1.3/src/pl'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/postgresql-8.1.3/src'
make: *** [all] Error 2
imacat@yuki /tmp/postgresql-8.1.3 %
   I have recompiled my perl many times, with:

./Configure -Dusethreads -Dcc=gcc -Duselongdouble -Doptimize="-g -O3"
-Duse64bitint -Duse64bitall -Dprefix=/usr -Dd_dosuid
-Dotherlibdirs=/usr/share/perl5 -Dinc_version_list=none
-Acccdlflags=-fPIC -Duseshrplib=false
-Dcf_email=imacat@mail.imacat.idv.tw
   I've changed CFLAGS_SL to -fPIC in src/makefiles/Makefile.linux, and
it still doesn't help.

...
tsort: plperl.o
ranlib libplperl.a
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fPIC
-shared -Wl,-soname,libplperl.so.0  plperl.o spi_internal.o SPI.o
-L/usr/local/lib
-L/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/CORE
-L../../../src/port /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/au
to/DynaLoader/DynaLoader.a -lperl -lnsl -ldl -lm -lcrypt -lutil
-lpthread -lc
-Wl,-rpath,/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/CORE -o
libplperl.so.0.0
/usr/bin/ld: /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/auto/Dyn
aLoader/DynaLoader.a(DynaLoader.o): relocation R_X86_64_32 can not be
used when making a shared object; recompile with -fPIC
/usr/lib/perl5/5.8.8/x86_64-linux-thread-multi-ld/auto/DynaLoader/DynaLoader.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libplperl.so.0.0] Error 1
...

...
make[3]: Entering directory `/tmp/postgresql-8.1.3/src/pl/plpython'
gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fPIC
-shared -Wl,-soname,libplpython.so.0  plpython.o
-L/usr/lib/python2.4/config -L../../../src/port -lpython2.4 -lpthread
-ldl -lutil -lm -Wl,-rpath,/usr/lib/python2.4/config -o
libplpython.so.0.0
/usr/bin/ld: /usr/lib/python2.4/config/libpython2.4.a(abstract.o):
relocation R_X86_64_32 can not be used when making a shared object;
recompile with -fPIC
/usr/lib/python2.4/config/libpython2.4.a: could not read symbols: Bad
value
collect2: ld returned 1 exit status
make[3]: *** [libplpython.so.0.0] Error 1
...
   I'm out of ideas.  Is there anyone know which flags to add to or
where my mistake is?  Thank you.

--
Best regards,
imacat ^_*' <imacat@mail.imacat.idv.tw>
PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt

<<Woman's Voice>> News: http://www.wov.idv.tw/
Tavern IMACAT's: http://www.imacat.idv.tw/
TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug

pgsql-hackers by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Demoting the "width" part of EXPLAIN
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Demoting the "width" part of EXPLAIN