diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-23 17:30:53 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-23 17:30:53 -0700 |
| commit | 26d2a7960e9199989d9387e0af29497581422f93 (patch) | |
| tree | 232000f18467d891a23c70b8e2b3ca48e9d62c8c /lib/std/Build/Step/Compile.zig | |
| parent | 33d47424562672834ff758770b7ce89c637d4a1d (diff) | |
| download | zig-26d2a7960e9199989d9387e0af29497581422f93.tar.gz zig-26d2a7960e9199989d9387e0af29497581422f93.zip | |
default "trace pc guard" coverage off
* Add -f(no-)sanitize-coverage-trace-pc-guard CLI flag which defaults to
off. This value lowers to TracePCGuard = true (LLVM backend) and -Xclang
-fsanitize-coverage-trace-pc-guard. These settings are not
automatically included with -ffuzz.
* Add `Build.Step.Compile` flag for sanitize_coverage_trace_pc_guard
with appropriate documentation.
* Add `zig cc` integration for the respective flags.
* Avoid crashing in ELF linker code when -ffuzz -femit-llvm-ir used
together.
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 8e9f61cfff..4f504151c0 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -217,6 +217,14 @@ no_builtin: bool = false, /// Managed by the build runner, not user build script. zig_process: ?*Step.ZigProcess, +/// Enables deprecated coverage instrumentation that is only useful if you +/// are using third party fuzzers that depend on it. Otherwise, slows down +/// the instrumented binary with unnecessary function calls. +/// +/// To enable fuzz testing instrumentation on a compilation, see the `fuzz` +/// flag in `Module`. +sanitize_coverage_trace_pc_guard: ?bool = null, + pub const ExpectedCompileErrors = union(enum) { contains: []const u8, exact: []const []const u8, @@ -1656,6 +1664,7 @@ fn getZigArgs(compile: *Compile) ![][]const u8 { try addFlag(&zig_args, "PIE", compile.pie); try addFlag(&zig_args, "lto", compile.want_lto); + try addFlag(&zig_args, "sanitize-coverage-trace-pc-guard", compile.sanitize_coverage_trace_pc_guard); if (compile.subsystem) |subsystem| { try zig_args.append("--subsystem"); |
