about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/src/core/build_steps/compile.rs30
-rw-r--r--src/ci/docker/host-x86_64/dist-sparcv9-solaris/Dockerfile36
-rw-r--r--src/ci/docker/host-x86_64/dist-various-2/Dockerfile11
-rwxr-xr-xsrc/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh111
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-illumos/Dockerfile1
-rw-r--r--src/ci/docker/host-x86_64/dist-x86_64-solaris/Dockerfile36
-rw-r--r--src/ci/docker/scripts/illumos-toolchain.sh52
-rw-r--r--src/ci/docker/scripts/shared.sh34
-rw-r--r--src/ci/docker/scripts/solaris-toolchain.sh162
-rw-r--r--src/ci/github-actions/jobs.yml6
-rw-r--r--src/doc/rustc/src/platform-support.md4
-rw-r--r--src/doc/rustc/src/platform-support/solaris.md4
-rw-r--r--src/tools/miri/src/alloc/isolated_alloc.rs5
13 files changed, 303 insertions, 189 deletions
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index 37d53ce476a..d52b9dd1f3a 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -1878,23 +1878,27 @@ impl Step for Sysroot {
         // so that any tools relying on `rust-src` also work for local builds,
         // and also for translating the virtual `/rustc/$hash` back to the real
         // directory (for running tests with `rust.remap-debuginfo = true`).
-        let sysroot_lib_rustlib_src = sysroot.join("lib/rustlib/src");
-        t!(fs::create_dir_all(&sysroot_lib_rustlib_src));
-        let sysroot_lib_rustlib_src_rust = sysroot_lib_rustlib_src.join("rust");
-        if let Err(e) = symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_src_rust) {
-            eprintln!(
-                "ERROR: creating symbolic link `{}` to `{}` failed with {}",
-                sysroot_lib_rustlib_src_rust.display(),
-                builder.src.display(),
-                e,
-            );
-            if builder.config.rust_remap_debuginfo {
+        if compiler.stage != 0 {
+            let sysroot_lib_rustlib_src = sysroot.join("lib/rustlib/src");
+            t!(fs::create_dir_all(&sysroot_lib_rustlib_src));
+            let sysroot_lib_rustlib_src_rust = sysroot_lib_rustlib_src.join("rust");
+            if let Err(e) =
+                symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_src_rust)
+            {
                 eprintln!(
-                    "ERROR: some `tests/ui` tests will fail when lacking `{}`",
+                    "ERROR: creating symbolic link `{}` to `{}` failed with {}",
                     sysroot_lib_rustlib_src_rust.display(),
+                    builder.src.display(),
+                    e,
                 );
+                if builder.config.rust_remap_debuginfo {
+                    eprintln!(
+                        "ERROR: some `tests/ui` tests will fail when lacking `{}`",
+                        sysroot_lib_rustlib_src_rust.display(),
+                    );
+                }
+                build_helper::exit!(1);
             }
-            build_helper::exit!(1);
         }
 
         // rustc-src component is already part of CI rustc's sysroot
diff --git a/src/ci/docker/host-x86_64/dist-sparcv9-solaris/Dockerfile b/src/ci/docker/host-x86_64/dist-sparcv9-solaris/Dockerfile
new file mode 100644
index 00000000000..f7852c6364d
--- /dev/null
+++ b/src/ci/docker/host-x86_64/dist-sparcv9-solaris/Dockerfile
@@ -0,0 +1,36 @@
+FROM ubuntu:22.04
+
+COPY scripts/cross-apt-packages.sh /tmp/
+RUN bash /tmp/cross-apt-packages.sh
+
+# Required gcc dependencies.
+RUN apt-get update && \
+    apt-get install -y --no-install-recommends \
+    libgmp-dev \
+    libmpfr-dev \
+    libmpc-dev \
+    && rm -rf /var/lib/apt/lists/*
+
+COPY scripts/shared.sh /tmp/
+COPY scripts/solaris-toolchain.sh /tmp/
+
+RUN bash /tmp/solaris-toolchain.sh sparcv9 sysroot
+RUN bash /tmp/solaris-toolchain.sh sparcv9 binutils
+RUN bash /tmp/solaris-toolchain.sh sparcv9 gcc
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+COPY scripts/cmake.sh /scripts/
+RUN /scripts/cmake.sh
+
+ENV \
+    AR_sparcv9_sun_solaris=sparcv9-solaris-ar \
+    RANLIB_sparcv9_sun_solaris=sparcv9-solaris-ranlib \
+    CC_sparcv9_sun_solaris=sparcv9-solaris-gcc \
+    CXX_sparcv9_sun_solaris=sparcv9-solaris-g++
+
+ENV HOSTS=sparcv9-sun-solaris
+
+ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
diff --git a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
index 03ec77f507e..e1d83d36087 100644
--- a/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile
@@ -43,12 +43,6 @@ ENV \
     CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
     CXXFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -I/usr/local/core-linux-amd64-fuchsia-sdk/pkg/fdio/include" \
     LDFLAGS_aarch64_unknown_fuchsia="--target=aarch64-unknown-fuchsia --sysroot=/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/sysroot -L/usr/local/core-linux-amd64-fuchsia-sdk/arch/arm64/lib" \
-    AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-ar \
-    CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-gcc \
-    CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.10-g++ \
-    AR_x86_64_pc_solaris=x86_64-pc-solaris2.10-ar \
-    CC_x86_64_pc_solaris=x86_64-pc-solaris2.10-gcc \
-    CXX_x86_64_pc_solaris=x86_64-pc-solaris2.10-g++ \
     CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-9 \
     CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-9 \
     AR_x86_64_fortanix_unknown_sgx=ar \
@@ -84,9 +78,6 @@ WORKDIR /tmp
 COPY scripts/shared.sh /tmp/
 COPY scripts/build-fuchsia-toolchain.sh /tmp/
 RUN /tmp/build-fuchsia-toolchain.sh
-COPY host-x86_64/dist-various-2/build-solaris-toolchain.sh /tmp/
-RUN /tmp/build-solaris-toolchain.sh x86_64  amd64   solaris-i386  pc
-RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc sun
 COPY host-x86_64/dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/
 RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh
 
@@ -118,8 +109,6 @@ ENV TARGETS=$TARGETS,wasm32-wasip1
 ENV TARGETS=$TARGETS,wasm32-wasip1-threads
 ENV TARGETS=$TARGETS,wasm32-wasip2
 ENV TARGETS=$TARGETS,wasm32v1-none
-ENV TARGETS=$TARGETS,sparcv9-sun-solaris
-ENV TARGETS=$TARGETS,x86_64-pc-solaris
 ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
 ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx
 ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda
diff --git a/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh b/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh
deleted file mode 100755
index d046b539036..00000000000
--- a/src/ci/docker/host-x86_64/dist-various-2/build-solaris-toolchain.sh
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-
-set -ex
-source shared.sh
-
-ARCH=$1
-LIB_ARCH=$2
-APT_ARCH=$3
-MANUFACTURER=$4
-BINUTILS=2.28.1
-GCC=6.5.0
-
-TARGET=${ARCH}-${MANUFACTURER}-solaris2.10
-
-# First up, build binutils
-mkdir binutils
-cd binutils
-
-curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf -
-mkdir binutils-build
-cd binutils-build
-hide_output ../binutils-$BINUTILS/configure --target=$TARGET
-hide_output make -j10
-hide_output make install
-
-cd ../..
-rm -rf binutils
-
-# Next, download and install the relevant solaris packages
-mkdir solaris
-cd solaris
-
-dpkg --add-architecture $APT_ARCH
-apt-get update
-apt-get install -y --download-only                           \
-  libc:$APT_ARCH                                             \
-  liblgrp:$APT_ARCH                                          \
-  libm-dev:$APT_ARCH                                         \
-  libpthread:$APT_ARCH                                       \
-  libresolv:$APT_ARCH                                        \
-  librt:$APT_ARCH                                            \
-  libsendfile:$APT_ARCH                                      \
-  libsocket:$APT_ARCH                                        \
-  system-crt:$APT_ARCH                                       \
-  system-header:$APT_ARCH
-
-for deb in /var/cache/apt/archives/*$APT_ARCH.deb; do
-  dpkg -x $deb .
-done
-apt-get clean
-
-# The -dev packages are not available from the apt repository we're using.
-# However, those packages are just symlinks from *.so to *.so.<version>.
-# This makes all those symlinks.
-for lib in $(find -name '*.so.*'); do
-  target=${lib%.so.*}.so
-  ln -s ${lib##*/} $target || echo "warning: silenced error symlinking $lib"
-done
-
-# Remove Solaris 11 functions that are optionally used by libbacktrace.
-# This is for Solaris 10 compatibility.
-rm usr/include/link.h
-patch -p0  << 'EOF'
---- usr/include/string.h
-+++ usr/include/string10.h
-@@ -93 +92,0 @@
--extern size_t strnlen(const char *, size_t);
-EOF
-
-mkdir                  /usr/local/$TARGET/usr
-mv usr/include         /usr/local/$TARGET/usr/include
-mv usr/lib/$LIB_ARCH/* /usr/local/$TARGET/lib
-mv     lib/$LIB_ARCH/* /usr/local/$TARGET/lib
-
-ln -s usr/include /usr/local/$TARGET/sys-include
-ln -s usr/include /usr/local/$TARGET/include
-
-cd ..
-rm -rf solaris
-
-# Finally, download and build gcc to target solaris
-mkdir gcc
-cd gcc
-
-curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | tar xJf -
-cd gcc-$GCC
-
-mkdir ../gcc-build
-cd ../gcc-build
-hide_output ../gcc-$GCC/configure \
-  --enable-languages=c,c++        \
-  --target=$TARGET                \
-  --with-gnu-as                   \
-  --with-gnu-ld                   \
-  --disable-multilib              \
-  --disable-nls                   \
-  --disable-libgomp               \
-  --disable-libquadmath           \
-  --disable-libssp                \
-  --disable-libvtv                \
-  --disable-libcilkrts            \
-  --disable-libada                \
-  --disable-libsanitizer          \
-  --disable-libquadmath-support   \
-  --disable-lto
-
-hide_output make -j10
-hide_output make install
-
-cd ../..
-rm -rf gcc
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-illumos/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-illumos/Dockerfile
index 55fefd2b725..37a8dc56a5f 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-illumos/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-illumos/Dockerfile
@@ -15,6 +15,7 @@ RUN apt-get update && \
     python2.7 \
     && rm -rf /var/lib/apt/lists/*
 
+COPY scripts/shared.sh /tmp/
 COPY scripts/illumos-toolchain.sh /tmp/
 
 RUN bash /tmp/illumos-toolchain.sh x86_64 sysroot
diff --git a/src/ci/docker/host-x86_64/dist-x86_64-solaris/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-solaris/Dockerfile
new file mode 100644
index 00000000000..4d77f0aad26
--- /dev/null
+++ b/src/ci/docker/host-x86_64/dist-x86_64-solaris/Dockerfile
@@ -0,0 +1,36 @@
+FROM ubuntu:22.04
+
+COPY scripts/cross-apt-packages.sh /tmp/
+RUN bash /tmp/cross-apt-packages.sh
+
+# Required gcc dependencies.
+RUN apt-get update && \
+    apt-get install -y --no-install-recommends \
+    libgmp-dev \
+    libmpfr-dev \
+    libmpc-dev \
+    && rm -rf /var/lib/apt/lists/*
+
+COPY scripts/shared.sh /tmp/
+COPY scripts/solaris-toolchain.sh /tmp/
+
+RUN bash /tmp/solaris-toolchain.sh x86_64 sysroot
+RUN bash /tmp/solaris-toolchain.sh x86_64 binutils
+RUN bash /tmp/solaris-toolchain.sh x86_64 gcc
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+COPY scripts/cmake.sh /scripts/
+RUN /scripts/cmake.sh
+
+ENV \
+    AR_x86_64_pc_solaris=x86_64-solaris-ar \
+    RANLIB_x86_64_pc_solaris=x86_64-solaris-ranlib \
+    CC_x86_64_pc_solaris=x86_64-solaris-gcc \
+    CXX_x86_64_pc_solaris=x86_64-solaris-g++
+
+ENV HOSTS=x86_64-pc-solaris
+
+ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
diff --git a/src/ci/docker/scripts/illumos-toolchain.sh b/src/ci/docker/scripts/illumos-toolchain.sh
index 0b2c09b3eed..7a3ca875554 100644
--- a/src/ci/docker/scripts/illumos-toolchain.sh
+++ b/src/ci/docker/scripts/illumos-toolchain.sh
@@ -4,6 +4,8 @@ set -o errexit
 set -o pipefail
 set -o xtrace
 
+source /tmp/shared.sh
+
 ARCH="$1"
 PHASE="$2"
 
@@ -59,52 +61,13 @@ BINUTILS_TAR="$BINUTILS_BASE.tar.bz2"
 BINUTILS_URL="https://ftp.gnu.org/gnu/binutils/$BINUTILS_TAR"
 
 
-download_file() {
-        local file="$1"
-        local url="$2"
-        local sum="$3"
-
-        while :; do
-                if [[ -f "$file" ]]; then
-                        if ! h="$(sha256sum "$file" | awk '{ print $1 }')"; then
-                                printf 'ERROR: reading hash\n' >&2
-                                exit 1
-                        fi
-
-                        if [[ "$h" == "$sum" ]]; then
-                                return 0
-                        fi
-
-                        printf 'WARNING: hash mismatch: %s != expected %s\n' \
-                            "$h" "$sum" >&2
-                        rm -f "$file"
-                fi
-
-                printf 'Downloading: %s\n' "$url"
-                if ! curl -f -L -o "$file" "$url"; then
-                        rm -f "$file"
-                        sleep 1
-                fi
-        done
-}
-
-
 case "$PHASE" in
 sysroot)
-        download_file "/tmp/$SYSROOT_TAR" "$SYSROOT_URL" "$SYSROOT_SUM"
-        mkdir -p "$SYSROOT_DIR"
-        cd "$SYSROOT_DIR"
-        tar -xzf "/tmp/$SYSROOT_TAR"
-        rm -f "/tmp/$SYSROOT_TAR"
+        download_tar_and_extract_into_dir "$SYSROOT_URL" "$SYSROOT_SUM" "$SYSROOT_DIR"
         ;;
 
 binutils)
-        download_file "/tmp/$BINUTILS_TAR" "$BINUTILS_URL" "$BINUTILS_SUM"
-        mkdir -p /ws/src/binutils
-        cd /ws/src/binutils
-        tar -xjf "/tmp/$BINUTILS_TAR"
-        rm -f "/tmp/$BINUTILS_TAR"
-
+        download_tar_and_extract_into_dir "$BINUTILS_URL" "$BINUTILS_SUM" /ws/src/binutils
         mkdir -p /ws/build/binutils
         cd /ws/build/binutils
         "/ws/src/binutils/$BINUTILS_BASE/configure" \
@@ -123,12 +86,7 @@ binutils)
         ;;
 
 gcc)
-        download_file "/tmp/$GCC_TAR" "$GCC_URL" "$GCC_SUM"
-        mkdir -p /ws/src/gcc
-        cd /ws/src/gcc
-        tar -xJf "/tmp/$GCC_TAR"
-        rm -f "/tmp/$GCC_TAR"
-
+        download_tar_and_extract_into_dir "$GCC_URL" "$GCC_SUM" /ws/src/gcc
         mkdir -p /ws/build/gcc
         cd /ws/build/gcc
         export CFLAGS='-fPIC'
diff --git a/src/ci/docker/scripts/shared.sh b/src/ci/docker/scripts/shared.sh
index 9969659088d..6efdbb2070d 100644
--- a/src/ci/docker/scripts/shared.sh
+++ b/src/ci/docker/scripts/shared.sh
@@ -40,3 +40,37 @@ function retry {
     }
   done
 }
+
+download_tar_and_extract_into_dir() {
+  local url="$1"
+  local sum="$2"
+  local dir="$3"
+  local file=$(mktemp -u)
+
+  while :; do
+    if [[ -f "$file" ]]; then
+      if ! h="$(sha256sum "$file" | awk '{ print $1 }')"; then
+        printf 'ERROR: reading hash\n' >&2
+        exit 1
+      fi
+
+      if [[ "$h" == "$sum" ]]; then
+        break
+      fi
+
+      printf 'WARNING: hash mismatch: %s != expected %s\n' "$h" "$sum" >&2
+      rm -f "$file"
+    fi
+
+    printf 'Downloading: %s\n' "$url"
+    if ! curl -f -L -o "$file" "$url"; then
+       rm -f "$file"
+      sleep 1
+    fi
+  done
+
+  mkdir -p "$dir"
+  cd "$dir"
+  tar -xf "$file"
+  rm -f "$file"
+}
diff --git a/src/ci/docker/scripts/solaris-toolchain.sh b/src/ci/docker/scripts/solaris-toolchain.sh
new file mode 100644
index 00000000000..82f0f105523
--- /dev/null
+++ b/src/ci/docker/scripts/solaris-toolchain.sh
@@ -0,0 +1,162 @@
+#!/bin/bash
+
+set -o errexit
+set -o pipefail
+set -o xtrace
+
+source /tmp/shared.sh
+
+ARCH="$1"
+PHASE="$2"
+
+JOBS="$(getconf _NPROCESSORS_ONLN)"
+
+case "$ARCH" in
+x86_64)
+        SYSROOT_MACH='i386'
+        ;;
+sparcv9)
+        SYSROOT_MACH='sparc'
+        ;;
+*)
+        printf 'ERROR: unknown architecture: %s\n' "$ARCH"
+        exit 1
+esac
+
+BUILD_TARGET="$ARCH-pc-solaris2.11"
+
+#
+# The illumos and the Solaris build both use the same GCC-level host triple,
+# though different versions of GCC are used and with different configuration
+# options.  To ensure as little accidental cross-pollination as possible, we
+# build the illumos toolchain in a specific directory tree and just symlink the
+# expected tools into /usr/local/bin at the end.  We omit /usr/local/bin from
+# PATH here for similar reasons.
+#
+PREFIX="/opt/solaris/$ARCH"
+export PATH="$PREFIX/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+
+#
+# NOTE: The compiler version selected here is more specific than might appear.
+# GCC 7.X releases do not appear to cross-compile correctly for Solaris
+# targets, at least insofar as they refuse to enable TLS in libstdc++.  When
+# changing the GCC version in future, one must carefully verify that TLS is
+# enabled in all of the static libraries we intend to include in output
+# binaries.
+#
+GCC_VERSION='8.4.0'
+GCC_SUM='e30a6e52d10e1f27ed55104ad233c30bd1e99cfb5ff98ab022dc941edd1b2dd4'
+GCC_BASE="gcc-$GCC_VERSION"
+GCC_TAR="gcc-$GCC_VERSION.tar.xz"
+GCC_URL="https://ci-mirrors.rust-lang.org/rustc/$GCC_TAR"
+
+SYSROOT_VER='2025-02-21'
+if [ $ARCH = "x86_64" ]; then
+SYSROOT_SUM='e82b78c14464cc2dc71f3cdab312df3dd63441d7c23eeeaf34d41d8b947688d3'
+SYSROOT_TAR="solaris-11.4.42.111.0-i386-sysroot-v$SYSROOT_VER.tar.bz2"
+SYSROOT_DIR="$PREFIX/sysroot-x86_64"
+else
+SYSROOT_SUM='e249a7ef781b9b3297419bd014fa0574800703981d84e113d6af3a897a8b4ffc'
+SYSROOT_TAR="solaris-11.4.42.111.0-sparc-sysroot-v$SYSROOT_VER.tar.bz2"
+SYSROOT_DIR="$PREFIX/sysroot-sparcv9"
+fi
+SYSROOT_URL="https://ci-mirrors.rust-lang.org/rustc/$SYSROOT_TAR"
+
+BINUTILS_VERSION='2.44'
+BINUTILS_SUM='ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237'
+BINUTILS_BASE="binutils-$BINUTILS_VERSION"
+BINUTILS_TAR="$BINUTILS_BASE.tar.xz"
+BINUTILS_URL="https://ci-mirrors.rust-lang.org/rustc/$BINUTILS_TAR"
+
+
+case "$PHASE" in
+sysroot)
+        download_tar_and_extract_into_dir "$SYSROOT_URL" "$SYSROOT_SUM" "$SYSROOT_DIR"
+        ;;
+
+binutils)
+        download_tar_and_extract_into_dir "$BINUTILS_URL" "$BINUTILS_SUM" /ws/src/binutils
+        cat > binutils.patch <<EOF
+Workaround for: https://github.com/rust-lang/rust/issues/137997
+--- binutils-2.44/bfd/elflink.c
++++ binutils-2.44/bfd/elflink.c
+@@ -5150,7 +5150,7 @@
+          if it is not a function, because it might be the version
+          symbol itself.  FIXME: What if it isn't?  */
+       if ((iver.vs_vers & VERSYM_HIDDEN) != 0
+-          || (vernum > 1
++          || (vernum > 1 && strcmp(name, "logb") != 0
+           && (!bfd_is_abs_section (sec)
+               || bed->is_function_type (ELF_ST_TYPE (isym->st_info)))))
+         {
+EOF
+        f=binutils-$BINUTILS_VERSION/bfd/elflink.c && expand -t 4 "$f" > "$f.exp"
+        mv binutils-$BINUTILS_VERSION/bfd/elflink.c.exp binutils-$BINUTILS_VERSION/bfd/elflink.c
+        patch binutils-$BINUTILS_VERSION/bfd/elflink.c < binutils.patch
+        rm binutils.patch
+
+        mkdir -p /ws/build/binutils
+        cd /ws/build/binutils
+        "/ws/src/binutils/$BINUTILS_BASE/configure" \
+            --prefix="$PREFIX" \
+            --target="$BUILD_TARGET" \
+            --program-prefix="$ARCH-solaris-" \
+            --with-sysroot="$SYSROOT_DIR"
+
+        make -j "$JOBS"
+
+        mkdir -p "$PREFIX"
+        make install
+
+        cd
+        rm -rf /ws/src/binutils /ws/build/binutils
+        ;;
+
+gcc)
+        download_tar_and_extract_into_dir "$GCC_URL" "$GCC_SUM" /ws/src/gcc
+        mkdir -p /ws/build/gcc
+        cd /ws/build/gcc
+        export CFLAGS='-fPIC'
+        export CXXFLAGS='-fPIC'
+        export CXXFLAGS_FOR_TARGET='-fPIC'
+        export CFLAGS_FOR_TARGET='-fPIC'
+        "/ws/src/gcc/$GCC_BASE/configure" \
+            --prefix="$PREFIX" \
+            --target="$BUILD_TARGET" \
+            --program-prefix="$ARCH-solaris-" \
+            --with-sysroot="$SYSROOT_DIR" \
+            --with-gnu-as \
+            --with-gnu-ld \
+            --disable-nls \
+            --disable-libgomp \
+            --disable-libquadmath \
+            --disable-libssp \
+            --disable-libvtv \
+            --disable-libcilkrts \
+            --disable-libada \
+            --disable-libsanitizer \
+            --disable-libquadmath-support \
+            --disable-shared \
+            --enable-tls
+
+        make -j "$JOBS"
+
+        mkdir -p "$PREFIX"
+        make install
+
+        #
+        # Link toolchain commands into /usr/local/bin so that cmake and others
+        # can find them:
+        #
+        (cd "$PREFIX/bin" && ls -U) | grep "^$ARCH-solaris-" |
+            xargs -t -I% ln -s "$PREFIX/bin/%" '/usr/local/bin/'
+
+        cd
+        rm -rf /ws/src/gcc /ws/build/gcc
+        ;;
+
+*)
+        printf 'ERROR: unknown phase "%s"\n' "$PHASE" >&2
+        exit 100
+        ;;
+esac
diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml
index 543b79b2f5d..d59e440fb68 100644
--- a/src/ci/github-actions/jobs.yml
+++ b/src/ci/github-actions/jobs.yml
@@ -253,6 +253,12 @@ auto:
   - name: dist-x86_64-netbsd
     <<: *job-linux-4c
 
+  - name: dist-x86_64-solaris
+    <<: *job-linux-4c
+
+  - name: dist-sparcv9-solaris
+    <<: *job-linux-4c
+
   # The i686-gnu job is split into multiple jobs to run tests in parallel.
   # i686-gnu-1 skips tests that run in i686-gnu-2.
   - name: i686-gnu-1
diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md
index 60002a5f9e5..e7dfaaf4fd5 100644
--- a/src/doc/rustc/src/platform-support.md
+++ b/src/doc/rustc/src/platform-support.md
@@ -110,6 +110,8 @@ target | notes
 `x86_64-unknown-linux-musl` | 64-bit Linux with musl 1.2.3
 [`x86_64-unknown-linux-ohos`](platform-support/openharmony.md) | x86_64 OpenHarmony
 [`x86_64-unknown-netbsd`](platform-support/netbsd.md) | NetBSD/amd64
+[`x86_64-pc-solaris`](platform-support/solaris.md) | 64-bit x86 Solaris 11.4
+[`sparcv9-sun-solaris`](platform-support/solaris.md) | SPARC V9 Solaris 11.4
 
 ## Tier 2 without Host Tools
 
@@ -183,7 +185,6 @@ target | std | notes
 `riscv64gc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFDC ISA)
 `riscv64imac-unknown-none-elf` | * | Bare RISC-V (RV64IMAC ISA)
 `sparc64-unknown-linux-gnu` | ✓ | SPARC Linux (kernel 4.4, glibc 2.23)
-[`sparcv9-sun-solaris`](platform-support/solaris.md) | ✓ | SPARC V9 Solaris 11.4
 [`thumbv6m-none-eabi`](platform-support/thumbv6m-none-eabi.md) | * | Bare Armv6-M
 [`thumbv7em-none-eabi`](platform-support/thumbv7em-none-eabi.md) | * | Bare Armv7E-M
 [`thumbv7em-none-eabihf`](platform-support/thumbv7em-none-eabi.md) | * | Bare Armv7E-M, hardfloat
@@ -203,7 +204,6 @@ target | std | notes
 [`x86_64-apple-ios-macabi`](platform-support/apple-ios-macabi.md) | ✓ | Mac Catalyst on x86_64
 [`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
 [`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
-[`x86_64-pc-solaris`](platform-support/solaris.md) | ✓ | 64-bit x86 Solaris 11.4
 [`x86_64-pc-windows-gnullvm`](platform-support/windows-gnullvm.md) | ✓ | 64-bit x86 MinGW (Windows 10+), LLVM ABI
 [`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
 `x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)
diff --git a/src/doc/rustc/src/platform-support/solaris.md b/src/doc/rustc/src/platform-support/solaris.md
index c22b5c24c12..1b2372eaa0e 100644
--- a/src/doc/rustc/src/platform-support/solaris.md
+++ b/src/doc/rustc/src/platform-support/solaris.md
@@ -12,7 +12,9 @@ Rust for Solaris operating system.
 
 ## Requirements
 
-Binary built for this target is expected to run on sparcv9 or x86_64, and Solaris 11.4.
+The `sparcv9-sun-solaris` and `x86_64-pc-solaris` targets are Tier 2 with host tools.
+
+Binary built for these targets are expected to run on sparcv9 or x86_64, and Solaris 11.4.
 
 ## Testing
 
diff --git a/src/tools/miri/src/alloc/isolated_alloc.rs b/src/tools/miri/src/alloc/isolated_alloc.rs
index 7b74d171373..3a7879f372a 100644
--- a/src/tools/miri/src/alloc/isolated_alloc.rs
+++ b/src/tools/miri/src/alloc/isolated_alloc.rs
@@ -145,10 +145,7 @@ impl IsolatedAlloc {
             if pinfo.domain_size() < offset_pinfo + size_pinfo {
                 break;
             }
-            // FIXME: is there a more efficient way to check whether the entire range is unset
-            // in the bitset?
-            let range_avail = !(offset_pinfo..offset_pinfo + size_pinfo).any(|i| pinfo.contains(i));
-            if range_avail {
+            if !pinfo.contains_any(offset_pinfo..offset_pinfo + size_pinfo) {
                 pinfo.insert_range(offset_pinfo..offset_pinfo + size_pinfo);
                 // SAFETY: We checked the available bytes after `idx` in the call
                 // to `domain_size` above and asserted there are at least `idx +