Re: weird lib problem building PostgreSQL - Mailing list pgsql-ports

From Louis Bertrand
Subject Re: weird lib problem building PostgreSQL
Date
Msg-id Pine.BSO.4.10.9907301532120.9425-100000@tronix.bertrandtech.on.ca
Whole thread Raw
List pgsql-ports
[Followup to my previous posts, cross-posting to both ports list.]

I'm still trying to find out why I can't build ODBC support for PostgreSQL
under OpenBSD. No help so far, so I keep digging...

The error I get is:
ld -x -Bshareable -Bforcearchive -o libpsqlodbc.so.0.25 info.o bind.o
columninf o.o connection.o convert.o drvconn.o environ.o execute.o lobj.o
misc.o options.o pgtypes.o psqlodbc.o qresult.o results.o socket.o parse.o
statement.o gpps.o tu ple.o tuplelist.o dlg_specific.o -lcompat -lm
-lreadline -ltermcap -lcurses
/usr/lib/libcompat.a(regerror.o): Definition of symbol `_v8_regerror'
(multiply defined)
/usr/lib/libcompat.a(regex.o): Definition of symbol `_v8_regerror'
(multiply defined)
gmake: *** [libpsqlodbc.so.0.25] Error 1

As I understand it, the error comes from ld when it tries to create a
shared library for odbc support and finds duplicate symbols (_v8_regerror)
in /usr/lib/libcompat.a . "-lcompat" gets introduced by the top level
configure.in with macro AC_CHECK_LIB(compat, main) which finds main() in
libcompat.a and adds the -lcompat to the command line.

I don't get the error on the non-odbc build of postgresql because cc
appears to handle this library without a glitch, for example
  cc -o pg_id -L../../interfaces/libpq pg_id.o -lpq -L/usr/local/lib
   -lcompat -lm -lreadline -ltermcap -lcurses

dmesg:
OpenBSD 2.5-current (GENERIC) #282: Wed Jun  2 15:54:14 MDT 1999
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: F00F bug workaround installed
cpu0: Intel Pentium (P54C) ("GenuineIntel" 586-class) 100 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,MCE,CX8

cc -v:
gcc version egcs-2.93.22 19990517.

I'm trying to understand why ld complains and cc doesn't, or how I can
solve or at least work around this problem. This whole experience of
updating and maintaining a port has been extremely frustrating. Any help
is much appreciated.

Thanks
 --Louis  <louis@bertrandtech.on.ca>

Louis Bertrand       http://www.bertrandtech.on.ca
Bertrand Technical Services, Bowmanville, ON, Canada

OpenBSD: Secure by default.  http://www.openbsd.org/

On Fri, 30 Jul 1999, Louis Bertrand wrote:

> Hello all,
>
> I ran across a weird lib problem while trying to build the ODBC support in
> PostgreSQL 6.5.1 (the rest seems to build fine, but I haven't properly
> checked out the regression tests). It's related to a port, so I'm posting
> in ports first. Feel free to redirect me to the appropriate list.
>
> I went to the source (-current) for /usr/lib/libcompat.a, looking for
> the duplication of symbol "_v8_regerror". I found the symbol defined in
> /usr/src/lib/libcompat/regexp/regerror.c but not elsewhere in the .c files
> under libcompat. Then I find in /usr/include/regexp.h:
>   #define regerror        v8_regerror
> followed by:
>   void v8_regerror __P((const char *));
>
> As far as I can tell, the 4.3/regex.c declares a function called
> regerror(), but including <regexp.h> renames regerror() with the #define
> to v8_regerror(), hence the conflict with regexp/regexp.c .
>
> Confused yet? I sure am... Could some kind soul help me make sense of this?
>
> Thanks
>  --Louis  <louis@bertrandtech.on.ca>
>
> Louis Bertrand       http://www.bertrandtech.on.ca
> Bertrand Technical Services, Bowmanville, ON, Canada
>
> OpenBSD: Secure by default.  http://www.openbsd.org/
>
>
>
>
>
>






pgsql-ports by date:

Previous
From: The Hermit Hacker
Date:
Subject: Stable vs Current (Was: Re: [HACKERS] Re: [PORTS] RedHat6.0 & Alpha)
Next
From: Ryan Kirkpatrick
Date:
Subject: Re: Stable vs Current (Was: Re: [HACKERS] Re: [PORTS] RedHat6.0 & Alpha)