rust: update to 1.75.0

This commit is contained in:
Marcin Puc 2023-12-29 00:54:10 +01:00 committed by classabbyamp
parent 95689a7278
commit 4ec7670d33
9 changed files with 225 additions and 276 deletions

View file

@ -3,15 +3,11 @@ From: Samuel Holland <samuel@sholland.org>
Date: Fri, 8 Sep 2017 00:04:29 -0500 Date: Fri, 8 Sep 2017 00:04:29 -0500
Subject: [PATCH 01/15] Fix LLVM build Subject: [PATCH 01/15] Fix LLVM build
--- diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
src/bootstrap/lib.rs | 3 ++- index 33b8f1a7c..f4942dd2d 100644
1 file changed, 2 insertions(+), 1 deletion(-) --- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs @@ -1195,7 +1195,8 @@ impl Build {
index 4ac857b47..b603ae90a 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1050,7 +1050,8 @@ impl Build {
.args() .args()
.iter() .iter()
.map(|s| s.to_string_lossy().into_owned()) .map(|s| s.to_string_lossy().into_owned())
@ -20,7 +16,4 @@ index 4ac857b47..b603ae90a 100644
+ && !s.starts_with("-static")) + && !s.starts_with("-static"))
.collect::<Vec<String>>(); .collect::<Vec<String>>();
// If we're compiling on macOS then we add a few unconditional flags // If we're compiling C++ on macOS then we add a flag indicating that
--
2.37.2

View file

@ -5,11 +5,33 @@ Subject: [PATCH 02/15] Remove -nostdlib and musl_root from musl targets
extended by various void contributors to match our musl setup 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 5117cadbe..c7d0433bb 100644
--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -1,16 +1,9 @@
-use crate::spec::crt_objects;
-use crate::spec::{base, LinkSelfContainedDefault, TargetOptions};
+use crate::spec::{base, TargetOptions};
pub fn opts() -> TargetOptions {
let mut base = base::linux::opts();
base.env = "musl".into();
- base.pre_link_objects_self_contained = crt_objects::pre_musl_self_contained();
- base.post_link_objects_self_contained = crt_objects::post_musl_self_contained();
- base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
-
- // These targets statically link libc by default
- base.crt_static_default = true;
base
}
diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
index c126390f5..7aef73d3b 100644 index 53f710b8f..2a4eec15f 100644
--- a/compiler/rustc_target/src/spec/crt_objects.rs --- a/compiler/rustc_target/src/spec/crt_objects.rs
+++ b/compiler/rustc_target/src/spec/crt_objects.rs +++ b/compiler/rustc_target/src/spec/crt_objects.rs
@@ -63,28 +63,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects { @@ -61,28 +61,6 @@ pub(super) fn all(obj: &'static str) -> CrtObjects {
]) ])
} }
@ -38,32 +60,11 @@ index c126390f5..7aef73d3b 100644
pub(super) fn pre_mingw_self_contained() -> CrtObjects { pub(super) fn pre_mingw_self_contained() -> CrtObjects {
new(&[ new(&[
(LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]), (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]),
diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
index 61553e71b..88f807a58 100644
--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
@@ -1,16 +1,9 @@
-use crate::spec::crt_objects::{self, LinkSelfContainedDefault};
use crate::spec::TargetOptions;
pub fn opts() -> TargetOptions {
let mut base = super::linux_base::opts();
base.env = "musl".into();
- base.pre_link_objects_self_contained = crt_objects::pre_musl_self_contained();
- base.post_link_objects_self_contained = crt_objects::post_musl_self_contained();
- base.link_self_contained = LinkSelfContainedDefault::Musl;
-
- // These targets statically link libc by default
- base.crt_static_default = true;
base
}
diff --git a/config.example.toml b/config.example.toml diff --git a/config.example.toml b/config.example.toml
index f3c2366d6..fa2b7726e 100644 index e5df28a49..31c682ab9 100644
--- a/config.example.toml --- a/config.example.toml
+++ b/config.example.toml +++ b/config.example.toml
@@ -574,14 +574,6 @@ changelog-seen = 2 @@ -589,14 +589,6 @@ change-id = 116881
# behavior -- this may lead to miscompilations or other bugs. # behavior -- this may lead to miscompilations or other bugs.
#description = "" #description = ""
@ -78,68 +79,50 @@ index f3c2366d6..fa2b7726e 100644
# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix # By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
# platforms to ensure that the compiler is usable by default from the build # 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 # directory (as it links to a number of dynamic libraries). This may not be
diff --git a/src/bootstrap/cc_detect.rs b/src/bootstrap/cc_detect.rs diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index 2496c2a9d..9aff56181 100644 index 544a42d9a..8bd3fc755 100755
--- a/src/bootstrap/cc_detect.rs --- a/src/bootstrap/configure.py
+++ b/src/bootstrap/cc_detect.rs +++ b/src/bootstrap/configure.py
@@ -110,7 +110,7 @@ pub fn find_target(build: &Build, target: TargetSelection) { @@ -99,34 +99,6 @@ v("llvm-config", None, "set path to llvm-config")
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) { v("llvm-filecheck", None, "set path to LLVM's FileCheck utility")
cfg.compiler(cc); v("python", "build.python", "set path to python")
} else { v("android-ndk", "build.android-ndk", "set path to Android NDK")
- set_compiler(&mut cfg, Language::C, target, config, build); -v("musl-root", "target.x86_64-unknown-linux-musl.musl-root",
+ set_compiler(&mut cfg, Language::C, target, config); - "MUSL root installation directory (deprecated)")
} -v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root",
- "x86_64-unknown-linux-musl install directory")
let compiler = cfg.get_compiler(); -v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root",
@@ -131,7 +131,7 @@ pub fn find_target(build: &Build, target: TargetSelection) { - "i586-unknown-linux-musl install directory")
cfg.compiler(cxx); -v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root",
true - "i686-unknown-linux-musl install directory")
} else if build.hosts.contains(&target) || build.build == target { -v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",
- set_compiler(&mut cfg, Language::CPlusPlus, target, config, build); - "arm-unknown-linux-musleabi install directory")
+ set_compiler(&mut cfg, Language::CPlusPlus, target, config); -v("musl-root-armhf", "target.arm-unknown-linux-musleabihf.musl-root",
true - "arm-unknown-linux-musleabihf install directory")
} else { -v("musl-root-armv5te", "target.armv5te-unknown-linux-musleabi.musl-root",
// Use an auto-detected compiler (or one configured via `CXX_target_triple` env vars). - "armv5te-unknown-linux-musleabi install directory")
@@ -166,7 +166,6 @@ fn set_compiler( -v("musl-root-armv7", "target.armv7-unknown-linux-musleabi.musl-root",
compiler: Language, - "armv7-unknown-linux-musleabi install directory")
target: TargetSelection, -v("musl-root-armv7hf", "target.armv7-unknown-linux-musleabihf.musl-root",
config: Option<&Target>, - "armv7-unknown-linux-musleabihf install directory")
- build: &Build, -v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
) { - "aarch64-unknown-linux-musl install directory")
match &*target.triple { -v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root",
// When compiling for android we may have the NDK configured in the - "mips-unknown-linux-musl install directory")
@@ -202,26 +201,6 @@ fn set_compiler( -v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root",
} - "mipsel-unknown-linux-musl install directory")
} -v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root",
- "mips64-unknown-linux-muslabi64 install directory")
- "mips-unknown-linux-musl" => { -v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root",
- if cfg.get_compiler().path().to_str() == Some("gcc") { - "mips64el-unknown-linux-muslabi64 install directory")
- cfg.compiler("mips-linux-musl-gcc"); v("musl-root-riscv32gc", "target.riscv32gc-unknown-linux-musl.musl-root",
- } "riscv32gc-unknown-linux-musl install directory")
- } v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root",
- "mipsel-unknown-linux-musl" => { diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
- if cfg.get_compiler().path().to_str() == Some("gcc") { index 7021a9543..b314bbb8d 100644
- cfg.compiler("mipsel-linux-musl-gcc"); --- a/src/bootstrap/src/core/build_steps/compile.rs
- } +++ b/src/bootstrap/src/core/build_steps/compile.rs
- } @@ -307,39 +307,7 @@ fn copy_self_contained_objects(
-
- t if t.contains("musl") => {
- if let Some(root) = build.musl_root(target) {
- let guess = root.join("bin/musl-gcc");
- if guess.exists() {
- cfg.compiler(guess);
- }
- }
- }
-
_ => {}
}
}
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 292ccc578..d1f5ff98a 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -256,39 +256,7 @@ fn copy_self_contained_objects(
let mut target_deps = vec![]; let mut target_deps = vec![];
// Copies the libc and CRT objects. // Copies the libc and CRT objects.
@ -180,7 +163,7 @@ index 292ccc578..d1f5ff98a 100644
let srcdir = builder let srcdir = builder
.wasi_root(target) .wasi_root(target)
.unwrap_or_else(|| { .unwrap_or_else(|| {
@@ -390,15 +358,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car @@ -436,15 +404,6 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
.arg("--manifest-path") .arg("--manifest-path")
.arg(builder.src.join("library/sysroot/Cargo.toml")); .arg(builder.src.join("library/sysroot/Cargo.toml"));
@ -196,11 +179,11 @@ index 292ccc578..d1f5ff98a 100644
if target.contains("-wasi") { if target.contains("-wasi") {
if let Some(p) = builder.wasi_root(target) { if let Some(p) = builder.wasi_root(target) {
let root = format!( let root = format!(
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 836328f94..1d0dc3e98 100644 index 0a9175aa3..029f32912 100644
--- a/src/bootstrap/config.rs --- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/config.rs +++ b/src/bootstrap/src/core/config/config.rs
@@ -264,7 +264,6 @@ pub struct Config { @@ -270,7 +270,6 @@ pub struct Config {
pub missing_tools: bool, pub missing_tools: bool,
// Fallback musl-root for all targets // Fallback musl-root for all targets
@ -208,7 +191,7 @@ index 836328f94..1d0dc3e98 100644
pub prefix: Option<PathBuf>, pub prefix: Option<PathBuf>,
pub sysconfdir: Option<PathBuf>, pub sysconfdir: Option<PathBuf>,
pub datadir: Option<PathBuf>, pub datadir: Option<PathBuf>,
@@ -522,8 +521,6 @@ pub struct Target { @@ -528,8 +527,6 @@ pub struct Target {
pub profiler: Option<StringOrBool>, pub profiler: Option<StringOrBool>,
pub rpath: Option<bool>, pub rpath: Option<bool>,
pub crt_static: Option<bool>, pub crt_static: Option<bool>,
@ -217,7 +200,7 @@ index 836328f94..1d0dc3e98 100644
pub wasi_root: Option<PathBuf>, pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>, pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool, pub no_std: bool,
@@ -979,7 +976,6 @@ define_config! { @@ -998,7 +995,6 @@ define_config! {
default_linker: Option<String> = "default-linker", default_linker: Option<String> = "default-linker",
channel: Option<String> = "channel", channel: Option<String> = "channel",
description: Option<String> = "description", description: Option<String> = "description",
@ -225,7 +208,7 @@ index 836328f94..1d0dc3e98 100644
rpath: Option<bool> = "rpath", rpath: Option<bool> = "rpath",
verbose_tests: Option<bool> = "verbose-tests", verbose_tests: Option<bool> = "verbose-tests",
optimize_tests: Option<bool> = "optimize-tests", optimize_tests: Option<bool> = "optimize-tests",
@@ -1028,8 +1024,6 @@ define_config! { @@ -1046,8 +1042,6 @@ define_config! {
profiler: Option<StringOrBool> = "profiler", profiler: Option<StringOrBool> = "profiler",
rpath: Option<bool> = "rpath", rpath: Option<bool> = "rpath",
crt_static: Option<bool> = "crt-static", crt_static: Option<bool> = "crt-static",
@ -234,15 +217,15 @@ index 836328f94..1d0dc3e98 100644
wasi_root: Option<String> = "wasi-root", wasi_root: Option<String> = "wasi-root",
qemu_rootfs: Option<String> = "qemu-rootfs", qemu_rootfs: Option<String> = "qemu-rootfs",
no_std: Option<bool> = "no-std", no_std: Option<bool> = "no-std",
@@ -1412,7 +1406,6 @@ impl Config { @@ -1437,7 +1431,6 @@ impl Config {
set(&mut config.llvm_tools_enabled, rust.llvm_tools); .parallel_compiler
config.rustc_parallel = rust.parallel_compiler.unwrap_or(false); .unwrap_or(config.channel == "dev" || config.channel == "nightly");
config.rustc_default_linker = rust.default_linker; config.rustc_default_linker = rust.default_linker;
- config.musl_root = rust.musl_root.map(PathBuf::from); - config.musl_root = rust.musl_root.map(PathBuf::from);
config.save_toolstates = rust.save_toolstates.map(PathBuf::from); config.save_toolstates = rust.save_toolstates.map(PathBuf::from);
set( set(
&mut config.deny_warnings, &mut config.deny_warnings,
@@ -1597,8 +1590,6 @@ impl Config { @@ -1606,8 +1599,6 @@ impl Config {
target.ranlib = cfg.ranlib.map(PathBuf::from); target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from);
target.crt_static = cfg.crt_static; target.crt_static = cfg.crt_static;
@ -251,79 +234,10 @@ index 836328f94..1d0dc3e98 100644
target.wasi_root = cfg.wasi_root.map(PathBuf::from); target.wasi_root = cfg.wasi_root.map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from);
target.sanitizers = cfg.sanitizers; target.sanitizers = cfg.sanitizers;
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs
index f469dbea6..fe2441e2a 100755 index eec3be66a..a2d1cb5df 100644
--- a/src/bootstrap/configure.py --- a/src/bootstrap/src/core/sanity.rs
+++ b/src/bootstrap/configure.py +++ b/src/bootstrap/src/core/sanity.rs
@@ -111,34 +111,6 @@ v("aarch64-linux-android-ndk", "target.aarch64-linux-android.android-ndk",
"aarch64-linux-android NDK standalone path")
v("x86_64-linux-android-ndk", "target.x86_64-linux-android.android-ndk",
"x86_64-linux-android NDK standalone path")
-v("musl-root", "target.x86_64-unknown-linux-musl.musl-root",
- "MUSL root installation directory (deprecated)")
-v("musl-root-x86_64", "target.x86_64-unknown-linux-musl.musl-root",
- "x86_64-unknown-linux-musl install directory")
-v("musl-root-i586", "target.i586-unknown-linux-musl.musl-root",
- "i586-unknown-linux-musl install directory")
-v("musl-root-i686", "target.i686-unknown-linux-musl.musl-root",
- "i686-unknown-linux-musl install directory")
-v("musl-root-arm", "target.arm-unknown-linux-musleabi.musl-root",
- "arm-unknown-linux-musleabi install directory")
-v("musl-root-armhf", "target.arm-unknown-linux-musleabihf.musl-root",
- "arm-unknown-linux-musleabihf install directory")
-v("musl-root-armv5te", "target.armv5te-unknown-linux-musleabi.musl-root",
- "armv5te-unknown-linux-musleabi install directory")
-v("musl-root-armv7", "target.armv7-unknown-linux-musleabi.musl-root",
- "armv7-unknown-linux-musleabi install directory")
-v("musl-root-armv7hf", "target.armv7-unknown-linux-musleabihf.musl-root",
- "armv7-unknown-linux-musleabihf install directory")
-v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
- "aarch64-unknown-linux-musl install directory")
-v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root",
- "mips-unknown-linux-musl install directory")
-v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root",
- "mipsel-unknown-linux-musl install directory")
-v("musl-root-mips64", "target.mips64-unknown-linux-muslabi64.musl-root",
- "mips64-unknown-linux-muslabi64 install directory")
-v("musl-root-mips64el", "target.mips64el-unknown-linux-muslabi64.musl-root",
- "mips64el-unknown-linux-muslabi64 install directory")
v("musl-root-riscv32gc", "target.riscv32gc-unknown-linux-musl.musl-root",
"riscv32gc-unknown-linux-musl install directory")
v("musl-root-riscv64gc", "target.riscv64gc-unknown-linux-musl.musl-root",
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 8b8d4b237..06c15d468 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1291,25 +1291,6 @@ impl Build {
}
}
- /// Returns the "musl root" for this `target`, if defined
- fn musl_root(&self, target: TargetSelection) -> Option<&Path> {
- self.config
- .target_config
- .get(&target)
- .and_then(|t| t.musl_root.as_ref())
- .or_else(|| self.config.musl_root.as_ref())
- .map(|p| &**p)
- }
-
- /// Returns the "musl libdir" for this `target`.
- fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf> {
- let t = self.config.target_config.get(&target)?;
- if let libdir @ Some(_) = &t.musl_libdir {
- return libdir.clone();
- }
- self.musl_root(target).map(|root| root.join("lib"))
- }
-
/// Returns the sysroot for the wasi target, if defined
fn wasi_root(&self, target: TargetSelection) -> Option<&Path> {
self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p)
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 0febdf250..c84f31d52 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -11,7 +11,6 @@ @@ -11,7 +11,6 @@
use std::collections::HashMap; use std::collections::HashMap;
use std::env; use std::env;
@ -361,3 +275,68 @@ index 0febdf250..c84f31d52 100644
if need_cmake && target.contains("msvc") { if need_cmake && target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and // There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual // 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 33b8f1a7c..4ba88439b 100644
--- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/src/lib.rs
@@ -1306,25 +1306,6 @@ impl Build {
}
}
- /// Returns the "musl root" for this `target`, if defined
- fn musl_root(&self, target: TargetSelection) -> Option<&Path> {
- self.config
- .target_config
- .get(&target)
- .and_then(|t| t.musl_root.as_ref())
- .or_else(|| self.config.musl_root.as_ref())
- .map(|p| &**p)
- }
-
- /// Returns the "musl libdir" for this `target`.
- fn musl_libdir(&self, target: TargetSelection) -> Option<PathBuf> {
- let t = self.config.target_config.get(&target)?;
- if let libdir @ Some(_) = &t.musl_libdir {
- return libdir.clone();
- }
- self.musl_root(target).map(|root| root.join("lib"))
- }
-
/// Returns the sysroot for the wasi target, if defined
fn wasi_root(&self, target: TargetSelection) -> Option<&Path> {
self.config.target_config.get(&target).and_then(|t| t.wasi_root.as_ref()).map(|p| &**p)
diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs
index 52b36ce75..a67d05075 100644
--- a/src/bootstrap/src/utils/cc_detect.rs
+++ b/src/bootstrap/src/utils/cc_detect.rs
@@ -201,30 +201,6 @@ fn default_compiler(
}
}
- "mips-unknown-linux-musl" if compiler == Language::C => {
- if cfg.get_compiler().path().to_str() == Some("gcc") {
- Some(PathBuf::from("mips-linux-musl-gcc"))
- } else {
- None
- }
- }
- "mipsel-unknown-linux-musl" if compiler == Language::C => {
- if cfg.get_compiler().path().to_str() == Some("gcc") {
- Some(PathBuf::from("mipsel-linux-musl-gcc"))
- } else {
- None
- }
- }
-
- t if t.contains("musl") && compiler == Language::C => {
- if let Some(root) = build.musl_root(target) {
- let guess = root.join("bin/musl-gcc");
- if guess.exists() { Some(guess) } else { None }
- } else {
- None
- }
- }
-
_ => None,
}
}

View file

@ -3,11 +3,11 @@ From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 20 Dec 2021 00:45:35 +0100 Date: Mon, 20 Dec 2021 00:45:35 +0100
Subject: [PATCH 03/15] move debugger scripts to /usr/share/rust Subject: [PATCH 03/15] move debugger scripts to /usr/share/rust
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 76aad16c1..db53459e8 100644 index c485481b9..b59aaa4fa 100644
--- a/src/bootstrap/dist.rs --- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -528,7 +528,7 @@ impl Step for DebuggerScripts { @@ -519,7 +519,7 @@ impl Step for DebuggerScripts {
fn run(self, builder: &Builder<'_>) { fn run(self, builder: &Builder<'_>) {
let host = self.host; let host = self.host;
let sysroot = self.sysroot; let sysroot = self.sysroot;
@ -30,7 +30,7 @@ index 9abed30ea..4c7f953ed 100755
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')" RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
index 913269316..f444fbc4b 100755 index 471810cbb..ba4e27241 100755
--- a/src/etc/rust-gdbgui --- a/src/etc/rust-gdbgui
+++ b/src/etc/rust-gdbgui +++ b/src/etc/rust-gdbgui
@@ -41,7 +41,7 @@ fi @@ -41,7 +41,7 @@ fi

View file

@ -3,15 +3,11 @@ From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 20 Dec 2021 01:44:54 +0100 Date: Mon, 20 Dec 2021 01:44:54 +0100
Subject: [PATCH 05/15] do not install libunwind source (removed) Subject: [PATCH 05/15] do not install libunwind source (removed)
--- diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
src/bootstrap/dist.rs | 2 +- index c485481b9..33171948c 100644
1 file changed, 1 insertion(+), 1 deletion(-) --- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs @@ -909,7 +909,7 @@ impl Step for Src {
index e7a077134..74e75df4b 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -804,7 +804,7 @@ impl Step for Src {
copy_src_dirs( copy_src_dirs(
builder, builder,
&builder.src, &builder.src,
@ -20,6 +16,3 @@ index e7a077134..74e75df4b 100644
&[ &[
// not needed and contains symlinks which rustup currently // not needed and contains symlinks which rustup currently
// chokes on when unpacking. // chokes on when unpacking.
--
2.37.2

View file

@ -3,25 +3,29 @@ From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 20 Dec 2021 01:48:14 +0100 Date: Mon, 20 Dec 2021 01:48:14 +0100
Subject: [PATCH 06/15] fix rustdoc when cross-compiling Subject: [PATCH 06/15] fix rustdoc when cross-compiling
--- diff --git a/src/bootstrap/src/bin/rustdoc.rs b/src/bootstrap/src/bin/rustdoc.rs
src/bootstrap/bin/rustdoc.rs | 7 ++----- index dbbce6fe2..86365e330 100644
1 file changed, 2 insertions(+), 5 deletions(-) --- a/src/bootstrap/src/bin/rustdoc.rs
+++ b/src/bootstrap/src/bin/rustdoc.rs
diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs @@ -7,6 +7,7 @@ use std::ffi::OsString;
index 5f85fc5aa..01e81fc39 100644 use std::path::PathBuf;
--- a/src/bootstrap/bin/rustdoc.rs use std::process::Command;
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -26,9 +26,6 @@ fn main() { +#[allow(unused)]
Err(_) => 0, use dylib_util::{dylib_path, dylib_path_var};
};
#[path = "../utils/bin_helpers.rs"]
@@ -29,9 +30,6 @@ fn main() {
// is passed (a bit janky...)
let target = args.windows(2).find(|w| &*w[0] == "--target").and_then(|w| w[1].to_str());
- let mut dylib_path = dylib_path(); - let mut dylib_path = dylib_path();
- dylib_path.insert(0, PathBuf::from(libdir.clone())); - dylib_path.insert(0, PathBuf::from(libdir.clone()));
- -
let mut cmd = Command::new(rustdoc); let mut cmd = Command::new(rustdoc);
// cfg(bootstrap) if target.is_some() {
@@ -43,7 +40,7 @@ fn main() { @@ -44,7 +42,7 @@ fn main() {
} }
cmd.args(&args); cmd.args(&args);
@ -30,7 +34,7 @@ index 5f85fc5aa..01e81fc39 100644
// Force all crates compiled by this compiler to (a) be unstable and (b) // Force all crates compiled by this compiler to (a) be unstable and (b)
// allow the `rustc_private` feature to link to other unstable crates // allow the `rustc_private` feature to link to other unstable crates
@@ -69,7 +66,7 @@ fn main() { @@ -78,7 +76,7 @@ fn main() {
eprintln!( eprintln!(
"rustdoc command: {:?}={:?} {:?}", "rustdoc command: {:?}={:?} {:?}",
dylib_path_var(), dylib_path_var(),
@ -38,7 +42,4 @@ index 5f85fc5aa..01e81fc39 100644
+ PathBuf::from(libdir.clone()), + PathBuf::from(libdir.clone()),
cmd, cmd,
); );
eprintln!("sysroot: {:?}", sysroot); eprintln!("sysroot: {sysroot:?}");
--
2.37.2

View file

@ -6,15 +6,12 @@ Subject: [PATCH 07/15] link stage 2 tools dynamically to libstd
stage 2 tools are the ones that are distributed, and we distribute 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 them together with the rust libs so there is no need to worry
about unstable ABI about unstable ABI
---
src/bootstrap/builder.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 62b5416ce..554dd4188 100644 index cd276674d..4741cd11b 100644
--- a/src/bootstrap/builder.rs --- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/builder.rs +++ b/src/bootstrap/src/core/builder.rs
@@ -2066,6 +2066,8 @@ impl<'a> Builder<'a> { @@ -2062,6 +2062,8 @@ impl<'a> Builder<'a> {
// linking all deps statically into the dylib. // linking all deps statically into the dylib.
if matches!(mode, Mode::Std | Mode::Rustc) { if matches!(mode, Mode::Std | Mode::Rustc) {
rustflags.arg("-Cprefer-dynamic"); rustflags.arg("-Cprefer-dynamic");
@ -23,6 +20,3 @@ index 62b5416ce..554dd4188 100644
} }
// When building incrementally we default to a lower ThinLTO import limit // When building incrementally we default to a lower ThinLTO import limit
--
2.37.2

View file

@ -4,15 +4,12 @@ Date: Sat, 29 May 2021 12:38:46 +0000
Subject: [PATCH 12/15] bootstrap: Disable initial-exec TLS model on powerpc Subject: [PATCH 12/15] bootstrap: Disable initial-exec TLS model on powerpc
Fixes #81334. Fixes #81334.
---
src/bootstrap/builder.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 8b144f146..acfa7cf04 100644 index cd276674d..9ec0c3210 100644
--- a/src/bootstrap/builder.rs --- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/builder.rs +++ b/src/bootstrap/src/core/builder.rs
@@ -1856,7 +1856,7 @@ impl<'a> Builder<'a> { @@ -1844,7 +1844,7 @@ impl<'a> Builder<'a> {
// efficient initial-exec TLS model. This doesn't work with `dlopen`, // 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 // so we can't use it by default in general, but we can use it for tools
// and our own internal libraries. // and our own internal libraries.

View file

@ -5,17 +5,12 @@ Subject: [PATCH 13/15] allow specifying native sysroot to use for linkage
This allows us to get around the linker attempting to use This allows us to get around the linker attempting to use
incompatible libs. incompatible libs.
---
src/bootstrap/builder.rs | 4 ++++
src/bootstrap/config.rs | 3 +++
src/bootstrap/lib.rs | 4 ++++
3 files changed, 11 insertions(+)
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 6a02a225c..483aa8818 100644 index cd276674d..a67a0cbcc 100644
--- a/src/bootstrap/builder.rs --- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/builder.rs +++ b/src/bootstrap/src/core/builder.rs
@@ -1708,6 +1708,10 @@ impl<'a> Builder<'a> { @@ -1687,6 +1687,10 @@ impl<'a> Builder<'a> {
} }
} }
@ -24,41 +19,41 @@ index 6a02a225c..483aa8818 100644
+ } + }
+ +
if let Some(host_linker) = self.linker(compiler.host) { if let Some(host_linker) = self.linker(compiler.host) {
cargo.env("RUSTC_HOST_LINKER", host_linker); hostflags.arg(format!("-Clinker={}", host_linker.display()));
} }
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 18a764689..f8b9bbd96 100644 index 0a9175aa3..d6f31b0cd 100644
--- a/src/bootstrap/config.rs --- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/config.rs +++ b/src/bootstrap/src/core/config/config.rs
@@ -395,6 +395,7 @@ pub struct Target { @@ -524,6 +524,7 @@ pub struct Target {
pub ranlib: Option<PathBuf>, pub ranlib: Option<PathBuf>,
pub default_linker: Option<PathBuf>, pub default_linker: Option<PathBuf>,
pub linker: Option<PathBuf>, pub linker: Option<PathBuf>,
+ pub sysroot: Option<PathBuf>, + pub sysroot: Option<PathBuf>,
pub ndk: Option<PathBuf>,
pub sanitizers: Option<bool>, pub sanitizers: Option<bool>,
pub profiler: Option<bool>, pub profiler: Option<StringOrBool>,
@@ -723,6 +724,7 @@ define_config! { pub rpath: Option<bool>,
@@ -1038,6 +1039,7 @@ define_config! {
ranlib: Option<String> = "ranlib", ranlib: Option<String> = "ranlib",
default_linker: Option<PathBuf> = "default-linker", default_linker: Option<PathBuf> = "default-linker",
linker: Option<String> = "linker", linker: Option<String> = "linker",
+ sysroot: Option<String> = "sysroot", + sysroot: Option<String> = "sysroot",
llvm_config: Option<String> = "llvm-config", llvm_config: Option<String> = "llvm-config",
llvm_has_rust_patches: Option<bool> = "llvm-has-rust-patches",
llvm_filecheck: Option<String> = "llvm-filecheck", llvm_filecheck: Option<String> = "llvm-filecheck",
llvm_libunwind: Option<String> = "llvm-libunwind", @@ -1605,6 +1607,7 @@ impl Config {
@@ -1156,6 +1158,7 @@ impl Config {
target.ar = cfg.ar.map(PathBuf::from); target.ar = cfg.ar.map(PathBuf::from);
target.ranlib = cfg.ranlib.map(PathBuf::from); target.ranlib = cfg.ranlib.map(PathBuf::from);
target.linker = cfg.linker.map(PathBuf::from); target.linker = cfg.linker.map(PathBuf::from);
+ target.sysroot = cfg.sysroot.map(PathBuf::from); + target.sysroot = cfg.sysroot.map(PathBuf::from);
target.crt_static = cfg.crt_static; target.crt_static = cfg.crt_static;
target.wasi_root = cfg.wasi_root.map(PathBuf::from); target.musl_root = cfg.musl_root.map(PathBuf::from);
target.qemu_rootfs = cfg.qemu_rootfs.map(PathBuf::from); target.musl_libdir = cfg.musl_libdir.map(PathBuf::from);
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
index 0a7012dbd..cded50d20 100644 index 33b8f1a7c..edfafa173 100644
--- a/src/bootstrap/lib.rs --- a/src/bootstrap/src/lib.rs
+++ b/src/bootstrap/lib.rs +++ b/src/bootstrap/src/lib.rs
@@ -1152,6 +1152,10 @@ impl Build { @@ -1305,6 +1305,10 @@ impl Build {
self.config.target_config.get(&target).and_then(|t| t.crt_static) self.config.target_config.get(&target).and_then(|t| t.crt_static)
} }
} }
@ -67,8 +62,5 @@ index 0a7012dbd..cded50d20 100644
+ self.config.target_config.get(&target).and_then(|c| c.sysroot.as_ref()).map(|p| &**p) + self.config.target_config.get(&target).and_then(|c| c.sysroot.as_ref()).map(|p| &**p)
+ } + }
/// Returns the sysroot for the wasi target, if defined /// Returns the "musl root" for this `target`, if defined
fn wasi_root(&self, target: TargetSelection) -> Option<&Path> { fn musl_root(&self, target: TargetSelection) -> Option<&Path> {
--
2.37.2

View file

@ -8,7 +8,7 @@
# uploaded to https://repo-default.voidlinux.org/distfiles/ # uploaded to https://repo-default.voidlinux.org/distfiles/
# #
pkgname=rust pkgname=rust
version=1.74.1 version=1.75.0
revision=1 revision=1
hostmakedepends="curl pkg-config python3 tar cargo-bootstrap" hostmakedepends="curl pkg-config python3 tar cargo-bootstrap"
makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15" makedepends="libffi-devel ncurses-devel libxml2-devel zlib-devel llvm15"
@ -18,7 +18,7 @@ maintainer="Enno Boland <gottox@voidlinux.org>"
license="MIT, Apache-2.0" license="MIT, Apache-2.0"
homepage="https://www.rust-lang.org/" homepage="https://www.rust-lang.org/"
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz" distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
checksum=67db3e22fc9921c885baae5953ba144fc474cde29ec69ab56d43ce764206231d checksum=5b739f45bc9d341e2d1c570d65d2375591e22c2d23ef5b8a37711a0386abc088
lib32disabled=yes lib32disabled=yes
make_check=no # CBA for now make_check=no # CBA for now
python_version=3 # needed for python files in rust-src python_version=3 # needed for python files in rust-src