During the 1.12 beta, I built and ran code this for Android without problems:
[package]
name = "android"
version = "0.1.0"
authors = ["Author <[email protected]>"]
build = "build.rs"
[lib]
name = "mylib"
crate-type = ["cdylib"]
I use rustup and rustup target add arm-linux-androideabi
.
Now when I load my Rust 1.12 library from Java code I get:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "rust_begin_unwind"
To temporarily fix this, I need a workaround:
#[allow(unused_variables)]
#[no_mangle]
pub extern
fn rust_begin_unwind(fmt: ::std::fmt::Arguments, file: &'static str, line: u32) -> ! {
loop {}
}
Rust 1.12 introduced the MIR (Mid-level Intermediate Representation), a new translation into machine code the compiler uses. I don't know much about it but it was apparently focused largely on control flow, and rust_begin_unwind
sounds reasonably likely to have been affected.
https://blog.rust-lang.org/2016/09/29/Rust-1.12.html#mir-code-generation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With