initial support for integrated fuzzing

* Add the `-ffuzz` and `-fno-fuzz` CLI arguments.
* Detect fuzz testing flags from zig cc.
* Set the correct clang flags when fuzz testing is requested. It can be
  combined with TSAN and UBSAN.
* Compilation: build fuzzer library when needed which is currently an
  empty zig file.
* Add optforfuzzing to every function in the llvm backend for modules
  that have requested fuzzing.
* In ZigLLVMTargetMachineEmitToFile, add the optimization passes for
  sanitizer coverage.
* std.mem.eql uses a naive implementation optimized for fuzzing when
  builtin.fuzz is true.

Tracked by #20702
This commit is contained in:
Andrew Kelley
2024-07-21 18:12:22 -07:00
parent eac7fd4da5
commit 54b7e144b1
11 changed files with 133 additions and 53 deletions

0
lib/fuzzer.zig Normal file
View File