meson: build .standalone versions of the report binaries

The goal is to be allow the use of those binaries on systemd with older
systemd. The report stuff is generally independent of the running systemd
version.

When built with -Dinstall-tests=true -Dstandalone-binaries=true
-Dbuildtype=release -Db_lto=true, gcc-16.1.1-2.fc44.x86_64, the sizes
are quite reasonable:

$ ls -lG build-lto/*.standalone
-rwxr-xr-x 1 zbyszek  713200 Jul  3 13:16 build-lto/systemd-report.standalone
-rwxr-xr-x 1 zbyszek  662936 Jul  3 13:16 build-lto/systemd-report-basic.standalone
-rwxr-xr-x 1 zbyszek  567424 Jul  3 13:16 build-lto/systemd-report-cgroup.standalone
-rwxr-xr-x 1 zbyszek  592856 Jul  3 13:16 build-lto/systemd-report-files.standalone
-rwxr-xr-x 1 zbyszek  589864 Jul  3 13:16 build-lto/systemd-report-sign-plain.standalone
-rwxr-xr-x 1 zbyszek  548624 Jul  3 13:16 build-lto/systemd-report-sign-tsm.standalone
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-07-07 13:40:13 +02:00
parent aad1e61010
commit 9155c0a5b9
+38 -18
View File
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
executables += [
libexec_template + {
report_executables = [
{
'name' : 'systemd-report',
'public' : true,
'sources' : files(
'export' : files(
'report.c',
'report-generate.c',
'report-sign.c',
@@ -14,43 +14,63 @@ executables += [
libcurl_cflags,
],
},
libexec_template + {
{
'name' : 'systemd-report-basic',
'public' : true,
'sources' : files(
'report-basic-server.c',
'export' : files(
'report-basic.c',
'report-basic-server.c',
),
},
libexec_template + {
{
'name' : 'systemd-report-cgroup',
'sources' : files(
'export' : files(
'report-cgroup.c',
'report-cgroup-server.c',
),
},
libexec_template + {
{
'name' : 'systemd-report-files',
'sources' : files(
'export' : files(
'report-files.c',
'report-files-server.c',
),
},
libexec_template + {
{
'name' : 'systemd-report-sign-plain',
'sources' : files(
'export' : files(
'report-sign-plain.c',
),
'dependencies' : libopenssl_cflags,
'conditions' : [
'HAVE_OPENSSL',
],
'conditions' : ['HAVE_OPENSSL'],
},
libexec_template + {
{
'name' : 'systemd-report-sign-tsm',
'sources' : files(
'export' : files(
'report-sign-tsm.c',
),
},
]
foreach exe : report_executables
exe2 = {
'name' : exe['name'] + '.standalone',
'import' : [exe['name']],
'link_with' : [
libc_wrapper_static,
libbasic_static,
libshared_static,
libsystemd_static,
]
}
foreach optional : ['public', 'dependencies', 'conditions']
if optional in exe
exe2 += { optional : exe[optional] }
endif
endforeach
executables += [
libexec_template + exe,
libexec_template + exe2,
]
endforeach