Re: DBD::Pg 2.10.7 compile failed on RH4 - Mailing list pgsql-general

From Albe Laurenz
Subject Re: DBD::Pg 2.10.7 compile failed on RH4
Date
Msg-id D960CB61B694CF459DCFB4B0128514C2029661CF@exadv11.host.magwien.gv.at
Whole thread Raw
In response to DBD::Pg 2.10.7 compile failed on RH4  (<Tapio.Niva@tietoenator.com>)
List pgsql-general
Tapio.Niva wrote:
> we have 32-bit PostgreSQL version 8.3.4 on 64-bit RHEL4 , Postgres
> itself is working as expected.
> We are using PostreSQL via following perl version
> ............................................
> # perl -v
> This is perl, v5.10.0 built for i686-linux-thread-multi
> (with 4 registered patches, see perl -V for more detail)
> Copyright 1987-2007, Larry Wall
> Binary build 1004 [287188] provided by ActiveState
> http://www.ActiveState.com
> Built Sep  3 2008 11:22:08
> ............................................
>
> Our problem is that DBD::Pg version 2.10.7 will not compile ,
> /usr/bin/ld skips all libpq files as incompatible - please see a slice
> of the result below :
> ............................................
> rm -f blib/arch/auto/DBD/Pg/Pg.so
> LD_RUN_PATH="/usr/lib" gcc  -shared -O2 Pg.o dbdimp.o quote.o types.o
> -o blib/arch/auto/DBD/Pg/Pg.so   \
>    -L/usr/lib -lpq -lm          \
>
> /usr/bin/ld: skipping incompatible /usr/lib/libpq.so when searching for
> -lpq

[...]
>
> # file /usr/lib/libpq.so.5.1
> /usr/lib/libpq.so.5.1: ELF 32-bit LSB shared object, Intel 80386,
> version 1 (SYSV), stripped
> #
>
> ............................................
>
> I assume that something is mixed here (=32/64-bit) because linker claims
> for incompatibility -  but because there is only 1 libpq created by
> Postgres install, I'm a bit lost.
> Should we use some other linker version ?
>
> Any ideas how to proceed ?

Yes, the problem must be that the compiler produces 64-bit code
which cannot be linked with 32-bit code.

You can either install 64-bit PostgreSQL libraries or give
gcc the -m32 option so that it generates 32-bit code.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Markus Wanner
Date:
Subject: Re: Re: [Pkg-postgresql-public] Postgres major version support policy on Debian
Next
From: johnf
Date:
Subject: localhost (windows) performance