Unit tests of internal functions

Russ Allbery rra at stanford.edu
Mon Dec 28 20:37:18 EST 2009


Ken Raeburn <raeburn at MIT.EDU> writes:

> Last I looked, though, libtool supported neither library
> initialization/finalization functions nor symbol export lists, and we
> use both (and perhaps eventually symbol versioning).  The export lists
> we could make do without, but the finalization support would be a
> problem for anything dynamically loading and unloading our libraries.
> Some platforms let you do it via source-file declarations to the
> compiler, but some require extra options to be passed to the linker on
> the command line.  Have you seen anything to indicate that they've
> addressed this?

Symbol export lists are supported; see -export-symbols.  Symbol versioning
is not.  For my packages, I handle that myself in Autoconf by selectively
adding extra linker options where needed and telling Libtool to just pass
them through.

It would be great to have native Libtool support for symbol versioning
where it is supported and dynamic creation of a symbol export list from
the version script where it isn't supported but symbol export lists are.
I suspect the Libtool maintainers feel the same way.  I haven't had the
time to contribute the work, though, since there's a relatively
straightforward workaround.

I haven't investigated library initialization and finalization functions,
but I suspect they're in the same situation as symbol versioning.

In both cases, adopting Libtool shouldn't make your life any *more*
complicated than it is right now.  You would just prepend -Wl, to your
existing linker options where you need them and then Libtool will pass
them along to the linker.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the krbdev mailing list