Bugs item #2020269, was opened at 2008-07-17 07:33 Message generated for change (Comment added) made by stmane You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2020269&group_id=56967
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: Pathfinder CVS Head Status: Open Resolution: None Priority: 5 Private: No Submitted By: Stefan Manegold (stmane) Assigned to: Ying Zhang (yingying) Summary: PF/runtime fails to link on Darwin (MacOS X) Initial Comment: pathfinder/runtime fails to link on Darwin (MacOS X): ======== [...] ld: multiple definitions of symbol _xrpc_admin .libs/lib_xrpc_client_la-xrpc_client.o definition of _xrpc_admin in section (__DATA,__common) ./.libs/libserialize.a(libserialize_la-serialize_dflt.o) definition of _xrpc_admin in section (__DATA,__common) ./.libs/libxrpc_common.a(libxrpc_common_la-xrpc_common.o) definition of _xrpc_admin in section (__DATA,__common) [...] /usr/bin/libtool: internal link edit command failed make[4]: *** [lib_xrpc_client.la] Error 1 ======== see also http://www.ins.cwi.nl/~monet/permastore/2008-07-17/Current/make-pathfinder-GNU.32.32.d-Darwin8.11.0.errors.html#l333 http://monetdb.cwi.nl/testing/projects/monetdb/Current/pathfinder/.GNU.32.32.d-Darwin8.11.0..2008.07.17_00-09-01/make.out.html http://monetdb.cwi.nl/testing/projects/monetdb/Current/pathfinder/.GNU.32.32.d-Darwin8.11.0..2008.07.17_00-09-01/make-k.out.html The reason seems to be that --- in contrast to, e.g., the "sloppy" GNU/gcc linker on Linux --- the linker on Darwin (correctly) does not like to link together object files that all (independendtly!) define the same (supposed to be shared??) global variables. In fact, I do not know, whether the BAT* xrpc_* variables defined in xrpc_common.mx's .h file --- and hence in each .o file whos .c file includes the xrpc_common.h --- just "happen to have" the same name in each of these .o files, or whether they are supposed to be shared among them. I also don't know, how the linker on Linux handles/solves (if at all) this conflict. In case these variables are supposed to be shared, you might want to define them in one .c/.o file, only (say xrpc_common.c) and declare them "extern" in all other .c/o. files that share them (e.g., by having these include the xrpc.common.h and putting the extern declaration there). In fact, the "extern" should of course be a proper export/import declaration to also work on Windows... ---------------------------------------------------------------------- >Comment By: Stefan Manegold (stmane) Date: 2008-07-17 08:19 Message: Logged In: YES user_id=572415 Originator: YES In fact, some (most?) of these variable might not be used at all. Please check carefully! ---------------------------------------------------------------------- Comment By: Stefan Manegold (stmane) Date: 2008-07-17 08:15 Message: Logged In: YES user_id=572415 Originator: YES A simple analysis reveals each of the BAT* xrpc_* variables from xrpc_common.h is used in either xrpc_server.c or xrpc_client.c, only; hence, I would suggest to define those variables also only in the very .c that actually uses them. Why make the code more "complicated" (and hence error-prone) than necessary...? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2020269&group_id=56967 ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Monetdb-bugs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/monetdb-bugs
