Re: Re: [PATCHES] Fix for ODBC close

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL odbc list <pgsql-odbc(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [PATCHES] Fix for ODBC close
Date: 2001-02-10 15:58:19
Message-ID: 200102101558.KAA24180@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-odbc pgsql-patches

> Bruce Momjian writes:
>
> > I just tried gcc and got:
> >
> > #$ gcc -shared -soname libpsqlodbc.so.0 -Bsymbolic info.o bind.o
> > columninfo.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 tuple.o tuplelist.o dlg_specific.o
> > -L/usr/local/lib -L/usr/contrib/lib -lm -o libpsqlodbc.so.0.26
> > gcc: unrecognized option `-soname'
> > gcc: file path prefix `symbolic' never used
>
> Try gcc -shared -Wl,-soname,libpsqlodbc.so.0 -Wl,-Bsymbolic ...

OK, this works:

gcc -shared -Wl,-Bsymbolic,-soname,libpsqlodbc.so.0 info.o bind.o
columninfo.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 tuple.o tuplelist.o dlg_specific.o
-L/usr/local/lib -L/usr/contrib/lib -lm -lc -o libpsqlodbc.so.0.26

I replaced the 'ld' with 'gcc -Wl', and that prevents the need for the
crt1.o.

It still requires -lc:

ifneq ($(PORTNAME), bsdi)
LINK.shared += $(shlib_symbolic)
else
LINK.shared = gcc -shared -Wl,-Bsymbolic,-soname,$(soname)
SHLIB_LINK += -lc
endif

It seems the -Bsymbolic needs the gcc, while other links are OK with ld.
We may find this is true on many platforms.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-02-10 16:44:31 Re: [HACKERS] Re: Open 7.1 items
Previous Message Bruce Momjian 2001-02-10 15:17:15 Re: Re: pg_ctl default shutdown mode

Browse pgsql-odbc by date

  From Date Subject
Next Message Bruce Momjian 2001-02-10 17:01:23 Re: Re: [PATCHES] Fix for ODBC close
Previous Message Bruce Momjian 2001-02-10 15:15:54 Re: RE: [PATCHES] Re: [HACKERS] 6.2 protocol

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-02-10 16:44:31 Re: [HACKERS] Re: Open 7.1 items
Previous Message Bruce Momjian 2001-02-10 15:15:54 Re: RE: [PATCHES] Re: [HACKERS] 6.2 protocol