summaryrefslogtreecommitdiffstats
path: root/source/d/rust
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/rust')
-rw-r--r--source/d/rust/0004-compiler-Use-wasm-ld-for-wasm-targets.patch24
-rwxr-xr-xsource/d/rust/rust.SlackBuild45
-rw-r--r--source/d/rust/rust.url10
3 files changed, 64 insertions, 15 deletions
diff --git a/source/d/rust/0004-compiler-Use-wasm-ld-for-wasm-targets.patch b/source/d/rust/0004-compiler-Use-wasm-ld-for-wasm-targets.patch
new file mode 100644
index 000000000..352889919
--- /dev/null
+++ b/source/d/rust/0004-compiler-Use-wasm-ld-for-wasm-targets.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
+Date: Sat, 6 Nov 2021 22:42:06 +0100
+Subject: [PATCH] compiler: Use wasm-ld for wasm targets
+
+We don't ship rust-lld.
+---
+ compiler/rustc_target/src/spec/base/wasm.rs | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
+index 4b4d2aca26e4..b4918c8fdda2 100644
+--- a/compiler/rustc_target/src/spec/base/wasm.rs
++++ b/compiler/rustc_target/src/spec/base/wasm.rs
+@@ -88,8 +88,7 @@ macro_rules! args {
+ // arguments just yet
+ limit_rdylib_exports: false,
+
+- // we use the LLD shipped with the Rust toolchain by default
+- linker: Some("rust-lld".into()),
++ linker: Some("wasm-ld".into()),
+ linker_flavor: LinkerFlavor::WasmLld(Cc::No),
+
+ pre_link_args,
diff --git a/source/d/rust/rust.SlackBuild b/source/d/rust/rust.SlackBuild
index 0000ae3a9..6c398d95b 100755
--- a/source/d/rust/rust.SlackBuild
+++ b/source/d/rust/rust.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2017 Andrew Clemons, Wellington, New Zealand
-# Copyright 2017, 2018, 2019, 2020, 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2017, 2018, 2019, 2020, 2021, 2022, 2023 Patrick J. Volkerding, Sebeka, Minnesota, USA
# Copyright 2017 Stuart Winter
# All rights reserved.
#
@@ -26,17 +26,17 @@ cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=rust
SRCNAM="${PKGNAM}c"
-VERSION=${VERSION:-1.55.0}
+VERSION=${VERSION:-1.77.2}
BUILD=${BUILD:-1}
# Set this to YES to build with the system LLVM, or NO to use the bundled LLVM.
# YES is probably better (when it works...)
-SYSTEM_LLVM=${SYSTEM_LLVM:-YES}
+SYSTEM_LLVM=${SYSTEM_LLVM:-NO}
# Bootstrap variables (might not be kept updated for latest Rust):
-RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.54.0}
-RSTAGE0_DIR=${RSTAGE0_DIR:-2021-07-29}
-CSTAGE0_VERSION=${CSTAGE0_VERSION:-1.54.0}
+RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.76.0}
+RSTAGE0_DIR=${RSTAGE0_DIR:-2024-02-08}
+CSTAGE0_VERSION=${CSTAGE0_VERSION:-1.76.0}
CSTAGE0_DIR=${CSTAGE0_DIR:-$RSTAGE0_DIR}
# Automatically determine the architecture we're building on:
@@ -111,7 +111,7 @@ else
fi
TMP=${TMP:-/tmp}
-OUTPUT=${OUTPUT:-/tmp}
+OUTPUT=${OUTPUT:-$TMP}
PKG=$TMP/package-$PKGNAM
# Not needed, as the build will automatically use as many jobs as there are
@@ -134,7 +134,8 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$VERSION-src
-tar xvf $CWD/$SRCNAM-$VERSION-src.tar.?z || exit 1
+echo "Extracting $CWD/$SRCNAM-$VERSION-src.tar.?z..."
+tar xf $CWD/$SRCNAM-$VERSION-src.tar.?z || exit 1
cd $SRCNAM-$VERSION-src || exit 1
# Link with -lffi in case of using system LLVM:
@@ -142,6 +143,8 @@ if [ "${SYSTEM_LLVM}" = "YES" ]; then
zcat $CWD/link_libffi.diff.gz | patch -p1 --verbose || exit 1
fi
+cat $CWD/0004-compiler-Use-wasm-ld-for-wasm-targets.patch | patch -p1 --verbose || exit 1
+
if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
# rust requires bootstrapping with the previous rust version.
# versions are defined in src/stage0.txt.
@@ -163,7 +166,7 @@ link-shared = true
build = "$BARCH-unknown-linux-$BABI"
host = ["$TARCH-unknown-linux-$BABI"]
target = ["$TARCH-unknown-linux-$BABI"]
-tools = ["analysis", "cargo", "clippy", "rls", "rustfmt", "src"]
+tools = ["analysis", "cargo", "clippy", "rls", "rustfmt", "src", "rust-analyzer", "rust-demangler"]
submodules = false
vendor = true
extended = true
@@ -179,7 +182,6 @@ codegen-units = 0
channel = "stable"
rpath = false
codegen-tests = false
-ignore-git = true
EOF
@@ -230,10 +232,29 @@ elif [ "$BARCH" = "i686" ] ; then
fi
fi
+# Fix path to the rust libraries in rust-analyzer:
+if [ -r src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs ]; then
+ if [ ! "$LIBDIRSUFFIX" = "" ]; then
+ sed -i "s,\"lib/rustlib,\"lib${LIBDIRSUFFIX}/rustlib,g" src/tools/rust-analyzer/crates/project-model/src/sysroot.rs
+ fi
+fi
+
# Build and install:
python3 ./x.py build || exit 1
DESTDIR=$PKG python3 x.py install || exit 1
+# In case the rls stub doesn't get installed by the 'install' target:
+if [ ! -x $PKG/usr/bin/rls ]; then
+ install -m755 build/*-linux-gnu/stage1-tools-bin/rls $PKG/usr/bin/rls
+fi
+
+# Fix path to lldb_commands:
+if [ -x $PKG/usr/bin/rust-lldb ]; then
+ if [ ! "$LIBDIRSUFFIX" = "" ]; then
+ sed -i "s,/lib/rustlib/,/lib$LIBDIRSUFFIX/rustlib/,g" $PKG/usr/bin/rust-lldb
+ fi
+fi
+
# Eh, none of this is all that big. Might as well leave it around as a
# reference.
#rm -f $PKG/usr/lib$LIBDIRSUFFIX/rustlib/components
@@ -264,6 +285,10 @@ find $PKG/usr/lib$LIBDIRSUFFIX -name "*.so" -exec chmod 755 "{}" \+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# Get rid of possible .old files in these locations:
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.old
+rm -f $PKG/usr/bin/*.old
+
# Commented out (for now) since we disable rpaths in config.toml:
## Remove any compiled-in RPATHs:
#find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
diff --git a/source/d/rust/rust.url b/source/d/rust/rust.url
index 1f4a237b6..d7fc4bf62 100644
--- a/source/d/rust/rust.url
+++ b/source/d/rust/rust.url
@@ -1,5 +1,5 @@
# Source code (repacked to .tar.lz):
-VERSION=1.55.0
+VERSION=1.77.2
rm -f rustc-${VERSION}-src.tar.*
lftpget https://static.rust-lang.org/dist/rustc-${VERSION}-src.tar.gz
lftpget https://static.rust-lang.org/dist/rustc-${VERSION}-src.tar.gz.asc
@@ -17,12 +17,12 @@ fi
# should be able to compile the next released version of Rust.
#
# To find the expected date/versions for bootstrap binaries to be able to
-# update the settings below, look at src/stage0.txt in the Rust sources.
+# update the settings below, look at src/stage0.json in the Rust sources.
exit 0
-BOOTSTRAP_DATE=2021-07-29
-BOOTSTRAP_CARGO=1.54.0
-BOOTSTRAP_VERSION=1.54.0
+BOOTSTRAP_DATE=2024-02-08
+BOOTSTRAP_VERSION=1.76.0
+BOOTSTRAP_CARGO=$BOOTSTRAP_VERSION
# i686 bootstrap:
lftpget https://static.rust-lang.org/dist/${BOOTSTRAP_DATE}/cargo-${BOOTSTRAP_CARGO}-i686-unknown-linux-gnu.tar.xz