aboutsummaryrefslogtreecommitdiff
path: root/development/rust
diff options
context:
space:
mode:
authorAndrew Clemons <andrew.clemons@gmail.com>2017-10-14 11:23:52 +0100
committerDavid Spencer <idlemoor@slackbuilds.org>2017-10-14 14:47:00 +0100
commit55d8113a763370a75a320d8bb5600a9aa6c3904f (patch)
treefcfc66b9613f3b55e7a7d124d6cb842b0a0d5ff1 /development/rust
parent0da3ae8db3cf57e6655a2146e3f1e5a3b16678ed (diff)
development/rust: Updated for version 1.21.0.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'development/rust')
-rw-r--r--development/rust/README21
-rw-r--r--development/rust/link_libffi.diff12
-rw-r--r--development/rust/rust.SlackBuild131
-rw-r--r--development/rust/rust.info42
4 files changed, 98 insertions, 108 deletions
diff --git a/development/rust/README b/development/rust/README
index 4e3aec3c9a449..2179a559910a6 100644
--- a/development/rust/README
+++ b/development/rust/README
@@ -14,24 +14,3 @@ You can also force either behaviour through the LOCAL_BOOTSTRAP=yes|no
parameter.
LOCAL_BOOTSTRAP=no ./rust.SlackBuild
-
-ARM builds
-==========
-
-soft-float:
-https://static.rust-lang.org/dist/2017-07-20/cargo-0.20.0-arm-unknown-linux-gnueabi.tar.gz
-https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-arm-unknown-linux-gnueabi.tar.gz
-https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-arm-unknown-linux-gnueabi.tar.gz
-
-5082e86858fd2b14ba7fd04fe715e85a cargo-0.20.0-arm-unknown-linux-gnueabi.tar.gz
-44d3fde5459d939c999f9be58a024b41 rust-std-1.19.0-arm-unknown-linux-gnueabi.tar.gz
-5d2ec83e731ea4fc05ca14a53e349109 rustc-1.19.0-arm-unknown-linux-gnueabi.tar.gz
-
-hard-float:
-https://static.rust-lang.org/dist/2017-07-20/cargo-0.20.0-armv7-unknown-linux-gnueabihf.tar.gz
-https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-armv7-unknown-linux-gnueabihf.tar.gz
-https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-armv7-unknown-linux-gnueabihf.tar.gz
-
-0991c64273b49b3b8488d4f61d827295 cargo-0.20.0-armv7-unknown-linux-gnueabihf.tar.gz
-5e5940b8cbc0bf00f8e4051472d5776e rust-std-1.19.0-armv7-unknown-linux-gnueabihf.tar.gz
-5498f62495c309dbdc6c70b7ed4d4f24 rustc-1.19.0-armv7-unknown-linux-gnueabihf.tar.gz
diff --git a/development/rust/link_libffi.diff b/development/rust/link_libffi.diff
new file mode 100644
index 0000000000000..38e0113e9cf53
--- /dev/null
+++ b/development/rust/link_libffi.diff
@@ -0,0 +1,12 @@
+diff -Naur rustc-1.21.0-src.bak/src/librustc_llvm/build.rs rustc-1.21.0-src/src/librustc_llvm/build.rs
+--- rustc-1.21.0-src.bak/src/librustc_llvm/build.rs 2017-10-10 09:04:51.000000000 +1300
++++ rustc-1.21.0-src/src/librustc_llvm/build.rs 2017-10-14 15:28:56.761081727 +1300
+@@ -221,6 +221,8 @@
+ println!("cargo:rustc-link-lib={}={}", kind, name);
+ }
+
++ println!("cargo:rustc-link-lib=dylib=ffi");
++
+ // LLVM ldflags
+ //
+ // If we're a cross-compile of LLVM then unfortunately we can't trust these
diff --git a/development/rust/rust.SlackBuild b/development/rust/rust.SlackBuild
index a8c8a442102bd..3c3a733b0566e 100644
--- a/development/rust/rust.SlackBuild
+++ b/development/rust/rust.SlackBuild
@@ -4,6 +4,7 @@
# Copyright 2017 Andrew Clemons, Wellington, New Zealand
# Copyright 2017 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2017 Stuart Winter
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -25,12 +26,12 @@
PRGNAM=rust
SRCNAM="${PRGNAM}c"
-VERSION=${VERSION:-1.20.0}
+VERSION=${VERSION:-1.21.0}
# src/stage0.txt
-RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.19.0}
-RSTAGE0_DIR=${RSTAGE0_DIR:-2017-07-20}
-CSTAGE0_VERSION=${CSTAGE0_VERSION:-0.20.0}
+RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.20.0}
+RSTAGE0_DIR=${RSTAGE0_DIR:-2017-08-31}
+CSTAGE0_VERSION=${CSTAGE0_VERSION:-0.21.0}
CSTAGE0_DIR=${CSTAGE0_DIR:-$RSTAGE0_DIR}
BUILD=${BUILD:-1}
@@ -57,8 +58,12 @@ if [ "$ARCH" = "i586" ]; then
if rustc -Vv | grep host | grep i586 > /dev/null ; then
BARCH="$ARCH"
else
- echo "Your exising rust cannot bootstrap an i586 toolchain. Either set LOCAL_BOOTSTRAP=no or remove your existing rust package and do a full bootstrap."
- exit 1
+ BARCH="i686"
+
+ if case "$( uname -m )" in i586) true ;; *) false ;; esac ; then
+ echo "rust must be bootstrapped from an i686 machine"
+ exit 1
+ fi
fi
else
# i586 must be built on a i686 machine, since the bootstrap compiler is i686
@@ -69,28 +74,28 @@ if [ "$ARCH" = "i586" ]; then
exit 1
fi
fi
+
+ TARCH="$ARCH"
+elif [ "$ARCH" = "arm" ]; then
+ # bootstrap compiler is armv6
+ BARCH="$ARCH"
+
+ if case "$( uname -m )" in armv5*) true ;; *) false ;; esac ; then
+ echo "rust must be bootstrapped from an armv6 machine or later"
+ exit 1
+ fi
+
+ # there is tier3 support for armv5te, but it ftbfs for me
+ # https://github.com/rust-lang-nursery/compiler-builtins/pull/115
+ TARCH="$BARCH"
else
BARCH="$ARCH"
+ TARCH="$ARCH"
fi
-TARCH="$ARCH"
-
# Bootstrapping ABI:
if [ "$ARCH" = "arm" ]; then
- if readelf -h /bin/bash | grep Flags | grep hard > /dev/null 2>&1 ; then
- # hardfloat
- BABI="gnueabihf"
- BARCH="armv7"
- TARCH="$BARCH"
- else
- # softfloat
- BABI="gnueabi"
-
- if case "$( uname -m )" in armv5*) true ;; *) false ;; esac ; then
- echo "rust must be bootstrapped from an armv6 machine or later"
- exit 1
- fi
- fi
+ BABI="gnueabi"
else
BABI="gnu"
fi
@@ -110,12 +115,8 @@ elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
elif [ "$ARCH" = "arm" ] ; then
- SLKCFLAGS="-O2"
+ SLKCFLAGS=""
LIBDIRSUFFIX=""
-
- if [ "$BABI" = "gnueabihf" ] ; then
- SLKCFLAGS="$SLKCFLAGS -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
- fi
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
@@ -129,6 +130,7 @@ cd $TMP
rm -rf $SRCNAM-$VERSION-src
tar xvf $CWD/$SRCNAM-$VERSION-src.tar.gz
cd $SRCNAM-$VERSION-src
+patch -p1 < $CWD/link_libffi.diff
if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
# rust requires bootstrapping with the previous rust version.
@@ -138,21 +140,18 @@ if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
$CWD/$SRCNAM-$RSTAGE0_VERSION-$BARCH-unknown-linux-$BABI.tar.gz \
build/cache/$RSTAGE0_DIR
- if [ "$TARCH" = "i586" ] ; then
- cp $CWD/$PRGNAM-std-$RSTAGE0_VERSION-$TARCH-unknown-linux-$BABI.tar.gz \
- build/cache/$RSTAGE0_DIR
- fi
-
mkdir -p build/cache/$CSTAGE0_DIR
- cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-$BABI.tar.gz build/cache/$CSTAGE0_DIR
+ cp $CWD/cargo-$CSTAGE0_VERSION-$BARCH-unknown-linux-$BABI.tar.gz \
+ build/cache/$CSTAGE0_DIR
fi
-# src/bootstrap/config.toml.example
+# config.toml.example
cat << EOF > config.toml
[build]
build = "$BARCH-unknown-linux-$BABI"
host = ["$TARCH-unknown-linux-$BABI"]
target = ["$TARCH-unknown-linux-$BABI"]
+submodules = false
vendor = true
extended = true
@@ -164,10 +163,10 @@ mandir = "man"
[rust]
codegen-units = 0
-debuginfo = false
channel = "stable"
rpath = false
codegen-tests = false
+ignore-git = true
[target.i586-unknown-linux-gnu]
llvm-config = "/usr/bin/llvm-config"
@@ -178,10 +177,7 @@ llvm-config = "/usr/bin/llvm-config"
[target.x86_64-unknown-linux-gnu]
llvm-config = "/usr/bin/llvm-config"
-[target.arm-unknown-linux-gnuabi]
-llvm-config = "/usr/bin/llvm-config"
-
-[target.armv7-unknown-linux-gnuabihf]
+[target.arm-unknown-linux-gnueabi]
llvm-config = "/usr/bin/llvm-config"
EOF
@@ -196,45 +192,44 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-if [ "$BARCH" = "i686" ] && [ "$TARCH" = "i586" ] ; then
- # this will cause some messages like:
- # warning: redundant linker flag specified for library `m`
- # but will keep the build from falling over when doing the stage1 compiler
- # linking for the i586 compiler. seems the correct flags don't get passed
- # through and we end up failures like:
- # error: linking with `clang` failed: exit code: 1
- # /tmp/SBo/rustc-1.20.0-src/build/i686-unknown-linux-gnu/stage1-rustc/i586-unknown-linux-gnu/release/deps/librustc_llvm-4ab259c9aed547db.so: undefined reference to `xxx`
- export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi -lrt -ldl -lcurses -lpthread -lz -lm"
-else
- # https://github.com/rust-lang/rust/issues/39880
- # $ llvm-config --system-libs
- # -lrt -ldl -lcurses -lpthread -lz -lm
- export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
-fi
-
export PKG_CONFIG_ALLOW_CROSS=1
if [ "$BARCH" = "i586" ] ; then
# when bootstrapping from i586 (rust already installed), also build a i686
# rustlib
- # from config.toml.example:
+ sed -i 's/^target =.*$/target = ["i686-unknown-linux-gnu"]/' config.toml
+elif [ "$BARCH" = "i686" ] ; then
+ # sigh, full bootstrapping fails on i686 with
+ # /tmp/SBo/rustc-1.21.0-src/build/i686-unknown-linux-gnu/stage2/bin/rustdoc: error while loading shared libraries: librustc_driver-f8bd7e4f77e9a650.so: cannot open shared object file: No such file or directory
+ # maybe this issue:
+ # https://github.com/rust-lang/rust/issues/43289
+ sed -i 's/rpath = false/rpath = true/' config.toml
- # In addition to all host triples, other triples to produce the standard library
- # for. Each host triple will be used to produce a copy of the standard library
- # for each target triple.
- #target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
+ if [ "$TARCH" = "i586" ] ; then
+ # this will cause some messages like:
+ # warning: redundant linker flag specified for library `m`
+ # but will keep the build from falling over when doing the stage1 compiler
+ # linking for the i586 compiler. seems the correct flags don't get passed
+ # through and we end up failures like:
+ # error: linking with `clang` failed: exit code: 1
+ # /tmp/SBo/rustc-1.20.0-src/build/i686-unknown-linux-gnu/stage1-rustc/i586-unknown-linux-gnu/release/deps/librustc_llvm-4ab259c9aed547db.so: undefined reference to `xxx`
+ export RUSTFLAGS="$RUSTFLAGS -C link-args=-lrt -ldl -lcurses -lpthread -lz -lm"
+ fi
+fi
- sed -i 's/^target =.*$/target = ["i686-unknown-linux-gnu"]/' config.toml
+if [ "$ARCH" = "arm" ] ; then
+ python x.py dist
+else
+ # README.md says gcc 4.7 / clang 3.x or later needed
+ # but building fails for me with GCC 5.3 from slackware 14.2
+ CC=clang \
+ CXX=clang++ \
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ python x.py dist
fi
-# README.md says gcc 4.7 / clang 3.x or later needed
-# but building fails for me with GCC 5.3 from slackware 14.2
-CC=clang \
-CXX=clang++ \
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-python x.py build
DESTDIR=$PKG python x.py install
# Eh, none of this is all that big. Might as well leave it around as a
diff --git a/development/rust/rust.info b/development/rust/rust.info
index 72d406a16a794..b912f81653927 100644
--- a/development/rust/rust.info
+++ b/development/rust/rust.info
@@ -1,24 +1,28 @@
PRGNAM="rust"
-VERSION="1.20.0"
+VERSION="1.21.0"
HOMEPAGE="https://www.rust-lang.org"
-DOWNLOAD="https://static.rust-lang.org/dist/rustc-1.20.0-src.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/cargo-0.20.0-i686-unknown-linux-gnu.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-i586-unknown-linux-gnu.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-i686-unknown-linux-gnu.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-i686-unknown-linux-gnu.tar.gz"
-MD5SUM="1d3c5d25d8e6215e7d0b6d4d4c9835b9 \
- 1de2d0fb8e09d3c976ac8d874f158f57 \
- 20462edfd584959cf48d24772fc224ff \
- 7e7d4a768fe05264fc23cb2afef75740 \
- 9711f634011658b451f315916234c88e"
-DOWNLOAD_x86_64="https://static.rust-lang.org/dist/rustc-1.20.0-src.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/cargo-0.20.0-x86_64-unknown-linux-gnu.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/rust-std-1.19.0-x86_64-unknown-linux-gnu.tar.gz \
- https://static.rust-lang.org/dist/2017-07-20/rustc-1.19.0-x86_64-unknown-linux-gnu.tar.gz"
-MD5SUM_x86_64="1d3c5d25d8e6215e7d0b6d4d4c9835b9 \
- 63aa861b029eec9f559f4fb5a10c287d \
- 2bff47764df01c99f349908601c10478 \
- e5077b80cc953a1fb9c767aa039d5984"
+DOWNLOAD="https://static.rust-lang.org/dist/rustc-1.21.0-src.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/cargo-0.21.0-i686-unknown-linux-gnu.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rust-std-1.20.0-i686-unknown-linux-gnu.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rustc-1.20.0-i686-unknown-linux-gnu.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/cargo-0.21.0-arm-unknown-linux-gnueabi.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rust-std-1.20.0-arm-unknown-linux-gnueabi.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rustc-1.20.0-arm-unknown-linux-gnueabi.tar.gz"
+MD5SUM="bc494706b764276613064aad52922f53 \
+ 9e7ceebdd7cd2454b0d0e07dce796905 \
+ 0e17001c04289930733b8d4545f238d4 \
+ c54da2f135f9f64a7c0cf314e9d30976 \
+ 5163845019f29d1847583cc72257b22a \
+ dfb6ca951e7e92ececfb477da9b0527d \
+ 92ab4e04e311ac1c01b015adb0216976"
+DOWNLOAD_x86_64="https://static.rust-lang.org/dist/rustc-1.21.0-src.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/cargo-0.21.0-x86_64-unknown-linux-gnu.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rust-std-1.20.0-x86_64-unknown-linux-gnu.tar.gz \
+ https://static.rust-lang.org/dist/2017-08-31/rustc-1.20.0-x86_64-unknown-linux-gnu.tar.gz"
+MD5SUM_x86_64="bc494706b764276613064aad52922f53 \
+ 0e5389d2e38a14933dda77db8172cb1f \
+ 8c0f7355b66830517a51a2bd6f530327 \
+ c6276176ec6061b61ae73617a64bceb0"
REQUIRES=""
MAINTAINER="Andrew Clemons"
EMAIL="andrew.clemons@gmail.com"