diff --git a/ci/run.sh b/ci/run.sh
index 420542a561c16143e74824975003eb606522236a..02dd35a12bf8ecd1661b9310f27103d260fcf955 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -41,7 +41,11 @@ if [ "$QEMU" != "" ]; then
 
   # Do the standard rigamarole of cross-compiling an executable and then the
   # script to run just executes the binary.
-  cargo build --manifest-path libc-test/Cargo.toml --target $TARGET --tests
+  cargo build \
+    --manifest-path libc-test/Cargo.toml \
+    --target $TARGET \
+    --test main
+  rm $CARGO_TARGET_DIR/$TARGET/debug/main-*.d
   cp $CARGO_TARGET_DIR/$TARGET/debug/main-* $tmpdir/mount/libc-test
   echo 'exec $1/libc-test' > $tmpdir/mount/run.sh