[freetds] Problem compiling on AIX 4.3.3.0

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Sep 21 08:03:52 EDT 2004


> > 
> > Here is the output of nm on tds/.libs/libtds.so.3  no .0 
> suffix on this
> > machine And this is the complete output for this lib
> >                      f          -
> > crt0main.s           f          -
> > end                  B  536871228
> > p_xargc              B  536871212       4
> > p_xargv              B  536871216       4
> > p_xrc                B  536871224       4
> > p_xrcfg              B  536871220       4
> 
> OK, that tells us your linker -- the thing that built this 
> shared library -- isn't exporting *any* FreeTDS functions.  
> That's why you're getting undefined symbol errors.  
> 
> > Here is what I found in tds/.libs/libtds_objects.a
> > 
> > nm ./libtds_objects.a | grep tds_alloc_login
> > §tds_alloc_login:F167 -        108
> > .tds_alloc_login     T       3264     288
> > tds_alloc_login      D      15852      12
> > tds_alloc_login      d      15676       4
> 
> That means '.tds_alloc_login' is in the static library; the 
> 'T' is the clue.  The error message said '.tds_alloc_login' 
> (with the leading dot) was undefined, and the static library 
> at any rate has that exact symbol, so you have a chance.   
> 
> I think I'd reconfigure with --disable-shared, and see if 
> tsql links.  
> 
> > Forgive my naiveté but where would I add the "-bloadmap or 
> -bnoquiet"
> > options so that they get run at the proper place for
> >  
> > cc -g -o .libs/tsql tsql.o  -lcurses -L../tds/.libs -ltds 
> -liconv -Wl,-blibpath:/usr/local/lib:/usr/lib:/lib
> 
> I don't know.  The suggestion came from ld(1), so they're 
> linker options.  Check your cc man page for how to pass 
> linker options on the cc command line.  On gcc, for example, 
> it would be "-Xlinker bloadmap".  If you want my guess, it'd be:
> 
> cc -g -o .libs/tsql tsql.o  -lcurses \
> 	-L../tds/.libs -ltds -liconv \
> 	-Wl,-blibpath:/usr/local/lib:/usr/lib:/lib \
> 	-Wl,-bloadmap,-bnoquiet
> 
> Linker problems are always a royal pain, partly because 
> linkers do a lot of magical stuff.  The way out is always the 
> same: you want to read your linker manual very carefully, 
> however tedious and obsure it may be.  What you really want 
> is the option to export symbols to shared libraries, but you 
> might settle, say, for the option that tells the linker to 
> prefer static libs to shared ones.  
> 
> Here's a hack: add "-llibtds.a" to the above command.  That 
> will bring in the FreeTDS symbols.  tsql should then work.  
> 
> Chris Eleveld mentions the libtool version.  The releases of 
> FreeTDS 0.62.3 and prior were generated with libtool 1.4a.  
> FreeTDS 0.62.4 and current snapshots use a later version, 
> 1.5.2 IIRC.  You might want to try an earlier/later release, 
> just to see.  Also, I found 
> http://www.nasi.com/pdfs/runninglinuxappsonaix.pdf.  Page 82 
> is interesting.  
> 

As usual you are an infinite source of informations :) How don't know how you can found all these documentations...
If libtool cause the problem you can also copy libtool script from another project that work. Consider also that libtool it's generating from configure prepending some define to ltmain.sh so you can search in your disk (AIX should have find command... or not?) ltmain.sh file, replace in FreeTDS source, configure again and rebuild. From a previous mail:

creating libtds_objects.la
(cd .libs && rm -f libtds_objects.la && ln -s ../libtds_objects.la
libtds_objects.la)
        /bin/sh ../../libtool --mode=link cc  -g    -o libtds.la -rpath
/usr/local/lib -version-info 3:0:0  libtds_objec
ts.la  -liconv ../replacements/libreplacements.la
generating symbol list for `libtds.la'
/usr/bin/nm -B -BCpg   ./.libs/libtds_objects.a
../replacements/.libs/libreplacements.a | awk '{ if ((($2 == "T") || ($2
 == "D") || ($2 == "B")) && (substr($3,1,1) != ".")) { print $3 } }' |
sort -u > .libs/libtds.exp
cc -Wl,-bM:SRE -o .libs/libtds.so.3    -liconv -lc
-Wl,-bE:.libs/libtds.exp -Wl,-bnoentry ${wl}-berok
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
make: 1254-004 The error code from the last command is 8.

as you can see libtool generated from FreeTDS configure strip all library names (cause it do not consider names that start with dot).

--disable-shared works however unixODBC require shared libraries to work so this workaround do not apply for you...

freddy77



More information about the FreeTDS mailing list