This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Symbol versions in libc.a
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Tue, 20 Aug 2013 21:14:59 +0000
- Subject: Symbol versions in libc.a
I'm looking at removing --disable-versioning, as proposed in
<http://sourceware.org/ml/libc-alpha/2013-07/msg00174.html>.
Mostly this is straightforward. The presumption that versioning is always
enabled for shared-library builds means that $(versioning) makefile
conditionals become $(build-shared) (the conditionals may not always be
needed at all, but $(build-shared) is a safe conversion). The
corresponding preprocessor macro is DO_VERSIONING.
When DO_VERSIONING is used together with SHARED, it's a simple matter of
removing the DO_VERSIONING conditional. There are however places where
it's used on its own. A couple of those in testcases (that are only built
when shared libraries are built) are unproblematic. The problem comes in
shlib-compat.h and libc-symbols.h.
In shlib-compat.h, we have
#if defined DO_VERSIONING
/* Since there is just one set of .d files generated, we need to
include this unconditionally to have the dependency noticed properly. */
#include <abi-versions.h> /* header generated by abi-versions.awk */
#endif
which appears to assert a need for the #include even when building objects
for static libraries, if (versioned) shared libraries are built at all. I
don't know what "just one set of .d files generated" is referring to - I
certainly see separate .o.d and .os.d files - so I suspect this is in fact
an obsolete comment and a conditional on SHARED would be fine.
In libc-symbols.h, DO_VERSIONING on its own controls the definitions of
macros such as symbol_version and default_symbol_version. The effect is
that if those macros are used outside a conditional on SHARED, and the
object is being built for libc.a, what happens depends on whether shared
libraries are being built at all. In particular, various objects in
libc.a on powerpc (at least) contain symbol version information, and I
suspect that they should not. I'm inclined to say this is a bug in the
relevant source files - they shouldn't be using symbol_version and
default_symbol_version outside of conditionals on SHARED - but also that
this information in libc.a objects is not useful and so it is safe to
change the DO_VERSIONING conditional in libc-symbols.h to one on SHARED
(so meaning libc.a no longer has this versioning information).
Comments?
--
Joseph S. Myers
joseph@codesourcery.com