Skip to Content.
Sympa Menu

freetds - Re: [freetds] libraries linked with a static path

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] libraries linked with a static path
  • Date: Tue, 31 Jan 2006 18:26:52 -0500

> From: Wolfgang Gruen
> Sent: Tuesday, January 31, 2006 4:30 PM
>
> It looks like I am building with the gnu compiler, but not linking
> with the gnu linker. I assume I need to install gnu binutils?
>
> I would appreciate if somebody could point me to the proper linker
> to use and where I can download it.
...
> Linker is noto gnu linker: configure:3411: checking for ld used
> by gcc configure:3478: result: /usr/ccs/bin/ld configure:3487:
> checking if the linker (/usr/ccs/bin/ld) is GNU ld configure:3502:
> result: no
>
> -bash-3.00$ ld -V 92453-07 linker command s800.sgs ld PA64 B.11.40
> REL 040528 ld: 92453-07 linker linker ld B.11.40 040530 ld: Usage:
> ld [options] [flags] files

Are you sure you want to use the GNU linker? I wasn't suggesting you
should; I was only saying I don't know yours. Your question was
(basically) "How do I change what my linker is doing?" and the answer
(basically) is "RTFM". ;-)

>From what little I know of proprietary unices, I'd try using the
proprietary linker.

Let's begin here:

http://docs.hp.com/en/B2355-60105/ld_pa.1.html

I think that matches what configure reported. It says:

+b path_list Specify a colon-separated list of directories to
be searched at program run-time to locate shared
libraries needed by the executable output file
that were specified with either the -l or -l:

+s Indicates that the shared library loader can use
the environment variable SHLIB_PATH to locate
shared libraries needed by the executable output
file that were specified with either the -l or -l:
(Series 700/800) option. The SHLIB_PATH
environment variable should be set to a colon-
separated list of directories. If both +s and +b
are used, their relative order on the command line
indicates which path list will be searched first
(see the +b option).

and we also know that "-Wl" is IIRC the POSIX way for a compiler to pass
options to a linker, so we know that:

> > gcc -shared -fPIC -Wl,+h -Wl,libtdsodbc.sl.0 -Wl,+b
> > -Wl,/home/i3build/freetds/lib -o .libs/libtdsodbc.sl.0.0

passes '+b /home/i3build/freetds/lib' to /usr/ccs/bin/ld.

What to do? Choices:

1. Find out where "/home/i3build/freetds/lib" came from, and change it.

2. LDFLAGS=+s ./configure

(Cf. ./configure --help | grep FLAGS)

Security-minded people recommend not letting the runtime linker search
for shared objects and would recommend #1. Option #2 is quick and
addresses your original complaint:

> > When the loader tries to
> > resolved the libraries, it will ignore the environment variable
> > SHLIB_PATH, since the library is added with a static path.

http://docs.hp.com/en/B2355-60105/chatr_pa.1.html

For a really quick-and-dirty test, try this:

$ chatr +s enable libtdsodbc.sl.0.0

Then set SHLIB_PATH and take the rest of the day off.

HTH.

--jkl

-----------------------------------------
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent
responsible
for delivering this message to the intended recipient, any review,
dissemination,
distribution or duplication of this communication is strictly prohibited. If
you are
not the intended recipient, please contact the sender immediately by reply
e-mail
and destroy all copies of the original message. Please note that we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.



  • Re: [freetds] libraries linked with a static path, Lowden, James K, 01/31/2006

Archive powered by MHonArc 2.6.24.

Top of Page