nandi/jolt-nativepublic Fork 0
258bbc5161b93d580a4c84363acabe63b0624e88
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 258bbc5161b93d580a4c84363acabe63b0624e88 · nandi · 19d ago
android-cc · 20 lines · 956 BBash Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# The NDK's clang, as the linker rustc runs for an Android target.
#
# The buck-side twin of this is toolchains/ndk.sh, which the C toolchain gets
# as a dependency; both resolve the same archive, pinned in one place —
# android-ndk.dotslash beside this script. rustc reaches it through a shim
# instead because -Clinker takes a plain string: rustc_flags cannot carry an
# artifact path, so the linker has to be something with a stable name. The cfg
# in toolchains/BUCK is what keeps two NDKs from sharing a cache entry.
#
# ANDROID_NDK_HOME wins if it is set, so a machine that already has an NDK
# skips the download.
set -e
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
api=${JOLT_ANDROID_API:-28}
target=${JOLT_ANDROID_TARGET:-aarch64-linux-android}

# android-ndk-bin is where the lookup lives, because an APK build wants the
# other binaries out of the same archive.
exec "$("$dir/android-ndk-bin")/clang" --target="$target$api" "$@"