Problem linking libecpg.5.3.dylib on OS X

Started by Jim C. Nasbyabout 19 years ago3 messages
#1Jim C. Nasby
jim@nasby.net

I'm seeing the following on cuckoo:

gcc -pipe -no-cpp-precomp -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Winline -Wdeclaration-after-statement -Wendif-labels
-fno-strict-aliasing -g -dynamiclib -install_name
/Users/buildfarm/buildfarm/HEAD/inst/lib/libecpg.5.dylib
-compatibility_version 5 -current_version 5.3 -multiply_defined
suppress execute.o typename.o descriptor.o data.o error.o prepare.o
memory.o connect.o misc.o path.o thread.o -L../pgtypeslib
-L../../../../src/interfaces/libpq -L../../../../src/port
-L/opt/local/lib -lpgtypes -lpq -lm -o libecpg.5.3.dylib
ld: Undefined symbols:
_ecpg_internal_regression_mode
/usr/bin/libtool: internal link edit command failed
make[4]: *** [libecpg.5.3.dylib] Error 1

http://lnk.nu/pgbuildfarm.org/cxd.pl

Any suggestions? Google and the archives aren't turning anything up :(
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jim C. Nasby (#1)
Re: Problem linking libecpg.5.3.dylib on OS X

"Jim C. Nasby" <jim@nasby.net> writes:

I'm seeing the following on cuckoo:
-L/opt/local/lib -lpgtypes -lpq -lm -o libecpg.5.3.dylib
ld: Undefined symbols:
_ecpg_internal_regression_mode
/usr/bin/libtool: internal link edit command failed

It looks like Joachim's last patch thinks it's OK for libecpg to try to
reference a variable declared by the calling program. This will
surely Not Work everywhere, and even if it did work it'd be a bad idea
because it would guarantee that existing calling programs would break at
the next libecpg update. The reference has to go the other way.

Actually I'd suggest that using an exported variable at all is probably
bad style. I'd suggest that libecpg export a set() function instead:

static int ecpg_regression_mode = 0;

void ecpg_set_regression_mode(int mode) {
ecpg_regression_mode = mode;
}

regards, tom lane

#3Michael Meskes
meskes@postgresql.org
In reply to: Tom Lane (#2)
Re: Problem linking libecpg.5.3.dylib on OS X

On Thu, Jan 11, 2007 at 10:47:32PM -0500, Tom Lane wrote:

Actually I'd suggest that using an exported variable at all is probably
bad style. I'd suggest that libecpg export a set() function instead:
...

I think I found an easier solution. With my latest commit ecpg uses a
#define to set a different debug level and the lib sets the regression
flags according to that level. This still needs a global variable in the
library but it is not accessed from the outside.

Hopefully this works on all archs.

Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!