]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: recompile all sources for install_libudev_static and install_libsystemd_static 8689/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 25 Apr 2018 13:29:48 +0000 (15:29 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 8 May 2018 15:33:04 +0000 (17:33 +0200)
commit975464e0d48b07f1486c61c726823204604cb2ad
tree3177b71a3f4e2002a39f262f1b81d4ea890e5b2a
parent20f3d32d8d3ce826d509a7e2979d758094ac7cf7
meson: recompile all sources for install_libudev_static and install_libsystemd_static

This means that when those targets are built, all the sources are built again,
instead of reusing the work done to create libbasic.a and other convenience static
libraries. It would be nice to not do this, but there seems to be no support in
our toolchain for joining multiple static libraries into one. When linking
a static library, any -l arguments are simply ignored by ar/gcc-ar, and .a
libraries given as positional arguments are copied verbatim into the archive
so they objects in them cannot be accessed.

https://stackoverflow.com/questions/2157629/linking-static-libraries-to-other-static-libraries
suggests either unzipping all the archives and putting them back togather,
or using a linker script. Unzipping and zipping back together seems ugly.
The other option is not very nice. The linker script language does not
allow "+" to appear in the filenames, and filenames that meson generates
use that, so files would have to be renamed before a linker script was used.
And we would have to generate the linker script on the fly. Either way, this
doesn't seem attractive. Since those static libraries are a niche use case,
it seems reasonable to just go with the easiest and safest solution and
recompile all the source files. Thanks to ccache, this is probably almost as
cheap as actually reusing the convenience .a libraries.

test-libsystemd-sym.c and test-libudev-sym.c compile fine with the generated
static libs, so it seems that they indeed provide all the symbols they should.
meson.build
src/basic/meson.build
src/shared/meson.build
src/udev/meson.build