diff --git a/.github/.cspell/project-dictionary.txt b/.github/.cspell/project-dictionary.txt index 7381507f..ef197f69 100644 --- a/.github/.cspell/project-dictionary.txt +++ b/.github/.cspell/project-dictionary.txt @@ -23,6 +23,7 @@ elfv emcc EMSDK evbarm +evbmips evbppc fexceptions ffreestanding @@ -30,6 +31,7 @@ fmin fstrict funwind fvisibility +gnusrc HWCAPS Icelake INLINES @@ -115,12 +117,14 @@ rcrt rtti Scrt secureplt +sharesrc sjlj softfp solarish stdarch stdlib strnlen +syssrc SYSV TOOLDIR uclibcgnueabi diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index da02a571..12d21c2d 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -54,9 +54,12 @@ jobs: # NetBSD - target: aarch64-unknown-netbsd # tier3 + - target: aarch64_be-unknown-netbsd # tier3 - target: armv6-unknown-netbsd-eabihf # tier3 - target: armv7-unknown-netbsd-eabihf # tier3 + - target: i586-unknown-netbsd # tier3 - target: i686-unknown-netbsd # tier3 + - target: mipsel-unknown-netbsd # tier3 - target: powerpc-unknown-netbsd # tier3 - target: sparc64-unknown-netbsd # tier3 - target: x86_64-unknown-netbsd diff --git a/README.md b/README.md index d201c6db..3cec533a 100644 --- a/README.md +++ b/README.md @@ -186,13 +186,16 @@ See also [setup-cross-toolchain-action](https://github.com/taiki-e/setup-cross-t | target | version | | ------ | ------- | -| `aarch64-unknown-netbsd` (tier3) | 9.3 | -| `armv6-unknown-netbsd-eabihf` (tier3) | 8.2 (default), 9.3 | -| `armv7-unknown-netbsd-eabihf` (tier3) | 8.2 (default), 9.3 | -| `i686-unknown-netbsd` (tier3) | 8.2 (default), 9.3 | -| `powerpc-unknown-netbsd` (tier3) | 8.2 (default), 9.3 | -| `sparc64-unknown-netbsd` (tier3) | 8.2 (default), 9.3 | -| `x86_64-unknown-netbsd` | 8.2 (default), 9.3 | +| `aarch64-unknown-netbsd` (tier3) | 9.3 (default), 10.0 | +| `aarch64_be-unknown-netbsd` (tier3) | 10.0 | +| `armv6-unknown-netbsd-eabihf` (tier3) | 8.2 (default), 9.3, 10.0 | +| `armv7-unknown-netbsd-eabihf` (tier3) | 8.2 (default), 9.3, 10.0 | +| `i586-unknown-netbsd` (tier3) | 8.2 (default), 9.3, 10.0 | +| `i686-unknown-netbsd` (tier3) | 8.2 (default), 9.3, 10.0 | +| `mipsel-unknown-netbsd` (tier3) | 8.2 (default), 9.3, 10.0 | +| `powerpc-unknown-netbsd` (tier3) | 8.2 (default), 9.3, 10.0 | +| `sparc64-unknown-netbsd` (tier3) | 8.2 (default), 9.3, 10.0 | +| `x86_64-unknown-netbsd` | 8.2 (default), 9.3, 10.0 | ### OpenBSD diff --git a/docker/base/build-docker.sh b/docker/base/build-docker.sh index 42c375ed..daf0a6f7 100755 --- a/docker/base/build-docker.sh +++ b/docker/base/build-docker.sh @@ -118,14 +118,19 @@ case "${target}" in netbsd_versions=("${NETBSD_VERSION}") else # NB: When updating this, the reminder to update tools/build-docker.sh. - netbsd_versions=("8.2" "9.3") + netbsd_versions=("9.3" "10.0") fi for netbsd_version in "${netbsd_versions[@]}"; do case "${target}" in aarch64-*) - if [[ "${netbsd_version}" == "8"* ]]; then - continue - fi + case "${netbsd_version}" in + 8.*) continue ;; + esac + ;; + aarch64_be-*) + case "${netbsd_version}" in + [8-9].*) continue ;; + esac ;; esac build "netbsd" "${target}" "${netbsd_version%%.*}" \ diff --git a/docker/base/netbsd.Dockerfile b/docker/base/netbsd.Dockerfile index ef6d7a18..116b5249 100644 --- a/docker/base/netbsd.Dockerfile +++ b/docker/base/netbsd.Dockerfile @@ -19,10 +19,16 @@ SHELL ["/bin/bash", "-eEuxo", "pipefail", "-c"] ARG NETBSD_VERSION RUN mkdir -p /build-src WORKDIR /build-src -RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/source/sets/src.tgz" | tar xzf - -RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/source/sets/gnusrc.tgz" | tar xzf - -RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/source/sets/sharesrc.tgz" | tar xzf - -RUN curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/source/sets/syssrc.tgz" | tar xzf - +RUN <&2 "unrecognized target '${RUST_TARGET}'" && exit 1 ;; esac -ext=.tgz -cmd=xzf +ext=tar.xz case "${RUST_TARGET}" in sparc64-* | x86_64*) - if [[ "${NETBSD_VERSION}" != "8"* ]]; then - ext=.tar.xz - cmd=xJf - fi + case "${NETBSD_VERSION}" in + [1-8].*) ext=tgz ;; + esac ;; + aarch64-* | aarch64_be-*) + case "${NETBSD_VERSION}" in + [1-9].*) ext=tgz ;; + esac + ;; + *) ext=tgz ;; +esac +case "${ext}" in + tar.xz) cmd=xJf ;; + *) cmd=xzf ;; +esac +case "${NETBSD_VERSION}" in + [1-8].*) base_url=https://archive.netbsd.org/pub/NetBSD-archive ;; + *) base_url=https://ftp.netbsd.org/pub/NetBSD ;; esac -curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/${netbsd_arch}/binary/sets/base${ext}" \ +curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${base_url}/NetBSD-${NETBSD_VERSION}/${netbsd_arch}/binary/sets/base.${ext}" \ | tar "${cmd}" - -C /sysroot ./lib ./usr/include ./usr/lib -curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "https://ftp.netbsd.org/pub/NetBSD/NetBSD-${NETBSD_VERSION}/${netbsd_arch}/binary/sets/comp${ext}" \ +curl --proto '=https' --tlsv1.2 -fsSL --retry 10 --retry-connrefused "${base_url}/NetBSD-${NETBSD_VERSION}/${netbsd_arch}/binary/sets/comp.${ext}" \ | tar "${cmd}" - -C /sysroot ./usr/include ./usr/lib EOF @@ -83,6 +102,7 @@ case "${RUST_TARGET}" in armv6-*) cc_target=armv6--netbsdelf-eabihf ;; armv7-*) cc_target=armv7--netbsdelf-eabihf ;; i?86-*) cc_target=i486--netbsdelf ;; + mipsel-*) cc_target=mipsel--netbsd ;; powerpc-*) cc_target=powerpc--netbsd ;; riscv32*) cc_target=riscv32--netbsd ;; riscv64*) cc_target=riscv64--netbsd ;; @@ -109,6 +129,7 @@ case "${RUST_TARGET}" in armv6-*) args=(-m evbarm -a earmv6hf) ;; armv7-*) args=(-m evbarm -a earmv7hf) ;; i?86-*) args=(-m i386) ;; + mipsel-*) args=(-m evbmips -a mipsel) ;; powerpc-*) args=(-m evbppc) ;; riscv32*) args=(-m riscv -a riscv32) ;; riscv64*) args=(-m riscv -a riscv64) ;; @@ -127,6 +148,7 @@ WORKDIR / RUN <"${TOOLCHAIN_DIR}/bin/${RUST_TARGET}-gcc" <