diff options
Diffstat (limited to 'build/debugger.zig')
| -rw-r--r-- | build/debugger.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/build/debugger.zig b/build/debugger.zig index 6fa6f8c..cb67354 100644 --- a/build/debugger.zig +++ b/build/debugger.zig @@ -17,6 +17,10 @@ pub fn add(ctx: Ctx) void { const musl_mod = b.createModule(.{ .target = musl, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false }); musl_mod.addCSourceFiles(.{ .root = b.path("targets"), .files = &.{"libc.c"}, .flags = &.{ "-O1", "-g", "-fno-omit-frame-pointer" } }); const libc_musl = b.addExecutable(.{ .name = "libc-musl", .root_module = musl_mod }); + // The list at -O0, where every local has its place on the stack. + const o0_mod = b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .omit_frame_pointer = false }); + o0_mod.addCSourceFiles(.{ .root = b.path("targets"), .files = &.{"list.c"}, .flags = &.{ "-O0", "-g" } }); + const list_o0 = b.addExecutable(.{ .name = "list-O0", .root_module = o0_mod }); // Zig, no libc: always a debug build, so its lines are the source's. const graph = b.addExecutable(.{ .name = "graph", .root_module = b.createModule(.{ .root_source_file = b.path("targets/graph.zig"), @@ -24,7 +28,7 @@ pub fn add(ctx: Ctx) void { .optimize = .Debug, }) }); - const targets = [_]*std.Build.Step.Compile{ fib, list, threads, libc_glibc, libc_musl, graph }; + const targets = [_]*std.Build.Step.Compile{ fib, list, list_o0, threads, libc_glibc, libc_musl, graph }; for (targets) |t| b.getInstallStep().dependOn(&b.addInstallArtifact(t, .{ .dest_dir = .{ .override = .{ .custom = "targets" } } }).step); // The compiler's own checks (UBSan, on by default in a debug build) are |
