Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing fixes for i686-pc-windows-gnu on top of #582 #584

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jobs:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
Expand Down Expand Up @@ -96,7 +97,7 @@ jobs:
shell: bash

# Non-linux tests just use our raw script
- run: ./ci/run.sh ${{ matrix.target }}
- run: ./ci/run.sh ${{ matrix.target }} ${{ matrix.rust }}
if: matrix.os != 'ubuntu-latest'
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion ci/docker/thumbv6m-none-eabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apt-get update && \
gcc libc6-dev ca-certificates \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi
ENV XARGO=1
ENV NO_STD=1
2 changes: 1 addition & 1 deletion ci/docker/thumbv7em-none-eabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apt-get update && \
gcc libc6-dev ca-certificates \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi
ENV XARGO=1
ENV NO_STD=1
2 changes: 1 addition & 1 deletion ci/docker/thumbv7em-none-eabihf/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apt-get update && \
gcc libc6-dev ca-certificates \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi
ENV XARGO=1
ENV NO_STD=1
2 changes: 1 addition & 1 deletion ci/docker/thumbv7m-none-eabi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ RUN apt-get update && \
gcc libc6-dev ca-certificates \
gcc-arm-none-eabi \
libnewlib-arm-none-eabi
ENV XARGO=1
ENV NO_STD=1
56 changes: 29 additions & 27 deletions ci/run.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
set -ex

cargo=cargo

# Test our implementation
if [ "$XARGO" = "1" ]; then
# FIXME: currently these tests don't work...
if [ "$NO_STD" = "1" ]; then
echo nothing to do
else
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
Expand All @@ -16,6 +13,15 @@ else
$run --features no-asm --release
fi

if [ -d /target ]; then
path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib
else
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib
fi

# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
rm -f $path

cargo build --target $1
cargo build --target $1 --release
cargo build --target $1 --features c
Expand All @@ -36,15 +42,11 @@ case $1 in
;;
esac

NM=$(find $(rustc --print sysroot) -name llvm-nm)
NM=$(find $(rustc --print sysroot) \( -name llvm-nm -o -name llvm-nm.exe \) )
if [ "$NM" = "" ]; then
NM=${PREFIX}nm
fi

if [ -d /target ]; then
path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib
else
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib
elif [ -n "$2" ]; then
NM="rustup run $2 $NM"
fi

# Look out for duplicated symbols when we include the compiler-rt (C) implementation
Expand Down Expand Up @@ -79,29 +81,29 @@ done
rm -f $path

# Verify that we haven't drop any intrinsic/symbol
build_intrinsics="$cargo build --target $1 -v --example intrinsics"
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --release
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --features c
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --features c --release
build_intrinsics="cargo build --target $1 -v --example intrinsics"
$build_intrinsics
$build_intrinsics --release
$build_intrinsics --features c
$build_intrinsics --features c --release

# Verify that there are no undefined symbols to `panic` within our
# implementations
#
# TODO(#79) fix the undefined references problem for debug-assertions+lto
if [ -z "$DEBUG_LTO_BUILD_DOESNT_WORK" ]; then
RUSTFLAGS="-C debug-assertions=no" \
CARGO_INCREMENTAL=0 \
CARGO_PROFILE_DEV_LTO=true \
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics
fi
CARGO_PROFILE_DEV_LTO=true \
cargo build --target $1 --example intrinsics
CARGO_PROFILE_RELEASE_LTO=true \
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics --release
cargo build --target $1 --example intrinsics --release

# Ensure no references to a panicking function
# Ensure no references to any symbols from core
for rlib in $(echo $path); do
set +ex
$NM -u $rlib 2>&1 | grep panicking
echo "================================================================"
echo checking $rlib for references to core
echo "================================================================"

$NM --quiet -U $rlib | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > defined_symbols.txt
$NM --quiet -u $rlib | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > undefined_symbols.txt
grep -v -F -x -f defined_symbols.txt undefined_symbols.txt

if test $? = 0; then
exit 1
Expand Down