-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
builder: add support for cross compiling to Darwin #2586
Conversation
8153a0d
to
3518212
Compare
In theory this should work now, let's see whether theory matches with reality... |
3518212
to
cebe420
Compare
It should only be added at the point that it is needed, for example when using libclang or using the built-in Clang. It isn't needed when running an external tool.
This means that it will be possible to generate a Darwin binary on any platform (Windows, Linux, and MacOS of course), including CGo. Of course, the resulting binaries can only run on MacOS itself. The binary links against libSystem.dylib, which is a shared library. The macos-minimal-sdk repository contains open source header files and generated symbol stubs so we can generate a stub libSystem.dylib without copying any closed source code.
cebe420
to
8d05924
Compare
Of course it didn't, but now it does! This is ready for review now. |
My app builds and passes tests on mac with this, fwiw. |
|
Can someone (@dgryski?) run the test corpus with this PR on MacOS? Just to make sure nothing broke. |
Running... |
Failed here after a while. Log excerpt:
|
That fails for me on dev, too, so it's not this pull request's fault. |
I have a patch for a cross compiled TinyGo ready (X86 to ARM Linux), but this PR should be merged first to avoid conflicts. |
This is some incredible work here @aykevl so exciting to see https://github.com/aykevl/macos-minimal-sdk is working! Now merging, this is a great place to start from for further iteration. |
This means that it will be possible to generate a Darwin binary on any platform (Windows, Linux, and MacOS of course), including CGo. Of course, the resulting binaries can only run on MacOS itself.
The binary links against libSystem.dylib, which is a shared library. The macos-minimal-sdk repository (created by me) contains open source header files and generated symbol stubs so we can generate a stub libSystem.dylib without copying any closed source code.