@@ -3,42 +3,34 @@ $NetBSD: patch-src_bootstrap_src_core_builder.rs,v 1.5 2024/07/27 02:35:24 tnn E
33Find  external libunwind on Linux . 
44Use  @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/ 68034 f837a39387e49fc7d7c5b088f5372a1127e 
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