-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ability to link against darwin frameworks (such as CoreFoundation) when cross compiling #1349
Comments
Reference ziglang#1349 for help/understanding;
Here's what we need to accomplish:
|
Zig, and A typical invocation may look as follows,
|
@kubkon I suspect the answer to this will be "Copy it from a Mac" but... Any hints on where to get a sysroot bundle for MacOS? If the answer is copy it, do you know where I can get a list of what bits I need to grab? |
You can get macOS 12 SDK from Hexops for example. If you are looking for an older SDK version, you can get it here. In general tho, if you have a Mac, you just need to grab whatever |
I got zig to cross-compile targeting aarch64 macOS on a Ubuntu Jammy host.
Dockerfile: FROM ubuntu:jammy
COPY sdk /sdk
RUN apt update
RUN apt install -y wget xz-utils
WORKDIR /workspace
RUN wget -O zig.tar.xz https://ziglang.org/download/0.10.1/zig-linux-aarch64-0.10.1.tar.xz
RUN tar -xf zig.tar.xz
RUN rm zig.tar.xz
RUN mv zig* zig
ENV PATH=$PATH:/workspace/zig
COPY samples samples
RUN zig cc -target aarch64-macos --sysroot=/sdk -I/sdk/usr/include -L/sdk/usr/lib -F/sdk/System/Library/Frameworks -framework CoreFoundation -o hello-c samples/hello.c |
The std library now has code that must be linked against CoreFoundation on macOS and iOS.
What is the best way to do so?
The text was updated successfully, but these errors were encountered: