build: make aarch64 linker sysroot-safe
This commit is contained in:
parent
e5813ab6c9
commit
ffa8b498a3
4 changed files with 69 additions and 11 deletions
|
|
@ -100,17 +100,10 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
cd "$GITHUB_WORKSPACE/src/Souveraine"
|
||||
export PKG_CONFIG_ALLOW_CROSS=1
|
||||
export PKG_CONFIG_LIBDIR="$HOME/aarch64-sysroot/usr/lib/pkgconfig"
|
||||
export PKG_CONFIG_SYSROOT_DIR="$HOME/aarch64-sysroot"
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
|
||||
# Without --sysroot the cross gcc's default sysroot (/usr/aarch64-linux-gnu,
|
||||
# sparse) has no libmvec, so the linker falls back to the host x86_64 one
|
||||
# and fails. Point it at the full chroot sysroot where aarch64 libmvec lives.
|
||||
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="-C link-arg=--sysroot=$HOME/aarch64-sysroot"
|
||||
# Persistent target dir: fresh clones per run, warm compile cache.
|
||||
export CARGO_TARGET_DIR="$HOME/.cache/souveraine-ci-target"
|
||||
cargo build --release --target aarch64-unknown-linux-gnu
|
||||
export SOUVERAINE_AARCH64_SYSROOT="$HOME/aarch64-sysroot"
|
||||
./scripts/build-cross.sh
|
||||
BIN="$CARGO_TARGET_DIR/aarch64-unknown-linux-gnu/release/souveraine"
|
||||
file "$BIN" | grep -q aarch64 || { echo "built binary is not aarch64" >&2; exit 1; }
|
||||
cp "$BIN" souveraine-aarch64
|
||||
|
|
|
|||
Loading…
Reference in a new issue