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

Build for iOS (aarch64-apple-ios) is broken #4416

Open
olliiiver opened this issue Dec 13, 2024 · 4 comments
Open

Build for iOS (aarch64-apple-ios) is broken #4416

olliiiver opened this issue Dec 13, 2024 · 4 comments

Comments

@olliiiver
Copy link

Hello.

It seems I cannot build the SDK for aarch64-apple-ios.

I've added a pipeline to demonstrate this here:

https://github.com/olliiiver/matrix-rust-sdk-build/actions/runs/12320983696/job/34391426770

The error message is:

  = note: ld: warning: object file (/Users/runner/work/matrix-rust-sdk-build/matrix-rust-sdk-build/matrix-rust-sdk/target/aarch64-apple-ios/debug/deps/libblake3-e40b55db2257280c.rlib[6](db3b6bfb95261072-blake3_neon.o)) was built for newer 'iOS' version (17.5) than being linked (10.0)
          Undefined symbols for architecture arm64:
            "___chkstk_darwin", referenced from:
                _blake3_hash4_neon in libblake3-e40b55db2257280c.rlib[6](db3b6bfb95261072-blake3_neon.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can this be fixed?

@zzorba
Copy link
Contributor

zzorba commented Dec 16, 2024

Seems like neon might not be available on all arm64 platforms, according to the blake3 documentation https://docs.rs/blake3/latest/blake3/

@olliiiver
Copy link
Author

Hi @zzorba ,

looks like this is a blake3 build issue.

I've added a ticket here as well:

BLAKE3-team/BLAKE3#437

@bnjbvr
Copy link
Member

bnjbvr commented Dec 16, 2024

For what it's worth, we at Element are building the aarch64-ios SDK with optimizations, as it seems to trigger dead code elimination, and remove usage of this symbol. It's an unfortunate workaround, and we'd be super happy to have a better fix for this, in case any of you has a better understanding of the issue or idea :)

@olliiiver
Copy link
Author

olliiiver commented Dec 17, 2024

Hi @bnjbvr @zzorba . Thanks for coming back to me. Yes, the build (currently) works by using the following workaround:

export CARGO_FEATURE_NO_NEON=1
cargo build --target aarch64-apple-ios

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

3 participants