1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
//! The Rust half of what the Android toolchain is asked to prove.
//!
//! No dependencies, first-party or third: the third-party graph has no Android
//! platform yet, so this is what can cross-compile today. It fails to build
//! unless rustc was given the device's libstd — `std::os::android` exists on
//! no other target — and unless the sysroot also still holds the host's, which
//! is what the stitching in toolchains//dist is for.
#[cfg(target_os = "android")]
pub use std::os::android as _platform;
#[cfg(not(target_os = "android"))]
compile_error!("not an Android target");
/// Named so the symbol is visible in the object; nothing calls it.
#[unsafe(no_mangle)]
pub extern "C" fn jolt_android_std_ok() -> u32 {
// Reaching libstd's allocator and its formatting machinery is the point:
// a target libstd that failed to load would not get this far.
format!("{}", u32::from(cfg!(target_arch = "aarch64"))).len() as u32
}
|