Re: Solaris ODBC - linker flag needs to be set when building shared objects

Lists: pgsql-bugs
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Solaris ODBC - linker flag needs to be set when building shared objects
Date: 2000-12-12 18:37:25
Message-ID: 200012121837.eBCIbPZ04484@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Mike McDonough (mpm(at)goldwiretech(dot)com) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Solaris ODBC - linker flag needs to be set when building shared objects

Long Description
Linker flag which needs to be set when building shared objects to prevent a symbol in the executable overriding one in the shared object: '-Bsymbolic' needs to be set in Makefile.shlib. This flag is set for linux builds, but not for solaris.

LDFLAGS_ODBC := -Bsymbolic

Sample Code
Makefile.shlib:

---- CUT -------
ifeq ($(PORTNAME), linux)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -Bdynamic -shared -soname $(shlib)
LDFLAGS_ODBC := -Bsymbolic -lc -lm
SHLIB_LINK += -lc
CFLAGS += $(CFLAGS_SL)
endif

ifeq ($(PORTNAME), solaris_i386)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
#+++rwhit, 12/12/00 added -Bsymbolic to fix SQLPrimaryKeys() - it's calls
# to other SQL*() functions were being resolved by
# the driver manager versions rather than the pgsql
# versions
LDFLAGS_ODBC := -Bsymbolic
SHLIB_LINK += -ldl -lsocket -lresolv -lnsl -lm -lc
CFLAGS += $(CFLAGS_SL)
endif

ifeq ($(PORTNAME), solaris_sparc)
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
LDFLAGS_SL := -G
#+++rwhit, 12/12/00 added -Bsymbolic to fix SQLPrimaryKeys() - it's calls
# to other SQL*() functions were being resolved by
# the driver manager versions rather than the pgsql
# versions
LDFLAGS_ODBC := -Bsymbolic
SHLIB_LINK += -ldl -lsocket -lresolv -lnsl -lm -lc
CFLAGS += $(CFLAGS_SL)
endif
--- END CUT ---

No file was uploaded with this report


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: <mpm(at)goldwiretech(dot)com>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Solaris ODBC - linker flag needs to be set when building shared objects
Date: 2000-12-13 19:09:17
Message-ID: Pine.LNX.4.30.0012132006290.1277-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> Mike McDonough (mpm(at)goldwiretech(dot)com) reports a bug with a severity of 2

> Solaris ODBC - linker flag needs to be set when building shared objects

> Long Description

> Linker flag which needs to be set when building shared objects to
> prevent a symbol in the executable overriding one in the shared
> object: '-Bsymbolic' needs to be set in Makefile.shlib. This flag is
> set for linux builds, but not for solaris.

> #+++rwhit, 12/12/00 added -Bsymbolic to fix SQLPrimaryKeys() - it's calls
> # to other SQL*() functions were being resolved by
> # the driver manager versions rather than the pgsql
> # versions

Can you explain why this flag is needed? What call is getting resolved
how and how should it have been resolved? Since this flag is only
portable to ELF systems the problem should really be fixed some other way.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/