scripts: Fix musl build error in AArch64 unit test

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao 2022-03-02 20:05:35 +08:00 committed by Rob Bradford
parent 8d11ba4833
commit 8ba1bc7621

View File

@ -12,5 +12,11 @@ if [[ $(uname -m) = "aarch64" || $hypervisor = "mshv" ]]; then
cargo_args+=("--no-default-features") cargo_args+=("--no-default-features")
cargo_args+=("--features $hypervisor") cargo_args+=("--features $hypervisor")
fi fi
if [[ "${BUILD_TARGET}" == "aarch64-unknown-linux-musl" ]]; then
export TARGET_CC="musl-gcc"
export RUSTFLAGS="-C link-arg=-lgcc -C link_arg=-specs -C link_arg=/usr/lib/aarch64-linux-musl/musl-gcc.specs"
fi
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1; cargo test --lib --bins --target $BUILD_TARGET --workspace ${cargo_args[@]} || exit 1;