diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b49d072..9b252b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: - riscv32gc-unknown-linux-gnu # tier3 - riscv64gc-unknown-linux-gnu - s390x-unknown-linux-gnu - # - sparc-unknown-linux-gnu # tier3, supported in rust-cross-toolchain but not ported to this action + - sparc-unknown-linux-gnu # tier3 - sparc64-unknown-linux-gnu - thumbv7neon-unknown-linux-gnueabihf - x86_64-unknown-linux-gnu @@ -217,6 +217,7 @@ jobs: - { target: mipsisa32r6-unknown-linux-gnu, os: ubuntu-20.04 } - { target: mipsisa64r6-unknown-linux-gnuabi64, os: ubuntu-20.04 } - { target: powerpc64-unknown-linux-gnu, os: ubuntu-20.04 } + - { target: sparc-unknown-linux-gnu, os: ubuntu-20.04 } - { target: sparc64-unknown-linux-gnu, os: ubuntu-20.04 } runs-on: ${{ matrix.os || 'ubuntu-latest' }} timeout-minutes: 60 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b4a696..41dc81c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com ## [Unreleased] - Support i686-pc-windows-gnullvm. +- Support sparc-unknown-linux-gnu (experimental). ## [1.17.0] - 2023-08-24 diff --git a/README.md b/README.md index 0453925..18ec091 100644 --- a/README.md +++ b/README.md @@ -211,6 +211,7 @@ jobs: | `riscv32gc-unknown-linux-gnu` | Ubuntu (20.04, 18.04, 22.04) [5] | qemu-user | | | `riscv64gc-unknown-linux-gnu` | ubuntu (22.04 [3]) | qemu-user | | | `s390x-unknown-linux-gnu` | Ubuntu (20.04 [1], 18.04 [2], 22.04 [3]) | qemu-user | | +| `sparc-unknown-linux-gnu` | Ubuntu (18.04 [2], 22.04 [3]) | qemu-user | tier3, experimental | | `sparc64-unknown-linux-gnu` | Ubuntu (18.04 [2], 22.04 [3]) | qemu-user | | | `thumbv7neon-unknown-linux-gnueabihf` | Ubuntu (20.04 [1], 18.04 [2], 22.04 [3]) | qemu-user | | | `x86_64-unknown-linux-gnu` | Ubuntu (20.04 [1], 18.04 [2], 22.04 [3]) | native (default), qemu-user | | diff --git a/main.sh b/main.sh index f85239b..483040a 100755 --- a/main.sh +++ b/main.sh @@ -297,17 +297,14 @@ setup_linux_host() { # https://github.com/taiki-e/rust-cross-toolchain/blob/a92f4cc85408460235b024933451f0350e08b726/docker/linux-gnu.sh#L55 bail "target '${target}' not yet supported; consider using armv7-unknown-linux-gnueabihf for testing armhf or arm-unknown-linux-gnueabi for testing armv6" ;; - sparc-unknown-linux-gnu) - # (tier3) Setup is tricky. - # https://github.com/taiki-e/rust-cross-toolchain/blob/a92f4cc85408460235b024933451f0350e08b726/docker/linux-gnu.Dockerfile#L44 - bail "target '${target}' not yet supported" - ;; *) case "${target}" in arm*hf | thumbv7neon-*) cc_target=arm-linux-gnueabihf ;; arm*) cc_target=arm-linux-gnueabi ;; riscv32gc-* | riscv64gc-*) cc_target="${target/gc-unknown/}" ;; sparc-*) + # Toolchain for sparc-linux-gnu is not available in APT, + # but we can use -m32 with sparc64-linux-gnu multilib. cc_target=sparc-linux-gnu apt_target=sparc64-linux-gnu multilib=1 @@ -319,10 +316,23 @@ setup_linux_host() { apt_packages+=("g++-${multilib:+multilib-}${apt_target/_/-}") # https://github.com/taiki-e/rust-cross-toolchain/blob/fcb7a7e6ca14333d93c528f34a1def5a38745b3a/docker/test/entrypoint.sh sysroot_dir="/usr/${apt_target}" - cat >>"${GITHUB_ENV}" <>"${GITHUB_ENV}" <>"${GITHUB_ENV}" <>"${GITHUB_ENV}" <"/usr/local/bin/${target}-gcc" <"/usr/local/bin/${target}-g++" <