diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-21 18:20:34 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-22 13:07:02 -0700 |
| commit | 1741b821c39c3e677719a5db435ddac6190874b2 (patch) | |
| tree | 50481157fe001c4239f14ff94cb072bd742f2ad1 /lib/std/Build/Module.zig | |
| parent | 54b7e144b126beb89e86dd8f3dc7ddc7a13871c9 (diff) | |
| download | zig-1741b821c39c3e677719a5db435ddac6190874b2.tar.gz zig-1741b821c39c3e677719a5db435ddac6190874b2.zip | |
add the build system API for enabling fuzzing
Diffstat (limited to 'lib/std/Build/Module.zig')
| -rw-r--r-- | lib/std/Build/Module.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/Build/Module.zig b/lib/std/Build/Module.zig index 844f69c8cd..635e6cc334 100644 --- a/lib/std/Build/Module.zig +++ b/lib/std/Build/Module.zig @@ -28,6 +28,7 @@ stack_protector: ?bool, stack_check: ?bool, sanitize_c: ?bool, sanitize_thread: ?bool, +fuzz: ?bool, code_model: std.builtin.CodeModel, valgrind: ?bool, pic: ?bool, @@ -186,6 +187,7 @@ pub const CreateOptions = struct { stack_check: ?bool = null, sanitize_c: ?bool = null, sanitize_thread: ?bool = null, + fuzz: ?bool = null, /// Whether to emit machine code that integrates with Valgrind. valgrind: ?bool = null, /// Position Independent Code @@ -228,6 +230,7 @@ pub fn init(m: *Module, owner: *std.Build, options: CreateOptions, compile: ?*St .stack_check = options.stack_check, .sanitize_c = options.sanitize_c, .sanitize_thread = options.sanitize_thread, + .fuzz = options.fuzz, .code_model = options.code_model, .valgrind = options.valgrind, .pic = options.pic, @@ -642,6 +645,7 @@ pub fn appendZigProcessFlags( try addFlag(zig_args, m.error_tracing, "-ferror-tracing", "-fno-error-tracing"); try addFlag(zig_args, m.sanitize_c, "-fsanitize-c", "-fno-sanitize-c"); try addFlag(zig_args, m.sanitize_thread, "-fsanitize-thread", "-fno-sanitize-thread"); + try addFlag(zig_args, m.fuzz, "-ffuzz", "-fno-fuzz"); try addFlag(zig_args, m.valgrind, "-fvalgrind", "-fno-valgrind"); try addFlag(zig_args, m.pic, "-fPIC", "-fno-PIC"); try addFlag(zig_args, m.red_zone, "-mred-zone", "-mno-red-zone"); |
