rust: update to 1.84.1

This commit is contained in:
tranzystorekk 2025-01-09 21:46:06 +01:00
parent 1c9977ea4d
commit 1005ae10e6
8 changed files with 119 additions and 79 deletions

View File

@ -6,14 +6,14 @@ Subject: [PATCH 02/15] Remove -nostdlib and musl_root from musl targets
extended by various void contributors to match our musl setup
diff --git a/compiler/rustc_target/src/spec/base/linux_musl.rs b/compiler/rustc_target/src/spec/base/linux_musl.rs
index 42aa1e1a6..c7d0433bb 100644
index e020bb8523..7b0cc7b556 100644
--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -1,15 +1,9 @@
-use crate::spec::{base, crt_objects, LinkSelfContainedDefault, TargetOptions};
-use crate::spec::{LinkSelfContainedDefault, TargetOptions, base, crt_objects};
+use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
pub(crate) fn opts() -> TargetOptions {
let mut base = base::linux::opts();
base.env = "musl".into();
@ -27,7 +27,7 @@ index 42aa1e1a6..c7d0433bb 100644
base
}
diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
index e3b6430a4..13a96e2cb 100644
index e3b6430a46..13a96e2cb7 100644
--- a/compiler/rustc_target/src/spec/crt_objects.rs
+++ b/compiler/rustc_target/src/spec/crt_objects.rs
@@ -62,28 +62,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects {
@ -60,10 +60,10 @@ index e3b6430a4..13a96e2cb 100644
new(&[
(LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]),
diff --git a/config.example.toml b/config.example.toml
index f1dc32234..462a86f5b 100644
index d3233ad17b..8c1c336ea5 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -599,14 +599,6 @@
@@ -627,14 +627,6 @@
# behavior -- this may lead to miscompilations or other bugs.
#description = ""
@ -79,10 +79,10 @@ index f1dc32234..462a86f5b 100644
# platforms to ensure that the compiler is usable by default from the build
# directory (as it links to a number of dynamic libraries). This may not be
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index 768aac912..6aebd9189 100755
index 70f4e70962..51e33251b2 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -99,34 +99,6 @@ v("llvm-config", None, "set path to llvm-config")
@@ -102,34 +102,6 @@ v("llvm-config", None, "set path to llvm-config")
v("llvm-filecheck", None, "set path to LLVM's FileCheck utility")
v("python", "build.python", "set path to python")
v("android-ndk", "build.android-ndk", "set path to Android NDK")
@ -118,10 +118,10 @@ index 768aac912..6aebd9189 100755
"riscv32gc-unknown-linux-musl install directory")
v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root",
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
index edf18e2eb..7597d6cd2 100644
index 8e088682f9..2ea50a068f 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -372,39 +372,7 @@ fn copy_self_contained_objects(
@@ -352,39 +352,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
// Copies the libc and CRT objects.
@ -162,7 +162,7 @@ index edf18e2eb..7597d6cd2 100644
let srcdir = builder.wasi_libdir(target).unwrap_or_else(|| {
panic!(
"Target {:?} does not have a \"wasi-root\" key in Config.toml \
@@ -566,15 +534,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
@@ -546,15 +514,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
.arg(builder.src.join("library/sysroot/Cargo.toml"));
@ -179,10 +179,10 @@ index edf18e2eb..7597d6cd2 100644
if let Some(dir) = builder.wasi_libdir(target) {
let root = format!("native={}", dir.to_str().unwrap());
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index bdfee55d8..18db92320 100644
index e706aba977..b876972c0a 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -321,7 +321,6 @@ pub struct Config {
@@ -346,7 +346,6 @@ pub struct Config {
pub print_step_rusage: bool,
// Fallback musl-root for all targets
@ -190,7 +190,7 @@ index bdfee55d8..18db92320 100644
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
@@ -582,8 +581,6 @@ pub struct Target {
@@ -620,8 +619,6 @@ pub struct Target {
pub profiler: Option<StringOrBool>,
pub rpath: Option<bool>,
pub crt_static: Option<bool>,
@ -199,7 +199,7 @@ index bdfee55d8..18db92320 100644
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub runner: Option<String>,
@@ -1104,7 +1101,6 @@ define_config! {
@@ -1151,7 +1148,6 @@ define_config! {
default_linker: Option<String> = "default-linker",
channel: Option<String> = "channel",
description: Option<String> = "description",
@ -207,7 +207,7 @@ index bdfee55d8..18db92320 100644
rpath: Option<bool> = "rpath",
strip: Option<bool> = "strip",
frame_pointers: Option<bool> = "frame-pointers",
@@ -1158,8 +1154,6 @@ define_config! {
@@ -1206,8 +1202,6 @@ define_config! {
profiler: Option<StringOrBool> = "profiler",
rpath: Option<bool> = "rpath",
crt_static: Option<bool> = "crt-static",
@ -216,23 +216,23 @@ index bdfee55d8..18db92320 100644
wasi_root: Option<String> = "wasi-root",
qemu_rootfs: Option<String> = "qemu-rootfs",
no_std: Option<bool> = "no-std",
@@ -1632,7 +1626,6 @@ impl Config {
@@ -1736,7 +1730,6 @@ impl Config {
default_linker,
channel,
channel: _, // already handled above
description,
- musl_root,
rpath,
verbose_tests,
optimize_tests,
@@ -1722,7 +1715,6 @@ impl Config {
config.rustc_parallel =
parallel_compiler.unwrap_or(config.channel == "dev" || config.channel == "nightly");
@@ -1822,7 +1815,6 @@ impl Config {
config.llvm_enzyme =
llvm_enzyme.unwrap_or(config.channel == "dev" || config.channel == "nightly");
config.rustc_default_linker = default_linker;
- config.musl_root = musl_root.map(PathBuf::from);
config.save_toolstates = save_toolstates.map(PathBuf::from);
set(
&mut config.deny_warnings,
@@ -1973,8 +1965,6 @@ impl Config {
set(&mut config.deny_warnings, match flags.warnings {
Warnings::Deny => Some(true),
@@ -2044,8 +2036,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@ -241,8 +241,8 @@ index bdfee55d8..18db92320 100644
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
target.runner = cfg.runner;
@@ -2919,7 +2909,6 @@ fn check_incompatible_options_for_ci_rustc(
split_debuginfo: _,
@@ -3123,7 +3113,6 @@ fn check_incompatible_options_for_ci_rustc(
debuginfo_level_tests: _,
backtrace: _,
parallel_compiler: _,
- musl_root: _,
@ -250,7 +250,7 @@ index bdfee55d8..18db92320 100644
optimize_tests: _,
codegen_tests: _,
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index 60ec57d0d..31b411259 100644
index fabb4f2b13..7246668378 100644
--- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/src/core/sanity.rs
@@ -11,7 +11,7 @@
@ -260,9 +260,9 @@ index 60ec57d0d..31b411259 100644
-use std::{env, fs};
+use std::env;
use crate::Build;
#[cfg(not(feature = "bootstrap-self-test"))]
use crate::builder::Builder;
@@ -325,28 +325,6 @@ than building it.
@@ -326,28 +326,6 @@ than building it.
continue;
}
@ -292,10 +292,10 @@ index 60ec57d0d..31b411259 100644
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 82b640f54..d906d2186 100644
index c384fd6bf4..cadb129e2c 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1282,25 +1282,6 @@ Executed at: {executed_at}"#,
@@ -1307,25 +1307,6 @@ Executed at: {executed_at}"#,
}
}
@ -322,10 +322,10 @@ index 82b640f54..d906d2186 100644
/// configured.
///
diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
index 29e6b74aa..a32fddbac 100644
index 0df0046945..f044b1791e 100644
--- a/src/bootstrap/src/utils/cc_detect.rs
+++ b/src/bootstrap/src/utils/cc_detect.rs
@@ -197,30 +197,6 @@ fn default_compiler(
@@ -210,30 +210,6 @@ fn default_compiler(
}
}

View File

@ -7,16 +7,19 @@ stage 2 tools are the ones that are distributed, and we distribute
them together with the rust libs so there is no need to worry
about unstable ABI
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index cd276674d..4741cd11b 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -2062,6 +2062,8 @@ impl<'a> Builder<'a> {
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 0688a1d..e09164d 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -1148,8 +1148,9 @@ impl Builder<'_> {
// linking all deps statically into the dylib.
if matches!(mode, Mode::Std | Mode::Rustc) {
if matches!(mode, Mode::Std) {
rustflags.arg("-Cprefer-dynamic");
+ } else if stage >= 2 {
- }
- if matches!(mode, Mode::Rustc) && !self.link_std_into_rustc_driver(target) {
+ } else if matches!(mode, Mode::Rustc) && !self.link_std_into_rustc_driver(target) {
+ rustflags.arg("-Cprefer-dynamic");
+ } else if stage >= 2 {
rustflags.arg("-Cprefer-dynamic");
}
// When building incrementally we default to a lower ThinLTO import limit

View File

@ -3,11 +3,11 @@ From: q66 <daniel@octaforge.org>
Date: Sun, 3 May 2020 18:02:03 +0200
Subject: [PATCH 10/15] Fix dynamic linkage of musl libc for the libc crate
diff --git a/vendor/libc-0.2.157/src/unix/mod.rs b/vendor/libc-0.2.157/src/unix/mod.rs
index 8b3d988ae..b4ab3db3f 100644
--- a/vendor/libc-0.2.157/src/unix/mod.rs
+++ b/vendor/libc-0.2.157/src/unix/mod.rs
@@ -347,7 +347,14 @@ cfg_if! {
diff --git a/vendor/libc-0.2.162/src/unix/mod.rs b/vendor/libc-0.2.162/src/unix/mod.rs
index d26d905355..b6b59e38d0 100644
--- a/vendor/libc-0.2.162/src/unix/mod.rs
+++ b/vendor/libc-0.2.162/src/unix/mod.rs
@@ -384,7 +384,14 @@ cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}
@ -23,11 +23,11 @@ index 8b3d988ae..b4ab3db3f 100644
#[cfg_attr(feature = "rustc-dep-of-std",
link(name = "c", kind = "static", modifiers = "-bundle",
cfg(target_feature = "crt-static")))]
diff --git a/vendor/libc-0.2.158/src/unix/mod.rs b/vendor/libc-0.2.158/src/unix/mod.rs
index 8b3d988ae..b4ab3db3f 100644
--- a/vendor/libc-0.2.158/src/unix/mod.rs
+++ b/vendor/libc-0.2.158/src/unix/mod.rs
@@ -347,7 +347,14 @@ cfg_if! {
diff --git a/vendor/libc-0.2.164/src/unix/mod.rs b/vendor/libc-0.2.164/src/unix/mod.rs
index db60f8ef29..fd506f7d56 100644
--- a/vendor/libc-0.2.164/src/unix/mod.rs
+++ b/vendor/libc-0.2.164/src/unix/mod.rs
@@ -384,7 +384,14 @@ cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "c", cfg(not(target_feature = "crt-static")))]
extern {}

View File

@ -8,10 +8,10 @@ LLVM. While this is not perfect (it does not allow rustc to compile legacy
binaries), rustc never requests specific ABI from llvm in the first place,
so at least match the environment we have.
diff --git a/compiler/rustc_target/src/abi/call/powerpc64.rs b/compiler/rustc_target/src/abi/call/powerpc64.rs
index 749eea0ef..1dfa3cbd0 100644
--- a/compiler/rustc_target/src/abi/call/powerpc64.rs
+++ b/compiler/rustc_target/src/abi/call/powerpc64.rs
diff --git a/compiler/rustc_target/src/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs
index 71e533b8cc..24beb8254c 100644
--- a/compiler/rustc_target/src/callconv/powerpc64.rs
+++ b/compiler/rustc_target/src/callconv/powerpc64.rs
@@ -3,7 +3,7 @@
// need to be fixed when PowerPC vector support is added.
@ -21,12 +21,14 @@ index 749eea0ef..1dfa3cbd0 100644
use crate::spec::HasTargetSpec;
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -91,14 +91,7 @@ where
@@ -99,16 +99,7 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec,
{
- let abi = if cx.target_spec().env == "musl" {
- ELFv2
- } else if cx.target_spec().os == "aix" {
- AIX
- } else {
- match cx.data_layout().endian {
- Endian::Big => ELFv1,

View File

@ -5,11 +5,11 @@ Subject: [PATCH 12/15] bootstrap: Disable initial-exec TLS model on powerpc
Fixes #81334.
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index cd276674d..9ec0c3210 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1844,7 +1844,7 @@ impl<'a> Builder<'a> {
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 0688a1d689..a57df11344 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -956,7 +956,7 @@ impl Builder<'_> {
// efficient initial-exec TLS model. This doesn't work with `dlopen`,
// so we can't use it by default in general, but we can use it for tools
// and our own internal libraries.

View File

@ -6,11 +6,11 @@ Subject: [PATCH 13/15] allow specifying native sysroot to use for linkage
This allows us to get around the linker attempting to use
incompatible libs.
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 7f93fdc72..f52644b57 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -2429,6 +2429,10 @@ impl Cargo {
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 0688a1d689..1b65ce6395 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -251,6 +251,10 @@ impl Cargo {
self.hostflags.arg(&arg);
}
@ -20,12 +20,12 @@ index 7f93fdc72..f52644b57 100644
+
if let Some(target_linker) = builder.linker(target) {
let target = crate::envify(&target.triple);
self.command.env(&format!("CARGO_TARGET_{target}_LINKER"), target_linker);
self.command.env(format!("CARGO_TARGET_{target}_LINKER"), target_linker);
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 3e1bc9a9a..e0038b9ac 100644
index e706aba977..c4fbbbb514 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -575,6 +575,7 @@ pub struct Target {
@@ -616,6 +616,7 @@ pub struct Target {
pub default_linker: Option<PathBuf>,
pub linker: Option<PathBuf>,
pub split_debuginfo: Option<SplitDebuginfo>,
@ -33,7 +33,7 @@ index 3e1bc9a9a..e0038b9ac 100644
pub sanitizers: Option<bool>,
pub profiler: Option<StringOrBool>,
pub rpath: Option<bool>,
@@ -1135,6 +1136,7 @@ define_config! {
@@ -1198,6 +1199,7 @@ define_config! {
default_linker: Option<PathBuf> = "default-linker",
linker: Option<String> = "linker",
split_debuginfo: Option<String> = "split-debuginfo",
@ -41,7 +41,7 @@ index 3e1bc9a9a..e0038b9ac 100644
llvm_config: Option<String> = "llvm-config",
llvm_has_rust_patches: Option<bool> = "llvm-has-rust-patches",
llvm_filecheck: Option<String> = "llvm-filecheck",
@@ -1875,6 +1877,7 @@ impl Config {
@@ -2043,6 +2045,7 @@ impl Config {
target.ar = cfg.ar.map(PathBuf::from);
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
@ -50,10 +50,10 @@ index 3e1bc9a9a..e0038b9ac 100644
target.musl_root = cfg.musl_root.map(PathBuf::from);
target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 5ed6b357e..0d4392dd8 100644
index c384fd6bf4..e9125cba3f 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1318,6 +1318,10 @@ impl Build {
@@ -1306,6 +1306,10 @@ Executed at: {executed_at}"#,
self.config.target_config.get(&target).and_then(|t| t.crt_static)
}
}

View File

@ -0,0 +1,34 @@
From 139d6ba054a1a4cc5fe64981ad46fd5547bd4916 Mon Sep 17 00:00:00 2001
From: onur-ozkan <work@onurozkan.dev>
Date: Thu, 30 Jan 2025 16:51:08 +0000
Subject: [PATCH] set rustc dylib on manually constructed rustc command
Signed-off-by: onur-ozkan <work@onurozkan.dev>
---
src/bootstrap/src/core/builder/cargo.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 1b413dcb07efb..79a65aedd9edb 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -653,7 +653,10 @@ impl Builder<'_> {
// Build proc macros both for the host and the target unless proc-macros are not
// supported by the target.
if target != compiler.host && cmd_kind != Kind::Check {
- let error = command(self.rustc(compiler))
+ let mut rustc_cmd = command(self.rustc(compiler));
+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
+
+ let error = rustc_cmd
.arg("--target")
.arg(target.rustc_target_arg())
.arg("--print=file-names")
@@ -661,6 +664,7 @@ impl Builder<'_> {
.arg("-")
.run_capture(self)
.stderr();
+
let not_supported = error
.lines()
.any(|line| line.contains("unsupported crate type `proc-macro`"));

View File

@ -8,9 +8,8 @@
# uploaded to https://repo-default.voidlinux.org/distfiles/
#
pkgname=rust
reverts="1.83.0_1"
version=1.82.0
revision=3
version=1.84.1
revision=1
_llvmver=19
hostmakedepends="curl pkg-config python3 tar cargo-bootstrap"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm${_llvmver}-devel"
@ -20,7 +19,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="Apache-2.0 OR MIT"
homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
checksum=7c53f4509eda184e174efa6ba7d5eeb586585686ce8edefc781a2b11a7cf512a
checksum=5e2fb5d49628a549f7671b2ccf9855ab379fd442831a7c2af16e0cdcc31bb375
lib32disabled=yes
make_check=no # CBA for now
python_version=3 # needed for python files in rust-src
@ -60,8 +59,8 @@ post_patch() {
fi
# clear out all the checksum nonsense of patched vendor crates
_clear_vendor_checksums libc-0.2.157
_clear_vendor_checksums libc-0.2.158
_clear_vendor_checksums libc-0.2.162
_clear_vendor_checksums libc-0.2.164
# pre-configure 01-override-config overwrites vendor files
_clear_vendor_checksums onig_sys-69.8.1
@ -117,6 +116,7 @@ do_configure() {
--enable-verbose-tests \
--disable-full-bootstrap \
--enable-extended \
--enable-profiler \
--disable-codegen-tests \
--disable-dist-src \
--${_llvm_shared}-llvm-link-shared \
@ -140,6 +140,7 @@ do_configure() {
--set="rust.incremental=false" \
--set="rust.parallel-compiler=false" \
--set="rust.jemalloc=false" \
--set="rust.llvm-tools=false" \
--set="build.submodules=false" \
--set="build.rustc=/usr/bin/rustc" \
--set="build.cargo=/usr/bin/cargo" \