Skip to content

Commit 831b81f

Browse files
committed
rust183: re-do fix to issue #133629 by applying upstream fix.
Fix is rust-lang/rust#136309 confirmed to work as intended.
1 parent b05bbdd commit 831b81f

File tree

2 files changed

+24
-32
lines changed

2 files changed

+24
-32
lines changed

rust183/distinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ SHA1 (patch-library_stdarch_crates_std__detect_tests_cpu-detection.rs) = 97c3ad8
124124
SHA1 (patch-src_bootstrap_bootstrap.py) = 150a5a7e057de9edbf96f3c387207fda8ba750f9
125125
SHA1 (patch-src_bootstrap_src_core_build__steps_compile.rs) = e928203ed4734c93cc33c5a3f7879cf18dcecc83
126126
SHA1 (patch-src_bootstrap_src_core_build__steps_install.rs) = cc6558df42c9c9ac28fdb2ff180bdaa7f22ce816
127-
SHA1 (patch-src_bootstrap_src_core_builder.rs) = 952c31f21698daedf74eb9d0efece1c0ca1105bb
127+
SHA1 (patch-src_bootstrap_src_core_builder.rs) = 6d996c1b82755a5cf81761dc65c88572641aec10
128128
SHA1 (patch-src_bootstrap_src_lib.rs) = d29bc3c0b335d5e788eecbb02fc08966beef0fb1
129129
SHA1 (patch-src_llvm-project_llvm_CMakeLists.txt) = 7abfabb6ec70df229a69355f8c76825610165c37
130130
SHA1 (patch-src_llvm-project_llvm_cmake_modules_AddLLVM.cmake) = e1b2eb2f0b3cf1cf87b443656ae306b3242f6b12

rust183/patches/patch-src_bootstrap_src_core_builder.rs

+23-31
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,34 @@ $NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.5 2024/07/27 02:35:24 tnn E
33
Find external libunwind on Linux.
44
Use @PREFIX@ in rpath.
55

6-
Also, following up on
7-
https://github.com/rust-lang/rust/issues/133629, reverse
8-
https://github.com/rust-lang/rust/pull/130899/commits/68034f837a39387e49fc7d7c5b088f5372a1127e
9-
to see if this fixes the cross-compile failure.
6+
Also, follow up on
7+
https://github.com/rust-lang/rust/issues/133629 by applying
8+
https://github.com/rust-lang/rust/pull/136309
9+
which should fix the cross-compile failure.
1010

1111
--- src/bootstrap/src/core/builder.rs.orig 2024-11-26 10:12:09.000000000 +0000
1212
+++ src/bootstrap/src/core/builder.rs
13-
@@ -1698,24 +1698,10 @@ impl<'a> Builder<'a> {
14-
match mode {
15-
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {}
16-
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
17-
- // Build proc macros both for the host and the target unless proc-macros are not
18-
- // supported by the target.
19-
+ // Build proc macros both for the host and the target
13+
@@ -1701,7 +1701,10 @@ impl<'a> Builder<'a> {
14+
// Build proc macros both for the host and the target unless proc-macros are not
15+
// supported by the target.
2016
if target != compiler.host && cmd_kind != Kind::Check {
2117
- let error = command(self.rustc(compiler))
22-
- .arg("--target")
23-
- .arg(target.rustc_target_arg())
24-
- .arg("--print=file-names")
25-
- .arg("--crate-type=proc-macro")
26-
- .arg("-")
27-
- .run_capture(self)
28-
- .stderr();
29-
- let not_supported = error
30-
- .lines()
31-
- .any(|line| line.contains("unsupported crate type `proc-macro`"));
32-
- if !not_supported {
33-
- cargo.arg("-Zdual-proc-macros");
34-
- rustflags.arg("-Zdual-proc-macros");
35-
- }
36-
+ cargo.arg("-Zdual-proc-macros");
37-
+ rustflags.arg("-Zdual-proc-macros");
38-
}
39-
}
40-
}
41-
@@ -2262,6 +2248,11 @@ impl<'a> Builder<'a> {
18+
+ let mut rustc_cmd = command(self.rustc(compiler));
19+
+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
20+
+
21+
+ let error = rustc_cmd
22+
.arg("--target")
23+
.arg(target.rustc_target_arg())
24+
.arg("--print=file-names")
25+
@@ -1709,6 +1712,7 @@ impl<'a> Builder<'a> {
26+
.arg("-")
27+
.run_capture(self)
28+
.stderr();
29+
+
30+
let not_supported = error
31+
.lines()
32+
.any(|line| line.contains("unsupported crate type `proc-macro`"));
33+
@@ -2262,6 +2266,11 @@ impl<'a> Builder<'a> {
4234
rustdocflags.arg("--cfg=parallel_compiler");
4335
}
4436

0 commit comments

Comments
 (0)