Re: Buildfarm failure on ecpg/test/pgtypeslib

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, pgsql-hackers(at)postgresql(dot)org, Joachim Wieland <joe(at)mcknight(dot)de>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: Buildfarm failure on ecpg/test/pgtypeslib
Date: 2006-08-09 21:11:37
Message-ID: 29411.1155157897@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Jim C. Nasby wrote:
>> Platypus just started failing...
>> http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=platypus&dt=2006-08-09%2010:05:01

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g -I./../../include -I../../../../../src/interfaces/libpq -I../../include -I../../../../../src/include -L../../../../../src/port -L/usr/local/lib -Wl,-R'/home/buildfarm/buildfarm/HEAD/inst/lib' -L../../ecpglib -L../../pgtypeslib -L../../../libpq num_test2.c -lpgport -lintl -lssl -lcrypto -lz -lreadline -lcrypt -lm -lpgtypes -lecpg -lpq -o num_test2
/tmp/buildfarm/ccwtFkAf.o(.text+0x259): In function `main':
/home/buildfarm/buildfarm/HEAD/pgsql.67800/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc:102: undefined reference to `PGTYPESdecimal_new'
/tmp/buildfarm/ccwtFkAf.o(.text+0x292):/home/buildfarm/buildfarm/HEAD/pgsql.67800/src/interfaces/ecpg/test/pgtypeslib/num_test2.pgc:118: undefined reference to `PGTYPESdecimal_free'
gmake[5]: *** [num_test2] Error 1

I note that both those functions exist in ecpg's pgtypeslib in HEAD
but not in 8.1. I'm betting you have an older pgtypeslib.so in
/usr/local/lib and that the poorly-chosen order of -L flags in the
above command is the problem.

Basically the bug here is that src/interfaces/ecpg/test/Makefile.regress
does

override LDFLAGS += -L../../ecpglib -L../../pgtypeslib -L../../../libpq

which is guaranteed to create the wrong ordering of -L switches compared
to anything coming from "configure --with-libraries". We need all the
-L switches for inside-the-build-tree directories to come before all the
ones for other places. pg_xs.mk does this by the simple expedient of
including PG_LIBS before LDFLAGS on the link command line;
Makefile.shlib has a more complex approach involving surgery on LDFLAGS
itself; but one way or the other you need to be careful.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shoaib Mir 2006-08-09 21:15:10 Re: WIN32 Build?
Previous Message Andrew Dunstan 2006-08-09 21:04:42 Re: Buildfarm failure on ecpg/test/pgtypeslib