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: "ZIGLIO, Frediano, VF-IT" <Frediano.Ziglio AT vodafone.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] libraries linked with a static path
  • Date: Wed, 1 Feb 2006 09:27:33 +0100

>
> 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?
>

Even if you compile binutils from source you will not get GNU linker...
ld do not still support HP-UX files (others utility do).

> I would appreciate if somebody could point me to the proper
> linker to use
> and where I can download it .
>
> Thanks
> Wolfgang
>
>
>
>
> configure:2322: gcc --version </dev/null >&5
> gcc (GCC) 3.4.4
> Copyright (C) 2004 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.
> There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
> PURPOSE.
>
> configure:2325: $? = 0
>
>
> configure:2541: checking whether we are using the GNU C compiler
> configure:2566: gcc -c -D_XOPEN_SOURCE_EXTENDED
> -D_FREETDS_LIBRARY_SOURCE conftest.c >&5
> configure:2569: $? = 0
> configure:2572: test -s conftest.o
> configure:2575: $? = 0
> configure:2588: result: yes
>
>
> 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
>
....
>
> Wolfgang Gruen wrote:
> > I am building the libraries on HP with unixODBC and two
> libraries get
> > added as libraries with a static path to the library
> libtdsodbc.sl in
> > the ODBC component. 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.
> >
> > Does somebody know why this is happening? I see it being
> added with the
> >
> > -l parameter in the Makefile and couldn't figure out where
> we add the
> > entire path.
> ...
> > gcc -shared -fPIC -Wl,+h -Wl,libtdsodbc.sl.0 -Wl,+b
> > -Wl,/home/i3build/freetds/lib -o .libs/libtdsodbc.sl.0.0
> .libs/odbc.o
> > .libs/connectparams XXXXX
> > -L/home/i3build/unixODBC/lib
> /home/i3build/unixODBC/lib/libodbcinst.sl
> > /usr/local/lib/libiconv.sl -lc -lc -Wl,-Bsymbolic
>

The problem is that libtool calls gcc (used to link in this case) with
full path. Instead of

gcc -shared -fPIC -Wl,+h -Wl,libtdsodbc.sl.0 -Wl,+b
-Wl,/home/i3build/freetds/lib -o .libs/libtdsodbc.sl.0.0 .libs/odbc.o
.libs/connectparams XXXXX -L/home/i3build/unixODBC/lib
/home/i3build/unixODBC/lib/libodbcinst.sl /usr/local/lib/libiconv.sl
-lc -lc -Wl,-Bsymbolic

if should use

gcc -shared -fPIC -Wl,+h -Wl,libtdsodbc.sl.0 -Wl,+b
-Wl,/home/i3build/freetds/lib -o .libs/libtdsodbc.sl.0.0 .libs/odbc.o
.libs/connectparams XXXXX -L/home/i3build/unixODBC/lib -lodbcinst
-liconv -lc -Wl,-Bsymbolic

I don't know why libtool find libraries for you... you could try to
replace libtool (you will find this file on source after configure step)
with a version you prefer.

freddy77



  • Re: [freetds] libraries linked with a static path, ZIGLIO, Frediano, VF-IT, 02/01/2006

Archive powered by MHonArc 2.6.24.

Top of Page