aboutsummaryrefslogtreecommitdiff
path: root/src/Compilation.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-07-23 15:58:18 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-07-23 16:04:58 -0700
commit33d47424562672834ff758770b7ce89c637d4a1d (patch)
tree56808bda9fe5aea195facd3d415edfdf4ec56c07 /src/Compilation.zig
parent7aaebd17746dc97111585563c64e166e27b334af (diff)
downloadzig-33d47424562672834ff758770b7ce89c637d4a1d.tar.gz
zig-33d47424562672834ff758770b7ce89c637d4a1d.zip
LLVM: more fine-grained sancov emit options
Exposes sanitizer coverage flags to the target machine emit function. Makes it easier to change sancov options without rebuilding the C++ files. This also enables PCTable = true for sancov which is needed by AFL, and adds the corresponding Clang flag.
Diffstat (limited to 'src/Compilation.zig')
-rw-r--r--src/Compilation.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 50fe8b36c3..688e4c0519 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -5652,6 +5652,10 @@ pub fn addCCArgs(
// function was called.
try argv.append("-fno-sanitize=function");
}
+
+ if (mod.fuzz) {
+ try argv.appendSlice(&.{ "-Xclang", "-fsanitize-coverage-trace-pc-guard" });
+ }
}
}