Skip to content

rust 1.84 + cross compiling to aarch64-apple-darwin results in curl linker error #309

Closed Answered by astelmashenko
astelmashenko asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to compile it. Thanks a lot! Briefly:

  1. I generated macos sdk https://github.com/tpoechtrager/osxcross?tab=readme-ov-file#packaging-the-sdk (Set a path to macos sdk export XCODEDIR=~/path_to/macos_sdk/Xcode.app)
  2. Followed steps to compile https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work/
  3. Extracted generated sdk into project dir mac_sdk/MacOSX12.3.sdk
  4. Point 2 required modifications, here is a script I used as zcc
#!/bin/sh
export MACOS_SDK="`pwd`/mac_sdk/MacOSX12.3.sdk"
zig cc --sysroot $MACOS_SDK -L/usr/lib -I$MACOS_SDK/usr/include -F$MACOS_SDK/System/Library/Frameworks -framework CoreFoundation -target aarch64-macos $@
  1. Created .cargo/config.toml
[target.a…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@messense
Comment options

@astelmashenko
Comment options

Answer selected by astelmashenko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #308 on January 15, 2025 01:27.