aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-23 17:30:53 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-07-23 17:30:53 -0700
commit26d2a7960e9199989d9387e0af29497581422f93 (patch)
tree232000f18467d891a23c70b8e2b3ca48e9d62c8c /src/Compilation.zig
parent33d47424562672834ff758770b7ce89c637d4a1d (diff)
downloadzig-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 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 688e4c0519..a4cff10dcd 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -1412,6 +1412,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
cache_helpers.addOptionalEmitLoc(&cache.hash, options.emit_docs);
cache.hash.addBytes(options.root_name);
cache.hash.add(options.config.wasi_exec_model);
+ cache.hash.add(options.config.san_cov_trace_pc_guard);
// TODO audit this and make sure everything is in it
const main_mod = options.main_mod orelse options.root_mod;
@@ -5653,7 +5654,7 @@ pub fn addCCArgs(
try argv.append("-fno-sanitize=function");
}
- if (mod.fuzz) {
+ if (comp.config.san_cov_trace_pc_guard) {
try argv.appendSlice(&.{ "-Xclang", "-fsanitize-coverage-trace-pc-guard" });
}
}