rust: update to 1.86.0

This commit is contained in:
tranzystorekk 2025-04-03 16:09:30 +02:00
parent a88b0e170a
commit e60599a667
6 changed files with 47 additions and 88 deletions

View file

@ -4,16 +4,16 @@ Date: Fri, 8 Sep 2017 00:04:29 -0500
Subject: [PATCH 01/15] Fix LLVM build
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 33b8f1a7c..f4942dd2d 100644
index 21b02a3b5..01b99f3e2 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1195,7 +1195,8 @@ impl Build {
.args()
@@ -1209,7 +1209,8 @@ Executed at: {executed_at}"#,
base.args()
.iter()
.map(|s| s.to_string_lossy().into_owned())
- .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
+ .filter(|s| !s.starts_with("-O") && !s.starts_with("/O")
+ && !s.starts_with("-static"))
.collect::<Vec<String>>();
.collect::<Vec<String>>()
}
// If we're compiling C++ on macOS then we add a flag indicating that

View file

@ -97,10 +97,10 @@ index 22e49f2f1..28a954758 100644
},
}
diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
index 6ba87c732..b805b80b8 100644
index 3d25c951e..f509c9825 100644
--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
+++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
@@ -6,8 +6,6 @@ pub(crate) fn target() -> Target {
@@ -9,8 +9,6 @@ pub(crate) fn target() -> Target {
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-melf_i386"]);
base.stack_probes = StackProbeType::Inline;
@ -123,10 +123,10 @@ index 8dcdc5be8..8be0f335d 100644
Target {
llvm_target: "x86_64-unknown-linux-musl".into(),
diff --git a/config.example.toml b/config.example.toml
index 5ea6774ce..ed0da89d7 100644
index f5395375a..3aa6e21ac 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -629,14 +629,6 @@
@@ -625,14 +625,6 @@
# behavior -- this may lead to miscompilations or other bugs.
#description = ""
@ -142,10 +142,10 @@ index 5ea6774ce..ed0da89d7 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 a86c20d46..9358154de 100755
index ac971a64d..f7367c8da 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -175,76 +175,6 @@ v("llvm-config", None, "set path to llvm-config")
@@ -179,76 +179,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")
@ -223,10 +223,10 @@ index a86c20d46..9358154de 100755
"musl-root-powerpc64le",
"target.powerpc64le-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 eeb5b18fd..4ee47e7c4 100644
index 479327d63..115b3eb0a 100644
--- a/src/bootstrap/src/core/build_steps/compile.rs
+++ b/src/bootstrap/src/core/build_steps/compile.rs
@@ -331,39 +331,7 @@ fn copy_self_contained_objects(
@@ -333,39 +333,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![];
// Copies the libc and CRT objects.
@ -236,7 +236,7 @@ index eeb5b18fd..4ee47e7c4 100644
- // to using gcc from a glibc-targeting toolchain for linking.
- // To do that we have to distribute musl startup objects as a part of Rust toolchain
- // and link with them manually in the self-contained mode.
- if target.contains("musl") && !target.contains("unikraft") {
- if target.needs_crt_begin_end() {
- let srcdir = builder.musl_libdir(target).unwrap_or_else(|| {
- panic!("Target {:?} does not have a \"musl-libdir\" key", target.triple)
- });
@ -267,7 +267,7 @@ index eeb5b18fd..4ee47e7c4 100644
let srcdir = builder.wasi_libdir(target).unwrap_or_else(|| {
panic!(
"Target {:?} does not have a \"wasi-root\" key in Config.toml \
@@ -530,15 +498,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
@@ -573,15 +541,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path")
.arg(builder.src.join("library/sysroot/Cargo.toml"));
@ -284,10 +284,10 @@ index eeb5b18fd..4ee47e7c4 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 0587408e9..ad3b1c374 100644
index 65f286a05..f12d57b14 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -346,7 +346,6 @@ pub struct Config {
@@ -350,7 +350,6 @@ pub struct Config {
pub print_step_rusage: bool,
// Fallback musl-root for all targets
@ -295,7 +295,7 @@ index 0587408e9..ad3b1c374 100644
pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>,
@@ -627,8 +626,6 @@ pub struct Target {
@@ -635,8 +634,6 @@ pub struct Target {
pub profiler: Option<StringOrBool>,
pub rpath: Option<bool>,
pub crt_static: Option<bool>,
@ -304,7 +304,7 @@ index 0587408e9..ad3b1c374 100644
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub runner: Option<String>,
@@ -1157,7 +1154,6 @@ define_config! {
@@ -1171,7 +1168,6 @@ define_config! {
default_linker: Option<String> = "default-linker",
channel: Option<String> = "channel",
description: Option<String> = "description",
@ -312,7 +312,7 @@ index 0587408e9..ad3b1c374 100644
rpath: Option<bool> = "rpath",
strip: Option<bool> = "strip",
frame_pointers: Option<bool> = "frame-pointers",
@@ -1212,8 +1208,6 @@ define_config! {
@@ -1226,8 +1222,6 @@ define_config! {
profiler: Option<StringOrBool> = "profiler",
rpath: Option<bool> = "rpath",
crt_static: Option<bool> = "crt-static",
@ -321,7 +321,7 @@ index 0587408e9..ad3b1c374 100644
wasi_root: Option<String> = "wasi-root",
qemu_rootfs: Option<String> = "qemu-rootfs",
no_std: Option<bool> = "no-std",
@@ -1758,7 +1752,6 @@ impl Config {
@@ -1821,7 +1815,6 @@ impl Config {
default_linker,
channel: _, // already handled above
description,
@ -329,15 +329,15 @@ index 0587408e9..ad3b1c374 100644
rpath,
verbose_tests,
optimize_tests,
@@ -1866,7 +1859,6 @@ impl Config {
@@ -1929,7 +1922,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, match flags.warnings {
Warnings::Deny => Some(true),
@@ -2088,8 +2080,6 @@ impl Config {
set(
&mut config.deny_warnings,
@@ -2152,8 +2144,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static;
@ -346,7 +346,7 @@ index 0587408e9..ad3b1c374 100644
target.wasi_root = cfg.wasi_root.map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
target.runner = cfg.runner;
@@ -3212,7 +3202,6 @@ fn check_incompatible_options_for_ci_rustc(
@@ -3295,7 +3285,6 @@ fn check_incompatible_options_for_ci_rustc(
debuginfo_level_tools: _,
debuginfo_level_tests: _,
backtrace: _,
@ -355,7 +355,7 @@ index 0587408e9..ad3b1c374 100644
optimize_tests: _,
codegen_tests: _,
diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index ed0155622..9873a6c09 100644
index 9e4a0816e..36c3b5901 100644
--- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/src/core/sanity.rs
@@ -11,7 +11,7 @@
@ -367,7 +367,7 @@ index ed0155622..9873a6c09 100644
use crate::Build;
#[cfg(not(test))]
@@ -321,28 +321,6 @@ than building it.
@@ -325,28 +325,6 @@ than building it.
continue;
}
@ -375,7 +375,7 @@ index ed0155622..9873a6c09 100644
- if target.contains("musl") && !target.contains("unikraft") {
- // If this is a native target (host is also musl) and no musl-root is given,
- // fall back to the system toolchain in /usr before giving up
- if build.musl_root(*target).is_none() && build.config.build == *target {
- if build.musl_root(*target).is_none() && build.is_builder_target(target) {
- let target = build.config.target_config.entry(*target).or_default();
- target.musl_root = Some("/usr".into());
- }
@ -397,10 +397,10 @@ index ed0155622..9873a6c09 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 ccc115a27..7cc8cc0c5 100644
index 21b02a3b5..491d924d4 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1283,25 +1283,6 @@ Executed at: {executed_at}"#,
@@ -1322,25 +1322,6 @@ Executed at: {executed_at}"#,
}
}
@ -427,10 +427,10 @@ index ccc115a27..7cc8cc0c5 100644
/// configured.
///
diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
index 4aec554b4..211efb6e3 100644
index 45797c127..12393b659 100644
--- a/src/bootstrap/src/utils/cc_detect.rs
+++ b/src/bootstrap/src/utils/cc_detect.rs
@@ -220,30 +220,6 @@ fn default_compiler(
@@ -210,30 +210,6 @@ fn default_compiler(
}
}

View file

@ -9,19 +9,19 @@ 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/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs
index 3a71592cb..24beb8254 100644
index 89ec85e4b..003be5d6f 100644
--- a/compiler/rustc_target/src/callconv/powerpc64.rs
+++ b/compiler/rustc_target/src/callconv/powerpc64.rs
@@ -3,7 +3,7 @@
@@ -2,7 +2,7 @@
// Alignment of 128 bit types is not currently handled, this will
// need to be fixed when PowerPC vector support is added.
use crate::abi::call::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
-use crate::abi::{Endian, HasDataLayout, TyAbiInterface};
+use crate::abi::{HasDataLayout, TyAbiInterface};
use crate::spec::HasTargetSpec;
-use rustc_abi::{Endian, HasDataLayout, TyAbiInterface};
+use rustc_abi::{HasDataLayout, TyAbiInterface};
#[derive(Debug, Clone, Copy, PartialEq)]
@@ -99,16 +99,7 @@ where
use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
use crate::spec::HasTargetSpec;
@@ -102,16 +102,7 @@ where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout + HasTargetSpec,
{

View file

@ -4,25 +4,18 @@ Date: Fri, 16 Apr 2021 03:34:16 -0300
Subject: [PATCH 14/15] copy new version of need-ssp_nonshared.patch from
alpine
---
library/std/src/sys/pal/unix/mod.rs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs
index 43cb9d89b..4158c79da 100644
index c0b56d8d2..b92ecb5e0 100644
--- a/library/std/src/sys/pal/unix/mod.rs
+++ b/library/std/src/sys/pal/unix/mod.rs
@@ -379,6 +379,10 @@ cfg_if::cfg_if! {
@@ -374,6 +374,10 @@ cfg_if::cfg_if! {
#[link(name = "dl", cfg(not(target_feature = "crt-static")))]
#[link(name = "log", cfg(not(target_feature = "crt-static")))]
extern "C" {}
unsafe extern "C" {}
+ } else if #[cfg(all(target_os = "linux", target_env = "musl"))] {
+ #[link(name = "ssp_nonshared")]
+ #[link(name = "execinfo")]
+ extern "C" {}
+ unsafe extern "C" {}
} else if #[cfg(target_os = "freebsd")] {
#[link(name = "execinfo")]
#[link(name = "pthread")]
--
2.44.0

View file

@ -1,34 +0,0 @@
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,7 +8,7 @@
# uploaded to https://repo-default.voidlinux.org/distfiles/
#
pkgname=rust
version=1.85.1
version=1.86.0
revision=1
_llvmver=19
hostmakedepends="curl pkg-config python3 tar cargo-bootstrap"
@ -19,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=0f2995ca083598757a8d9a293939e569b035799e070f419a686b0996fb94238a
checksum=022a27286df67900a044d227d9db69d4732ec3d833e4ffc259c4425ed71eed80
lib32disabled=yes
make_check=no # CBA for now
python_version=3 # needed for python files in rust-src