diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-07-24 17:41:44 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-07-25 18:52:21 -0700 |
| commit | a3c74aca99c7eaf719c745ec6e9ee7366cad1910 (patch) | |
| tree | b0396505cb9623d1a906501ed97905f7cc8bb6c6 /lib/std/Build/Step/Compile.zig | |
| parent | 90dfd86ebee1639e5455ace4e34157ff9b68ac0f (diff) | |
| download | zig-a3c74aca99c7eaf719c745ec6e9ee7366cad1910.tar.gz zig-a3c74aca99c7eaf719c745ec6e9ee7366cad1910.zip | |
add --debug-rt CLI arg to the compiler + bonus edits
The flag makes compiler_rt and libfuzzer be in debug mode.
Also:
* fuzzer: override debug logs and disable debug logs for frequently
called functions
* std.Build.Fuzz: fix bug of rerunning the old unit test binary
* report errors from rebuilding the unit tests better
* link.Elf: additionally add tsan lib and fuzzer lib to the hash
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index ffb2337ac5..8a418760c1 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1483,6 +1483,8 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { try zig_args.append("--global-cache-dir"); try zig_args.append(b.graph.global_cache_root.path orelse "."); + if (b.graph.debug_compiler_runtime_libs) try zig_args.append("--debug-rt"); + try zig_args.append("--name"); try zig_args.append(compile.name); @@ -1840,6 +1842,14 @@ fn make(step: *Step, options: Step.MakeOptions) !void { } pub fn rebuildInFuzzMode(c: *Compile, progress_node: std.Progress.Node) ![]const u8 { + const gpa = c.step.owner.allocator; + + c.step.result_error_msgs.clearRetainingCapacity(); + c.step.result_stderr = ""; + + c.step.result_error_bundle.deinit(gpa); + c.step.result_error_bundle = std.zig.ErrorBundle.empty; + const zig_args = try getZigArgs(c, true); const maybe_output_bin_path = try c.step.evalZigProcess(zig_args, progress_node, false); return maybe_output_bin_path.?; |
