Skip to content
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

Zig 0.11.0 with MacOS SDK 13.3 fails to build aarch64 target #322

Open
theMackabu opened this issue Mar 6, 2025 · 0 comments
Open

Zig 0.11.0 with MacOS SDK 13.3 fails to build aarch64 target #322

theMackabu opened this issue Mar 6, 2025 · 0 comments

Comments

@theMackabu
Copy link

I've been getting a strange issue lately when using these together

error: linking with `/root/.cache/cargo-zigbuild/0.19.8/zigcc-aarch64-apple-darwin-342c.sh` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET -u XROS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/.cargo/bin:./node_modules/.bin:/mnt/data/code/node_modules/.bin" VSLANG="1033" ZERO_AR_DATE="1" "/root/.cache/cargo-zigbuild/0.19.8/zigcc-aarch64-apple-darwin-342c.sh" "/tmp/rustctqRuEQ/symbols.o" "<1 object files omitted>" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-apple-darwin/lib/{libcompiler_builtins-127b2e95f1a1ab85.rlib}" "-lSystem" "-lc" "-lm" "-arch" "arm64" "-mmacosx-version-min=11.0.0" "-o" "/mnt/data/code/target/aarch64-apple-darwin/release/deps/loft-176645d1434a3555" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: 'znver2' is not a recognized processor for this target (ignoring processor)
          'znver2' is not a recognized processor for this target (ignoring processor)
          'znver2' is not a recognized processor for this target (ignoring processor)
          'znver2' is not a recognized processor for this target (ignoring processor)
          error: sub-compilation of compiler_rt failed
              /root/.cache/zig/o/10f4828aedb3f767f0f03fc9e81e96ea/builtin.zig:15:38: note: struct 'target.aarch64.cpu' has no member named 'znver2'
              /usr/local/zig-linux-x86_64-0.11.0/lib/std/target/aarch64.zig:1445:17: note: struct declared here
error: could not compile `loft` (bin "loft") due to 1 previous error

specifically after

rustup target add aarch64-apple-darwin
# this works fine 
cargo zigbuild -r --target x86_64-apple-darwin
# this does not
cargo zigbuild -r --target aarch64-apple-darwin

the machine used is just a fly.io x86 machine inside of the rust:1.85.0 debian docker container
the rest of the build script is used to put github.com/roblabla/MacOSX-SDKs/releases/download/13.3/MacOSX13.3.sdk.tar.xz in /opt/MacOSX13.3.sdk with SDKROOT (this causes another issue on zig 0.12.0+ with duplicate paths, for another issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant