-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #138 - bgermann:master, r=japaric
Add Solaris targets Closes #134.
- Loading branch information
Showing
6 changed files
with
197 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
set -ex | ||
|
||
main() { | ||
local arch=$1 | ||
|
||
local binutils=2.25.1 \ | ||
gcc=5.3.0 \ | ||
target=$arch-sun-solaris2.11 | ||
|
||
local dependencies=( | ||
bzip2 | ||
ca-certificates | ||
curl | ||
g++ | ||
make | ||
software-properties-common | ||
wget | ||
xz-utils | ||
) | ||
|
||
apt-get update | ||
local purge_list=() | ||
for dep in ${dependencies[@]}; do | ||
if ! dpkg -L $dep; then | ||
apt-get install --no-install-recommends -y $dep | ||
purge_list+=( $dep ) | ||
fi | ||
done | ||
|
||
local td=$(mktemp -d) | ||
|
||
mkdir $td/{binutils,gcc}{,-build} $td/solaris | ||
|
||
curl https://ftp.gnu.org/gnu/binutils/binutils-$binutils.tar.bz2 | \ | ||
tar -C $td/binutils --strip-components=1 -xj | ||
|
||
curl https://ftp.gnu.org/gnu/gcc/gcc-$gcc/gcc-$gcc.tar.bz2 | \ | ||
tar -C $td/gcc --strip-components=1 -xj | ||
|
||
pushd $td | ||
|
||
cd gcc | ||
./contrib/download_prerequisites | ||
cd .. | ||
|
||
local apt_arch= | ||
local lib_arch= | ||
case $arch in | ||
x86_64) | ||
apt_arch=solaris-i386 | ||
lib_arch=amd64 | ||
;; | ||
sparcv9) | ||
apt_arch=solaris-sparc | ||
lib_arch=sparcv9 | ||
;; | ||
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' | ||
dpkg --add-architecture $apt_arch | ||
apt-get update | ||
apt-get download $(apt-cache depends --recurse --no-replaces \ | ||
libc-dev:$apt_arch \ | ||
libdl-dev:$apt_arch \ | ||
libm-dev:$apt_arch \ | ||
libnsl-dev:$apt_arch \ | ||
libpthread-dev:$apt_arch \ | ||
libresolv-dev:$apt_arch \ | ||
librt-dev:$apt_arch \ | ||
libsocket-dev:$apt_arch \ | ||
system-crt:$apt_arch \ | ||
system-header:$apt_arch \ | ||
| grep "^\w") | ||
|
||
for deb in *$apt_arch.deb; do | ||
dpkg -x $deb $td/solaris | ||
done | ||
|
||
cd binutils-build | ||
../binutils/configure \ | ||
--target=$target | ||
nice make -j$(nproc) | ||
make install | ||
cd .. | ||
|
||
local destdir=/usr/local/$target | ||
mkdir $destdir/usr | ||
cp -r $td/solaris/usr/include $destdir/usr | ||
mv $td/solaris/usr/lib/$lib_arch/* $destdir/lib | ||
mv $td/solaris/lib/$lib_arch/* $destdir/lib | ||
|
||
ln -s usr/include $destdir/sys-include | ||
ln -s usr/include $destdir/include | ||
|
||
cd gcc-build | ||
../gcc/configure \ | ||
--disable-libada \ | ||
--disable-libcilkrts \ | ||
--disable-libgomp \ | ||
--disable-libquadmath \ | ||
--disable-libquadmath-support \ | ||
--disable-libsanitizer \ | ||
--disable-libssp \ | ||
--disable-libvtv \ | ||
--disable-lto \ | ||
--disable-multilib \ | ||
--disable-nls \ | ||
--enable-languages=c,c++ \ | ||
--with-gnu-as \ | ||
--with-gnu-ld \ | ||
--target=$target | ||
nice make -j$(nproc) | ||
make install | ||
cd .. | ||
|
||
# clean up | ||
popd | ||
|
||
apt-get purge --auto-remove -y ${purge_list[@]} | ||
|
||
rm -rf $td | ||
rm $0 | ||
} | ||
|
||
main "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
cmake \ | ||
gcc \ | ||
libc6-dev \ | ||
make \ | ||
pkg-config | ||
|
||
COPY xargo.sh / | ||
RUN bash /xargo.sh | ||
|
||
COPY solaris.sh openssl.sh / | ||
RUN bash /solaris.sh sparcv9 && \ | ||
bash /openssl.sh solaris64-sparcv9-gcc sparcv9-sun-solaris2.11- | ||
|
||
ENV CARGO_TARGET_SPARCV9_SUN_SOLARIS_LINKER=sparcv9-sun-solaris2.11-gcc \ | ||
CC_sparcv9_sun_solaris=sparcv9-sun-solaris2.11-gcc \ | ||
OPENSSL_DIR=/openssl \ | ||
OPENSSL_INCLUDE_DIR=/openssl/include \ | ||
OPENSSL_LIB_DIR=/openssl/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
cmake \ | ||
gcc \ | ||
libc6-dev \ | ||
make \ | ||
pkg-config | ||
|
||
COPY xargo.sh / | ||
RUN bash /xargo.sh | ||
|
||
COPY solaris.sh openssl.sh / | ||
RUN bash /solaris.sh x86_64 && \ | ||
bash /openssl.sh solaris64-x86_64-gcc x86_64-sun-solaris2.11- | ||
|
||
ENV CARGO_TARGET_X86_64_SUN_SOLARIS_LINKER=x86_64-sun-solaris2.11-gcc \ | ||
CC_x86_64_sun_solaris=x86_64-sun-solaris2.11-gcc \ | ||
OPENSSL_DIR=/openssl \ | ||
OPENSSL_INCLUDE_DIR=/openssl/include \ | ||
OPENSSL_LIB_DIR=/openssl/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters