3 ms·
cross compiling to Mac from Linux, cross-architecture used to be an impossible bitbake adventure to go on. in go, it's just two env vars!
by fragmede 1y ago
cross compiling to Mac from Linux, cross-architecture used to be an impossible bitbake adventure to go on. in go, it's just two env vars!
- metaltyphoon 1y agoWith a big footnote: Until you need CGO
- fragmede 1y agofair.
- supriyo-biswas 1y agoHaving recently done some investigation along the same lines for a side project that I did not continue to work on: is it not just a matter of passing CGO_LDFLAGS=—static and building on musl?
- saagarjha 1y agoI don't think you can do this when targeting macOS
- metaltyphoon 1y agoor FreeBSD
- steveklabnik 1y agoTo say what your siblings said, but more generally: basically this only works for Linux. Other OSes generally don't let you do this, you must have some degree of dynamic linking. Go used to try and let you do it, but has walked back those implementations after all the bugs they've caused, in my understanding.