Comments (4)
If I try to build for aarch64 on my macOS aarch64 system, it does seem to work, but building with 32-bit ARM dies in more exciting ways.
I would recommend running with -vv
at the end and dumping the logs. That way you can rebuild the environment and try to run cargo directly with the environment that cargo ndk is setting.
Maybe try adding --bindgen
to the command and see if that helps? That feature was added a long time ago and I'm not sure if it's still relevant.
from cargo-ndk.
@bbqsrc I'll try running the job with -vv
and see.I'm also on aarhch64
macOS, and it works without any issues! I suppose I could also spin up an Ubuntu VM and try locally.
Hopefully the logs will give a clue or two. Thanks for the swift response! 🙏
from cargo-ndk.
@bbqsrc I'll try running the job with
-vv
and see.I'm also onaarhch64
macOS, and it works without any issues! I suppose I could also spin up an Ubuntu VM and try locally.Hopefully the logs will give a clue or two. Thanks for the swift response! 🙏
With -vv
, I get the following details:
+ cargo ndk --target aarch64-linux-android --platform 21 -- -vv build --release
Detected NDK v26.1.10909125 (/home/expo/Android/Sdk/ndk/26.1.10909125) [ANDROID_NDK_HOME]
Exporting CARGO_NDK_CMAKE_TOOLCHAIN_PATH="/home/expo/Android/Sdk/ndk/26.1.10909125/build/cmake/android.toolchain.cmake"
Setting Android SDK platform level to 21
Building targets (arm64-v8a)
Building arm64-v8a (aarch64-linux-android)
Exporting CARGO_NDK_ANDROID_TARGET="arm64-v8a"
Exporting CC_aarch64-linux-android="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/clang"
Exporting CFLAGS_aarch64-linux-android="--target=aarch64-linux-android21"
Exporting CXX_aarch64-linux-android="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++"
Exporting CXXFLAGS_aarch64-linux-android="--target=aarch64-linux-android21"
Exporting AR_aarch64-linux-android="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
Exporting RANLIB_aarch64-linux-android="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib"
Exporting CARGO_TARGET_AARCH64_LINUX_ANDROID_AR="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
Exporting CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="/home/expo/.cargo/bin/cargo-ndk"
Exporting CARGO_NDK_SYSROOT_PATH="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/sysroot"
Exporting CARGO_NDK_SYSROOT_LIBS_PATH="/home/expo/Android/Sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android"
and the rocksdb
compilation part:
Compiling librocksdb-sys v0.11.0+8.1.1
Running `CARGO=/home/expo/.rustup/toolchains/nightly-2022-12-10-x86_64-unknown-linux-gnu/bin/cargo CARGO_CRATE_NAME=build_script_build CARGO_MANIFEST_DIR=/home/expo/.cargo/registry/src/github.com-1ecc6299db9ec823/librocksdb-sys-0.11.0+8.1.1 CARGO_PKG_AUTHORS='Karl Hobley <[email protected]>:Arkadiy Paronyan <[email protected]>' CARGO_PKG_DESCRIPTION='Native bindings to librocksdb' CARGO_PKG_HOMEPAGE='' CARGO_PKG_LICENSE=MIT/Apache-2.0/BSD-3-Clause CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=librocksdb-sys CARGO_PKG_REPOSITORY='https://github.com/rust-rocksdb/rust-rocksdb' CARGO_PKG_RUST_VERSION=1.60 CARGO_PKG_VERSION=0.11.0+8.1.1 CARGO_PKG_VERSION_MAJOR=0 CARGO_PKG_VERSION_MINOR=11 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' LD_LIBRARY_PATH='/home/expo/workingdir/build/target/release/deps:/home/expo/.rustup/toolchains/nightly-2022-12-10-x86_64-unknown-linux-gnu/lib:/home/expo/.rustup/toolchains/nightly-2022-12-10-x86_64-unknown-linux-gnu/lib' rustc --crate-name build_script_build --edition=2018 /home/expo/.cargo/registry/src/github.com-1ecc6299db9ec823/librocksdb-sys-0.11.0+8.1.1/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="bzip2"' --cfg 'feature="bzip2-sys"' --cfg 'feature="default"' --cfg 'feature="libz-sys"' --cfg 'feature="lz4"' --cfg 'feature="lz4-sys"' --cfg 'feature="snappy"' --cfg 'feature="static"' --cfg 'feature="zlib"' --cfg 'feature="zstd"' --cfg 'feature="zstd-sys"' -C metadata=15a888c3efcb2fca -C extra-filename=-15a888c3efcb2fca --out-dir /home/expo/workingdir/build/target/release/build/librocksdb-sys-15a888c3efcb2fca -L dependency=/home/expo/workingdir/build/target/release/deps --extern bindgen=/home/expo/workingdir/build/target/release/deps/libbindgen-9e8fc4bc66280808.rlib --extern cc=/home/expo/workingdir/build/target/release/deps/libcc-8f616a01bfaf8a58.rlib --extern glob=/home/expo/workingdir/build/target/release/deps/libglob-2836ed3c36f62b96.rlib --cap-lints warn`
from cargo-ndk.
Building it like so worked (was an issue with sysroot
, and your --bindgen
suggestion was very apropos!):
SYSROOT_PATH="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android"
BINDGEN_EXTRA_CLANG_ARGS="--sysroot ${SYSROOT_PATH}" cargo ndk --bindgen --target aarch64-linux-android --platform 21 -- build --release
Re: rust-rocksdb/rust-rocksdb#598 (comment)
Closing this issue now. Thank you for your help!
from cargo-ndk.
Related Issues (20)
- 3.2.0 version seems to be different from 3.1.2, failed to correctly find the compiler HOT 1
- C linker issue HOT 6
- CFLAGS getting ignored HOT 17
- error[E0308]: mismatched types HOT 1
- Changes for 3.3 release haven't been pushed to main HOT 1
- Using proc-macros - no .kt file HOT 1
- install error
- x86_64 linker issue HOT 7
- Not an issue. Just a question if there is any version support NDK 21? HOT 1
- A library produces .sos with undefined symbols HOT 3
- Error in build HOT 1
- Feature request: Printing environment variables set HOT 31
- Install cargo-ndk failed HOT 4
- m1 Mac: ARCH not found in this scope HOT 2
- Feature Request: Set Env for clang/cc-rs HOT 3
- What's the difference when handle libc++_shared.so HOT 1
- default ndk location for linux is wrong HOT 2
- (Question) The Android toolchain and libraries needs to run on Linux?
- Failed loading manifest HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-ndk.