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

macOS to Android cross compile error: No such file or directory #622

Closed
EternalDeiwos opened this issue Jan 8, 2018 · 3 comments
Closed

Comments

@EternalDeiwos
Copy link

EternalDeiwos commented Jan 8, 2018

I've tried a bunch of things to get aarch64 and armaebi-v7a to build for android

  • Tried building on both macOS and linux (x86_64).
  • Changing the API version in build.rs
  • Regenerating my standalone android NDK toolchain (with --api 21)
  • Specifying the correct gcc compiler (from the NDK toolchain) in `.cargo/config
  • Multiple versions of ring -- specifically 0.12.1 and 0.13.0.

I've also made sure that I am able to build a simple static library for these architectures when not requiring/using ring.

The build fails to compile multiple files of .c/.S crypto code with the error:

$ cargo build --target aarch64-linux-android --release
...
No such file or directory (os error 2)', ring/build.rs:633:8
(what file is this referring to?)

I started at #486 but the build still fails even for the exact rev that shows passing tests on travis. If I had to guess, I'd say the problem is related to cross-compiling the C/ASM code specifically.

@EternalDeiwos
Copy link
Author

Update
In addition to the above; I was able to successfully build v0.12.1 for aarch64 using the following environment variables:

PATH=$(PATH):$(NDK_STANDALONE)/arm64/bin \
CC=aarch64-linux-android-gcc \
CXX=aarch64-linux-android-g++ \
cargo build --target aarch64-linux-android --release --lib

The same worked for the armaebi, armaebi-v7a, i686 and x86_64 android builds which will allow me to use the static libraries in JNI. Aside from the API differences mentioned in #486, I don't think there's an issue (maybe aside from some documentation on the topic in BUILDING.md). The above error which I created the issue on was clearly a configuration problem on my end.

@EternalDeiwos
Copy link
Author

Update

Our exact setup can be seen here.

@briansmith
Copy link
Owner

I'm closing this as a combination of "dupe of #486" and "no longer an issue."

Thanks for all the help here.

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

2 participants