Skip to content

Commit f93a62b

Browse files
committed
Auto merge of #31792 - Zoxc:sysroot, r=alexcrichton
With these changes you can build a freestanding sysroot without using floating points using a Cargo.toml and copying the `deps` folder cargo outputs. ``` [package] name = "sysroot" version = "0.1.0" [lib] path = "lib.rs" crate-type = ["rlib"] [dependencies.core] path = "../vendor/rust/src/src/libcore" features = ["disable_float"] [dependencies] collections = { path = "../vendor/rust/src/src/libcollections" } ```
2 parents 0f62d21 + 8ade080 commit f93a62b

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/liballoc/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ test = false
1010

1111
[dependencies]
1212
core = { path = "../libcore" }
13-
libc = { path = "../rustc/libc_shim" }
14-
alloc_system = { path = "../liballoc_system" }

src/liballoc/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,9 @@
9292
#![feature(unsafe_no_drop_flag, filling_drop)]
9393
#![feature(unsize)]
9494

95-
// Issue# 30592: Systematically use alloc_system during stage0 since jemalloc
96-
// might be unavailable or disabled
97-
#![cfg_attr(stage0, feature(alloc_system))]
98-
9995
#![cfg_attr(not(test), feature(raw, fn_traits, placement_new_protocol))]
10096
#![cfg_attr(test, feature(test, rustc_private, box_heap))]
10197

102-
#[cfg(stage0)]
103-
extern crate alloc_system;
104-
10598
// Allow testing this library
10699

107100
#[cfg(test)]

src/libstd/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@
269269
#![feature(vec_push_all)]
270270
#![feature(zero_one)]
271271

272+
// Issue# 30592: Systematically use alloc_system during stage0 since jemalloc
273+
// might be unavailable or disabled
274+
#![cfg_attr(stage0, feature(alloc_system))]
275+
272276
// Don't link to std. We are std.
273277
#![no_std]
274278

@@ -295,6 +299,9 @@ extern crate alloc;
295299
extern crate rustc_unicode;
296300
extern crate libc;
297301

302+
#[cfg(stage0)]
303+
extern crate alloc_system;
304+
298305
// Make std testable by not duplicating lang items and other globals. See #2912
299306
#[cfg(test)] extern crate std as realstd;
300307

0 commit comments

Comments
 (0)