parent
23ad3537d2
commit
8ba15fc99a
@ -1,2 +1,2 @@
|
||||
SOURCES/rustc-1.66.1-src.tar.xz
|
||||
SOURCES/wasi-libc-wasi-sdk-17.tar.gz
|
||||
SOURCES/rustc-1.71.1-src.tar.xz
|
||||
SOURCES/wasi-libc-wasi-sdk-20.tar.gz
|
||||
|
@ -1,2 +1,2 @@
|
||||
a8cc02cc11a942bddf67f1cfdcdd2bd867296f8e SOURCES/rustc-1.66.1-src.tar.xz
|
||||
1f4561760c6c7e9f9f30c8cf0d156b8d551e04e2 SOURCES/wasi-libc-wasi-sdk-17.tar.gz
|
||||
ffa03139b447604322d689eefe4e157a49c39f51 SOURCES/rustc-1.71.1-src.tar.xz
|
||||
8678e3510c88ef1de4d8c2940fa8ddad8f4eb084 SOURCES/wasi-libc-wasi-sdk-20.tar.gz
|
||||
|
@ -0,0 +1,142 @@
|
||||
From f2fd2d01f96b50b039402c9ab4278230687f7922 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Tue, 25 Jul 2023 13:11:50 -0700
|
||||
Subject: [PATCH] Allow using external builds of the compiler-rt profile lib
|
||||
|
||||
This changes the bootstrap config `target.*.profiler` from a plain bool
|
||||
to also allow a string, which will be used as a path to the pre-built
|
||||
profiling runtime for that target. Then `profiler_builtins/build.rs`
|
||||
reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
|
||||
---
|
||||
config.example.toml | 6 ++++--
|
||||
library/profiler_builtins/build.rs | 6 ++++++
|
||||
src/bootstrap/compile.rs | 4 ++++
|
||||
src/bootstrap/config.rs | 30 ++++++++++++++++++++++++------
|
||||
4 files changed, 38 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/config.example.toml b/config.example.toml
|
||||
index d0eaa9fd7ffa..e0e991e679af 100644
|
||||
--- a/config.example.toml
|
||||
+++ b/config.example.toml
|
||||
@@ -745,8 +745,10 @@ changelog-seen = 2
|
||||
# This option will override the same option under [build] section.
|
||||
#sanitizers = build.sanitizers (bool)
|
||||
|
||||
-# Build the profiler runtime for this target(required when compiling with options that depend
|
||||
-# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`).
|
||||
+# When true, build the profiler runtime for this target(required when compiling
|
||||
+# with options that depend on this runtime, such as `-C profile-generate` or
|
||||
+# `-C instrument-coverage`). This may also be given a path to an existing build
|
||||
+# of the profiling runtime library from LLVM's compiler-rt.
|
||||
# This option will override the same option under [build] section.
|
||||
#profiler = build.profiler (bool)
|
||||
|
||||
diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs
|
||||
index 1b1f11798d74..d14d0b82229a 100644
|
||||
--- a/library/profiler_builtins/build.rs
|
||||
+++ b/library/profiler_builtins/build.rs
|
||||
@@ -6,6 +6,12 @@
|
||||
use std::path::Path;
|
||||
|
||||
fn main() {
|
||||
+ println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB");
|
||||
+ if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") {
|
||||
+ println!("cargo:rustc-link-lib=static:+verbatim={rt}");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
let target = env::var("TARGET").expect("TARGET was not set");
|
||||
let cfg = &mut cc::Build::new();
|
||||
|
||||
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
|
||||
index 33addb90da37..1d8b3c6e5435 100644
|
||||
--- a/src/bootstrap/compile.rs
|
||||
+++ b/src/bootstrap/compile.rs
|
||||
@@ -305,6 +305,10 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
|
||||
cargo.env("MACOSX_DEPLOYMENT_TARGET", target);
|
||||
}
|
||||
|
||||
+ if let Some(path) = builder.config.profiler_path(target) {
|
||||
+ cargo.env("LLVM_PROFILER_RT_LIB", path);
|
||||
+ }
|
||||
+
|
||||
// Determine if we're going to compile in optimized C intrinsics to
|
||||
// the `compiler-builtins` crate. These intrinsics live in LLVM's
|
||||
// `compiler-rt` repository, but our `src/llvm-project` submodule isn't
|
||||
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||
index e192cda9a9a7..a4803db0a470 100644
|
||||
--- a/src/bootstrap/config.rs
|
||||
+++ b/src/bootstrap/config.rs
|
||||
@@ -467,7 +467,7 @@ pub struct Target {
|
||||
pub linker: Option<PathBuf>,
|
||||
pub ndk: Option<PathBuf>,
|
||||
pub sanitizers: Option<bool>,
|
||||
- pub profiler: Option<bool>,
|
||||
+ pub profiler: Option<StringOrBool>,
|
||||
pub rpath: Option<bool>,
|
||||
pub crt_static: Option<bool>,
|
||||
pub musl_root: Option<PathBuf>,
|
||||
@@ -796,9 +796,9 @@ struct Dist {
|
||||
}
|
||||
}
|
||||
|
||||
-#[derive(Debug, Deserialize)]
|
||||
+#[derive(Clone, Debug, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
-enum StringOrBool {
|
||||
+pub enum StringOrBool {
|
||||
String(String),
|
||||
Bool(bool),
|
||||
}
|
||||
@@ -809,6 +809,12 @@ fn default() -> StringOrBool {
|
||||
}
|
||||
}
|
||||
|
||||
+impl StringOrBool {
|
||||
+ fn is_string_or_true(&self) -> bool {
|
||||
+ matches!(self, Self::String(_) | Self::Bool(true))
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
define_config! {
|
||||
/// TOML representation of how the Rust build is configured.
|
||||
struct Rust {
|
||||
@@ -880,7 +886,7 @@ struct TomlTarget {
|
||||
llvm_libunwind: Option<String> = "llvm-libunwind",
|
||||
android_ndk: Option<String> = "android-ndk",
|
||||
sanitizers: Option<bool> = "sanitizers",
|
||||
- profiler: Option<bool> = "profiler",
|
||||
+ profiler: Option<StringOrBool> = "profiler",
|
||||
rpath: Option<bool> = "rpath",
|
||||
crt_static: Option<bool> = "crt-static",
|
||||
musl_root: Option<String> = "musl-root",
|
||||
@@ -1744,12 +1750,24 @@ pub fn any_sanitizers_enabled(&self) -> bool {
|
||||
self.target_config.values().any(|t| t.sanitizers == Some(true)) || self.sanitizers
|
||||
}
|
||||
|
||||
+ pub fn profiler_path(&self, target: TargetSelection) -> Option<&str> {
|
||||
+ match self.target_config.get(&target)?.profiler.as_ref()? {
|
||||
+ StringOrBool::String(s) => Some(s),
|
||||
+ StringOrBool::Bool(_) => None,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
pub fn profiler_enabled(&self, target: TargetSelection) -> bool {
|
||||
- self.target_config.get(&target).map(|t| t.profiler).flatten().unwrap_or(self.profiler)
|
||||
+ self.target_config
|
||||
+ .get(&target)
|
||||
+ .and_then(|t| t.profiler.as_ref())
|
||||
+ .map(StringOrBool::is_string_or_true)
|
||||
+ .unwrap_or(self.profiler)
|
||||
}
|
||||
|
||||
pub fn any_profiler_enabled(&self) -> bool {
|
||||
- self.target_config.values().any(|t| t.profiler == Some(true)) || self.profiler
|
||||
+ self.target_config.values().any(|t| matches!(&t.profiler, Some(p) if p.is_string_or_true()))
|
||||
+ || self.profiler
|
||||
}
|
||||
|
||||
pub fn rpath_enabled(&self, target: TargetSelection) -> bool {
|
||||
--
|
||||
2.41.0
|
||||
|
@ -0,0 +1,53 @@
|
||||
From 6e2adb05860b72610291d3b0e8bd525c44cb0cc9 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Fri, 9 Jun 2023 15:23:08 -0700
|
||||
Subject: [PATCH] Let environment variables override some default CPUs
|
||||
|
||||
---
|
||||
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
index fd896e086b54..08d0c43d20b4 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
- base.cpu = "ppc64le".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into();
|
||||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
diff --git a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
index f2c722b9a89d..17a14d10b27e 100644
|
||||
--- a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
@@ -5,7 +5,7 @@ pub fn target() -> Target {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
base.endian = Endian::Big;
|
||||
// z10 is the oldest CPU supported by LLVM
|
||||
- base.cpu = "z10".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
|
||||
// FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
|
||||
// ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
|
||||
// also strip v128 from the data_layout below to match the older LLVM's expectation.
|
||||
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
index 9af1049b8702..68f876dd18c3 100644
|
||||
--- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub fn target() -> Target {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
- base.cpu = "x86-64".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into();
|
||||
base.max_atomic_width = Some(64);
|
||||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
|
||||
base.stack_probes = StackProbeType::X86;
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 98ae83daae67e9e7663b8345eced1de8c667271f Mon Sep 17 00:00:00 2001
|
||||
From: Dan Gohman <dev@sunfishcode.online>
|
||||
Date: Thu, 8 Dec 2022 10:35:46 -0800
|
||||
Subject: [PATCH] Mangle "main" as "__main_void" on wasm32-wasi
|
||||
|
||||
On wasm, the age-old C trick of having a main function which can either have
|
||||
no arguments or argc+argv doesn't work, because wasm requires caller and
|
||||
callee signatures to match. WASI's current strategy is to have compilers
|
||||
mangle main's name to indicate which signature they're using. Rust uses the
|
||||
no-argument form, which should be mangled as `__main_void`.
|
||||
|
||||
This is needed on wasm32-wasi as of #105395.
|
||||
---
|
||||
compiler/rustc_target/src/spec/wasm32_wasi.rs | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
index 6f0bbf0672d4..a0476d542e64 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
@@ -104,6 +104,10 @@ pub fn target() -> Target {
|
||||
// `args::args()` makes the WASI API calls itself.
|
||||
options.main_needs_argc_argv = false;
|
||||
|
||||
+ // And, WASI mangles the name of "main" to distinguish between different
|
||||
+ // signatures.
|
||||
+ options.entry_name = "__main_void".into();
|
||||
+
|
||||
Target {
|
||||
llvm_target: "wasm32-wasi".into(),
|
||||
pointer_width: 32,
|
||||
--
|
||||
2.38.1
|
||||
|
@ -0,0 +1,36 @@
|
||||
From a627c8f54cab6880dc7d36c55092a94c6f750a6e Mon Sep 17 00:00:00 2001
|
||||
From: Ariadne Conill <ariadne@dereferenced.org>
|
||||
Date: Thu, 3 Aug 2023 15:05:40 -0700
|
||||
Subject: [PATCH] bootstrap: config: fix version comparison bug
|
||||
|
||||
Rust requires a previous version of Rust to build, such as the current version, or the
|
||||
previous version. However, the version comparison logic did not take patch releases
|
||||
into consideration when doing the version comparison for the current branch, e.g.
|
||||
Rust 1.71.1 could not be built by Rust 1.71.0 because it is neither an exact version
|
||||
match, or the previous version.
|
||||
|
||||
Adjust the version comparison logic to tolerate mismatches in the patch version.
|
||||
|
||||
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
|
||||
(cherry picked from commit 31a81a08786826cc6e832bd0b49fb8b934e29648)
|
||||
---
|
||||
src/bootstrap/config.rs | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||
index e192cda9a9a7..2b5d0b94e968 100644
|
||||
--- a/src/bootstrap/config.rs
|
||||
+++ b/src/bootstrap/config.rs
|
||||
@@ -1805,7 +1805,8 @@ pub fn check_build_rustc_version(&self) {
|
||||
.unwrap();
|
||||
if !(source_version == rustc_version
|
||||
|| (source_version.major == rustc_version.major
|
||||
- && source_version.minor == rustc_version.minor + 1))
|
||||
+ && (source_version.minor == rustc_version.minor
|
||||
+ || source_version.minor == rustc_version.minor + 1)))
|
||||
{
|
||||
let prev_version = format!("{}.{}.x", source_version.major, source_version.minor - 1);
|
||||
eprintln!(
|
||||
--
|
||||
2.41.0
|
||||
|
@ -1,185 +0,0 @@
|
||||
From 2bdbc5fbf7f84c62f8c7b1007f3b6fd6d3da06f6 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Fri, 14 Oct 2022 16:11:28 -0700
|
||||
Subject: [PATCH] compiletest: set the dylib path when gathering target cfg
|
||||
|
||||
If the compiler is built with `rpath = false`, then it won't find its
|
||||
own libraries unless the library search path is set. We already do that
|
||||
while running the actual compiletests, but #100260 added another rustc
|
||||
command for getting the target cfg.
|
||||
|
||||
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
|
||||
thread 'main' panicked at 'error: failed to get cfg info from "[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc"
|
||||
--- stdout
|
||||
|
||||
--- stderr
|
||||
[...]/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: librustc_driver-a2a76dc626cd02d2.so: cannot open shared object file: No such file or directory
|
||||
', src/tools/compiletest/src/common.rs:476:13
|
||||
|
||||
Now the library path is set here as well, so it works without rpath.
|
||||
|
||||
(cherry picked from commit f8a0cc2ca8a644ddb63867526711ba17cb7508c8)
|
||||
---
|
||||
src/tools/compiletest/src/common.rs | 20 +++++++++++---------
|
||||
src/tools/compiletest/src/runtest.rs | 27 +++------------------------
|
||||
src/tools/compiletest/src/util.rs | 23 +++++++++++++++++++++++
|
||||
3 files changed, 37 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs
|
||||
index 0260f6848386..9a432f11f82f 100644
|
||||
--- a/src/tools/compiletest/src/common.rs
|
||||
+++ b/src/tools/compiletest/src/common.rs
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
use std::ffi::OsString;
|
||||
use std::fmt;
|
||||
+use std::iter;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use std::str::FromStr;
|
||||
|
||||
-use crate::util::PathBufExt;
|
||||
+use crate::util::{add_dylib_path, PathBufExt};
|
||||
use lazycell::LazyCell;
|
||||
use test::ColorConfig;
|
||||
|
||||
@@ -385,8 +386,7 @@ pub fn run_enabled(&self) -> bool {
|
||||
}
|
||||
|
||||
fn target_cfg(&self) -> &TargetCfg {
|
||||
- self.target_cfg
|
||||
- .borrow_with(|| TargetCfg::new(&self.rustc_path, &self.target, &self.target_rustcflags))
|
||||
+ self.target_cfg.borrow_with(|| TargetCfg::new(self))
|
||||
}
|
||||
|
||||
pub fn matches_arch(&self, arch: &str) -> bool {
|
||||
@@ -457,21 +457,23 @@ pub enum Endian {
|
||||
}
|
||||
|
||||
impl TargetCfg {
|
||||
- fn new(rustc_path: &Path, target: &str, target_rustcflags: &Vec<String>) -> TargetCfg {
|
||||
- let output = match Command::new(rustc_path)
|
||||
+ fn new(config: &Config) -> TargetCfg {
|
||||
+ let mut command = Command::new(&config.rustc_path);
|
||||
+ add_dylib_path(&mut command, iter::once(&config.compile_lib_path));
|
||||
+ let output = match command
|
||||
.arg("--print=cfg")
|
||||
.arg("--target")
|
||||
- .arg(target)
|
||||
- .args(target_rustcflags)
|
||||
+ .arg(&config.target)
|
||||
+ .args(&config.target_rustcflags)
|
||||
.output()
|
||||
{
|
||||
Ok(output) => output,
|
||||
- Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", rustc_path),
|
||||
+ Err(e) => panic!("error: failed to get cfg info from {:?}: {e}", config.rustc_path),
|
||||
};
|
||||
if !output.status.success() {
|
||||
panic!(
|
||||
"error: failed to get cfg info from {:?}\n--- stdout\n{}\n--- stderr\n{}",
|
||||
- rustc_path,
|
||||
+ config.rustc_path,
|
||||
String::from_utf8(output.stdout).unwrap(),
|
||||
String::from_utf8(output.stderr).unwrap(),
|
||||
);
|
||||
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
|
||||
index 8af5f1da694b..f8903f754f09 100644
|
||||
--- a/src/tools/compiletest/src/runtest.rs
|
||||
+++ b/src/tools/compiletest/src/runtest.rs
|
||||
@@ -13,7 +13,7 @@
|
||||
use crate::header::TestProps;
|
||||
use crate::json;
|
||||
use crate::read2::read2_abbreviated;
|
||||
-use crate::util::{logv, PathBufExt};
|
||||
+use crate::util::{add_dylib_path, dylib_env_var, logv, PathBufExt};
|
||||
use crate::ColorConfig;
|
||||
use regex::{Captures, Regex};
|
||||
use rustfix::{apply_suggestions, get_suggestions_from_json, Filter};
|
||||
@@ -26,6 +26,7 @@
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::io::prelude::*;
|
||||
use std::io::{self, BufReader};
|
||||
+use std::iter;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Child, Command, ExitStatus, Output, Stdio};
|
||||
use std::str;
|
||||
@@ -72,19 +73,6 @@ fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R {
|
||||
f()
|
||||
}
|
||||
|
||||
-/// The name of the environment variable that holds dynamic library locations.
|
||||
-pub fn dylib_env_var() -> &'static str {
|
||||
- if cfg!(windows) {
|
||||
- "PATH"
|
||||
- } else if cfg!(target_os = "macos") {
|
||||
- "DYLD_LIBRARY_PATH"
|
||||
- } else if cfg!(target_os = "haiku") {
|
||||
- "LIBRARY_PATH"
|
||||
- } else {
|
||||
- "LD_LIBRARY_PATH"
|
||||
- }
|
||||
-}
|
||||
-
|
||||
/// The platform-specific library name
|
||||
pub fn get_lib_name(lib: &str, dylib: bool) -> String {
|
||||
// In some casess (e.g. MUSL), we build a static
|
||||
@@ -1811,16 +1799,7 @@ fn compose_and_run(
|
||||
|
||||
// Need to be sure to put both the lib_path and the aux path in the dylib
|
||||
// search path for the child.
|
||||
- let mut path =
|
||||
- env::split_paths(&env::var_os(dylib_env_var()).unwrap_or_default()).collect::<Vec<_>>();
|
||||
- if let Some(p) = aux_path {
|
||||
- path.insert(0, PathBuf::from(p))
|
||||
- }
|
||||
- path.insert(0, PathBuf::from(lib_path));
|
||||
-
|
||||
- // Add the new dylib search path var
|
||||
- let newpath = env::join_paths(&path).unwrap();
|
||||
- command.env(dylib_env_var(), newpath);
|
||||
+ add_dylib_path(&mut command, iter::once(lib_path).chain(aux_path));
|
||||
|
||||
let mut child = disable_error_reporting(|| command.spawn())
|
||||
.unwrap_or_else(|_| panic!("failed to exec `{:?}`", &command));
|
||||
diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs
|
||||
index e5ff0906be8a..ec36f1e4fb72 100644
|
||||
--- a/src/tools/compiletest/src/util.rs
|
||||
+++ b/src/tools/compiletest/src/util.rs
|
||||
@@ -2,6 +2,7 @@
|
||||
use std::env;
|
||||
use std::ffi::OsStr;
|
||||
use std::path::PathBuf;
|
||||
+use std::process::Command;
|
||||
|
||||
use tracing::*;
|
||||
|
||||
@@ -111,3 +112,25 @@ fn with_extra_extension<S: AsRef<OsStr>>(&self, extension: S) -> PathBuf {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+/// The name of the environment variable that holds dynamic library locations.
|
||||
+pub fn dylib_env_var() -> &'static str {
|
||||
+ if cfg!(windows) {
|
||||
+ "PATH"
|
||||
+ } else if cfg!(target_os = "macos") {
|
||||
+ "DYLD_LIBRARY_PATH"
|
||||
+ } else if cfg!(target_os = "haiku") {
|
||||
+ "LIBRARY_PATH"
|
||||
+ } else {
|
||||
+ "LD_LIBRARY_PATH"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/// Adds a list of lookup paths to `cmd`'s dynamic library lookup path.
|
||||
+/// If the dylib_path_var is already set for this cmd, the old value will be overwritten!
|
||||
+pub fn add_dylib_path(cmd: &mut Command, paths: impl Iterator<Item = impl Into<PathBuf>>) {
|
||||
+ let path_env = env::var_os(dylib_env_var());
|
||||
+ let old_paths = path_env.as_ref().map(env::split_paths);
|
||||
+ let new_paths = paths.map(Into::into).chain(old_paths.into_iter().flatten());
|
||||
+ cmd.env(dylib_env_var(), env::join_paths(new_paths).unwrap());
|
||||
+}
|
||||
--
|
||||
2.38.1
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
||||
--- rustc-1.61.0-src/src/etc/rust-gdb.orig 2022-05-17 18:29:36.000000000 -0700
|
||||
+++ rustc-1.61.0-src/src/etc/rust-gdb 2022-05-18 11:18:13.732709661 -0700
|
||||
@@ -14,6 +14,9 @@ fi
|
||||
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
|
||||
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
||||
|
||||
+RUST_STD_BUILD="@BUILDDIR@/library/"
|
||||
+RUST_STD_SRC="$RUSTC_SYSROOT/lib/rustlib/src/rust/library/"
|
||||
+
|
||||
# Run GDB with the additional arguments that load the pretty printers
|
||||
# Set the environment variable `RUST_GDB` to overwrite the call to a
|
||||
# different/specific command (defaults to `gdb`).
|
||||
@@ -21,4 +24,5 @@ RUST_GDB="${RUST_GDB:-gdb}"
|
||||
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
|
||||
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
|
||||
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
|
||||
+ -iex "set substitute-path $RUST_STD_BUILD $RUST_STD_SRC" \
|
||||
"$@"
|
@ -1,43 +0,0 @@
|
||||
--- rustc-beta-src/Cargo.lock.orig 2022-09-24 10:20:14.000000000 -0700
|
||||
+++ rustc-beta-src/Cargo.lock 2022-10-04 10:26:35.490270607 -0700
|
||||
@@ -1971,7 +1971,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2004,20 +2003,6 @@
|
||||
]
|
||||
|
||||
[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.2.23"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
-
|
||||
-[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- rustc-beta-src/vendor/git2/Cargo.toml.orig 2022-10-04 10:26:35.490270607 -0700
|
||||
+++ rustc-beta-src/vendor/git2/Cargo.toml 2022-10-04 10:28:14.002187686 -0700
|
||||
@@ -58,9 +58,7 @@
|
||||
|
||||
[features]
|
||||
default = [
|
||||
- "ssh",
|
||||
"https",
|
||||
- "ssh_key_from_memory",
|
||||
]
|
||||
https = [
|
||||
"libgit2-sys/https",
|
@ -1,43 +0,0 @@
|
||||
--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2022-09-24 10:20:14.000000000 -0700
|
||||
+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2022-10-05 11:24:21.759564185 -0700
|
||||
@@ -755,7 +755,7 @@
|
||||
&& cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")
|
||||
{
|
||||
info!("linker output: {:?}", out);
|
||||
- warn!("Linker does not support -no-pie command line option. Retrying without.");
|
||||
+ info!("Linker does not support -no-pie command line option. Retrying without.");
|
||||
for arg in cmd.take_args() {
|
||||
if arg.to_string_lossy() != "-no-pie" {
|
||||
cmd.arg(arg);
|
||||
@@ -774,7 +774,7 @@
|
||||
&& cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")
|
||||
{
|
||||
info!("linker output: {:?}", out);
|
||||
- warn!(
|
||||
+ info!(
|
||||
"Linker does not support -static-pie command line option. Retrying with -static instead."
|
||||
);
|
||||
// Mirror `add_(pre,post)_link_objects` to replace CRT objects.
|
||||
@@ -1520,15 +1520,15 @@
|
||||
}
|
||||
|
||||
fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
|
||||
- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
|
||||
+ // Only use PIE if explicitly specified.
|
||||
+ #[allow(rustc::bad_opt_access)]
|
||||
+ let explicit_pic =
|
||||
+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
|
||||
+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
|
||||
(CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
|
||||
- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
|
||||
- LinkOutputKind::DynamicPicExe
|
||||
- }
|
||||
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
|
||||
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
|
||||
- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
|
||||
- LinkOutputKind::StaticPicExe
|
||||
- }
|
||||
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
|
||||
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
|
||||
(_, true, _) => LinkOutputKind::StaticDylib,
|
||||
(_, false, _) => LinkOutputKind::DynamicDylib,
|
@ -0,0 +1,21 @@
|
||||
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
|
||||
index 9abed30ea6f7..e4bf55df3688 100755
|
||||
--- a/src/etc/rust-gdb
|
||||
+++ b/src/etc/rust-gdb
|
||||
@@ -13,8 +13,6 @@ fi
|
||||
# Find out where the pretty printer Python module is
|
||||
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
|
||||
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
|
||||
-# Get the commit hash for path remapping
|
||||
-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
|
||||
|
||||
# Run GDB with the additional arguments that load the pretty printers
|
||||
# Set the environment variable `RUST_GDB` to overwrite the call to a
|
||||
@@ -23,6 +21,6 @@ RUST_GDB="${RUST_GDB:-gdb}"
|
||||
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
|
||||
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
|
||||
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
|
||||
- -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
|
||||
+ -iex "set substitute-path @BUILDDIR@ $RUSTC_SYSROOT/lib/rustlib/src/rust" \
|
||||
"$@"
|
||||
|
@ -0,0 +1,42 @@
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-06-24 10:27:37.000000000 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-07-07 17:12:23.406932870 -0700
|
||||
@@ -1942,7 +1942,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -1965,20 +1964,6 @@
|
||||
]
|
||||
|
||||
[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.3.0"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
-
|
||||
-[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-06-24 10:27:37.000000000 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-07-07 17:12:00.688392750 -0700
|
||||
@@ -31,7 +31,7 @@
|
||||
filetime = "0.2.9"
|
||||
flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
|
||||
fwdansi = "1.1.0"
|
||||
-git2 = "0.17.1"
|
||||
+git2 = { version = "0.17.1", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.18.0"
|
||||
gix = { version = "0.44.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] }
|
||||
gix-features-for-configuration-only = { version = "0.29.0", package = "gix-features", features = [ "parallel" ] }
|
Loading…
Reference in new issue