cone-0.78.20090507: link problems on Mac OSX

Uffe Jakobsen <[email protected]> Thu, 04 Jun 2009 20:38:38 +0200
Newsgroups gmane.mail.cone
Message-ID <[email protected]>
Hi,

I'm in the process of compiling the newest cone-0.78.20090507 snapshot 
on Mac OSX.

During the make (build) it fails linking the tests in the "rfc1035" 
subdir - se output below:

Making all in rfc1035
make  all-am
/bin/sh ./libtool --tag=CC   --mode=link gcc  -g -O2 -Wall -I./.. -I.. 
-static  -o testlookup testlookup.o librfc1035.a ../soxwrap/libsoxwrap.a 
../md5/libmd5.la ../random128/librandom128.la `cat ../soxwrap/soxlibs.dep`
gcc -g -O2 -Wall -I./.. -I.. -o testlookup testlookup.o  librfc1035.a 
../soxwrap/libsoxwrap.a ../md5/.libs/libmd5.a 
../random128/.libs/librandom128.a
Undefined symbols:
   "_rfc1035_default_resolver", referenced from:
       _rfc1035_default_resolver$non_lazy_ptr in testlookup.o
       _rfc1035_default_resolver$non_lazy_ptr in librfc1035.a(spf.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [testlookup] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2


Looking into the problem:

"_rfc1035_default_resolver" is found inside librfc135.a objecfile 
"rfc1035_res.o"

dumping librfc1035.a shows (cmd: ar t librfc1035.a)
__.SYMDEF SORTED
rfc1035.o
rfc1035_res.o
rfc1035an.o
rfc1035dump.o
rfc1035dumprrdata.o
rfc1035fmttime.o
rfc1035gettxt.o
rfc1035ifconf.o
rfc1035ipv6to4.o
rfc1035mkaddress.o
rfc1035mksocket.o
rfc1035mxlist.o
rfc1035qa.o
rfc1035qptr.o
rfc1035reply.o
rfc1035resolve.o
rfc1035sameip.o
rfc1035search.o
rfc1035sockaddrip.o
rfc1035sockaddrport.o
rfc1035str.o
rfc1035tcp.o
rfc1035udp.o
rfc1035bindsource.o
spf.o

since spf.o (last objectfile inside librfc1035.a) needs 
"_rfc1035_default_resolver".
My guess is that I've run into the usual problem with ".a" archive-files:

Normally, an archive is searched only once in the order that it is 
specified on the command line. If a symbol in that archive is needed to 
resolve an undefined symbol referred to by an object in an archive that 
appears later on the command line, the linker would not be able to 
resolve that reference.

I know that most cone users reside on linux platforms - and I tried 
googling and found only one old reference related to the same problem:

http://markmail.org/message/dl4eas6ntxqeraib


On linux problems like this is normally is solved with the 
"--whole-archive" or "--start-group" and "--end-group" linker options.

please search this webpage for "--whole-archive" or "--start-group" and 
"--end-group":
http://sourceware.org/binutils/docs-2.19/ld/Options.html


Question: does linux compile out of pure luck ? - because I know for 
sure that linux (binutils) ld's have the same problem - but maybe the 
objectfile ordering inside librfc1035.a is different on linux ?


DETAILS:

uname -a:
Darwin mac01.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 
22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386


gcc -v:
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc_42/gcc_42-5566~1/src/configure 
--disable-checking --enable-werror --prefix=/usr --mandir=/usr/share/man 
--enable-languages=c,objc,c++,obj-c++ 
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib 
--build=i686-apple-darwin9 --with-gxx-include-dir=/usr/include/c++/4.0.0 
--host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5566)


Kind regards Uffe Jakobsen


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Courier-cone mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-cone