Commit 3f577f06a0

LordMZTE <lord@mzte.de>
2022-10-19 13:13:37
build: added unwind_tables to LibExeObjStep
1 parent 8a344fa
Changed files (1)
lib
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"),