Quoting Matthew Lye <m...@talkwireless.ca> from ml.softs.gtk-gnutella.devel: :Since the recent changes in ./src/sdbm, I have been encountering a :compile-time error originating with ./src/lib/utf8.o 's links to the :iconv library. My system is a ppc7450 iMac running OS X 10.5.8, which :has Darwin 9.8.0. : :> cc -o dbu dbu.o util.o -O2 -g -L. -lsdbm -L../lib -lshared -lglib :> collect2: ld terminated with signal 6 [Abort trap] :> Undefined symbols :> "_libiconv_open", referenced from: :> _utf8_cd_get in libshared.a(utf8.o)
The utf8.o file should not be loaded when linking dbu, since none of the UTF-8 routines are used by dbu nor by sdbm... :I believe that this problem has its roots in the Darwin OS's :implementation of /usr/lib/libiconv.* and/or /usr/include/iconv.h :being incompatible with the newer GNU versions, and that it involves :macros and C++; there are lots of message board posts reporting iconv :errors when people try to port projects to Darwin. Again, we're talking about a library here, and the normal linker behaviour should be to not load a file from the library unless one of the symbols defined by the file is needed. I've checked locally the symbols in my linked dbu, and I'm astonished to see that symbols like cq_cancel() are defined. :Any ideas or suggestions? You are pinpointing a lack of granularity in the "shared" library files that causes too much unnecessary stuff to be loaded due to transitive dependencies. Fixing this will probably require splitting the "shared" library in more than one so that we can only the files for the required symbols, which are: assertion_failure common_stats compat_pread compat_pwrite fd_close file_open h_strconcat h_strdup halloc_init hash_list_free hash_list_iter_previous hash_list_iter_release hash_list_iterator_tail hash_list_moveto_head hash_list_new hash_list_prepend hash_list_tail hfree hrealloc vmm_alloc vmm_free vmm_init walloc walloc0 wfree wrealloc >From that list, I can almost see where the problem lies: the fact that we need h_strdup() means that the whole misc.o file needs to be loaded, which in turn causes many other library files to be required given the diverse routines defined there. A first solution is therefore to start moving h_strconcat() and h_strdup() out of misc.c, and then things should be much more under control. Raphael ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ gtk-gnutella-devel mailing list gtk-gnutella-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel