diff --git a/lib/std/build.zig b/lib/std/build.zig index c3deff5a09..3f903a0b12 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -1469,6 +1469,7 @@ pub const LibExeObjStep = struct { major_only_filename: ?[]const u8, name_only_filename: ?[]const u8, strip: ?bool, + unwind_tables: ?bool, // keep in sync with src/link.zig:CompressDebugSections compress_debug_sections: enum { none, zlib } = .none, lib_paths: ArrayList([]const u8), @@ -1739,6 +1740,7 @@ pub const LibExeObjStep = struct { const self = builder.allocator.create(LibExeObjStep) catch unreachable; self.* = LibExeObjStep{ .strip = null, + .unwind_tables = null, .builder = builder, .verbose_link = false, .verbose_cc = false, @@ -2698,6 +2700,14 @@ pub const LibExeObjStep = struct { } } + if (self.unwind_tables) |unwind_tables| { + if (unwind_tables) { + try zig_args.append("-funwind-tables"); + } else { + try zig_args.append("-fno-unwind-tables"); + } + } + switch (self.compress_debug_sections) { .none => {}, .zlib => try zig_args.append("--compress-debug-sections=zlib"),