Commit 75a9354
committed
fix(build): zig macos linker is not happy with luajit debug info
same as 61f8ca4 but ported to the
v0.15.2 branch
On master attempting to build -Dlang=luajit on macos (at least for
arm64) hits an assert in Zig's MachO linker:
thread 73187 panic: unexpected pointer encoding
/home/bfredl/dev/zig/src/link/MachO/eh_frame.zig:33:21: 0x772f808 in parse (main.zig)
@Panic("unexpected pointer encoding"); // TODO error
^
/home/bfredl/dev/zig/src/link/MachO/Object.zig:1125:22: 0x7732c1d in initEhFrameRecords (main.zig)
try cie.parse(macho_file);
^
/home/bfredl/dev/zig/src/link/MachO/Object.zig:255:36: 0x7743887 in parse (main.zig)
try self.initEhFrameRecords(gpa, index, handle, macho_file);
^
/home/bfredl/dev/zig/src/link/MachO/file.zig:336:35: 0x7745bd3 in parse (main.zig)
.object => |x| x.parse(macho_file),
^
with some debugging this turns out to be the __eh_frame section which
is generated in lj_vm.S. This debug info can be disabled at compile time
using LJ_NO_UNWIND.
Ideally this should be handled better upstream by omiting debug frames
it does not understand instead of crashing the compiler, but for now
this allows luajit to be used on macos at all.1 parent dca1800 commit 75a9354
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
142 | 145 | | |
143 | 146 | | |
144 | 147 | | |
145 | | - | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
0 commit comments