Skip to Content.
Sympa Menu

freetds - Re: [freetds] freetds on solaris 11: symbol scope specifies local binding (same problem)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: freetds AT lists.ibiblio.org
  • Subject: Re: [freetds] freetds on solaris 11: symbol scope specifies local binding (same problem)
  • Date: Mon, 23 Sep 2013 13:42:27 -0400

On Mon, 23 Sep 2013 08:53:31 +0100
"Marco A. Ferra" <MAFerra AT isq.pt> wrote:

> Regarding Justin Pryzby's question on "freetds on solaris 11: symbol
> scope specifies local binding" [1] I'm also having a hard time
> compiling FreeTDS 0.91 from source on Solaris 11. The error is:
>
>
> libtool: link: gcc -shared -Wl,-z -Wl,text -Wl,-M
> -Wl,.libs/libct.so.4.0.0.exp -Wl,-h -Wl,libct.so.4 -o
> .libs/libct.so.4.0.0 .libs/ct.o .libs/cs.o .libs/blk.o .libs/ctutil.o
> -Wl,-z -Wl,allextract ../tds/.libs/libtds.a
> ../replacements/.libs/libreplacements.a -Wl,-z -Wl,defaultextract
> -lnsl -lsocket -lc -pthreads -pthreads
> Undefined first referenced
> symbol in file
> strlen .libs/ct.o (symbol scope
> specifies local binding)
> ld: fatal: symbol referencing errors. No output written to
> .libs/libct.so.4.0.0
> collect2: ld returned 1 exit status

My GNU ld manual doesn't mention options such as those on your command
line, e.g. allextract and defaultextract. Since those options are
accepted by the linker, I have to believe you're using the Solaris
linker. Perhaps Solaris's compiler, too?

The first thing to understand -- which I don't, yet -- is what the error
means. I think it means that ct.o contains a reference to the symbol
strlen that specifies local binding, meaning the linker is not free to
use the strlen from libc. nm(1) will tell you the answer if you're
patient.

If so, I would look at how ct.o was compiled, and look for options you
don't need. For example, -fstack-protector seems like it might be a
liability:

https://github.com/duosecurity/duo_unix/issues/17

or maybe it's optimization:

https://bugs.freedesktop.org/show_bug.cgi?id=49669

because it's easy to make go fast if it doesn't have to work.

Recompile it until nm(1) says it's a normal everyday symbol your
grandmother would recognize. Then link, then go back and reconfigure
with CFLAGS set more helpfully.

Or it's something else, perhaps something extremely tedious in the
linker script, cf.

http://sourceware.org/binutils/docs/ld/VERSION.html

if there is one. There aren't any explicit linker scripts in the
FreeTDS build, but that doesn't mean one isn't invoked somewhere on
your system.

HTH.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page