Skip to content

Commit

Permalink
rustc: use LLVM 18
Browse files Browse the repository at this point in the history
Using LLVM 19 causes great difficulty for packagers as it would require
all Rust packages to switch to llvm-19. Revert that change since LLVM 18
can now build Rust 1.83.0 on LoongArch.
  • Loading branch information
MingcongBai committed Dec 24, 2024
1 parent 8d59670 commit 122a2b4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions lang-rust/rustc/autobuild/defines
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
PKGNAME=rustc
PKGEPOCH=1
PKGSEC=devel
PKGDEP="gcc-runtime llvm-runtime-19 http-parser"
BUILDDEP="cmake curl libffi llvm-19 ninja rustc"
PKGDEP="gcc-runtime llvm-runtime-18 http-parser"
BUILDDEP="cmake curl libffi llvm-18 ninja rustc"
PKGDES="General purpose, multi-paradigm programming language (compiler and runtime)"

NOLTO=1
Expand Down
66 changes: 33 additions & 33 deletions lang-rust/rustc/autobuild/prepare
Original file line number Diff line number Diff line change
Expand Up @@ -50,37 +50,37 @@ EOF

# FIXME: Uncomment this if we have the last version built and ready.
#
#abinfo "Using system rustc for bootstrapping ..."
#cat >> "$SRCDIR"/config.toml << EOF
#cargo = "/usr/bin/cargo"
#rustc = "/usr/bin/rustc"
#rustfmt = "/usr/bin/rustfmt"
#EOF
abinfo "Using system rustc for bootstrapping ..."
cat >> "$SRCDIR"/config.toml << EOF
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
rustfmt = "/usr/bin/rustfmt"
EOF

# FIXME: Using local bootstrap tarball as we missed a release - rustc needs
# to bootstrap from an adjacent release.
if ab_match_arch loongson3; then
SRC_PARENT="$(realpath $SRCDIR/..)"

abinfo "Extracting bootstrapped Stage 1 Rust toolchain..."
bsdtar xf "$SRC_PARENT"/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}.tar.xz \
-C "$SRC_PARENT"

abinfo "Copying bootstrapped Stage 1 Rust toolchain ..."
cp -rv "$SRC_PARENT"/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH} \
/opt

if [ ! -e /opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustc ] ; then
abdie "Help! Stage 1 Rust toolchain does not exist in the desired directory."
fi

abinfo "Using local bootstrap binaries ..."
cat >> "$SRCDIR"/config.toml << EOF
cargo = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/cargo"
rustc = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustc"
rustfmt = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustfmt"
EOF
fi
#if ab_match_arch loongson3; then
# SRC_PARENT="$(realpath $SRCDIR/..)"
#
# abinfo "Extracting bootstrapped Stage 1 Rust toolchain..."
# bsdtar xf "$SRC_PARENT"/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}.tar.xz \
# -C "$SRC_PARENT"
#
# abinfo "Copying bootstrapped Stage 1 Rust toolchain ..."
# cp -rv "$SRC_PARENT"/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH} \
# /opt
#
# if [ ! -e /opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustc ] ; then
# abdie "Help! Stage 1 Rust toolchain does not exist in the desired directory."
# fi
#
# abinfo "Using local bootstrap binaries ..."
# cat >> "$SRCDIR"/config.toml << EOF
#cargo = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/cargo"
#rustc = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustc"
#rustfmt = "/opt/rustc-bootstrap-${PKGVER}-${CROSS:-$ARCH}/bin/rustfmt"
#EOF
#fi

if ab_match_arch i486; then
cat >> "$SRCDIR"/config.toml << EOF
Expand Down Expand Up @@ -115,7 +115,7 @@ codegen-units-std = 1
debuginfo-level = 2
EOF
else
cat >> "$SRCDIR"/config.toml << EOF
cat >> "$SRCDIR"/config.toml << EOF
# Working around limited VM space on arm32, i486
codegen-units = 1
codegen-units-std = 1
Expand All @@ -128,22 +128,22 @@ channel = "stable"
rpath = false

[target.${rust_target}]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
llvm-config = "/usr/lib/llvm-18/bin/llvm-config"
EOF

if ab_match_arch i486; then
cat >> "$SRCDIR"/config.toml << EOF
[target.i686-unknown-linux-gnu]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
llvm-config = "/usr/lib/llvm-18/bin/llvm-config"
EOF
fi

if ab_match_arch armv7hf; then
cat >> "$SRCDIR"/config.toml << EOF
[target.thumbv7neon-unknown-linux-gnueabihf]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
llvm-config = "/usr/lib/llvm-18/bin/llvm-config"

[target.armv7-unknown-linux-gnueabihf]
llvm-config = "/usr/lib/llvm-19/bin/llvm-config"
llvm-config = "/usr/lib/llvm-18/bin/llvm-config"
EOF
fi
12 changes: 6 additions & 6 deletions lang-rust/rustc/spec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
VER=1.83.0

# Note: Uncomment this if we have the last version built and ready.
#SRCS="tbl::https://static.rust-lang.org/dist/rustc-${VER}-src.tar.xz"
#CHKSUMS="sha256::7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df"
SRCS="tbl::https://static.rust-lang.org/dist/rustc-${VER}-src.tar.xz"
CHKSUMS="sha256::7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df"

# FIXME: Using local bootstrap tarball as we missed a release - rustc needs
# to bootstrap from an adjacent release.
#
# Comment the following segment if this is not the case.
SRCS="tbl::https://static.rust-lang.org/dist/rustc-${VER}-src.tar.xz \
tbl::rename=rustc-bootstrap-${VER}-loongson3.tar.xz::https://repo.aosc.io/aosc-repacks/rust-loongson3/rustc-bootstrap-${VER}-loongson3.tar.xz"
CHKSUMS="sha256::7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df \
sha256::c8bad5abe44f459fd7983a66337543952fea756fcfa73ddd10a869c4c753c336"
#SRCS="tbl::https://static.rust-lang.org/dist/rustc-${VER}-src.tar.xz \
# tbl::rename=rustc-bootstrap-${VER}-loongson3.tar.xz::https://repo.aosc.io/aosc-repacks/rust-loongson3/rustc-bootstrap-${VER}-loongson3.tar.xz"
#CHKSUMS="sha256::7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df \
# sha256::c8bad5abe44f459fd7983a66337543952fea756fcfa73ddd10a869c4c753c336"

CHKUPDATE="anitya::id=7635"
SUBDIR="rustc-${VER}-src"

0 comments on commit 122a2b4

Please sign in to comment.