Skip to content

Commit 188ba36

Browse files
authored
Merge pull request #190 from bfredl/luajit_macos
fix(build): zig macos linker is not happy with luajit debug info
2 parents 45abda9 + 1119e18 commit 188ba36

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build/luajit.zig

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

123-
const buildvm_windows_c_flags: []const []const u8 = if (target.result.os.tag == .windows)
123+
const buildvm_os_c_flags: []const []const u8 = if (target.result.os.tag == .windows)
124124
&.{"-DLUAJIT_OS=1"}
125+
else if (target.result.os.tag.isDarwin())
126+
// FIXME: this can be removed once https://codeberg.org/ziglang/zig/issues/30669 is successfully resolved
127+
&.{"-DLJ_NO_UNWIND=1"}
125128
else
126129
&.{};
127130

@@ -131,7 +134,7 @@ pub fn configure(b: *Build, target: Build.ResolvedTarget, optimize: std.builtin.
131134
.sub_path = "",
132135
} },
133136
.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" },
134-
.flags = std.mem.concat(b.allocator, []const u8, &.{ buildvm_c_flags, buildvm_windows_c_flags }) catch @panic("OOM!"),
137+
.flags = std.mem.concat(b.allocator, []const u8, &.{ buildvm_c_flags, buildvm_os_c_flags }) catch @panic("OOM!"),
135138
});
136139

137140
buildvm.root_module.addIncludePath(upstream.path("src"));

0 commit comments

Comments
 (0)