Closed alexrp closed 1 week ago
This still reproduces with 0.13.0, but now gives an additional error:
❯ zig cc main.c -target x86_64-windows-gnu -fexceptions
lld-link: error: undefined symbol: _Unwind_Resume
>>> referenced by C:\Users\Alex Rønne Petersen\source\repos\tests\main.c:7
>>> C:\Users\Alex Rønne Petersen\AppData\Local\zig\o\ae60fb380b2b070096508d68b5346ae2\main.obj:(main)
lld-link: error: undefined symbol: __gcc_personality_seh0
>>> referenced by C:\Users\Alex Rønne Petersen\AppData\Local\zig\o\ae60fb380b2b070096508d68b5346ae2\main.obj:(.xdata)
For reference, the code we need to port is here: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/builtins/gcc_personality_v0.c
This now works after #21472, but requires adding -lunwind
.
(For some reason, it only happens with 2+ variables using the
cleanup
attribute.)