carlos / todomvc-bakeoff Public

Clone
git clone https://amadan.net/carlos/todomvc-bakeoff

Plain git — no account needed to clone.

Download

Download this file

1#!/usr/bin/env bash
2# The C compiler Spinel calls for an arm64 build (see spinel-cross).
3# Rewrites the host Spinel's runtime paths to the arm64 Spinel's, copies
4# the generated C into the work directory (which the arm64 root can see),
5# and runs a static link with the arm64 root's gcc and glibc.
6set -euo pipefail
7here=$(cd "$(dirname "$0")" && pwd)
8repo=$(cd "$here/../../.." && pwd)
9host_lib="$(dirname "${SPINEL_HOST:?}")/../lib"
10arm_lib="$(dirname "${SPINEL_ARM64:?}")/../lib"
11work=${ARM64_WORK:?}
12mkdir -p "$work"
13args=()
14for a in "$@"; do
15 case "$a" in
16 *"$host_lib"*) a="${a//"$host_lib"/"$arm_lib"}" ;;
17 */spinel_out_*.c) cp "$a" "$work/app.c"; a="$work/app.c" ;;
18 esac
19 args+=("$a")
20done
21exec "$repo/scripts/arm64.sh" cc -static -s -L"${ARM64_LIB_DIR:?}" "${args[@]}" -lz -lzstd
22