Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create a nostd crate
the goal is to build, in a single Cargo invocation, several no-std crates that we want to put in the
rust-std component of no-std targets. The nostd crate builds these crates:

- core
- compiler-builtin (with the "c" and "mem" features enabled)
- alloc
- std_unicode
  • Loading branch information
japaric committed Apr 4, 2018
commit 14768f9b636ef345320ded41da5e9f3da7af3a81
10 changes: 10 additions & 0 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"bootstrap",
"rustc",
"libnostd",
"libstd",
"libtest",
"librustc_trans",
Expand Down
8 changes: 4 additions & 4 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ pub fn std_cargo(build: &Builder,
}

if build.no_std(target) == Some(true) {
// for no-std targets we only compile core and compiler-builtins
cargo.arg("--features").arg("c mem")
.arg("--manifest-path")
.arg(build.src.join("src/rustc/compiler_builtins_shim/Cargo.toml"));
// for no-std targets we compile a minimal nostd crate that only depends on crates that work
// without an OS
cargo.arg("--manifest-path")
.arg(build.src.join("src/libnostd/Cargo.toml"));
} else {
let mut features = build.std_features();

Expand Down
17 changes: 17 additions & 0 deletions src/libnostd/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
authors = ["The Rust Project Developers"]
name = "nostd"
version = "0.0.0"
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-lang/rust.git"
description = "(not) The Rust Standard Library"

[lib]
name = "nostd"
path = "lib.rs"

[dependencies]
alloc = { path = "../liballoc" }
compiler_builtins = { path = "../rustc/compiler_builtins_shim", features = ["c", "mem"] }
core = { path = "../libcore" }
std_unicode = { path = "../libstd_unicode" }
3 changes: 3 additions & 0 deletions src/libnostd/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#![feature(staged_api)]
#![no_std]
#![unstable(feature = "nostd", issue = "0")]