@@ -17,6 +17,7 @@ use std::{env, fs, str};
17
17
18
18
use serde_derive:: Deserialize ;
19
19
20
+ use crate :: core:: build_steps:: gcc:: { Gcc , add_cg_gcc_cargo_flags} ;
20
21
use crate :: core:: build_steps:: tool:: SourceType ;
21
22
use crate :: core:: build_steps:: { dist, llvm} ;
22
23
use crate :: core:: builder;
@@ -30,7 +31,7 @@ use crate::utils::exec::command;
30
31
use crate :: utils:: helpers:: {
31
32
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
32
33
} ;
33
- use crate :: { CLang , Compiler , DependencyType , GitRepo , LLVM_TOOLS , Mode } ;
34
+ use crate :: { CLang , Compiler , DependencyType , GitRepo , LLVM_TOOLS , Mode , trace } ;
34
35
35
36
#[ derive( Debug , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
36
37
pub struct Std {
@@ -107,7 +108,11 @@ impl Step for Std {
107
108
// the `rust.download-rustc=true` option.
108
109
let force_recompile = builder. rust_info ( ) . is_managed_git_subrepository ( )
109
110
&& builder. download_rustc ( )
110
- && builder. config . last_modified_commit ( & [ "library" ] , "download-rustc" , true ) . is_none ( ) ;
111
+ && builder. config . has_changes_from_upstream ( & [ "library" ] ) ;
112
+
113
+ trace ! ( "is managed git repo: {}" , builder. rust_info( ) . is_managed_git_subrepository( ) ) ;
114
+ trace ! ( "download_rustc: {}" , builder. download_rustc( ) ) ;
115
+ trace ! ( force_recompile) ;
111
116
112
117
run. builder . ensure ( Std {
113
118
compiler : run. builder . compiler ( run. builder . top_stage , run. build_triple ( ) ) ,
@@ -1500,6 +1505,14 @@ impl Step for CodegenBackend {
1500
1505
. arg ( builder. src . join ( format ! ( "compiler/rustc_codegen_{backend}/Cargo.toml" ) ) ) ;
1501
1506
rustc_cargo_env ( builder, & mut cargo, target, compiler. stage ) ;
1502
1507
1508
+ // Ideally, we'd have a separate step for the individual codegen backends,
1509
+ // like we have in tests (test::CodegenGCC) but that would require a lot of restructuring.
1510
+ // If the logic gets more complicated, it should probably be done.
1511
+ if backend == "gcc" {
1512
+ let gcc = builder. ensure ( Gcc { target } ) ;
1513
+ add_cg_gcc_cargo_flags ( & mut cargo, & gcc) ;
1514
+ }
1515
+
1503
1516
let tmp_stamp = BuildStamp :: new ( & out_dir) . with_prefix ( "tmp" ) ;
1504
1517
1505
1518
let _guard = builder. msg_build ( compiler, format_args ! ( "codegen backend {backend}" ) , target) ;
0 commit comments