Skip to content

Commit 108706f

Browse files
committed
Auto merge of #45001 - bgermann:master, r=alexcrichton
Add builder for Solaris and merge it with Fuchsia's builder The new Solaris builder can be used to build rust-std. The dilos illumos distribution was chosen, because illumos is free software as opposed to Oracle Solaris and dilos is the only illumos distribution that supports x86_64 and sparcv9 at the same level.
2 parents f338dba + dba52ff commit 108706f

File tree

7 files changed

+159
-43
lines changed

7 files changed

+159
-43
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ matrix:
115115
if: branch = auto
116116
- env: IMAGE=cross DEPLOY=1
117117
if: branch = auto
118+
- env: IMAGE=cross2 DEPLOY=1
119+
if: branch = auto
118120
- env: IMAGE=dist-aarch64-linux DEPLOY=1
119121
if: branch = auto
120122
- env: IMAGE=dist-android DEPLOY=1
@@ -125,8 +127,6 @@ matrix:
125127
if: branch = auto
126128
- env: IMAGE=dist-armv7-linux DEPLOY=1
127129
if: branch = auto
128-
- env: IMAGE=dist-fuchsia DEPLOY=1
129-
if: branch = auto
130130
- env: IMAGE=dist-i586-gnu-i686-musl DEPLOY=1
131131
if: branch = auto
132132
- env: IMAGE=dist-i686-freebsd DEPLOY=1

src/ci/docker/cross2/Dockerfile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM ubuntu:16.04
2+
3+
COPY scripts/cross-apt-packages.sh /scripts/
4+
RUN sh /scripts/cross-apt-packages.sh
5+
6+
RUN apt-get build-dep -y clang llvm && apt-get install -y --no-install-recommends \
7+
build-essential \
8+
libedit-dev \
9+
libgmp-dev \
10+
libisl-dev \
11+
libmpc-dev \
12+
libmpfr-dev \
13+
ninja-build \
14+
nodejs \
15+
python2.7-dev \
16+
software-properties-common \
17+
unzip
18+
19+
RUN apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486
20+
RUN add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main'
21+
22+
WORKDIR /tmp
23+
COPY cross2/shared.sh cross2/build-fuchsia-toolchain.sh /tmp/
24+
COPY cross2/build-solaris-toolchain.sh /tmp/
25+
RUN /tmp/build-fuchsia-toolchain.sh
26+
RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386
27+
RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc
28+
29+
COPY scripts/sccache.sh /scripts/
30+
RUN sh /scripts/sccache.sh
31+
32+
ENV \
33+
AR_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-ar \
34+
CC_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang \
35+
CXX_x86_64_unknown_fuchsia=x86_64-unknown-fuchsia-clang++ \
36+
AR_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-ar \
37+
CC_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang \
38+
CXX_aarch64_unknown_fuchsia=aarch64-unknown-fuchsia-clang++ \
39+
AR_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-ar \
40+
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-gcc \
41+
CXX_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-g++ \
42+
AR_x86_64_sun_solaris=x86_64-sun-solaris2.11-ar \
43+
CC_x86_64_sun_solaris=x86_64-sun-solaris2.11-gcc \
44+
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.11-g++
45+
46+
ENV TARGETS=x86_64-unknown-fuchsia
47+
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
48+
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
49+
ENV TARGETS=$TARGETS,x86_64-sun-solaris
50+
51+
ENV RUST_CONFIGURE_ARGS --target=$TARGETS --enable-extended
52+
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
#!/bin/bash
2+
# Copyright 2016 The Rust Project Developers. See the COPYRIGHT
3+
# file at the top-level directory of this distribution and at
4+
# http://rust-lang.org/COPYRIGHT.
5+
#
6+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
7+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
8+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
9+
# option. This file may not be copied, modified, or distributed
10+
# except according to those terms.
11+
12+
set -ex
13+
source shared.sh
14+
15+
ARCH=$1
16+
LIB_ARCH=$2
17+
APT_ARCH=$3
18+
BINUTILS=2.28.1
19+
GCC=6.4.0
20+
21+
# First up, build binutils
22+
mkdir binutils
23+
cd binutils
24+
25+
curl https://ftp.gnu.org/gnu/binutils/binutils-$BINUTILS.tar.xz | tar xJf -
26+
mkdir binutils-build
27+
cd binutils-build
28+
hide_output ../binutils-$BINUTILS/configure --target=$ARCH-sun-solaris2.11
29+
hide_output make -j10
30+
hide_output make install
31+
32+
cd ../..
33+
rm -rf binutils
34+
35+
# Next, download and install the relevant solaris packages
36+
mkdir solaris
37+
cd solaris
38+
39+
dpkg --add-architecture $APT_ARCH
40+
apt-get update
41+
apt-get download \
42+
libc:$APT_ARCH \
43+
libc-dev:$APT_ARCH \
44+
libm:$APT_ARCH \
45+
libm-dev:$APT_ARCH \
46+
libpthread:$APT_ARCH \
47+
libpthread-dev:$APT_ARCH \
48+
libresolv:$APT_ARCH \
49+
libresolv-dev:$APT_ARCH \
50+
librt:$APT_ARCH \
51+
librt-dev:$APT_ARCH \
52+
libsocket:$APT_ARCH \
53+
libsocket-dev:$APT_ARCH \
54+
system-crt:$APT_ARCH \
55+
system-header:$APT_ARCH
56+
57+
for deb in *$APT_ARCH.deb; do
58+
dpkg -x $deb .
59+
done
60+
61+
mkdir /usr/local/$ARCH-sun-solaris2.11/usr
62+
mv usr/include /usr/local/$ARCH-sun-solaris2.11/usr/include
63+
mv usr/lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib
64+
mv lib/$LIB_ARCH/* /usr/local/$ARCH-sun-solaris2.11/lib
65+
66+
ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/sys-include
67+
ln -s /usr/local/$ARCH-sun-solaris2.11/usr/include /usr/local/$ARCH-sun-solaris2.11/include
68+
69+
cd ..
70+
rm -rf solaris
71+
72+
# Finally, download and build gcc to target solaris
73+
mkdir gcc
74+
cd gcc
75+
76+
curl https://ftp.gnu.org/gnu/gcc/gcc-$GCC/gcc-$GCC.tar.xz | tar xJf -
77+
cd gcc-$GCC
78+
79+
mkdir ../gcc-build
80+
cd ../gcc-build
81+
hide_output ../gcc-$GCC/configure \
82+
--enable-languages=c,c++ \
83+
--target=$ARCH-sun-solaris2.11 \
84+
--with-gnu-as \
85+
--with-gnu-ld \
86+
--disable-multilib \
87+
--disable-nls \
88+
--disable-libgomp \
89+
--disable-libquadmath \
90+
--disable-libssp \
91+
--disable-libvtv \
92+
--disable-libcilkrts \
93+
--disable-libada \
94+
--disable-libsanitizer \
95+
--disable-libquadmath-support \
96+
--disable-lto \
97+
--with-sysroot=/usr/local/$ARCH-sun-solaris2.11
98+
99+
hide_output make -j10
100+
hide_output make install
101+
102+
cd ../..
103+
rm -rf gcc
File renamed without changes.

src/ci/docker/dist-fuchsia/Dockerfile

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/tools/build-manifest/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ static TARGETS: &'static [&'static str] = &[
8383
"powerpc64le-unknown-linux-gnu",
8484
"s390x-unknown-linux-gnu",
8585
"sparc64-unknown-linux-gnu",
86+
"sparcv9-sun-solaris",
8687
"wasm32-unknown-emscripten",
8788
"x86_64-linux-android",
8889
"x86_64-apple-darwin",
8990
"x86_64-apple-ios",
9091
"x86_64-pc-windows-gnu",
9192
"x86_64-pc-windows-msvc",
9293
"x86_64-rumprun-netbsd",
94+
"x86_64-sun-solaris",
9395
"x86_64-unknown-freebsd",
9496
"x86_64-unknown-fuchsia",
9597
"x86_64-unknown-linux-gnu",

0 commit comments

Comments
 (0)