Skip to content

Commit

Permalink
Don't pass target-features to host tests.
Browse files Browse the repository at this point in the history
This avoids a flood of warnings when testing the
armv7-unknown-linux-gnueabihf target.

Under this target, we would pass -Ctarget-features=+neon when building
intrinsic-test, but it is compiled for the host (and this tool doesn't
need Neon even if the host _is_ Armv7).

This also sets --target when running the 'hex' example, since that
seems more appropriate than always building it for the host.
  • Loading branch information
jacobbramley authored and Amanieu committed Nov 1, 2023
1 parent a7fd04c commit e504eff
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -ex
#export RUST_TEST_THREADS=1

export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
export HOST_RUSTFLAGS="${RUSTFLAGS}"

export STDARCH_DISABLE_DEDUP_GUARD=1

Expand Down Expand Up @@ -147,18 +148,26 @@ case ${TARGET} in
esac

if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
export CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/"
RUST_LOG=warn cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
(
CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
RUSTFLAGS="$HOST_RUSTFLAGS" \
RUST_LOG=warn \
cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
)
elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
export CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/"
RUST_LOG=warn cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
(
CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
RUSTFLAGS="$HOST_RUSTFLAGS" \
RUST_LOG=warn \
cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
)
fi

if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then
# Test examples
(
cd examples
cargo test --target "$TARGET"
echo test | cargo run --release hex
echo test | cargo run --target "$TARGET" --release hex
)
fi

0 comments on commit e504eff

Please sign in to comment.