Thread: Trouble compiling postgres 7.4 on aix 4.3.3 using gcc

Trouble compiling postgres 7.4 on aix 4.3.3 using gcc

From
Ewan Leith
Date:
Hi, hopefully someone can help with this since postgres is listed as working
with AIX, and some people seem to have got the release candidates working
with AIX.

When I compile postgres using gmake and gcc 2.95.3 I get the error below -
I'm just using a straighforward ./configure, I've tried various switches but
none have made a difference.

It seems like one of the libraries is missing an -lsomething during the
compile, but I've no idea what.

ld: 0711-317 ERROR: Undefined symbol: .PQresultErrorField
ld: 0711-317 ERROR: Undefined symbol: .last_path_separator
ld: 0711-317 ERROR: Undefined symbol: .PQsetNoticeReceiver
ld: 0711-317 ERROR: Undefined symbol: .PQfreemem
collect2: ld returned 8 exit status
gmake[4]: *** [libecpg.so] Error 1

Thanks for any help, I do know a bit about C, gcc, and AIX, but not enough
to figure out this issue...

Ewan

Longer output below:

gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations
-I../../../../src/interfaces/ecpg/include -I../../../../src/interfaces/libpq
-I.
./../../../src/include     -c -o misc.o misc.c
ar crs libecpg.a execute.o typename.o descriptor.o data.o error.o prepare.o
memory.o connect.o misc.o
touch libecpg.a
../../../../src/backend/port/aix/mkldexport.sh libecpg.a > libecpg.exp
gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes
-Wmissing-declarations
-Wl,-bnoentry -Wl,-H512 -Wl,-bM:SRE -o libecpg.so libecpg.a
-L../../../../src/po
rt -L/usr/local/lib  -L../../../../src/port -L/usr/local/lib -L../pgtypeslib
-lp
gtypes -L../../../../src/interfaces/libpq -lpq -lm
-Wl,-bI:../../../../src/bac
kend/postgres.imp -Wl,-bE:libecpg.exp
ld: 0711-224 WARNING: Duplicate symbol: .pqsignal
ld: 0711-224 WARNING: Duplicate symbol: .DLNewElem
ld: 0711-224 WARNING: Duplicate symbol: .DLNewList
ld: 0711-224 WARNING: Duplicate symbol: .DLInitList
ld: 0711-224 WARNING: Duplicate symbol: .DLFreeList
ld: 0711-224 WARNING: Duplicate symbol: .DLInitElem
ld: 0711-224 WARNING: Duplicate symbol: .DLFreeElem
ld: 0711-224 WARNING: Duplicate symbol: .DLRemove
ld: 0711-224 WARNING: Duplicate symbol: .DLAddHead
ld: 0711-224 WARNING: Duplicate symbol: .DLAddTail
ld: 0711-224 WARNING: Duplicate symbol: .DLRemHead
ld: 0711-224 WARNING: Duplicate symbol: .DLRemTail
ld: 0711-224 WARNING: Duplicate symbol: .DLMoveToFront
ld: 0711-224 WARNING: Duplicate symbol: .DecodeInterval
ld: 0711-224 WARNING: Duplicate symbol: .EncodeInterval
ld: 0711-224 WARNING: Duplicate symbol: .DecodeUnits
ld: 0711-224 WARNING: Duplicate symbol: .date2j
ld: 0711-224 WARNING: Duplicate symbol: .j2date
ld: 0711-224 WARNING: Duplicate symbol: .EncodeDateOnly
ld: 0711-224 WARNING: Duplicate symbol: .EncodeDateTime
ld: 0711-224 WARNING: Duplicate symbol: .GetEpochTime
ld: 0711-224 WARNING: Duplicate symbol: .GetCurrentDateTime
ld: 0711-224 WARNING: Duplicate symbol: .ParseDateTime
ld: 0711-224 WARNING: Duplicate symbol: .DecodeDateTime
ld: 0711-224 WARNING: Duplicate symbol: months
ld: 0711-224 WARNING: Duplicate symbol: days
ld: 0711-224 WARNING: Duplicate symbol: .tm2timestamp
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
ld: 0711-317 ERROR: Undefined symbol: .PQresultErrorField
ld: 0711-317 ERROR: Undefined symbol: .last_path_separator
ld: 0711-317 ERROR: Undefined symbol: .PQsetNoticeReceiver
ld: 0711-317 ERROR: Undefined symbol: .PQfreemem
collect2: ld returned 8 exit status
gmake[4]: *** [libecpg.so] Error 1
gmake[4]: Leaving directory
`/user_boy/ejl/postgresql-7.4/src/interfaces/ecpg/ecpglib'
gmake[3]: *** [all] Error 2
gmake[3]: Leaving directory
`/user_boy/ejl/postgresql-7.4/src/interfaces/ecpg'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/user_boy/ejl/postgresql-7.4/src/interfaces'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/user_boy/ejl/postgresql-7.4/src'
gmake: *** [all] Error 2

Re: Trouble compiling postgres 7.4 on aix 4.3.3 using gcc

From
Tom Lane
Date:
Ewan Leith <ejl@man.fwltech.com> writes:

> ld: 0711-317 ERROR: Undefined symbol: .PQresultErrorField
> ld: 0711-317 ERROR: Undefined symbol: .last_path_separator
> ld: 0711-317 ERROR: Undefined symbol: .PQsetNoticeReceiver
> ld: 0711-317 ERROR: Undefined symbol: .PQfreemem
> collect2: ld returned 8 exit status
> gmake[4]: *** [libecpg.so] Error 1

Looks to me like the linker is trying to link against a pre-7.4 version
of libpq.so --- those are all symbols that got added in 7.4.  Probably
it is taking the existing installed version of libpq.so in preference to
the just-built one in the source tree.

Dunno what the clean solution to this under AIX is, but a brute force
answer is to go ahead and install the new libpq (gmake install in
src/interfaces/libpq) and then continue with building ecpg.

            regards, tom lane

Re: Trouble compiling postgres 7.4 on aix 4.3.3 using gcc

From
Ewan Leith
Date:
Brilliant, thanks that sorted it

I had to do:
gmake install in src/interfaces/libpq
gmake clean
./configure --with-libs=/usr/local/pgsql/lib
gmake

And it all worked.

Thanks for your help

Ewan


> -----Original Message-----
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 25 November 2003 17:14
> To: Ewan Leith
> Cc: 'pgsql-ports@postgresql.org'
> Subject: Re: [PORTS] Trouble compiling postgres 7.4 on aix 4.3.3 using
> gcc
>
>
> Ewan Leith <ejl@man.fwltech.com> writes:
>
> > ld: 0711-317 ERROR: Undefined symbol: .PQresultErrorField
> > ld: 0711-317 ERROR: Undefined symbol: .last_path_separator
> > ld: 0711-317 ERROR: Undefined symbol: .PQsetNoticeReceiver
> > ld: 0711-317 ERROR: Undefined symbol: .PQfreemem
> > collect2: ld returned 8 exit status
> > gmake[4]: *** [libecpg.so] Error 1
>
> Looks to me like the linker is trying to link against a
> pre-7.4 version
> of libpq.so --- those are all symbols that got added in 7.4.  Probably
> it is taking the existing installed version of libpq.so in
> preference to
> the just-built one in the source tree.
>
> Dunno what the clean solution to this under AIX is, but a brute force
> answer is to go ahead and install the new libpq (gmake install in
> src/interfaces/libpq) and then continue with building ecpg.
>
>             regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so
> that your
>       message can get through to the mailing list cleanly
>