A new chapter about linking oddities in the solaris port, asking for
advise, comments or ideas.
I've identified two problems or differences in the way the combo
gcc/binutils works, compared with SunStudio12/SunLinker:
1.-Implicit dependencies.
GNU ld follows implicit dependencies (meaning that if libB.so provides
symbol foo_b, and main.o references it, it gets resolved if main.o is
linked against some library linking libB.so). However, it seems that
this behaviour will change in 2.19, after reading this bug report:
http://www.mail-archive.com/bug-binut...@gnu.org/msg05910.html
The example works with ld 2.18.93.20081009 from ubuntu 8.10, but fails
(trusting the report) with 2.19, and also with solaris linker.
For the qpid case, as I've reported time ago, the problem arises when
we are indirectly using features from a shared library, say including a
header that is using some symbols from it. In the current situation
(with binutis 2.18), if that shared library is linked from another
shared library we are including in the linker list, the link stage will
succeed. But is seems that this won't be true anymore after 2.19,
neither it is with the solaris linker nowadays.
So, I would suggest here to add all the needed libraries, regardless
they are implicitly linked by others.
2.-Linkage of libraries.
Qpid plugins are passed the -no-undefined libtool option, that is
translated into -zdefs for the solaris linker. However, when Sun C++
compiler is requested to generate a shared library instead of an
executable, it doesn't pass to the linker the C++ runtime libraries
(libCrun and libCstd for Sun Studio 12), and this fact, combined with
the -zdefs flag, produces link failures.
Information about this can be found here:
http://forums.sun.com/thread.jspa?threadID=5369808&tstart=0
I think that the best option here would be to create some variable in
Makefile.am, like SUNCC_RUNTIME, and fill with the runtime dependencies
in case we are using the Sun Compiler, and add it to the PLUGINLDFLAGS
variable.
Regards
--
Manuel.
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org