Re: Problem linking libecpg.5.3.dylib on OS X - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Problem linking libecpg.5.3.dylib on OS X
Date
Msg-id 204.1168573652@sss.pgh.pa.us
Whole thread Raw
In response to Problem linking libecpg.5.3.dylib on OS X  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: Problem linking libecpg.5.3.dylib on OS X
List pgsql-hackers
"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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Checkpoint request failed on version 8.2.1.
Next
From: Joachim Wieland
Date:
Subject: Re: [COMMITTERS] pgsql: Stamp major release 8.3.0,