[freetds] linker and Darwin (Mac OS X)

James K. Lowden jklowden at schemamania.org
Sun Jun 13 14:28:47 EDT 2004


On Sun, 13 Jun 2004 17:32:53 +0200, Frediano Ziglio <freddyz77 at tin.it>
wrote:
> I did change in linker settings:
> - check for -Bsymbolic link flag and use it to reduce size and loading
> time. This should work now on all platforms (tested on Linux, Solaris,
> Mac OS X with GNU tools)

The symbol-reduction effort is still causing problems for me on NetBSD:

gcc -shared  .libs/ct.o .libs/cs.o .libs/blk.o .libs/ctutil.o
-Wl,--whole-archive ../tds/.libs/libtds_objects.a
../replacements/.libs/libreplacements.a -Wl,--no-whole-archive  
-Wl,-Bsymbolic -Wl,-soname -Wl,libct.so.3 -Wl,-retain-symbols-file
-Wl,.libs/libct.exp -o .libs/libct.so.3.0
.libs/ct.o: In function `_ct_get_msgstr':
/usr/local/website/DocumentRoot/projects/freetds/build/src/ctlib/../../..
/src/ctlib/ct.c:159: undefined reference to `asprintf'
.libs/ct.o: In function `_ctclient_msg':
/usr/local/website/DocumentRoot/projects/freetds/build/src/ctlib/../../..
/src/ctlib/ct.c:186: undefined reference to `free'
.libs/ct.o: In function `ct_con_alloc':
/usr/local/website/DocumentRoot/projects/freetds/build/src/ctlib/../../..
/src/ctlib/ct.c:226: undefined reference to `malloc'
[...]

I get around this with:

for T in src/*/Makefile
do
    sed 's/-export-symbols-regex.*$//' $T | diff -u $T - | patch
done

I haven't looked into it further to understand exactly what's wrong.  

--jkl



More information about the FreeTDS mailing list