flowrs-engine/tools/qemu-mips-wasm/fixtures/pps/build.sh
flowRS 49c9d04fbc flowRS engine, cut from flowRS bd343e051a2e
Built alone from an empty CARGO_HOME, its tests passed, and flowrsc checked, ran and exported a
document from the conformance corpus; the export built alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-05 13:37:09 -05:00

16 lines
840 B
Shell
Executable file

#!/bin/bash
# The PIC32MX1xx/2xx bare-metal fixture (peripheral pin select), built with LLVM as
# ../baremetal is: a whole-chip ELF with its own reset code and configuration words.
# build.sh <out dir>
set -euo pipefail
D=$(cd "$(dirname "$0")" && pwd)
O=${1:-$D/out}
mkdir -p "$O"
CC=/opt/homebrew/opt/llvm/bin/clang
LD=/opt/homebrew/bin/ld.lld
FLAGS="--target=mipsel-none-elf -march=mips32r2 -mabi=32 -mno-abicalls -fno-pic -G0 -msoft-float -O2 -ffreestanding -fno-builtin -Wall -Werror"
$CC $FLAGS -c "$D/start.S" -o "$O/pps-start.o"
$CC $FLAGS -c "$D/main.c" -o "$O/pps-main.o"
$LD -T "$D/link.ld" -nostdlib --no-pie -z max-page-size=16 "$O/pps-start.o" "$O/pps-main.o" -o "$O/pic32-pps.elf"
/opt/homebrew/opt/llvm/bin/llvm-objdump -h "$O/pic32-pps.elf" | grep -E "reset|config|vectors|text|data|bss"
shasum -a 256 "$O/pic32-pps.elf"