3 ms·
In this case sqlite is bundled as a single C source file. You could just use Zig as your C cross compiler to cross compile alongside Go for almost any platform[
by messe 4y ago
In this case sqlite is bundled as a single C source file. You could just use Zig as your C cross compiler to cross compile alongside Go for almost any platform[1].
[1]: https://dev.to/kristoff/zig-makes-go-cross-compilation-just-work-29ho https://dev.to/kristoff/zig-makes-go-cross-compilation-just-...
- IshKebab 4y agoStill way more of a pain than if it was pure Go.
- ketralnis 4y agoI just can't agree with this. It's true that one piece, the compiling, is less painful. But the entire rest of the system from developing to testing to routing out implementation bugs is way, way more painful
- zamadatix 4y agoIt's ridiculously more painful for a single one off by a single dev for a single tool but an actual ecosystem of pure go reimplementations has popped up where that load can become collectively shared over time and ultimately using native implementations doesn't carry that burden to the end developer. It has to start somewhere though.
- oefrha 4y agoExcept that’s at the very least broken for macOS -> Linux right now. I attempted to use zig cc as the cross compiler for sqlite3 the other day. Ran into https://github.com/ziglang/zig/issues/5882 https://github.com/ziglang/zig/issues/5882 https://github.com/ziglang/zig/issues/9485 https://github.com/ziglang/zig/issues/9485 an almost two-year-old issue. Cross compiling C sucks.
- AndyKelley 4y agoIt is a bug, and we will fix it, but keep in mind the scope - this is something that affects old versions of glibc. Newer versions of glibc are not affected, and neither is musl libc (often preferable for cross compiling to Linux). You can target a newer glibc like this: -target x86_64-linux-gnu.2.28 You can target musl libc like this: -target x86_64-linux-musl