From 627354ed2cd4241dc7077d87a89aabcbd09b23b7 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 10 Jan 2025 18:47:04 -0800 Subject: [PATCH] test cross linux-arm with QEMU --- .github/workflows/ci-scripts-build.yml | 2 +- configure/os/CONFIG_SITE.linux-x86.linux-arm | 4 ++++ src/tools/makeTestfile.pl | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-scripts-build.yml b/.github/workflows/ci-scripts-build.yml index a89ddc92ae..bf0998b644 100644 --- a/.github/workflows/ci-scripts-build.yml +++ b/.github/workflows/ci-scripts-build.yml @@ -205,7 +205,7 @@ jobs: - name: "apt-get install" run: | sudo apt-get update - sudo apt-get -y install qemu-system-x86 g++-mingw-w64-x86-64 gdb + sudo apt-get -y install qemu-system-x86 qemu-user g++-mingw-w64-x86-64 gdb if: runner.os == 'Linux' - name: Prepare and compile dependencies run: python .ci/cue.py prepare diff --git a/configure/os/CONFIG_SITE.linux-x86.linux-arm b/configure/os/CONFIG_SITE.linux-x86.linux-arm index 231c54bb80..b2ce208ae2 100644 --- a/configure/os/CONFIG_SITE.linux-x86.linux-arm +++ b/configure/os/CONFIG_SITE.linux-x86.linux-arm @@ -30,3 +30,7 @@ GNU_DIR = /usr/local/vw/zynq-2016.1/gnu/arm/lin # See CONFIG_SITE.Common.linux-arm for other COMMANDLINE_LIBRARY values #COMMANDLINE_LIBRARY = READLINE +# If you're building this architecture you _probably_ want to +# run the tests for it under QEMU, but if not you can turn +# them off here by commenting out this line: +CROSS_COMPILER_RUNTEST_ARCHS += $(T_A) diff --git a/src/tools/makeTestfile.pl b/src/tools/makeTestfile.pl index a886079e75..4be756b350 100644 --- a/src/tools/makeTestfile.pl +++ b/src/tools/makeTestfile.pl @@ -65,6 +65,10 @@ # Explicitly fail for other RTEMS targets die "$tool: I don't know how to create scripts for testing $TA on $HA\n"; } +elsif ($HA =~ /^linux-x86/ && $TA =~ /^linux-arm/) { + $exec = "qemu-arm-static -L /usr/arm-linux-gnueabihf $exe"; + $error= "qemu-arm-static ... $exe"; +} else { # Assume it's directly executable on other targets $error = $exec = "./$exe";