summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
diff options
context:
space:
mode:
authorDeepesh Varatharajan <Deepesh.Varatharajan@windriver.com>2025-03-04 22:01:56 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-05 21:26:54 +0000
commit72e21bef1a6bcc8f05ad4e24cfef4228384f1c3a (patch)
tree0c7977c65f6bb1d0fec23dc3a39f17214e8bb2a9 /meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
parent64ad67cf6955cdaebbb3aec65318399013e09ce1 (diff)
downloadpoky-72e21bef1a6bcc8f05ad4e24cfef4228384f1c3a.tar.gz
rust: Upgrade 1.82.0->1.83.0
Rust stable version updated to 1.83.0. https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html Renamed and modified the below patch to adapt the new version. rv32-cargo-rustix-0.38.34-fix.patch->rv32-cargo-rustix-0.38.37-fix.patch Modified the below patches to adapt the new version. repro-issue-fix-with-cc-crate-hashmap.patch revert-link-std-statically-in-rustc_driver-feature.patch Dropped: zlib-off64_t.patch https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3kq Because of the following commit , https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e when we enable lib32, getting build failure because there is a check for target support for "-Zdual-proc-macros" flag not functioning properly when lib32 is enabled in the build environment. So for now reverting this commit and bring back the previous behavior, where the "-Zdual-proc-macros" flag is always added for building proc macros, regardless of the target architecture's support. This would bypass the check introduced in the patch, allowing the build to proceed without error, even when building for a 64-bit architecture with lib32 enabled. (From OE-Core rev: 40d8dafdf556d7ce79c12a6de872193be9a0928a) Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch')
-rw-r--r--meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch37
1 files changed, 33 insertions, 4 deletions
diff --git a/meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch b/meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
index 257883ef60..407d701bad 100644
--- a/meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
+++ b/meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch
@@ -104,7 +104,7 @@ diff --git a/src/bootstrap/src/bin/rustc.rs b/src/bootstrap/src/bin/rustc.rs
104index d04e2fbeb7..011c289d93 100644 104index d04e2fbeb7..011c289d93 100644
105--- a/src/bootstrap/src/bin/rustc.rs 105--- a/src/bootstrap/src/bin/rustc.rs
106+++ b/src/bootstrap/src/bin/rustc.rs 106+++ b/src/bootstrap/src/bin/rustc.rs
107@@ -89,25 +89,6 @@ fn main() { 107@@ -89,24 +89,6 @@ fn main() {
108 rustc_real 108 rustc_real
109 }; 109 };
110 110
@@ -114,7 +114,6 @@ index d04e2fbeb7..011c289d93 100644
114- // When statically linking `std` into `rustc_driver`, remove `-C prefer-dynamic` 114- // When statically linking `std` into `rustc_driver`, remove `-C prefer-dynamic`
115- if env::var("RUSTC_LINK_STD_INTO_RUSTC_DRIVER").unwrap() == "1" 115- if env::var("RUSTC_LINK_STD_INTO_RUSTC_DRIVER").unwrap() == "1"
116- && crate_name == Some("rustc_driver") 116- && crate_name == Some("rustc_driver")
117- && stage != "0"
118- { 117- {
119- if let Some(pos) = args.iter().enumerate().position(|(i, a)| { 118- if let Some(pos) = args.iter().enumerate().position(|(i, a)| {
120- a == "-C" && args.get(i + 1).map(|a| a == "prefer-dynamic").unwrap_or(false) 119- a == "-C" && args.get(i + 1).map(|a| a == "prefer-dynamic").unwrap_or(false)
@@ -130,7 +129,7 @@ index d04e2fbeb7..011c289d93 100644
130 let mut cmd = match env::var_os("RUSTC_WRAPPER_REAL") { 129 let mut cmd = match env::var_os("RUSTC_WRAPPER_REAL") {
131 Some(wrapper) if !wrapper.is_empty() => { 130 Some(wrapper) if !wrapper.is_empty() => {
132 let mut cmd = Command::new(wrapper); 131 let mut cmd = Command::new(wrapper);
133@@ -118,6 +99,9 @@ fn main() { 132@@ -117,6 +99,9 @@ fn main() {
134 }; 133 };
135 cmd.args(&args).env(dylib_path_var(), env::join_paths(&dylib_path).unwrap()); 134 cmd.args(&args).env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
136 135
@@ -144,7 +143,7 @@ diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.
144index ff0d1f3a72..b2c9602e57 100644 143index ff0d1f3a72..b2c9602e57 100644
145--- a/src/bootstrap/src/core/builder.rs 144--- a/src/bootstrap/src/core/builder.rs
146+++ b/src/bootstrap/src/core/builder.rs 145+++ b/src/bootstrap/src/core/builder.rs
147@@ -2153,7 +2153,7 @@ impl<'a> Builder<'a> { 146@@ -2201,7 +2201,7 @@ impl<'a> Builder<'a> {
148 // When we build Rust dylibs they're all intended for intermediate 147 // When we build Rust dylibs they're all intended for intermediate
149 // usage, so make sure we pass the -Cprefer-dynamic flag instead of 148 // usage, so make sure we pass the -Cprefer-dynamic flag instead of
150 // linking all deps statically into the dylib. 149 // linking all deps statically into the dylib.
@@ -197,3 +196,33 @@ index b8b0432aa9..b5bd71e015 100644
197 use std::env; 196 use std::env;
198 use std::io::stdout; 197 use std::io::stdout;
199 use std::path::{Path, PathBuf}; 198 use std::path::{Path, PathBuf};
199diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
200index 27bbc8bd8f..a6fc4df2eb 100644
201--- a/src/bootstrap/src/core/build_steps/compile.rs
202+++ b/src/bootstrap/src/core/build_steps/compile.rs
203@@ -1934,24 +1934,8 @@ impl Step for Assemble {
204 let src_libdir = builder.sysroot_libdir(build_compiler, host);
205 for f in builder.read_dir(&src_libdir) {
206 let filename = f.file_name().into_string().unwrap();
207-
208- let is_proc_macro = proc_macros.contains(&filename);
209- let is_dylib_or_debug = is_dylib(&filename) || is_debug_info(&filename);
210-
211- // If we link statically to stdlib, do not copy the libstd dynamic library file
212- // FIXME: Also do this for Windows once incremental post-optimization stage0 tests
213- // work without std.dll (see https://github.com/rust-lang/rust/pull/131188).
214- let can_be_rustc_dynamic_dep = if builder
215- .link_std_into_rustc_driver(target_compiler.host)
216- && !target_compiler.host.is_windows()
217+ if (is_dylib(&filename) || is_debug_info(&filename)) && !proc_macros.contains(&filename)
218 {
219- let is_std = filename.starts_with("std-") || filename.starts_with("libstd-");
220- !is_std
221- } else {
222- true
223- };
224-
225- if is_dylib_or_debug && can_be_rustc_dynamic_dep && !is_proc_macro {
226 builder.copy_link(&f.path(), &rustc_libdir.join(&filename));
227 }
228 }