@@ -45,8 +45,7 @@ fn build(
45
45
util:: mkdir ( & dst) ?;
46
46
47
47
build_libcore ( cmode, & ctoml, home, src, & dst, verbose) ?;
48
- build_libcompiler_builtins ( cmode, & ctoml, home, src, & dst, config, verbose) ?;
49
- build_liballoc ( cmode, & ctoml, home, src, & dst, verbose) ?;
48
+ build_liballoc ( cmode, & ctoml, home, src, & dst, config, verbose) ?;
50
49
51
50
// Create hash file
52
51
util:: write ( & rustlib. parent ( ) . join ( ".hash" ) , & hash. to_string ( ) ) ?;
@@ -114,8 +113,7 @@ fn build_crate(
114
113
}
115
114
116
115
cmd. arg ( "--" ) ;
117
- cmd. arg ( "--sysroot" ) ;
118
- cmd. arg ( home. display ( ) . to_string ( ) ) ;
116
+ cmd. env ( "RUSTFLAGS" , & format ! ( "--sysroot {}" , home. display( ) ) ) ;
119
117
cmd. arg ( "-Z" ) ;
120
118
cmd. arg ( "force-unstable-if-unmarked" ) ;
121
119
@@ -162,7 +160,7 @@ version = "0.0.0"
162
160
build_crate ( "core" , stoml, cmode, ctoml, home, dst, verbose)
163
161
}
164
162
165
- fn build_libcompiler_builtins (
163
+ fn build_liballoc (
166
164
cmode : & CompilationMode ,
167
165
ctoml : & cargo:: Toml ,
168
166
home : & Home ,
@@ -174,53 +172,18 @@ fn build_libcompiler_builtins(
174
172
const TOML : & ' static str = r#"
175
173
[package]
176
174
authors = ["The Rust Project Developers"]
177
- name = "sysroot "
175
+ name = "alloc "
178
176
version = "0.0.0"
177
+
178
+ [dependencies.compiler_builtins]
179
+ version = "0.1.0"
179
180
"# ;
180
181
181
182
let mut stoml = TOML . to_owned ( ) ;
182
183
183
- let path = src. path ( )
184
- . join ( "libcompiler_builtins" )
185
- . display ( )
186
- . to_string ( ) ;
187
- let mut compiler_builtin_dep = Table :: new ( ) ;
188
- compiler_builtin_dep. insert ( "path" . to_owned ( ) , Value :: String ( path) ) ;
189
-
190
- let mut features = vec ! [ Value :: String ( "compiler-builtins" . to_owned( ) ) ] ;
191
184
if config. memcpy {
192
- features . push ( Value :: String ( " mem" . to_owned ( ) ) ) ;
185
+ stoml . push_str ( "features = [ \" mem\" ] \n " ) ;
193
186
}
194
- compiler_builtin_dep. insert ( "default-features" . to_owned ( ) , Value :: Boolean ( false ) ) ;
195
- compiler_builtin_dep. insert ( "features" . to_owned ( ) , Value :: Array ( features) ) ;
196
- let mut deps = Table :: new ( ) ;
197
- deps. insert (
198
- "compiler_builtins" . to_owned ( ) ,
199
- Value :: Table ( compiler_builtin_dep) ,
200
- ) ;
201
- let mut map = Table :: new ( ) ;
202
- map. insert ( "dependencies" . to_owned ( ) , Value :: Table ( deps) ) ;
203
- stoml. push_str ( & Value :: Table ( map) . to_string ( ) ) ;
204
-
205
- build_crate ( "compiler_builtins" , stoml, cmode, ctoml, home, dst, verbose)
206
- }
207
-
208
- fn build_liballoc (
209
- cmode : & CompilationMode ,
210
- ctoml : & cargo:: Toml ,
211
- home : & Home ,
212
- src : & Src ,
213
- dst : & Path ,
214
- verbose : bool ,
215
- ) -> Result < ( ) > {
216
- const TOML : & ' static str = r#"
217
- [package]
218
- authors = ["The Rust Project Developers"]
219
- name = "alloc"
220
- version = "0.0.0"
221
- "# ;
222
-
223
- let mut stoml = TOML . to_owned ( ) ;
224
187
225
188
let path = src. path ( ) . join ( "liballoc/lib.rs" ) . display ( ) . to_string ( ) ;
226
189
let mut map = Table :: new ( ) ;
0 commit comments