rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
95.38k stars 12.29k forks source link

Building host tools for Solaris #114162

Open inferiorhumanorgans opened 12 months ago

inferiorhumanorgans commented 12 months ago

I'm not quite sure if this is the right place to track these things, but I've been trying to cross build the native host tools for Solaris (both x86 and SPARC).

x86_64

Environment

Cross: x86_64-apple-darwinx86_64-pc-solaris Sysroot: see below Compiler: gcc 11.2.0 binutils: GNU binutils 2.40 + ar LLVM 16 (todo: test with GNU ar) rust 1.70.0 Local changes to rust: #114078

Known issues

Status

With this in place I can build these artifacts from 1.70.0:

cargo-nightly-x86_64-pc-solaris.tar.xz
rust-analysis-nightly-x86_64-pc-solaris.tar.xz
rust-analyzer-nightly-x86_64-pc-solaris.tar.xz
rust-demangler-nightly-x86_64-pc-solaris.tar.xz
rust-dev-nightly-x86_64-pc-solaris.tar.xz
rust-nightly-x86_64-pc-solaris.tar.xz
rust-std-nightly-x86_64-pc-solaris.tar.xz
rustc-dev-nightly-x86_64-pc-solaris.tar.xz
rustc-nightly-x86_64-pc-solaris.tar.xz
rustfmt-nightly-x86_64-pc-solaris.tar.xz

Manually installing the rust-std-nightly and rustc-nightly tarballs got me an install that successfully compiled a "Hello, world" program with the Oracle provided gcc as the linker.

SPARCv9

Environment

Cross: x86_64-apple-darwinsparcv9-sun-solaris Sysroot: see below Compiler: gcc 11.2.0 binutils: GNU binutils 2.40 rust 1.70.0 Local changes to rust: #114078

Known issues

Status

I can build these artifacts from 1.70.0:

cargo-nightly-sparcv9-sun-solaris.tar.xz
rust-analysis-nightly-sparcv9-sun-solaris.tar.xz
rust-analyzer-nightly-sparcv9-sun-solaris.tar.xz
rust-demangler-nightly-sparcv9-sun-solaris.tar.xz
rust-dev-nightly-sparcv9-sun-solaris.tar.xz
rust-nightly-sparcv9-sun-solaris.tar.xz
rust-std-nightly-sparcv9-sun-solaris.tar.xz
rustc-dev-nightly-sparcv9-sun-solaris.tar.xz
rustc-nightly-sparcv9-sun-solaris.tar.xz
rustfmt-nightly-sparcv9-sun-solaris.tar.xz

Sysroot

Package information from Oracle is available here:

http://pkg.oracle.com/solaris/release/en/catalog.shtml

Solaris packages contain files for both x86 and SPARC architectures. The following packages should be sufficient to create a usable sysroot for cross compiling:

# system headers
system/header@11.4,5.11-11.4.42.0.0.111.1:20211203T213657Z

# Core system libraries
system/library@11.4,5.11-11.4.42.0.0.111.1:20211203T214210Z

# ld.so, crt*
system/linker@11.4-11.4.0.0.1.15.0:20180817T003258Z

# libc
system/library/libc@11.4-11.4.42.0.0.111.1:20211203T214042Z

# libm
system/library/math@11.4-11.4.0.1.0.17.0:20200221T005425Z

# libucrypto
system/library/security/crypto@11.4,5.11-11.4.42.0.0.111.1:20211203T214125Z

# libssl v3
library/security/openssl-3@3,11.4-11.4.42.0.0.111.0:20211203T203706Z

# libz
library/zlib@1.2.11,11.4-11.4.42.0.0.111.0:20211203T203816Z
workingjubilee commented 12 months ago

( please feel free to add whatever labels you think it should have via rustbot label: +label, if you want to potentially bring it to the more attention, I removed needs-triage because it looks like you're just tracking a work in progress, which I don't mind either way. )

inferiorhumanorgans commented 12 months ago

@rustbot label: +A-cross +O-SPARC

@workingjubilee thanks! For the stuff that won't get fixed (e.g. needing to specify ar and ranlib by hand, is there a good place to land some documentation?

workingjubilee commented 12 months ago

We have been linking documentation to platform quirks from src/doc/rustc/src/platform-support.md, because that gets rendered as https://doc.rust-lang.org/nightly/rustc/platform-support.html