Subject: Re: OS/X linker problems
To: None <mlh@goathill.org>
From: Dan Winship <danw@NetBSD.org>
List: tech-pkg
Date: 12/05/2003 13:40:54
On Dec 3, 2003, at 2:13 AM, MLH wrote:
> Mac OS/X exhibits linking problems with many pkgsrc packages,
> whereby the linker can't locate symbols in a library compiled via
> pkgsrc. For example:
> ld: multiple definitions of symbol CORBA_sequence_CORBA_string(float,
> long double,...)(...)
> .libs/libgconf-1.1.4.dylib-master.o definition of
> CORBA_sequence_CORBA_string(float, long double,...)(...) in section
> (__TEXT,__text)
> /usr/pkgsrc/devel/GConf/work.MAC300/.buildlink/
> libliboaf.dylib(liboaf.0.0.dylib-master.o) definition of
> CORBA_sequence_CORBA_string(float, long double,...)(...)
The problem isn't missing symbols, it's *duplicate* symbols. libgconf
and liboaf are both trying to define CORBA_sequence_CORBA_string. For
some reason, the ELF linker allows this without complaint, but Mach-O
won't.
I think the easiest fix in this case is to patch gconf to not use
sequence<string> in its idl (by typedef'ing something else to string
and using a sequence of that instead). That won't cause any problems
with other packages, since gconf's idl file isn't installed and isn't
part of its ABI. But if there are other places where two *installed*
idl files both use sequence<string>, it might be harder to fix.
(The GNOME 2 platform avoids this problem because sequence<string> is
one of the core types defined in libORBit-2 itself, so GConf2 and
bonobo-activation don't need to implement the functions. I am not sure
if this was intentional or merely fortuitous. :-)
-- Dan