about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-06-29 14:51:47 +0200
committerRalf Jung <post@ralfj.de>2025-06-29 22:40:14 +0200
commit6aaaff88638573e7bb512484d3749c80fd50e8b0 (patch)
treeb31a811c5926d211ea2b782553d4e8720e3cbeee /src/tools
parentab2443cbad0d0e2b40f9c862756e4233a17174bb (diff)
downloadrust-6aaaff88638573e7bb512484d3749c80fd50e8b0.tar.gz
rust-6aaaff88638573e7bb512484d3749c80fd50e8b0.zip
test on x86-32 and arm-32
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/miri/.github/workflows/ci.yml41
-rw-r--r--src/tools/miri/.github/workflows/setup/action.yml2
-rwxr-xr-xsrc/tools/miri/ci/ci.sh23
3 files changed, 41 insertions, 25 deletions
diff --git a/src/tools/miri/.github/workflows/ci.yml b/src/tools/miri/.github/workflows/ci.yml
index 50a7cff0fa7..adcaeb53beb 100644
--- a/src/tools/miri/.github/workflows/ci.yml
+++ b/src/tools/miri/.github/workflows/ci.yml
@@ -14,21 +14,23 @@ defaults:
 
 jobs:
   test:
-    name: build and test on ${{ matrix.host_target }}
+    name: test (${{ matrix.host_target }})
     strategy:
       fail-fast: false
       matrix:
         include:
           - host_target: x86_64-unknown-linux-gnu
             os: ubuntu-latest
-          # Needs a libffi patch: <https://github.com/libffi-rs/libffi-rs/pull/160>
-          # - host_target: i686-unknown-linux-gnu
-          #   os: ubuntu-latest
+          - host_target: i686-unknown-linux-gnu
+            os: ubuntu-latest
+            multiarch: i386
+            gcc_cross: i686-linux-gnu
           - host_target: aarch64-unknown-linux-gnu
             os: ubuntu-24.04-arm
-          # Disabled due to <https://github.com/rust-lang/rust/issues/143184>.
-          # - host_target: armv7-unknown-linux-gnueabihf
-          #   os: ubuntu-24.04-arm
+          - host_target: armv7-unknown-linux-gnueabihf
+            os: ubuntu-24.04-arm
+            multiarch: armhf
+            gcc_cross: arm-linux-gnueabihf
           - host_target: aarch64-apple-darwin
             os: macos-latest
           - host_target: i686-pc-windows-msvc
@@ -38,22 +40,27 @@ jobs:
       HOST_TARGET: ${{ matrix.host_target }}
     steps:
       - uses: actions/checkout@v4
-      - name: Install multilib dependencies
-        if: ${{ matrix.host_target == 'i686-unknown-linux-gnu' }}
-        run: |
-          sudo dpkg --add-architecture i386
-          sudo apt update
-          sudo apt install gcc-multilib zlib1g-dev:i386 libffi-dev:i386
-      - name: Install multilib dependencies
-        if: ${{ matrix.host_target == 'armv7-unknown-linux-gnueabihf' }}
+      - name: install multiarch
+        if: ${{ matrix.multiarch != '' }}
         run: |
-          sudo dpkg --add-architecture armhf
+          sudo dpkg --add-architecture ${{ matrix.multiarch }}
           sudo apt update
-          sudo apt install gcc-arm-linux-gnueabihf zlib1g-dev:armhf libffi-dev:armhf
+          sudo apt install $(echo "libatomic1: zlib1g-dev:" | sed 's/:/:${{ matrix.multiarch }}/g')
       - uses: ./.github/workflows/setup
         with:
           toolchain_flags: "--host ${{ matrix.host_target }}"
 
+      # We set up the cross-compiler *after* the basic setup as setting CC would otherwise
+      # cause confusion.
+      - name: install gcc-cross
+        if: ${{ matrix.gcc_cross != '' }}
+        run: |
+          sudo apt install gcc-${{ matrix.gcc_cross }}
+          echo "Setting environment variables:"
+          echo "CC=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
+          TARGET_UPPERCASE=$(echo ${{ matrix.host_target }} | tr '[:lower:]-' '[:upper:]_')
+          echo "CARGO_TARGET_${TARGET_UPPERCASE}_LINKER=${{ matrix.gcc_cross }}-gcc" | tee -a $GITHUB_ENV
+
       - name: Test Miri
         run: ./ci/ci.sh
 
diff --git a/src/tools/miri/.github/workflows/setup/action.yml b/src/tools/miri/.github/workflows/setup/action.yml
index 582f8450cd9..9110e6947f4 100644
--- a/src/tools/miri/.github/workflows/setup/action.yml
+++ b/src/tools/miri/.github/workflows/setup/action.yml
@@ -36,7 +36,7 @@ runs:
           key: cargo-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.lock') }}-v1
           restore-keys: cargo-${{ runner.os }}-${{ runner.arch }}
 
-      - name: Install rustup-toolchain-install-master
+      - name: Install the tools we need
         if: steps.cache.outputs.cache-hit != 'true'
         run: cargo install -f rustup-toolchain-install-master hyperfine
         shell: bash
diff --git a/src/tools/miri/ci/ci.sh b/src/tools/miri/ci/ci.sh
index 35a1cb4d650..67c18d3b401 100755
--- a/src/tools/miri/ci/ci.sh
+++ b/src/tools/miri/ci/ci.sh
@@ -146,6 +146,18 @@ case $HOST_TARGET in
     MANY_SEEDS=64 TEST_TARGET=x86_64-apple-darwin run_tests
     MANY_SEEDS=64 TEST_TARGET=x86_64-pc-windows-gnu run_tests
     ;;
+  i686-unknown-linux-gnu)
+    # Host
+    # Without GC_STRESS as this is a slow runner.
+    MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
+    # Partially supported targets (tier 2)
+    BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
+    UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
+    TEST_TARGET=aarch64-linux-android  run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
+    TEST_TARGET=wasm32-wasip2          run_tests_minimal $BASIC wasm
+    TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
+    TEST_TARGET=thumbv7em-none-eabihf  run_tests_minimal no_std
+    ;;
   aarch64-unknown-linux-gnu)
     # Host
     GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
@@ -154,6 +166,10 @@ case $HOST_TARGET in
     # Custom target JSON file
     TEST_TARGET=tests/x86_64-unknown-kernel.json MIRI_NO_STD=1 run_tests_minimal no_std
     ;;
+  armv7-unknown-linux-gnueabihf)
+    # Host
+    GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
+    ;;
   aarch64-apple-darwin)
     # Host
     GC_STRESS=1 MIR_OPT=1 MANY_SEEDS=64 TEST_BENCH=1 CARGO_MIRI_ENV=1 run_tests
@@ -170,13 +186,6 @@ case $HOST_TARGET in
     MANY_SEEDS=16 TEST_TARGET=x86_64-pc-solaris run_tests
     MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-freebsd run_tests
     MANY_SEEDS=16 TEST_TARGET=i686-unknown-freebsd run_tests
-    # Partially supported targets (tier 2)
-    BASIC="empty_main integer heap_alloc libc-mem vec string btreemap" # ensures we have the basics: pre-main code, system allocator
-    UNIX="hello panic/panic panic/unwind concurrency/simple atomic libc-mem libc-misc libc-random env num_cpus" # the things that are very similar across all Unixes, and hence easily supported there
-    TEST_TARGET=aarch64-linux-android  run_tests_minimal $BASIC $UNIX time hashmap random thread sync concurrency epoll eventfd
-    TEST_TARGET=wasm32-wasip2          run_tests_minimal $BASIC wasm
-    TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std empty_main wasm # this target doesn't really have std
-    TEST_TARGET=thumbv7em-none-eabihf  run_tests_minimal no_std
     ;;
   i686-pc-windows-msvc)
     # Host