Hacker News new | past | comments | ask | show | jobs | submit login

You don't even need Darling or Wine if you just want to cross-compile since Clang can target any platform irrespective of the platform you are running it on (as long as your Clang is not built with support for that target disabled). All you need is the system libraries/headers and a linker (Apple's ld64 is open source, no idea if lld is usable for Mach-O yet). See e.g. OpenTTD's old how-to: http://web.archive.org/web/20200917010945/http://devs.opentt...

The only thing making this hard for targeting OS X is that a) too few people care for ready-made cross-compilers to be available so you have to piece this together yourself and b) there is no open-source reimplementation of the OS X system headers and stub libraries to link against so you have to extract the official ones from Xcode but that again is only a matter of people not caring.

For MinGW that is all there because Windows is a much more popular target - many Linux distros have MinGW packages that you can simply install and start cross-compiling. The same could be done for OS X.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: