1
0
mirror of https://github.com/systemd/systemd synced 2024-07-08 20:15:55 +00:00
Commit Graph

11 Commits

Author SHA1 Message Date
Frantisek Sumsal
a3d3bf559c fuzz: don't panic without a C++ compiler
meson's `cpp_args` option is defined only if it detects a C++ compiler,
otherwise we get an error:

../test/fuzz/meson.build:56:28: ERROR: Tried to access unknown option 'cpp_args'.
2023-11-15 12:07:42 +00:00
Frantisek Sumsal
17ee59c9c9 fuzz: pass -Dc_args=/-Dcpp_args= to fuzzer targets
Prompted by #29972, because right now it's practically impossible to pass
-fno-sanitize=function to the fuzzer targets without some extensive
sed'ing.

This splits both c_args and cpp_args to separate arguments for
tools/meson-build.sh, because the other way would be to use `eval`, so
the space-separated but quoted strings passed to these options are not
split where they shouldn't, and I'd rather avoid using `eval` if
possible.

Also, this switches the positional arguments we pass to `meson setup`,
as they were in incorrect order (docs say it should be buildir followed
by sourcedir); meson is apparently clever enough to figure this out and
switch the arguments around if necessary, so it didn't complain.
2023-11-10 17:22:08 +00:00
Yu Watanabe
e3b2f7c056 tools: explicitly specify "setup" subcommand
As invoking meson without subcommand is deprecated since 0.64.0.
2023-03-03 20:06:30 +09:00
Yu Watanabe
26ab5ea69d tools: fix the file name that "meson setup" generates 2023-03-03 19:54:38 +09:00
наб
ee0d4cf74a
Fix which(1) in meson-build.sh 2022-05-23 12:52:56 +02:00
Frantisek Sumsal
f7e0d22d76 tools: shellcheck-ify tool scripts 2021-09-30 12:27:06 +02:00
Zbigniew Jędrzejewski-Szmek
9ee03516df tree-wide: add spdx header on all scripts and helpers
Even though many of those scripts are very simple, it is easier to include
the header than to try to say whether each of those files is trivial enough
not to require one.
2021-01-28 09:55:35 +01:00
Yu Watanabe
f6d783ac3d meson: use same compilers to build fuzzers 2018-10-09 11:54:10 +02:00
Yu Watanabe
0a924a775a meson: check the existence of ninja.build for fuzzer tests 2018-07-23 08:50:26 +02:00
Filipe Brandenburger
63554ed907 oss-fuzz: Fallback to ninja-build when available (#8641)
The ninja binary is deployed as `ninja-build` in older distros such as
RHEL 7/CentOS 7.  Detect that and use `ninja-build` instead of `ninja`
when it's available.
2018-04-04 09:32:59 +02:00
Zbigniew Jędrzejewski-Szmek
b68dfb9e83 Hook up oss-fuzz test cases as tests
This is a bit painful because a separate build of systemd is necessary. The
tests are guarded by tests!=false and slow-tests==true. Running them is not
slow, but compilation certainly is. If this proves unwieldy, we can add a
separate option controlling those builds later.

The build for each sanitizer has its own directory, and we build all fuzzer
tests there, and then pull them out one-by-one by linking into the target
position as necessary. It would be nicer to just build the desired fuzzer, but
we need to build the whole nested build as one unit.

[I also tried making systemd and nested meson subproject. This would work
nicely, but meson does not allow that because the nested target names are the
same as the outer project names. If that is ever fixed, that would be the way
to go.]

v2:
- make sure things still work if memory sanitizer is not available
v3:
- switch to syntax which works with meson 0.42.1 found in Ubuntu
2018-01-27 09:03:46 +01:00