Remaining native / cross-compile differences in glibc
Joseph S. Myers
joseph@codesourcery.com
Wed Nov 14 23:39:00 GMT 2012
After the patch I just posted
<http://sourceware.org/ml/libc-alpha/2012-11/msg00366.html> to generate
/usr/libexec/getconf files when cross-compiling, there are still at least
the following issues with getting full feature parity of native and cross
builds of glibc:
* localedef generates locale files that depend on endianness and on the
alignment requirements of uint32_t. "make localedata/install-locales"
uses the newly built localedef program and can only be used when building
natively.
There are various overlapping ways in which this situation could be
improved, and some patches in EGLIBC that will hopefully be useful
starting points for such improvements. The localedef program, as
installed by glibc, could usefully gain options to specify endianness and
alignment of uint32_t to use for the generated locale files; that allows
localedef for one system to be used to generate locale files that can be
used on another system. It is also possible to set up build
infrastructure for building localedef outside of glibc, so that it could
be built and used in much the same way as a cross-compiler, although it
does make fairly heavy use of glibc features and is not that easy to make
build on a wide range of systems.
* The conform/ tests are only enabled for native building. They build
programs using new headers but not linked with the new C library (linked
with whatever one the compiler uses by default - which may of course not
exist / be installed in the case of a cross compiler), and then run such
programs. They would probably need changing to link properly with the new
library, and run programs the way programs built with it should be run, so
using $(run-program-prefix) - ideally supporting doing just compilation
and not execution tests if $(run-built-tests) is "no".
* iconvdata/Makefile and sysdeps/s390/s390-64/Makefile try to update an
existing gconv-modules.cache file, for native builds, using the newly
built iconvconfig. Some form of cross-iconvconfig would be needed to
generate / update such a file in general for cross builds; I don't know of
previous work on that, or how hard it might be.
* The toplevel Makefile runs ldconfig for native builds. Cross-ldconfig
is, like cross-localedef, something potentially of use when cross-building
a system's root filesystem image. A version was once implemented at
CodeSourcery for an old glibc version; the target dependencies are
substantially more complicated than for ldconfig, so it may not readily be
possible to make an ldconfig binary work generically for all
architectures, and as with localedef the code has a lot of glibc
dependencies so portability to a range of build systems may also be hard.
* malloc/Makefile disables memusagestat when cross-compiling:
# Unless we get a test for the availability of libgd which also works
# for cross-compiling we disable the memusagestat generation in this
# situation.
I'm sure it's possible to implement such a test - it wouldn't work in
bootstrap situations, but could be used if a glibc build has been
installed, then libgd built against that installed glibc, and now glibc is
being built again. But really I think this is a program that should be
split out into a separate package (glibc-memusage, or glibc-utils) -
released alongside glibc, maybe, but built on its own after glibc is built
and installed.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list