Skip to content

Commit e504eff

Browse files
jacobbramleyAmanieu
authored andcommitted
Don't pass target-features to host tests.
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.
1 parent a7fd04c commit e504eff

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

ci/run.sh

+14-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set -ex
1111
#export RUST_TEST_THREADS=1
1212

1313
export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
14+
export HOST_RUSTFLAGS="${RUSTFLAGS}"
1415

1516
export STDARCH_DISABLE_DEDUP_GUARD=1
1617

@@ -147,18 +148,26 @@ case ${TARGET} in
147148
esac
148149

149150
if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
150-
export CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/"
151-
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
151+
(
152+
CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
153+
RUSTFLAGS="$HOST_RUSTFLAGS" \
154+
RUST_LOG=warn \
155+
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
156+
)
152157
elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
153-
export CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/"
154-
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
158+
(
159+
CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
160+
RUSTFLAGS="$HOST_RUSTFLAGS" \
161+
RUST_LOG=warn \
162+
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
163+
)
155164
fi
156165

157166
if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then
158167
# Test examples
159168
(
160169
cd examples
161170
cargo test --target "$TARGET"
162-
echo test | cargo run --release hex
171+
echo test | cargo run --target "$TARGET" --release hex
163172
)
164173
fi

0 commit comments

Comments
 (0)