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.

Cross-compile for Android, with an NDK nobody has to install 14a30c0 · on 14a30c029628db6eb0966e8de5efffa1aeeafc57 · nandi · 19d ago
abi.rs · 22 lines · 951 BRust Blame HistoryRaw
 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
}