Skip to content

Commit 826b523

Browse files
authored
Merge pull request #191 from bfredl/luajit_macos0.15.2
backport 0.15.2: zig macos linker is not happy with luajit debug info
2 parents dca1800 + 75a9354 commit 826b523

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build/luajit.zig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,11 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
131131
else => &.{},
132132
};
133133

134-
const buildvm_windows_c_flags: []const []const u8 = if (target.result.os.tag == .windows)
134+
const buildvm_os_c_flags: []const []const u8 = if (target.result.os.tag == .windows)
135135
&.{"-DLUAJIT_OS=1"}
136+
else if (target.result.os.tag.isDarwin())
137+
// FIXME: this can be removed once https://codeberg.org/ziglang/zig/issues/30669 is successfully resolved
138+
&.{"-DLJ_NO_UNWIND=1"}
136139
else
137140
&.{};
138141

@@ -142,7 +145,7 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
142145
.sub_path = "",
143146
} },
144147
.files = &.{ "src/host/buildvm_asm.c", "src/host/buildvm_fold.c", "src/host/buildvm_lib.c", "src/host/buildvm_peobj.c", "src/host/buildvm.c" },
145-
.flags = std.mem.concat(b.allocator, []const u8, &.{ buildvm_c_flags, buildvm_windows_c_flags }) catch @panic("OOM!"),
148+
.flags = std.mem.concat(b.allocator, []const u8, &.{ buildvm_c_flags, buildvm_os_c_flags }) catch @panic("OOM!"),
146149
});
147150

148151
buildvm.addIncludePath(upstream.path("src"));

0 commit comments

Comments
 (0)