diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-04-25 15:29:48 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-08 17:33:04 +0200 |
commit | 975464e0d48b07f1486c61c726823204604cb2ad (patch) | |
tree | 3177b71a3f4e2002a39f262f1b81d4ea890e5b2a /src/shared/meson.build | |
parent | 20f3d32d8d3ce826d509a7e2979d758094ac7cf7 (diff) | |
download | systemd-975464e0d48b07f1486c61c726823204604cb2ad.tar.gz |
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.
Diffstat (limited to 'src/shared/meson.build')
-rw-r--r-- | src/shared/meson.build | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/meson.build b/src/shared/meson.build index d0cb38650b..e3b076122b 100644 --- a/src/shared/meson.build +++ b/src/shared/meson.build @@ -2,7 +2,7 @@ # # Copyright 2017 Zbigniew Jędrzejewski-Szmek -shared_sources = ''' +shared_sources = files(''' acl-util.h acpi-fpdt.c acpi-fpdt.h @@ -104,25 +104,25 @@ shared_sources = ''' watchdog.c watchdog.h wireguard-netlink.h -'''.split() +'''.split()) test_tables_h = files('test-tables.h') shared_sources += [test_tables_h] if conf.get('HAVE_ACL') == 1 - shared_sources += ['acl-util.c'] + shared_sources += files('acl-util.c') endif if conf.get('ENABLE_UTMP') == 1 - shared_sources += ['utmp-wtmp.c'] + shared_sources += files('utmp-wtmp.c') endif if conf.get('HAVE_SECCOMP') == 1 - shared_sources += ['seccomp-util.c'] + shared_sources += files('seccomp-util.c') endif if conf.get('HAVE_LIBIPTC') == 1 - shared_sources += ['firewall-util.c'] + shared_sources += files('firewall-util.c') endif libshared_name = 'systemd-shared-@0@'.format(meson.project_version()) |