Skip to content

Commit 8675eaf

Browse files
committed
Add rustup build script
1 parent cfb0764 commit 8675eaf

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

rustup/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Oracle Solaris Rustup builder
2+
3+
This builds rustup for Solaris before Solaris is officially supported by
4+
Rustup upstream (https://github.com/rust-lang/rustup).
5+
6+
It requires at least Rust 1.88 to build (it was tested with 1.91.1 [1])
7+
8+
The usage is:
9+
10+
RUST_PATH=~/rust-1.91.1/bin ./build.sh
11+
12+
[1] Rust 1.91.1 for Solaris:
13+
https://static.rust-lang.org/dist/rust-1.91.1-x86_64-pc-solaris.tar.xz
14+
https://static.rust-lang.org/dist/rust-1.91.1-sparcv9-sun-solaris.tar.xz

rustup/build.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
#
3+
# Build script for rustup on Solaris.
4+
#
5+
set -xe
6+
7+
VERSION=20251114
8+
9+
PATH=$RUST_PATH:/usr/gnu/bin:/usr/bin
10+
11+
WS="`pwd`"
12+
BUILD_DIR="$WS/build_dir"
13+
14+
SRC_DIR=rustup-src
15+
16+
SRU=$(uname -v | cut -d . -f 3)
17+
if [ $SRU -ge 78 ]; then
18+
GCC=/usr/gcc/14/bin/gcc
19+
GXX=/usr/gcc/14/bin/g++
20+
else
21+
GCC=/usr/gcc/11/bin/gcc
22+
GXX=/usr/gcc/11/bin/g++
23+
fi
24+
25+
mkdir -p "$BUILD_DIR"
26+
27+
# Clean build directory
28+
( cd "$BUILD_DIR"; rm -rf $SRC_DIR $BUILD_HOME )
29+
30+
# Clone rustup repo
31+
( cd "$BUILD_DIR"; git clone https://github.com/rust-lang/rustup.git $SRC_DIR )
32+
33+
# Check out tested working version
34+
( cd "$BUILD_DIR/$SRC_DIR" ; git checkout 7444818d076d05438a15422d9ebe97d062527d5b )
35+
36+
cd "$BUILD_DIR"/$SRC_DIR
37+
38+
# Build rustup
39+
PATH="$PATH" CC=$GCC CXX=$GXX cargo build --release
40+
41+
# Rename and list rustup init binary
42+
OPENSSL_VERSION=`elfdump -d target/release/rustup-init | grep libssl | gsed 's;^.*so\.;;'`
43+
mv target/release/rustup-init target/release/rustup-init-$VERSION-`mach`-openssl$OPENSSL_VERSION
44+
ls -lh `pwd`/target/release/rustup-init-$VERSION-`mach`-openssl$OPENSSL_VERSION

0 commit comments

Comments
 (0)