nandi/jolt-nativepublic Fork 0
089e6f7d8398ecab5c661dbf79e4063ec6c3b48c
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.

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