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

Justin T Pryzby justinp at norchemlab.com
Mon Sep 30 21:13:02 EDT 2013

On Mon, Sep 30, 2013 at 10:44:17AM +1300, Brent Jackson wrote:
> I vaguely recall encountering a similar problem when I compiled 
> FreeTDS 0.65 back in 2007.
> I think I avoided the problem by setting the FREETDS_LIBGCC variable 
> in the dtlib/Makefile to explicitly specify my libgcc.a file, so as 
> to use the GCC version of strlen() instead of the Solaris one.

I tried this, it didn't really help; I believe libgcc is a gcc
runtime; there is no solaris libgcc, just solaris libc.

However, in the process of messing around with that idea, I tried
gsed -i 's/strlen/zstrlen/g' src/ctlib/*.c

Which (amazingly) allows the whole thing to compiled (zstrlen is any
random symbol name, not some replacement defined somewhere).  That may
not help much, but it does mean the problem is specific to strlen().

After installing, I even succeeded in compiling DBD::Sybase with:
SYBASE=/usr/local perl Makefile.PL &&
  make CC='gcc -m64' LD='gcc -m64' OPTIMIZE=-O3 CCCDLFLAGS='-fPIC'

I nuked the TDS src dir for further testing; running James' ld command
without "-lc -lsocket -lnsl" confirms the above: many libc functions
are shown as undefined, but only strlen says "(symbol scope specifies
local binding)".


More information about the FreeTDS mailing list