]> git.ipfire.org Git - thirdparty/systemd.git/commit
meson: Stop doing nested build when fuzzers are enabled
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 11 May 2025 07:42:28 +0000 (09:42 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 12 May 2025 11:34:28 +0000 (13:34 +0200)
commitd8def5dc8745c3d77cf49ad5abbb6719ffd94035
tree66e607a76d7bb04ee5825a4020447c9c00e10b3e
parent1dbeb98feaefe873e7e58ee9db53432fa55523aa
meson: Stop doing nested build when fuzzers are enabled

Currently, when fuzzers are enabled, we run meson from within meson
to build the fuzzer executables with sanitizers. The idea is that
we can build the fuzzers with different kinds of sanitizers
independently from the main build.

The issue with this setup is that we don't actually make use of it.
We only build the fuzzers with one set of sanitizers (address,undefined)
so we're adding a bunch of extra complexity without any benefit as we
can just setup the top level meson build with these sanitizers and get
the same result.

The other issue with this setup is that we don't pass on all the options
passed to the top level meson build to the nested meson build. The only things
we pass on are extra compiler arguments and the value of the auto_features
option, but none of the individual feature options if overridden are passed on,
which can lead to very hard to debug issues as an option enabled in the top
level build is not enabled in the nested build.

Since we're not getting anything useful out of this setup, let's simplify
and get rid of the nested meson build. Instead, sanitizers should be enabled
for the top level meson.build. This currently didn't work as we were overriding
the sanitizers passed to the meson build with the fuzzer sanitizer, so we
fix that as well by making sure we combine the fuzzer sanitizer with the ones
passed in by the user.

We also drop support for looking up libFuzzer as a separate library as
it has been shipped builtin in clang since clang 6.0, so we can assume
that -fsanitize=fuzzer is available.

To make sure we still run the fuzzing tests, we enable the fuzz-tests option
by default now to make sure they still always run (without instrumentation unless
one of llvm-fuzz or oss-fuzz is enabled).
meson.build
meson_options.txt
test/fuzz/meson.build
test/integration-tests/README.md