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

I've been using this the past few weeks to try and cross compile my software. Clang works, but a lot of the core libraries are missing. pkgbuild for instance won't work. And even native Cocoa apps I've tried won't work. That being said, this has a ton of potential. I really wish the devs had more time to work on it.



Cocotron used to have pretty good AppKit API coverage:

https://www.cocotron.org

I was able to get a ported app running with it at one point. And I think Microsoft took a pass at it more recently: https://github.com/Microsoft/WinObjC

But it appears Darling uses Cocotron so maybe you've already seen how well it works for you.


Have you tried using the headers and sources from Xcode SDKs and linking them against Clang on Darling? Should be enough if cross compiling is the goal and not porting apps to run on other platforms.

Something similar can be done with Wine as well as MinGW and other similar toolchains and platforms that target Windows.


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: