]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: move fuzz-journald-util.c to fuzz-journal-audit
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 22 Apr 2026 14:33:12 +0000 (16:33 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 23 Apr 2026 08:13:25 +0000 (10:13 +0200)
The .c file is shared between various fuzz-journal-* binaries. It
was added to 32bd43d768a4bdd54481c5e37ce9ea3d1009a824, but that is
somewhat ugly.

Let's add it to the alphabetially first fuzzer and share from there.

Follow-up for 32bd43d768a4bdd54481c5e37ce9ea3d1009a824 and
85b5acde869baa51f5618fa503eafac3dccbf379.

src/journal/meson.build

index 1bec605b0ccf09a1f3df12e58c706c88e5ffad58..142d2246c1fe04dab02f868ac822f92623c98ec2 100644 (file)
@@ -21,14 +21,6 @@ systemd_journald_extract_sources = files(
         'journald-wall.c',
 )
 
-if want_fuzz_tests
-        # Build fuzz-journald-util.c as part of systemd-journald so we only
-        # compile it once instead of once per fuzz test.
-        systemd_journald_extract_sources += files(
-                'fuzz-journald-util.c',
-        )
-endif
-
 journald_gperf_c = custom_target(
         input : 'journald-gperf.gperf',
         output : 'journald-gperf.c',
@@ -63,7 +55,10 @@ journal_test_template = test_template + {
 }
 
 journal_fuzz_template = fuzz_template + {
-        'objects' : ['systemd-journald'],
+        'objects' : [
+                'fuzz-journald-audit',
+                'systemd-journald',
+        ],
         'dependencies' : libselinux_cflags,
 }
 
@@ -138,8 +133,11 @@ executables += [
                         libselinux_cflags,
                 ],
         },
-        journal_fuzz_template + {
+        fuzz_template + {
                 'sources' : files('fuzz-journald-audit.c'),
+                # fuzz-journald-util.c is shared with the other fuzzers below.
+                'extract' : files('fuzz-journald-util.c'),
+                'objects' : ['systemd-journald'],
         },
         journal_fuzz_template + {
                 'sources' : files('fuzz-journald-kmsg.c'),