@@ -17,7 +17,7 @@ pub(crate) fn build_sysroot(
17
17
channel : & str ,
18
18
sysroot_kind : SysrootKind ,
19
19
cg_clif_dylib_src : & Path ,
20
- host_compiler : & Compiler ,
20
+ bootstrap_host_compiler : & Compiler ,
21
21
target_triple : & str ,
22
22
) {
23
23
eprintln ! ( "[BUILD] sysroot {:?}" , sysroot_kind) ;
@@ -53,7 +53,8 @@ pub(crate) fn build_sysroot(
53
53
54
54
let default_sysroot = super :: rustc_info:: get_default_sysroot ( ) ;
55
55
56
- let host_rustlib_lib = RUSTLIB_DIR . to_path ( dirs) . join ( & host_compiler. triple ) . join ( "lib" ) ;
56
+ let host_rustlib_lib =
57
+ RUSTLIB_DIR . to_path ( dirs) . join ( & bootstrap_host_compiler. triple ) . join ( "lib" ) ;
57
58
let target_rustlib_lib = RUSTLIB_DIR . to_path ( dirs) . join ( target_triple) . join ( "lib" ) ;
58
59
fs:: create_dir_all ( & host_rustlib_lib) . unwrap ( ) ;
59
60
fs:: create_dir_all ( & target_rustlib_lib) . unwrap ( ) ;
@@ -83,7 +84,11 @@ pub(crate) fn build_sysroot(
83
84
SysrootKind :: None => { } // Nothing to do
84
85
SysrootKind :: Llvm => {
85
86
for file in fs:: read_dir (
86
- default_sysroot. join ( "lib" ) . join ( "rustlib" ) . join ( & host_compiler. triple ) . join ( "lib" ) ,
87
+ default_sysroot
88
+ . join ( "lib" )
89
+ . join ( "rustlib" )
90
+ . join ( & bootstrap_host_compiler. triple )
91
+ . join ( "lib" ) ,
87
92
)
88
93
. unwrap ( )
89
94
{
@@ -103,7 +108,7 @@ pub(crate) fn build_sysroot(
103
108
try_hard_link ( & file, host_rustlib_lib. join ( file. file_name ( ) . unwrap ( ) ) ) ;
104
109
}
105
110
106
- if target_triple != host_compiler . triple {
111
+ if target_triple != bootstrap_host_compiler . triple {
107
112
for file in fs:: read_dir (
108
113
default_sysroot. join ( "lib" ) . join ( "rustlib" ) . join ( target_triple) . join ( "lib" ) ,
109
114
)
@@ -118,19 +123,19 @@ pub(crate) fn build_sysroot(
118
123
build_clif_sysroot_for_triple (
119
124
dirs,
120
125
channel,
121
- host_compiler . clone ( ) ,
126
+ bootstrap_host_compiler . clone ( ) ,
122
127
& cg_clif_dylib_path,
123
128
) ;
124
129
125
- if host_compiler . triple != target_triple {
130
+ if bootstrap_host_compiler . triple != target_triple {
126
131
build_clif_sysroot_for_triple (
127
132
dirs,
128
133
channel,
129
134
{
130
- let mut target_compiler = host_compiler . clone ( ) ;
131
- target_compiler . triple = target_triple. to_owned ( ) ;
132
- target_compiler . set_cross_linker_and_runner ( ) ;
133
- target_compiler
135
+ let mut bootstrap_target_compiler = bootstrap_host_compiler . clone ( ) ;
136
+ bootstrap_target_compiler . triple = target_triple. to_owned ( ) ;
137
+ bootstrap_target_compiler . set_cross_linker_and_runner ( ) ;
138
+ bootstrap_target_compiler
134
139
} ,
135
140
& cg_clif_dylib_path,
136
141
) ;
0 commit comments