nandi/jolt-nativepublic Fork 0
14a30c029628db6eb0966e8de5efffa1aeeafc57
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

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