5 ms·
I wrote a blog post about using Zig with CGo, the main problem is that CGo doesn't expect the CC command to have a space in it and the workaround is to wrap the
by kristoff_it 5y ago
I wrote a blog post about using Zig with CGo, the main problem is that CGo doesn't expect the CC command to have a space in it and the workaround is to wrap the Zig invocation inside a bash script.
https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho https://dev.to/kristoff/zig-makes-go-cross-compilation-just-...
As a related note, it seems that Go 1.17 won't have the fix as the relative patch has not been merged (see https://go-review.googlesource.com/c/go/+/276412/ https://go-review.googlesource.com/c/go/+/276412/ ). Would be awesome if somebody from the Go team saw this post and made it happen :)
- pojntfx 5y agoThanks a lot, I was trying to use it all day yesterday and just couldn't get it work. Zig and Go are a great match it seems.
- hawski 5y agoZig should work like multi call binaries (i.e. busybox) so a link to it called cc or would call the compiler.
- slimsag 5y agoYeah, my brother opened an issue similar to this earlier - there is actually a quite cool proposal for something like this here now: https://github.com/ziglang/zig/issues/8973 https://github.com/ziglang/zig/issues/8973