ryupold / raylib.zig

Idiomatic Zig bindings for raylib utilizing raylib_parser
MIT License
222 stars 36 forks source link

Compiler segfault when cross-compiling a project for Windows #23

Open recursiveGecko opened 1 year ago

recursiveGecko commented 1 year ago

Hi,

I'm working on a small project using Raylib.zig and I'm experiencing some issues when I try to cross-compile the project from Linux to x86_64_windows_gnu. I've tried various recent Zig 0.11-dev versions but they all segfault when I try to build the project in any of the Release modes - Debug builds work fine.

Here's the failing GitHub Actions output from the minimal example project I'm trying to build: https://github.com/recursiveGecko/zig-raylib-segfault-repro/actions/runs/5624683409/job/15241992190#step:4:66

I've filed an issue in the Zig repo, but I'd like to know if there's anything I can do in the meantime to work around it?

Any tips, example projects or guides would be really appreciated! Thanks :)

ryupold commented 1 year ago

I encounter the same problem on a Windows machine with my example repo. Unfortunately I have no idea what causes that error 😅 Thanks for filing an issue in the zig repo. I hope this get fixed soon. I set a reminder for myself to test this periodically and let you know if it works again.

rdoetjes commented 1 year ago

Same here on MacOS M1

ProIcons commented 7 months ago

This works only on linux, because it links with LIBC https://github.com/ryupold/raylib.zig/blob/bd561b3689bc4e703f46bf1908633abb09680b4b/build.zig#L93

Some changes might need to be made to raylib upstream, before this can be fixed.