mirror of
https://git.yoctoproject.org/poky
synced 2026-09-13 09:49:32 +02:00
rust: Upgrade 1.80.1->1.81.0
https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html Drop the following backported patches which is addressed with rust v1.81.0 upgrade. 0001-cargo-do-not-write-host-information-into-compilation.patch2db0bab161hardcodepaths.patch28503d69ac(From OE-Core rev: 611ec9ffbac974f472a828277ba7f3e344e99ca3) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3805214ecf
commit
e51f98d5ff
@@ -1,51 +0,0 @@
|
||||
From 065d7c263091118437465d714d8a29dbb6296921 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Kanavin <alex@linutronix.de>
|
||||
Date: Mon, 13 May 2024 14:57:54 +0200
|
||||
Subject: [PATCH] cargo: do not write host information into compilation unit
|
||||
hashes
|
||||
|
||||
This breaks reproducibility in cross-builds where the cross-target
|
||||
can be the same, but build hosts are different, as seen with
|
||||
"rustc --version -v":
|
||||
...
|
||||
host: x86_64-unknown-linux-gnu
|
||||
|
||||
vs.
|
||||
|
||||
host: aarch64-unknown-linux-gnu
|
||||
|
||||
This can possibly be improved by only hashing host info if the build
|
||||
is a native one (e.g. there's no --target option passed to cargo
|
||||
invocation) but I'm not sure how.
|
||||
|
||||
Upstream-Status: Inappropriate [reported at https://github.com/rust-lang/cargo/issues/13922]
|
||||
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
|
||||
---
|
||||
.../src/cargo/core/compiler/context/compilation_files.rs | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/tools/cargo/src/cargo/core/compiler/build_runner/compilation_files.rs b/src/tools/cargo/src/cargo/core/compiler/build_runner/compilation_files.rs
|
||||
index d83dbf10c..b2ad8d9f3 100644
|
||||
--- a/src/tools/cargo/src/cargo/core/compiler/build_runner/compilation_files.rs
|
||||
+++ b/src/tools/cargo/src/cargo/core/compiler/build_runner/compilation_files.rs
|
||||
@@ -652,7 +652,7 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher) {
|
||||
if vers.pre.is_empty() || bcx.gctx.cli_unstable().separate_nightlies {
|
||||
// For stable, keep the artifacts separate. This helps if someone is
|
||||
// testing multiple versions, to avoid recompiles.
|
||||
- bcx.rustc().verbose_version.hash(hasher);
|
||||
+ //bcx.rustc().verbose_version.hash(hasher);
|
||||
return;
|
||||
}
|
||||
// On "nightly"/"beta"/"dev"/etc, keep each "channel" separate. Don't hash
|
||||
@@ -665,7 +665,7 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher) {
|
||||
// Keep "host" since some people switch hosts to implicitly change
|
||||
// targets, (like gnu vs musl or gnu vs msvc). In the future, we may want
|
||||
// to consider hashing `unit.kind.short_name()` instead.
|
||||
- bcx.rustc().host.hash(hasher);
|
||||
+ //bcx.rustc().host.hash(hasher);
|
||||
// None of the other lines are important. Currently they are:
|
||||
// binary: rustc <-- or "rustdoc"
|
||||
// commit-hash: 38114ff16e7856f98b2b4be7ab4cd29b38bed59a
|
||||
--
|
||||
2.39.2
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
When building for the target, some build paths end up embedded in the binaries.
|
||||
These changes remove that. Further investigation is needed to work out the way
|
||||
to resolve these issues properly upstream.
|
||||
|
||||
Upstream-Status: Inappropriate [patches need rework]
|
||||
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
|
||||
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
|
||||
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
|
||||
index b4b2ab1e1f8a..8bb3e3f0557c 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/context.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/context.rs
|
||||
@@ -34,7 +34,6 @@
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use libc::c_uint;
|
||||
-use std::borrow::Borrow;
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::ffi::CStr;
|
||||
use std::str;
|
||||
@@ -155,25 +154,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- // Ensure the data-layout values hardcoded remain the defaults.
|
||||
- {
|
||||
- let tm = crate::back::write::create_informational_target_machine(tcx.sess);
|
||||
- llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, &tm);
|
||||
-
|
||||
- let llvm_data_layout = llvm::LLVMGetDataLayoutStr(llmod);
|
||||
- let llvm_data_layout = str::from_utf8(CStr::from_ptr(llvm_data_layout).to_bytes())
|
||||
- .expect("got a non-UTF8 data-layout from LLVM");
|
||||
-
|
||||
- if target_data_layout != llvm_data_layout {
|
||||
- tcx.dcx().emit_err(crate::errors::MismatchedDataLayout {
|
||||
- rustc_target: sess.opts.target_triple.to_string().as_str(),
|
||||
- rustc_layout: target_data_layout.as_str(),
|
||||
- llvm_target: sess.target.llvm_target.borrow(),
|
||||
- llvm_layout: llvm_data_layout,
|
||||
- });
|
||||
- }
|
||||
- }
|
||||
-
|
||||
let data_layout = SmallCStr::new(&target_data_layout);
|
||||
llvm::LLVMSetDataLayout(llmod, data_layout.as_ptr());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
rust: reproducibility issue fix with v1.80
|
||||
rust: reproducibility issue fix with v1.81
|
||||
|
||||
A few crates are using the updated version of the 'cc' crate and this is causing the generated object file names containing a unique hashmap id.
|
||||
By the following changes same hash values will be genarted even for diffrent build paths.
|
||||
@@ -49,6 +49,57 @@ Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
|
||||
let obj = dst
|
||||
.join(format!("{:016x}-{}", hasher.finish(), basename))
|
||||
.with_extension("o");
|
||||
diff --git a/vendor/cc-1.0.99/src/command_helpers.rs b/vendor/cc-1.0.99/src/command_helpers.rs
|
||||
index fe919a5239..2b1f442019 100644
|
||||
--- a/vendor/cc-1.0.99/src/command_helpers.rs
|
||||
+++ b/vendor/cc-1.0.99/src/command_helpers.rs
|
||||
@@ -257,6 +257,7 @@ fn wait_on_child(
|
||||
/// and store them in the output Object.
|
||||
pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec<Object>, Error> {
|
||||
let mut objects = Vec::with_capacity(files.len());
|
||||
+ let target_substring = ["rustc"];
|
||||
for file in files {
|
||||
let basename = file
|
||||
.file_name()
|
||||
@@ -277,10 +278,29 @@ pub(crate) fn objects_from_files(files: &[Arc<Path>], dst: &Path) -> Result<Vec<
|
||||
})?
|
||||
.to_string_lossy();
|
||||
|
||||
+ // Function to find the position of the first occurrence of the target substring
|
||||
+ fn find_target_position(s: &str, targets: &[&str]) -> Option<usize> {
|
||||
+ let mut pos = None;
|
||||
+ for target in targets {
|
||||
+ if let Some(index) = s.rfind(target) {
|
||||
+ //If a target is found and pos is None, set it
|
||||
+ if pos.is_none() || index < pos.unwrap() {
|
||||
+ pos = Some(index);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ pos
|
||||
+ }
|
||||
+
|
||||
+ let filtered_dirname = if let Some(pos) = find_target_position(&dirname, &target_substring) {
|
||||
+ dirname[pos..].to_string() //Keep everything from the target substring onwards
|
||||
+ } else {
|
||||
+ dirname.to_string() //If target substring is not found, keep the original dirname
|
||||
+ };
|
||||
// Hash the dirname. This should prevent conflicts if we have multiple
|
||||
// object files with the same filename in different subfolders.
|
||||
let mut hasher = hash_map::DefaultHasher::new();
|
||||
- hasher.write(dirname.to_string().as_bytes());
|
||||
+ hasher.write(filtered_dirname.as_bytes());
|
||||
let obj = dst
|
||||
.join(format!("{:016x}-{}", hasher.finish(), basename))
|
||||
.with_extension("o");
|
||||
diff --git a/vendor/cc-1.0.99/.cargo-checksum.json b/vendor/cc-1.0.99/.cargo-checksum.json
|
||||
index b070eeb322..ba768ff86f 100644
|
||||
--- a/vendor/cc-1.0.99/.cargo-checksum.json
|
||||
+++ b/vendor/cc-1.0.99/.cargo-checksum.json
|
||||
@@ -1 +1 @@
|
||||
-{"files":{"Cargo.toml":"3c555dbe1a698f12b66c8a5748ed52ff26ff7b8ebb12237c1a72a1cbe4b9392e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"f1ddbede208a5b78333a25dac0a7598e678e9b601a7d99a791069bddaf180dfe","src/command_helpers.rs":"15afbc35930a5a53f00d74a8910cff35caeb5511c26642cffe5630377aced901","src/detect_compiler_family.c":"72903b91d7a28f49b39e7d730f4c9c4bb39fb901948fa1279cd08abf392f5a29","src/lib.rs":"92440d3adb5cb6ea05596d9ca860a205d3937dbf0fc959e524bac5f2b748c1af","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/job_token.rs":"352a0295c965c684904329d334f3b9889db3a9c3f201701f8db44e4d00e00515","src/parallel/mod.rs":"bd9c1334d17d138c281961c690b8d8118a2d6295a7d6cd7296826255436fa063","src/parallel/stderr.rs":"a2d18ba3f2e04deb9047ece9ab7ca5452d9a76b515afbe20a76307e31597f34b","src/target_info.rs":"342be00f6215e161d8163e272a2945bb9f52f171648e15e11d46800a73186955","src/tempfile.rs":"47a58e904ac07da6682004b5b615dc83250b253a8d3e8ba1b9bcaf6cdf4fd142","src/tool.rs":"e13c439a96d8311ba8d37b9d5522cd6997d94261cbb95517c82df70525acaa7f","src/windows/com.rs":"a2800ddb81215fff2bf618336f5c4ff8e8bdb746dd18b795873c7304b3f2a5e3","src/windows/find_tools.rs":"4c350cddbce1557682b7f40cd917cc4f131ad89ff2e34c23d629014ed8d7203e","src/windows/mod.rs":"42f1ad7fee35a17686b003e6aa520d3d1940d47d2f531d626e9ae0c48ba49005","src/windows/registry.rs":"c521b72c825e8095843e73482ffa810ed066ad8bb9f86e6db0c5c143c171aba1","src/windows/setup_config.rs":"754439cbab492afd44c9755abcbec1a41c9b2c358131cee2df13c0e996dbbec8","src/windows/vs_instances.rs":"76e3cee74b5fd38ddaf533bba11fe401667c50dda5f9d064099840893eaa7587","src/windows/winapi.rs":"250d51c1826d1a2329e9889dd9f058cfce253dbf2a678b076147c6cdb5db046c","src/windows/windows_sys.rs":"5a440eb39d8a0c176b66177e8753186797793bc5d7896292c408fb44c12dfed3"},"package":"96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"}
|
||||
\ No newline at end of file
|
||||
+{"files":{"Cargo.toml":"3c555dbe1a698f12b66c8a5748ed52ff26ff7b8ebb12237c1a72a1cbe4b9392e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"f1ddbede208a5b78333a25dac0a7598e678e9b601a7d99a791069bddaf180dfe","src/command_helpers.rs":"4c4a9ea55a109dbeada9e23d4ec963c257a56451b5fd16c7e4e8b97374f1a2ff","src/detect_compiler_family.c":"72903b91d7a28f49b39e7d730f4c9c4bb39fb901948fa1279cd08abf392f5a29","src/lib.rs":"92440d3adb5cb6ea05596d9ca860a205d3937dbf0fc959e524bac5f2b748c1af","src/parallel/async_executor.rs":"4ce24435fff6b6555b43fee042c16bd65d4150d0346567f246b9190d85b45983","src/parallel/job_token.rs":"352a0295c965c684904329d334f3b9889db3a9c3f201701f8db44e4d00e00515","src/parallel/mod.rs":"bd9c1334d17d138c281961c690b8d8118a2d6295a7d6cd7296826255436fa063","src/parallel/stderr.rs":"a2d18ba3f2e04deb9047ece9ab7ca5452d9a76b515afbe20a76307e31597f34b","src/target_info.rs":"342be00f6215e161d8163e272a2945bb9f52f171648e15e11d46800a73186955","src/tempfile.rs":"47a58e904ac07da6682004b5b615dc83250b253a8d3e8ba1b9bcaf6cdf4fd142","src/tool.rs":"e13c439a96d8311ba8d37b9d5522cd6997d94261cbb95517c82df70525acaa7f","src/windows/com.rs":"a2800ddb81215fff2bf618336f5c4ff8e8bdb746dd18b795873c7304b3f2a5e3","src/windows/find_tools.rs":"4c350cddbce1557682b7f40cd917cc4f131ad89ff2e34c23d629014ed8d7203e","src/windows/mod.rs":"42f1ad7fee35a17686b003e6aa520d3d1940d47d2f531d626e9ae0c48ba49005","src/windows/registry.rs":"c521b72c825e8095843e73482ffa810ed066ad8bb9f86e6db0c5c143c171aba1","src/windows/setup_config.rs":"754439cbab492afd44c9755abcbec1a41c9b2c358131cee2df13c0e996dbbec8","src/windows/vs_instances.rs":"76e3cee74b5fd38ddaf533bba11fe401667c50dda5f9d064099840893eaa7587","src/windows/winapi.rs":"250d51c1826d1a2329e9889dd9f058cfce253dbf2a678b076147c6cdb5db046c","src/windows/windows_sys.rs":"5a440eb39d8a0c176b66177e8753186797793bc5d7896292c408fb44c12dfed3"},"package":"96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695"}
|
||||
--- a/vendor/cc-1.0.97/.cargo-checksum.json
|
||||
+++ b/vendor/cc-1.0.97/.cargo-checksum.json
|
||||
@@ -1 +1 @@
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user