Mailinglist Archive: zypp-devel (18 mails)
| < Previous | Next > |
Re: [zypp-devel] Shared library for libsatsolver
- From: Michael Matz <matz@xxxxxxx>
- Date: Thu, 21 Apr 2011 15:18:43 +0200 (CEST)
- Message-id: <Pine.LNX.4.64.1104211508300.1989@wotan.suse.de>
Hi,
On Thu, 21 Apr 2011, Michael Tremer wrote:
I've meanwhile forgotten the cmake way of specifying linker argument, but
you have to somehow pass "-Wl,--version-script,libsatsolver.ver" to the
link command (if using gcc for linking). The file libsatsolver.ver would
be written by you and contains a list of all to-be-exported symbols with
their associated version, like:
% cat example.ver
SAT1.0 {
global:
some_function;
some_other_function;
local:
*;
};
(Once you have released such a shared library for good you never change
the content of the SAT1.0 section, you instead only ever add more version
sections, e.g. to export new symbols).
To get to the list of functions that are sensible to export there are two
easy strategies:
a) start with an empty version script, and add as many symbols as needed
until the whole repo and libzypp builds again
b) start with the list of symbols that are currently exported without a
version script (readelf -W --dyn-syms libsatsolver.so | grep -v UND)
and remove all that seem to be intended to be internal when thinking
about them.
Variant (a) is more fragile of course, because you have to be sure you
know all current users of the library, so I would recommend the (b) way.
Ciao,
Michael.
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
On Thu, 21 Apr 2011, Michael Tremer wrote:
Good point. I'm sorry I missed that. As I am not familiar with the
internals of libsatsolver, could someone support me with that?
I've meanwhile forgotten the cmake way of specifying linker argument, but
you have to somehow pass "-Wl,--version-script,libsatsolver.ver" to the
link command (if using gcc for linking). The file libsatsolver.ver would
be written by you and contains a list of all to-be-exported symbols with
their associated version, like:
% cat example.ver
SAT1.0 {
global:
some_function;
some_other_function;
local:
*;
};
(Once you have released such a shared library for good you never change
the content of the SAT1.0 section, you instead only ever add more version
sections, e.g. to export new symbols).
To get to the list of functions that are sensible to export there are two
easy strategies:
a) start with an empty version script, and add as many symbols as needed
until the whole repo and libzypp builds again
b) start with the list of symbols that are currently exported without a
version script (readelf -W --dyn-syms libsatsolver.so | grep -v UND)
and remove all that seem to be intended to be internal when thinking
about them.
Variant (a) is more fragile of course, because you have to be sure you
know all current users of the library, so I would recommend the (b) way.
Ciao,
Michael.
--
To unsubscribe, e-mail: zypp-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-devel+help@xxxxxxxxxxxx
| < Previous | Next > |