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

James K. Lowden jklowden at freetds.org
Mon Sep 23 13:42:27 EDT 2013

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

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


or maybe it's optimization: 


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. 


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.  



More information about the FreeTDS mailing list