tree-wide: check if necessary cflags dependencies are set

This makes each `foo_cflags` dependency define a `SYSTEMD_CFLAGS_MARKER_FOO`
macro, and checks if the macro is set when headers provided by external
libraries are included.

With this, we can fail fast at compile time if necessary `_cflags`
dependencies are omitted in meson.build. Missing dependencies found by this
mechanism have been added across the tree.
This commit is contained in:
Yu Watanabe
2026-07-03 21:50:45 +09:00
parent 4c5cbc970a
commit 5280cd7bdb
66 changed files with 476 additions and 69 deletions
+4 -1
View File
@@ -55,7 +55,10 @@ executables += [
libcore,
libshared,
],
'dependencies' : libseccomp_cflags,
'dependencies' : [
libseccomp_cflags,
tpm2_cflags,
],
'install' : conf.get('ENABLE_ANALYZE') == 1,
},
core_test_template + {
+15
View File
@@ -6,25 +6,40 @@
#include <unistd.h>
#if HAVE_XZ
#ifndef SYSTEMD_CFLAGS_MARKER_LIBXZ
# error "missing libxz_cflags in meson dependency."
#endif
#include <lzma.h>
#endif
#if HAVE_LZ4
#ifndef SYSTEMD_CFLAGS_MARKER_LIBLZ4
# error "missing liblz4_cflags in meson dependency."
#endif
#include <lz4.h>
#include <lz4frame.h>
#include <lz4hc.h>
#endif
#if HAVE_ZSTD
#ifndef SYSTEMD_CFLAGS_MARKER_LIBZSTD
# error "missing libzstd_cflags in meson dependency."
#endif
#include <zstd.h>
#include <zstd_errors.h>
#endif
#if HAVE_ZLIB
#ifndef SYSTEMD_CFLAGS_MARKER_LIBZ
# error "missing libz_cflags in meson dependency."
#endif
#include <zlib.h>
#endif
#if HAVE_BZIP2
#ifndef SYSTEMD_CFLAGS_MARKER_LIBBZIP2
# error "missing libbzip2_cflags in meson dependency."
#endif
#include <bzlib.h>
#endif
+4 -1
View File
@@ -24,7 +24,10 @@ executables += [
],
'sources' : bootctl_sources,
'link_with' : boot_link_with,
'dependencies' : [libopenssl_cflags],
'dependencies' : [
libopenssl_cflags,
tpm2_cflags,
],
},
test_template + {
'sources' : files(
+15 -8
View File
@@ -174,14 +174,18 @@ libcore_static = static_library(
include_directories : core_includes,
implicit_include_directories : false,
c_args : ['-fvisibility=default'],
dependencies : [libaudit_cflags,
libbpf_cflags,
libcryptsetup_cflags,
libm,
libmount_cflags,
libseccomp_cflags,
libselinux_cflags,
userspace],
dependencies : [
libacl_cflags,
libaudit_cflags,
libbpf_cflags,
libcryptsetup_cflags,
libm,
libmount_cflags,
libpcre2_cflags,
libseccomp_cflags,
libselinux_cflags,
userspace,
],
build_by_default : false)
libcore = shared_library(
@@ -210,6 +214,7 @@ core_libs_shared = [
systemd_deps = [
libapparmor_cflags,
libaudit_cflags,
libkmod_cflags,
libmount_cflags,
libseccomp_cflags,
@@ -226,6 +231,7 @@ if conf.get('SYSTEMD_MULTICALL_BINARY') == 1
systemd_deps += [
libbpf_cflags,
libcryptsetup_cflags,
libopenssl_cflags,
libpam_cflags,
]
endif
@@ -282,6 +288,7 @@ else
libbpf_cflags,
libcryptsetup_cflags,
libmount_cflags,
libopenssl_cflags,
libpam_cflags,
libseccomp_cflags,
libselinux_cflags,
+4 -1
View File
@@ -38,7 +38,10 @@ executables += [
'sources' : systemd_coredump_sources,
'extract' : systemd_coredump_extract_sources,
'link_with' : [libshared],
'dependencies' : common_dependencies,
'dependencies' : [
common_dependencies,
libacl_cflags,
],
},
executable_template + {
'name' : 'coredumpctl',
+1
View File
@@ -12,6 +12,7 @@ executables += [
'dependencies' : [
libmount_cflags,
libopenssl_cflags,
tpm2_cflags,
],
},
]
+1
View File
@@ -27,6 +27,7 @@ executables += [
libfido2_cflags,
libopenssl_cflags,
libp11kit_cflags,
tpm2_cflags,
],
},
]
+4 -1
View File
@@ -5,7 +5,10 @@ lib_cryptsetup_token_common = static_library(
'cryptsetup-token-util.c',
include_directories : includes,
implicit_include_directories : false,
dependencies : userspace,
dependencies : [
libcryptsetup_cflags,
userspace,
],
link_with : libshared,
build_by_default : false)
+4
View File
@@ -23,11 +23,15 @@ executables += [
libmount_cflags,
libopenssl_cflags,
libp11kit_cflags,
tpm2_cflags,
],
},
generator_template + {
'name' : 'systemd-cryptsetup-generator',
'sources' : files('cryptsetup-generator.c'),
'dependencies' : [
libcryptsetup_cflags,
],
},
]
+3
View File
@@ -9,6 +9,9 @@ executables += [
'name' : 'systemd-dissect',
'public' : true,
'sources' : files('dissect.c'),
'dependencies' : [
libarchive_cflags,
],
},
]
+7 -1
View File
@@ -8,7 +8,6 @@ simple_fuzzers += files(
'fuzz-env-file.c',
'fuzz-hostname-setup.c',
'fuzz-json.c',
'fuzz-pe-binary.c',
'fuzz-time-util.c',
'fuzz-udev-database.c',
'fuzz-user-record.c',
@@ -16,6 +15,13 @@ simple_fuzzers += files(
'fuzz-varlink-idl.c',
)
executables += [
fuzz_template + {
'sources' : files('fuzz-pe-binary.c'),
'dependencies' : libopenssl_cflags,
},
]
# The following fuzzers do not work on oss-fuzz. See #11018.
if not want_ossfuzz
simple_fuzzers += files('fuzz-compress.c')
+3
View File
@@ -4,6 +4,9 @@ executables += [
libexec_template + {
'name' : 'systemd-growfs',
'sources' : files('growfs.c'),
'dependencies' : [
libcryptsetup_cflags,
],
},
libexec_template + {
'name' : 'systemd-makefs',
+3
View File
@@ -75,7 +75,9 @@ executables += [
'objects' : ['systemd-homed'],
'dependencies' : [
libblkid_cflags,
libcryptsetup_cflags,
libfdisk_cflags,
libfido2_cflags,
libopenssl_cflags,
libp11kit_cflags,
],
@@ -87,6 +89,7 @@ executables += [
'extract' : homectl_extract,
'objects' : ['systemd-homed'],
'dependencies' : [
libfido2_cflags,
libopenssl_cflags,
libp11kit_cflags,
],
+3
View File
@@ -10,6 +10,9 @@ executables += [
'public' : true,
'sources' : files('imdsd.c'),
'extract' : files('imds-util.c'),
'dependencies' : [
libcurl_cflags,
],
},
libexec_template + {
'name' : 'systemd-imds',
+11 -1
View File
@@ -17,6 +17,10 @@ executables += [
'import-common.c',
'qcow2-util.c',
),
'dependencies' : [
libarchive_cflags,
libselinux_cflags,
],
},
libexec_template + {
'name' : 'systemd-pull',
@@ -30,7 +34,10 @@ executables += [
'pull-tar.c',
),
'objects' : ['systemd-importd'],
'dependencies' : libopenssl_cflags,
'dependencies' : [
libcurl_cflags,
libopenssl_cflags,
],
},
libexec_template + {
'name' : 'systemd-import',
@@ -73,6 +80,9 @@ executables += [
test_template + {
'sources' : files('test-tar.c'),
'type' : 'manual',
'dependencies' : [
libarchive_cflags,
],
},
test_template + {
'sources' : files('test-qcow2.c'),
+4 -1
View File
@@ -59,7 +59,10 @@ executables += [
'sources' : systemd_journal_upload_sources,
'extract' : systemd_journal_upload_extract_sources,
'objects' : ['systemd-journal-remote'],
'dependencies' : common_deps,
'dependencies' : [
common_deps,
libcurl_cflags,
],
},
test_template + {
'sources' : files('test-journal-header-util.c'),
+3
View File
@@ -2,6 +2,9 @@
BEGIN{
print "#if HAVE_AUDIT"
print "# ifndef SYSTEMD_CFLAGS_MARKER_LIBAUDIT"
print "# error \"missing libaudit_cflags in meson dependency.\""
print "# endif"
print "# include <libaudit.h>"
print "#endif"
print ""
+7
View File
@@ -95,7 +95,10 @@ executables += [
'sources' : systemd_journald_sources,
'extract' : systemd_journald_extract_sources,
'dependencies' : [
libacl_cflags,
libaudit_cflags,
liblz4_cflags,
libpcre2_cflags,
libselinux_cflags,
libxz_cflags,
libzstd_cflags,
@@ -106,6 +109,9 @@ executables += [
'public' : true,
'conditions' : ['HAVE_QRENCODE'],
'sources' : files('bsod.c'),
'dependencies' : [
libqrencode_cflags,
],
},
executable_template + {
'name' : 'systemd-cat',
@@ -121,6 +127,7 @@ executables += [
'dependencies' : [
liblz4_cflags,
libopenssl_cflags,
libpcre2_cflags,
libxz_cflags,
libzstd_cflags,
],
+6
View File
@@ -5,12 +5,18 @@
#include "macro.h"
#if HAVE_GLIB
#ifndef SYSTEMD_CFLAGS_MARKER_LIBGLIB
# error "missing libglib_cflags in meson dependency."
#endif
DISABLE_WARNING_FORMAT_NONLITERAL
#include <gio/gio.h> /* NOLINT */
REENABLE_WARNING
#endif
#if HAVE_DBUS
#ifndef SYSTEMD_CFLAGS_MARKER_LIBDBUS
# error "missing libdbus_cflags in meson dependency."
#endif
#include <dbus/dbus.h>
#endif
+4
View File
@@ -5,6 +5,10 @@
#include "shared-forward.h"
#if HAVE_XKBCOMMON
#ifndef SYSTEMD_CFLAGS_MARKER_LIBXKBCOMMON
# error "missing libxkbcommon_cflags in meson dependency."
#endif
#include <xkbcommon/xkbcommon.h>
extern DLSYM_PROTOTYPE(xkb_context_new);
+3
View File
@@ -48,6 +48,9 @@ executables += [
'dbus' : true,
'sources' : systemd_logind_sources,
'extract' : systemd_logind_extract_sources,
'dependencies' : [
libacl_cflags,
],
},
executable_template + {
'name' : 'loginctl',
+4 -1
View File
@@ -9,6 +9,9 @@ executables += [
'HAVE_TPM2',
],
'sources' : files('measure-tool.c'),
'dependencies' : libopenssl_cflags,
'dependencies' : [
libopenssl_cflags,
tpm2_cflags,
],
},
]
+7 -1
View File
@@ -204,9 +204,12 @@ executables += [
libsystemd_network,
networkd_link_with,
],
'dependencies' : [
libbpf_cflags,
],
'bpf_programs': [
'sysctl-monitor',
]
],
},
libexec_template + {
'name' : 'systemd-networkd-wait-online',
@@ -225,6 +228,9 @@ executables += [
libsystemd_network,
networkd_link_with,
],
'dependencies' : [
libselinux_cflags,
],
},
libexec_template + {
'name' : 'systemd-network-generator',
+3
View File
@@ -24,6 +24,9 @@ executables += [
'name' : 'systemd-nsresourced',
'sources' : systemd_nsresourced_sources,
'extract' : systemd_nsresourced_extract_sources,
'dependencies' : [
libbpf_cflags,
],
'bpf_programs': ['userns-restrict'],
},
libexec_template + {
+4
View File
@@ -15,9 +15,11 @@ executables += [
),
'dependencies' : [
libblkid_cflags,
libcryptsetup_cflags,
libfdisk_cflags,
libmount_cflags,
libopenssl_cflags,
tpm2_cflags,
],
},
executable_template + {
@@ -32,9 +34,11 @@ executables += [
],
'dependencies' : [
libblkid_cflags,
libcryptsetup_cflags,
libfdisk_cflags,
libmount_cflags,
libopenssl_cflags,
tpm2_cflags,
],
},
]
+3
View File
@@ -10,6 +10,9 @@ executables += [
'report-sign.c',
'report-upload.c',
),
'dependencies' : [
libcurl_cflags,
],
},
libexec_template + {
+4
View File
@@ -1,6 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
# error "missing libopenssl_cflags in meson dependency."
#endif
#include <openssl/asn1.h>
#include "shared-forward.h"
+4
View File
@@ -6,6 +6,10 @@
#include "shared-forward.h"
#if HAVE_ACL
#ifndef SYSTEMD_CFLAGS_MARKER_LIBACL
# error "missing libacl_cflags in meson dependency."
#endif
#include <acl/libacl.h> /* IWYU pragma: export */
#include <sys/acl.h> /* IWYU pragma: export */
+4
View File
@@ -4,6 +4,10 @@
#include "shared-forward.h"
#if HAVE_APPARMOR
# ifndef SYSTEMD_CFLAGS_MARKER_LIBAPPARMOR
# error "missing libapparmor_cflags in meson dependency."
# endif
# include <sys/apparmor.h>
# include "dlfcn-util.h"
+3
View File
@@ -6,6 +6,9 @@
#include "shared-forward.h"
#if HAVE_BLKID
# ifndef SYSTEMD_CFLAGS_MARKER_LIBBLKID
# error "missing libblkid_cflags in meson dependency."
# endif
#include <blkid.h>
+3
View File
@@ -2,6 +2,9 @@
#pragma once
#if HAVE_LIBBPF
#ifndef SYSTEMD_CFLAGS_MARKER_LIBBPF
# error "missing libbpf_cflags in meson dependency."
#endif
#include <bpf/libbpf.h>
+3
View File
@@ -6,6 +6,9 @@
#include "sd-dlopen.h"
#if HAVE_LIBBPF
#ifndef SYSTEMD_CFLAGS_MARKER_LIBBPF
# error "missing libbpf_cflags in meson dependency."
#endif
#include <bpf/bpf.h> /* IWYU pragma: export */
#include <bpf/libbpf.h> /* IWYU pragma: export */
+4
View File
@@ -33,6 +33,10 @@ int dlopen_libcrypto(int log_level);
#define X509_FINGERPRINT_SIZE SHA256_DIGEST_SIZE
#if HAVE_OPENSSL
#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
# error "missing libopenssl_cflags in meson dependency."
#endif
#define LIBCRYPTO_NOTE(priority) \
SD_ELF_NOTE_DLOPEN("libcrypto", \
"Support for cryptographic operations", \
+4
View File
@@ -7,6 +7,10 @@
#include "shared-forward.h"
#if HAVE_LIBCRYPTSETUP
#ifndef SYSTEMD_CFLAGS_MARKER_LIBCRYPTSETUP
# error "missing libcryptsetup_cflags in meson dependency."
#endif
#include <libcryptsetup.h> /* IWYU pragma: export */
/* Available since libcryptsetup 2.7. Always redeclare so DLSYM_PROTOTYPE's typeof() resolves on older
+4
View File
@@ -6,6 +6,10 @@
#include "shared-forward.h"
#if HAVE_LIBCURL
#ifndef SYSTEMD_CFLAGS_MARKER_LIBCURL
# error "missing libcurl_cflags in meson dependency."
#endif
#include <curl/curl.h> /* IWYU pragma: export */
#include "dlfcn-util.h"
+4
View File
@@ -1,6 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_ELFUTILS
#ifndef SYSTEMD_CFLAGS_MARKER_LIBELF
# error "missing libelf_cflags in meson dependency."
#endif
#include <dwarf.h>
#include <elfutils/libdwelf.h>
#include <elfutils/libdwfl.h>
+3
View File
@@ -6,6 +6,9 @@
#include "shared-forward.h"
#if HAVE_LIBFDISK
#ifndef SYSTEMD_CFLAGS_MARKER_LIBFDISK
# error "missing libfdisk_cflags in meson dependency."
#endif
#include <libfdisk.h> /* IWYU pragma: export */
+4
View File
@@ -6,6 +6,10 @@
int dlopen_gnutls(int log_level);
#if HAVE_GNUTLS
# ifndef SYSTEMD_CFLAGS_MARKER_LIBGNUTLS
# error "missing libgnutls_cflags in meson dependency."
# endif
# include <gnutls/gnutls.h> /* IWYU pragma: export */
# include <gnutls/x509.h> /* IWYU pragma: export */
+4
View File
@@ -6,6 +6,10 @@
#include "shared-forward.h"
#if HAVE_LIBIDN2
#ifndef SYSTEMD_CFLAGS_MARKER_LIBIDN2
# error "missing libidn2_cflags in meson dependency."
#endif
#include <idn2.h>
#include "dlfcn-util.h"
+4
View File
@@ -6,6 +6,10 @@
#include "shared-forward.h"
#if HAVE_LIBARCHIVE
#ifndef SYSTEMD_CFLAGS_MARKER_LIBARCHIVE
# error "missing libarchive_cflags in meson dependency."
#endif
#include <archive.h> /* IWYU pragma: export */
#include <archive_entry.h> /* IWYU pragma: export */
+4
View File
@@ -6,6 +6,10 @@
int dlopen_libaudit(int log_level);
#if HAVE_AUDIT
# ifndef SYSTEMD_CFLAGS_MARKER_LIBAUDIT
# error "missing libaudit_cflags in meson dependency."
# endif
# include <libaudit.h> /* IWYU pragma: export */
# include "dlfcn-util.h"
+3
View File
@@ -1,6 +1,9 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_LIBCRYPT
# ifndef SYSTEMD_CFLAGS_MARKER_LIBCRYPT
# error "missing libcrypt_cflags in meson dependency."
# endif
# include <crypt.h>
#endif
+4
View File
@@ -19,6 +19,10 @@ typedef enum Fido2EnrollFlags {
int dlopen_libfido2(int log_level);
#if HAVE_LIBFIDO2
#ifndef SYSTEMD_CFLAGS_MARKER_LIBFIDO2
# error "missing libfido2_cflags in meson dependency."
#endif
#include <fido.h>
#include "dlfcn-util.h"
+3
View File
@@ -6,6 +6,9 @@
#include "shared-forward.h"
#if HAVE_LIBMOUNT
#ifndef SYSTEMD_CFLAGS_MARKER_LIBMOUNT
# error "missing libmount_cflags in meson dependency."
#endif
/* This needs to be after sys/mount.h */
#include <libmount.h> /* IWYU pragma: export */
+4
View File
@@ -8,6 +8,10 @@
int dlopen_microhttpd(int log_level);
#if HAVE_MICROHTTPD
#ifndef SYSTEMD_CFLAGS_MARKER_LIBMICROHTTPD
# error "missing libmicrohttpd_cflags in meson dependency."
#endif
#define MICROHTTPD_NOTE(priority) \
SD_ELF_NOTE_DLOPEN("microhttpd", \
"Support for embedded HTTP server via libmicrohttpd", \
+3
View File
@@ -6,6 +6,9 @@
#include "shared-forward.h"
#if HAVE_KMOD
#ifndef SYSTEMD_CFLAGS_MARKER_LIBKMOD
# error "missing libkmod_cflags in meson dependency."
#endif
#include <libkmod.h> /* IWYU pragma: export */
+4
View File
@@ -6,6 +6,10 @@
#include "shared-forward.h"
#if HAVE_PAM
#ifndef SYSTEMD_CFLAGS_MARKER_LIBPAM
# error "missing libpam_cflags in meson dependency."
#endif
#include <security/pam_appl.h>
#include <security/pam_ext.h>
#include <security/pam_modules.h> /* IWYU pragma: export */
@@ -6,6 +6,9 @@
#include "log.h" /* IWYU pragma: keep */
#if HAVE_PASSWDQC
#ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
# error "missing libpwquality_cflags in meson dependency."
#endif
#include <passwdqc.h>
@@ -6,6 +6,9 @@
#include "log.h"
#if HAVE_PWQUALITY
#ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
# error "missing libpwquality_cflags in meson dependency."
#endif
#include <pwquality.h>
#include <stdio.h>
+3
View File
@@ -4,6 +4,9 @@
#include "shared-forward.h"
#if HAVE_PCRE2
#ifndef SYSTEMD_CFLAGS_MARKER_LIBPCRE2
# error "missing libpcre2_cflags in meson dependency."
#endif
#include "dlfcn-util.h"
+3
View File
@@ -2,6 +2,9 @@
#pragma once
#if HAVE_P11KIT
# ifndef SYSTEMD_CFLAGS_MARKER_LIBP11KIT
# error "missing libp11kit_cflags in meson dependency."
# endif
# include <p11-kit/p11-kit.h> /* IWYU pragma: export */
# include <p11-kit/uri.h> /* IWYU pragma: export */
#endif
+3
View File
@@ -3,6 +3,9 @@
#include "qrcode-util.h"
#if HAVE_QRENCODE
#ifndef SYSTEMD_CFLAGS_MARKER_LIBQRENCODE
# error "missing libqrencode_cflags in meson dependency."
#endif
#include <qrencode.h>
#endif
#include <stdio.h>
+4
View File
@@ -5,6 +5,10 @@
#include <unistd.h>
#if HAVE_XENCTRL
#ifndef SYSTEMD_CFLAGS_MARKER_LIBXENCTRL
# error "missing libxenctrl_cflags in meson dependency."
#endif
#include <sys/ioctl.h>
#include <sys/mman.h>
+4
View File
@@ -7,6 +7,10 @@
#include "shared-forward.h"
#if HAVE_SECCOMP
#ifndef SYSTEMD_CFLAGS_MARKER_LIBSECCOMP
# error "missing libseccomp_cflags in meson dependency."
#endif
#include <seccomp.h> /* IWYU pragma: export */
#include "dlfcn-util.h"
+4
View File
@@ -8,6 +8,10 @@
#include "shared-forward.h"
#if HAVE_SELINUX
#ifndef SYSTEMD_CFLAGS_MARKER_LIBSELINUX
# error "missing libselinux_cflags in meson dependency."
#endif
#include <selinux/avc.h>
#include <selinux/label.h>
#include <selinux/context.h>
+4
View File
@@ -8,6 +8,10 @@
int dlopen_libssl(int log_level);
#if HAVE_OPENSSL
#ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
# error "missing libopenssl_cflags in meson dependency."
#endif
#define LIBSSL_NOTE(priority) \
SD_ELF_NOTE_DLOPEN("libssl", \
"Support for TLS", \
+4
View File
@@ -50,6 +50,10 @@ static inline bool TPM2_PCR_MASK_VALID(uint32_t pcr_mask) {
int dlopen_tpm2(int log_level);
#if HAVE_TPM2
#ifndef SYSTEMD_CFLAGS_MARKER_TPM2
# error "missing tpm2_cflags in meson dependency."
#endif
#define TPM2_ESYS_NOTE(priority) \
SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-esys.so.0")
#define TPM2_RC_NOTE(priority) \
+1
View File
@@ -10,6 +10,7 @@ executables += [
libblkid_cflags,
libcryptsetup_cflags,
libmount_cflags,
libselinux_cflags,
],
},
]
+3
View File
@@ -65,6 +65,9 @@ executables += [
'sources' : files('fuzz-systemctl-parse-argv.c'),
'objects' : ['systemctl'],
'link_with' : systemctl_link_with,
'dependencies' : [
libselinux_cflags,
],
},
]
+4
View File
@@ -11,6 +11,10 @@ int dlopen_gcrypt(int log_level);
int initialize_libgcrypt(bool secmem);
#if HAVE_GCRYPT
#ifndef SYSTEMD_CFLAGS_MARKER_LIBGCRYPT
# error "missing libgcrypt_cflags in meson dependency."
#endif
#define GCRYPT_NOTE(priority) \
SD_ELF_NOTE_DLOPEN("gcrypt", \
"Support for journald forward-sealing", \
+48 -7
View File
@@ -79,13 +79,11 @@ simple_tests += files(
'test-clock.c',
'test-color-util.c',
'test-compare-operator.c',
'test-condition.c',
'test-conf-files.c',
'test-conf-parser.c',
'test-copy.c',
'test-coredump-util.c',
'test-cpu-set-util.c',
'test-creds.c',
'test-daemon.c',
'test-data-fd-util.c',
'test-date.c',
@@ -170,7 +168,6 @@ simple_tests += files(
'test-parse-util.c',
'test-path-lookup.c',
'test-path-util.c',
'test-pe-binary.c',
'test-percent-util.c',
'test-pidref.c',
'test-pressure.c',
@@ -246,6 +243,7 @@ executables += [
test_template + {
'sources' : files('test-acl-util.c'),
'conditions' : ['HAVE_ACL'],
'dependencies' : libacl_cflags,
},
test_template + {
'sources' : files('test-af-list.c') +
@@ -280,6 +278,14 @@ executables += [
'sources' : files('test-compress.c'),
'link_with' : [libshared],
},
test_template + {
'sources' : files('test-condition.c'),
'dependencies' : [
libapparmor_cflags,
libaudit_cflags,
libselinux_cflags,
],
},
test_template + {
'sources' : files('test-coredump-stacktrace.c'),
'type' : 'manual',
@@ -291,6 +297,10 @@ executables += [
'override_options' : ['b_sanitize=none', 'strip=false', 'debug=true'],
'c_args' : ['-fno-sanitize=all', '-fno-optimize-sibling-calls', '-O1'],
},
test_template + {
'sources' : files('test-creds.c'),
'dependencies' : tpm2_cflags,
},
test_template + {
'sources' : files('test-crypto-util.c'),
'dependencies' : libopenssl_cflags,
@@ -306,15 +316,29 @@ executables += [
'gcrypt-util.c',
),
'dependencies' : [
libacl_cflags,
libapparmor_cflags,
libarchive_cflags,
libaudit_cflags,
libblkid_cflags,
libbpf_cflags,
libcryptsetup_cflags,
libcurl_cflags,
libfdisk_cflags,
libfido2_cflags,
libgcrypt_cflags,
libgnutls_cflags,
libidn2_cflags,
libkmod_cflags,
libmicrohttpd_cflags,
libmount_cflags,
libopenssl_cflags,
libp11kit_cflags,
libpam_cflags,
libpcre2_cflags,
libseccomp_cflags,
libselinux_cflags,
tpm2_cflags,
],
},
test_template + {
@@ -373,6 +397,7 @@ executables += [
test_template + {
'sources' : files('test-curl-util.c'),
'conditions' : ['HAVE_LIBCURL'],
'dependencies' : libcurl_cflags,
},
test_template + {
'sources' : files('test-libcrypt-util.c'),
@@ -423,6 +448,10 @@ executables += [
'objects' : ['test-nss-hosts'],
'conditions' : ['ENABLE_NSS'],
},
test_template + {
'sources' : files('test-pe-binary.c'),
'dependencies' : libopenssl_cflags,
},
test_template + {
'sources' : files('test-pkcs7-util.c'),
'dependencies' : libopenssl_cflags,
@@ -476,7 +505,10 @@ executables += [
},
test_template + {
'sources' : files('test-tpm2.c'),
'dependencies' : libopenssl_cflags,
'dependencies' : [
libopenssl_cflags,
tpm2_cflags,
],
'timeout' : 120,
},
test_template + {
@@ -528,11 +560,17 @@ executables += [
},
core_test_template + {
'sources' : files('test-bpf-restrict-fs.c'),
'dependencies' : common_test_dependencies,
'dependencies' : [
common_test_dependencies,
libbpf_cflags,
],
},
core_test_template + {
'sources' : files('test-bpf-restrict-fsaccess.c'),
'dependencies' : common_test_dependencies,
'dependencies' : [
common_test_dependencies,
libbpf_cflags,
],
'bpf_programs' : ['restrict-fsaccess'],
'type' : 'manual',
},
@@ -584,7 +622,10 @@ executables += [
},
core_test_template + {
'sources' : files('test-load-fragment.c'),
'dependencies' : common_test_dependencies,
'dependencies' : [
common_test_dependencies,
libpcre2_cflags,
],
},
core_test_template + {
'sources' : files('test-loop-util.c'),
+8 -2
View File
@@ -12,7 +12,10 @@ executables += [
'public' : true,
'extract' : files('tmpfiles.c') +
offline_passwd_c,
'dependencies' : libacl_cflags,
'dependencies' : [
libacl_cflags,
libselinux_cflags,
],
},
executable_template + {
'name' : 'systemd-tmpfiles.standalone',
@@ -24,7 +27,10 @@ executables += [
libshared_static,
libsystemd_static,
],
'dependencies' : libacl_cflags,
'dependencies' : [
libacl_cflags,
libselinux_cflags,
],
},
test_template + {
'sources' : files('test-offline-passwd.c') +
+7
View File
@@ -11,6 +11,7 @@ executables += [
],
'dependencies' : [
libopenssl_cflags,
tpm2_cflags,
],
},
libexec_template + {
@@ -21,6 +22,9 @@ executables += [
'HAVE_OPENSSL',
'HAVE_TPM2',
],
'dependencies' : [
tpm2_cflags,
],
},
libexec_template + {
'name' : 'systemd-tpm2-swtpm',
@@ -39,6 +43,9 @@ executables += [
'HAVE_OPENSSL',
'HAVE_TPM2',
],
'dependencies' : [
tpm2_cflags,
],
},
]
+2
View File
@@ -122,6 +122,8 @@ udev_dependencies = [
libblkid_cflags,
libkmod_cflags,
libmount_cflags,
libselinux_cflags,
tpm2_cflags,
]
udev_plugin_template = executable_template + {
+4 -1
View File
@@ -8,7 +8,10 @@ executables += [
libexec_template + {
'name' : 'systemd-veritysetup',
'sources' : files('veritysetup.c'),
'dependencies' : libcryptsetup_cflags,
'dependencies' : [
libcryptsetup_cflags,
tpm2_cflags,
],
},
generator_template + {
'name' : 'systemd-veritysetup-generator',