diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c989c28..6f537ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,15 +126,18 @@ jobs: qemu-system-misc # APT's qemu package doesn't provide firmware for riscv32 and mips: # https://packages.ubuntu.com/en/jammy/all/qemu-system-data/filelist - OPENSBI_VERSION=1.2 + OPENSBI_VERSION=1.3.1 # https://github.com/riscv-software-src/opensbi/releases curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://github.com/riscv-software-src/opensbi/releases/download/v${OPENSBI_VERSION}/opensbi-${OPENSBI_VERSION}-rv-bin.tar.xz" \ | tar xJf - sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin sudo mv "opensbi-${OPENSBI_VERSION}-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.elf" /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.elf rm -rf "opensbi-${OPENSBI_VERSION}-rv-bin" - # TODO: use sparse-checkout - git clone --depth 1 https://github.com/qemu/qemu.git + git clone --depth 1 --filter=tree:0 --no-checkout https://github.com/qemu/qemu.git cd qemu + git sparse-checkout init + echo '!/*' >> .git/info/sparse-checkout + echo '/pc-bios/' >> .git/info/sparse-checkout + git checkout sudo mv pc-bios/{efi-pcnet.rom,vgabios-cirrus.bin} /usr/share/qemu/ cd .. rm -rf qemu @@ -145,15 +148,20 @@ jobs: docker rm -f qemu-user >/dev/null sudo mv qemu-user/bin/qemu-* /usr/bin/ rm -rf ./qemu-user + qemu-system-arm --version qemu-arm --version if: startsWith(matrix.os, 'ubuntu') || matrix.os == '' - - run: brew install --cask gcc-arm-embedded + - run: | + set -euxo pipefail + brew install --cask gcc-arm-embedded + qemu-system-arm --version if: startsWith(matrix.os, 'macos') - run: | set -euxo pipefail choco install --no-progress --requirechecksums gcc-arm-embedded - choco install --no-progress --requirechecksums qemu --version=2023.4.24 # 8.0 + choco install --no-progress --requirechecksums qemu --version=2023.8.22 # 8.1 https://community.chocolatey.org/packages/Qemu#versionhistory echo "C:\Program Files\qemu" >>"${GITHUB_PATH}" + "C:\Program Files\qemu\qemu-system-arm" --version if: startsWith(matrix.os, 'windows') - run: tools/no-std.sh - run: TEST_RUNNER=qemu-user tools/no-std.sh diff --git a/README.md b/README.md index 161c9a7..a3e0be7 100644 --- a/README.md +++ b/README.md @@ -46,31 +46,30 @@ The host must be running an emulator or a debugger attached to the target. The following targets have been tested on CI. (qemu-system has been tested on Linux, macOS, and Windows hosts, and qemu-user on Linux host.) -| target | exit | all-apis \[1] (qemu-system) | all-apis \[1] (qemu-user) | panic-unwind (qemu-system \[2]) | -| ------------------------------------ | ---- | --------------------------- | ------------------------- | ------------------------------- | -| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ | -| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | | -| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | | -| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | | -| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | | -| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | | -| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | | -| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | | -| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | | -| `thumbv8m.base-none-eabi` | ✓ | ✓ \[3] | N/A | | -| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ \[3] | N/A | | -| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | -| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | -| `mips{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mips64{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mipsisa32r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mipsisa64r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | +| target | exit | all-apis \[1] (system) | all-apis \[1] (user-mode) | panic-unwind (system \[2]) | note | +| ----------------------------------- | ---- | ---------------------- | ------------------------- | -------------------------- | ---- | +| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ | | +| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | | | +| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | | | +| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | | | +| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | | | +| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | | | +| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | | | +| `thumbv8m.base-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ | N/A | | | +| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | | +| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | | +| `mips{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mips64{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mipsisa32r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mipsisa64r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | \[1] `stdio`, `fs`, `time`, and `args`.
\[2] I'm not sure how to test panic-unwind on qemu-user.
-\[4] Worked on QEMU 6.2 and QEMU 8.0, failed on QEMU 7.2.
-\[5] Requires nightly due to `#![feature(asm_experimental_arch)]`.
-\[6] It seems [unsupported on QEMU 8.0](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).
+\[3] Requires nightly due to `#![feature(asm_experimental_arch)]`.
+\[4] It seems [unsupported on QEMU 8.0+](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).
## Optional features diff --git a/src/lib.rs b/src/lib.rs index cb559f1..d54694c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,31 +41,30 @@ The host must be running an emulator or a debugger attached to the target. The following targets have been tested on CI. (qemu-system has been tested on Linux, macOS, and Windows hosts, and qemu-user on Linux host.) -| target | exit | all-apis \[1] (qemu-system) | all-apis \[1] (qemu-user) | panic-unwind (qemu-system \[2]) | -| ------------------------------------ | ---- | --------------------------- | ------------------------- | ------------------------------- | -| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ | -| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | | -| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | | -| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | | -| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | | -| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | | -| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | | -| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | | -| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | | -| `thumbv8m.base-none-eabi` | ✓ | ✓ \[3] | N/A | | -| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ \[3] | N/A | | -| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | -| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | -| `mips{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mips64{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mipsisa32r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | -| `mipsisa64r6{,el}-unknown-none` \[5] | ✓ | ✓ \[6] | N/A | | +| target | exit | all-apis \[1] (system) | all-apis \[1] (user-mode) | panic-unwind (system \[2]) | note | +| ----------------------------------- | ---- | ---------------------- | ------------------------- | -------------------------- | ---- | +| `aarch64-unknown-none{,-softfloat}` | ✓ | ✓ | ✓ | ✓ | | +| `{arm,thumb}v4t-none-eabi` | ✓ | | ✓ | | | +| `{arm,thumb}v5te-none-eabi` | ✓ | ✓ | ✓ | | | +| `armv7a-none-eabi{,hf}` | ✓ | ✓ | ✓ | | | +| `armv7r-none-eabi{,hf}` | ✓ | ✓ | ✓ | | | +| `armebv7r-none-eabi{,hf}` | ✓ | | ✓ | | | +| `thumbv6m-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv7m-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv7em-none-eabi{,hf}` | ✓ | ✓ | N/A | | | +| `thumbv8m.base-none-eabi` | ✓ | ✓ | N/A | | | +| `thumbv8m.main-none-eabi{,hf}` | ✓ | ✓ | N/A | | | +| `riscv32*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | | +| `riscv64*-unknown-none-elf` | ✓ | ✓ | ✓ | ✓ | | +| `mips{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mips64{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mipsisa32r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | +| `mipsisa64r6{,el}-unknown-none` | ✓ | ✓ | N/A | | \[3] \[4] | \[1] `stdio`, `fs`, `time`, and `args`.
\[2] I'm not sure how to test panic-unwind on qemu-user.
-\[4] Worked on QEMU 6.2 and QEMU 8.0, failed on QEMU 7.2.
-\[5] Requires nightly due to `#![feature(asm_experimental_arch)]`.
-\[6] It seems [unsupported on QEMU 8.0](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).
+\[3] Requires nightly due to `#![feature(asm_experimental_arch)]`.
+\[4] It seems [unsupported on QEMU 8.0+](https://qemu-project.gitlab.io/qemu/about/removed-features.html#mips-trap-and-emulate-kvm-support-removed-in-8-0).
## Optional features diff --git a/tools/no-std.sh b/tools/no-std.sh index 6c66d08..b8aa784 100755 --- a/tools/no-std.sh +++ b/tools/no-std.sh @@ -199,9 +199,9 @@ run() { mips*) case "${runner}" in qemu-system) - # TODO: On QEMU 8.0, QEMU doesn't support semihosting for MIPS. - if qemu-system-mips --version | grep -Eq "QEMU emulator version 8\.0"; then - info "QEMU doesn't support semihosting for MIPS (${target}) on QEMU 8.0 (skipped)" + # On QEMU 8.0+, QEMU doesn't seem to support semihosting for MIPS. + if qemu-system-mips --version | grep -Eq "QEMU emulator version 8\."; then + info "QEMU doesn't support semihosting for MIPS (${target}) on QEMU 8.0+ (skipped)" return 0 fi linker=link.x