My crate failed to cross-compile rustls after it introduced aws-lc-rs. After spending some time digging into it, I found the failure is caused by rust-bindgen, and two extra env vars should be set to make it compile.
ANDROID_NDK=/path/to/android/ndk and BINDGEN_EXTRA_CLANG_ARGS="--sysroot=/path/to/andtroid/ndk/sysroot"
My crate failed to cross-compile
rustls
after it introducedaws-lc-rs
. After spending some time digging into it, I found the failure is caused byrust-bindgen
, and two extra env vars should be set to make it compile.ANDROID_NDK=/path/to/android/ndk
andBINDGEN_EXTRA_CLANG_ARGS="--sysroot=/path/to/andtroid/ndk/sysroot"