Commit 84ece56
fix
- allow `-fsanitize-coverage-trace-pc-guard` to be used on its own without enabling the fuzzer.
(note that previouly, while the flag was only active when fuzzing, the fuzzer itself doesn't use it, and the code will not link as is.)
- add stub functions in the fuzzer to link with instrumented C code (previously fuzzed tests failed to link if they were calling into C):
while the zig compile unit uses a custom `EmitOptions.Coverage` with features disabled,
the C code is built calling into the clang driver with "-fsanitize=fuzzer-no-link" that automatically enables the default features.
(see https://github.com/llvm/llvm-project/blob/de06978ebcff5f75913067b019d2d522d0be0872/clang/lib/Driver/SanitizerArgs.cpp#L587)
- emit `-fsanitize-coverage=trace-pc-guard` instead of `-Xclang -fsanitize-coverage-trace-pc-guard` so that edge coverrage is enabled by clang driver. (previously, it was enabled only because the fuzzer was)-fsanitize-coverage-trace-pc-guard and fuzzer support for C compile units1 parent aa5c6c0 commit 84ece56
3 files changed
+19
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
86 | 98 | | |
87 | 99 | | |
88 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5922 | 5922 | | |
5923 | 5923 | | |
5924 | 5924 | | |
| 5925 | + | |
5925 | 5926 | | |
5926 | | - | |
5927 | | - | |
5928 | | - | |
| 5927 | + | |
| 5928 | + | |
5929 | 5929 | | |
5930 | 5930 | | |
5931 | 5931 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1333 | 1333 | | |
1334 | 1334 | | |
1335 | 1335 | | |
1336 | | - | |
1337 | 1336 | | |
1338 | 1337 | | |
1339 | 1338 | | |
1340 | 1339 | | |
1341 | 1340 | | |
1342 | 1341 | | |
1343 | 1342 | | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1344 | 1346 | | |
1345 | 1347 | | |
1346 | 1348 | | |
1347 | 1349 | | |
1348 | 1350 | | |
1349 | 1351 | | |
1350 | 1352 | | |
1351 | | - | |
| 1353 | + | |
1352 | 1354 | | |
1353 | 1355 | | |
1354 | 1356 | | |
| |||
0 commit comments