From c81946b220393facb51c332a1cd5fc7a0c5d878a Mon Sep 17 00:00:00 2001 From: thirteenowls Date: Fri, 17 May 2024 20:54:25 +0200 Subject: [PATCH] Fix `*-solaris` targets Adapted from https://github.com/rust-lang/rust/pull/108951 and https://github.com/rust-lang/rust/pull/81229. --- .changes/1495.json | 6 ++++++ docker/solaris.sh | 21 +++++++++++++-------- src/docker/provided_images.rs | 10 ++++++++++ targets.toml | 2 -- 4 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 .changes/1495.json diff --git a/.changes/1495.json b/.changes/1495.json new file mode 100644 index 000000000..f5c10bb5c --- /dev/null +++ b/.changes/1495.json @@ -0,0 +1,6 @@ +{ + "description": "Fix `*-solaris` targets", + "issues": [1424], + "type": "fixed", + "breaking": true +} diff --git a/docker/solaris.sh b/docker/solaris.sh index 55f35cc4b..a7ba0da98 100755 --- a/docker/solaris.sh +++ b/docker/solaris.sh @@ -57,28 +57,33 @@ main() { esac apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486 - add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main' + add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2 main' dpkg --add-architecture "${apt_arch}" apt-get update - # shellcheck disable=SC2046 - apt-get download $(apt-cache depends --recurse --no-replaces \ + apt-get install -y --download-only \ "libc:${apt_arch}" \ - "liblgrp-dev:${apt_arch}" \ "liblgrp:${apt_arch}" \ "libm-dev:${apt_arch}" \ "libpthread:${apt_arch}" \ "libresolv:${apt_arch}" \ "librt:${apt_arch}" \ - "libsendfile-dev:${apt_arch}" \ "libsendfile:${apt_arch}" \ "libsocket:${apt_arch}" \ "system-crt:${apt_arch}" \ - "system-header:${apt_arch}" \ - | grep "^\w") + "system-header:${apt_arch}" - for deb in *"${apt_arch}.deb"; do + for deb in /var/cache/apt/archives/*"${apt_arch}.deb"; do dpkg -x "${deb}" "${td}/solaris" 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.. + # This makes all those symlinks. + while IFS= read -r -d '' lib; do + link_name=${lib%.so.*}.so + [ -e "$link_name" ] || ln -sf "${lib##*/}" "$link_name" + done < <(find . -name '*.so.*' -print0) cd binutils-build ../binutils/configure \ diff --git a/src/docker/provided_images.rs b/src/docker/provided_images.rs index 6d87ec791..be7f087e7 100644 --- a/src/docker/provided_images.rs +++ b/src/docker/provided_images.rs @@ -228,6 +228,16 @@ pub static PROVIDED_IMAGES: &[ProvidedImage] = &[ platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU], sub: None }, + ProvidedImage { + name: "sparcv9-sun-solaris", + platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU], + sub: None + }, + ProvidedImage { + name: "x86_64-pc-solaris", + platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU], + sub: None + }, ProvidedImage { name: "x86_64-unknown-illumos", platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU], diff --git a/targets.toml b/targets.toml index 8ca1e8a18..9d46f0a07 100644 --- a/targets.toml +++ b/targets.toml @@ -447,7 +447,6 @@ dylib = true std = true [[target]] -disabled = true # https://github.com/cross-rs/cross/issues/1424 target = "sparcv9-sun-solaris" os = "ubuntu-latest" cpp = true @@ -455,7 +454,6 @@ dylib = true std = true [[target]] -disabled = true # https://github.com/cross-rs/cross/issues/1424 target = "x86_64-pc-solaris" os = "ubuntu-latest" cpp = true