Skip to Content.
Sympa Menu

freetds - RE: [freetds] tsql problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "kevin bartz" <kbartz AT loyaltymatrix.com>
  • To: "'FreeTDS Development Group'" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] tsql problem
  • Date: Fri, 18 Jun 2004 17:51:41 -0700

Hi James! Thanks for your reply and for all your help. I have to go home
from work now, but I'll be back on Monday and try out some of your tips! I'm
looking forward to it! I'll get back to you then about what happens. Thanks
and enjoy your weekend,

Kevin

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of James K. Lowden
Sent: Friday, June 18, 2004 5:50 PM
To: FreeTDS Development Group
Subject: Re: [freetds] tsql problem

On Fri, 18 Jun 2004 <kbartz AT loyaltymatrix.com> wrote:
> Hi James!

Hi Kevin,

> Thanks for your help. I learned quite a bit from your response,
> and am now a bit more comfortable with my runtime linker! I thought I
> would let you know what happened when I ran the commands you suggested.
> First,
>
> kevin@redtail:~/test> readelf -d `which tsql` |sed -ne1,/rpath/p
>
> Dynamic segment at offset 0x3428 contains 22 entries:
> Tag Type Name/Value
> 0x0000000000000001 (NEEDED) Shared library:
> [libreadline.so.4] 0x0000000000000001 (NEEDED) Shared
> library: [libtds.so.3] 0x0000000000000001 (NEEDED) Shared
> library: [libc.so.6] 0x000000000000000c (INIT) 0x4014f8

Well, there's a surprise. Recall mine:

> Tag Type Name/Value
> 0x00000001 (NEEDED) Shared library:
> [libcurses.so.5] 0x00000001 (NEEDED) Shared
> library: [libtds.so.3] 0x00000001 (NEEDED) Shared
> library: [libc.so.12] 0x0000000f (RPATH) Library
> rpath: [/usr/local/lib]

tsql on your system is linking in libreadline, but on mine it's linking in
libcurses. How about them apples? (My ldd(1) also says it wants
libcurses.)

The job of untangling which to use belongs to configure. On my system:

$ grep READLINE build/config.log
READLINE_LIBS='-lcurses '

Bet yours doesn't say that. I wonder if it should?

Looking at configure, it's testing for tgetent(3), looking in readline,
ncurses, curses, and termcap, in that order. It would seem your (newer?)
readline has that function. The order of preference is controlled by
configure.in, a file that belongs to FreeTDS. If the test is outmoded, we
could fix it.

> kevin@redtail:~/test> nm /usr/local/lib/libreadline.so.4 |grep BC
> U abort@@GLIBC_2.2.5
> U access@@GLIBC_2.2.5
> U BC
> U closedir@@GLIBC_2.2.5
>
> Does this mean anything?

Yes. It means your linker isn't schizophrenic: nm is telling you BC is
undefined in readline, which is what ld.so complained about, too. ("info
nm" and search for [`U'] without the brackets.)

What to do? I'm not sure. First, I'd use nm to see if your regular
ncurses defines BC, like mine does, and I'd double check that it doesn't
define tgetent(3). If those things are both true, you need to link in
both libraries to get tsql to work. If you kept a log of the "make"
output (or rerun it), you'll see the command line that linked tsql.
Situate yourself in the right directory, modify the command to include the
extra library, and go home happy.

(Assuming quite a few things, of course.) ;-)

If that actually works, please say so. I don't know what the right remedy
is, but if that -- missing ncurses for 64-bit Suse in tsql -- is the
actual problem, I'd like to see it fixed, so it compiles out-of-the-box
next time.

Regards,

--jkl


> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of James K. Lowden
> Sent: Friday, June 18, 2004 3:44 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] tsql problem
>
> On Fri, 18 Jun 2004, "kevin bartz" <kbartz AT loyaltymatrix.com> wrote:
> > ldd gives
> >
> > kevin@redtail:~/test> ldd /usr/local/bin/tsql
> >
> > libreadline.so.4 => /usr/local/lib/libreadline.so.4
> > libtds.so.3 => not found
> > libc.so.6 => /lib64/libc.so.6
>
> You want to understand your runtime linker a little better, not that
> that's everyone's favorite pasttime.
>
> And ELF binary can incorporate runtime link paths. I'm curious, what
> does your machine show for this:
>
> $ readelf -d `which tsql` |sed -ne1,/rpath/p
>
> Dynamic segment at offset 0x2e6c contains 20 entries:
> Tag Type Name/Value
> 0x00000001 (NEEDED) Shared library:
> [libcurses.so.5] 0x00000001 (NEEDED) Shared
> library: [libtds.so.3] 0x00000001 (NEEDED) Shared
> library: [libc.so.12] 0x0000000f (RPATH) Library
> rpath: [/usr/local/lib]
>
> (ISTR Linux systems often don't use the RPATH entry. I guess it would
> be set by libtool.)
>
> Regarding readline,
>
> $ nm /usr/pkg/lib/libreadline.so.4 |grep BC
> 00028ebc B BC
>
> On my system, libreadline.so.4 points to libreadline.so.4.3. Yours?
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds






Archive powered by MHonArc 2.6.24.

Top of Page