Skip to content

Commit

Permalink
std: make compilation of libpanic_unwind optional via a Cargo feature
Browse files Browse the repository at this point in the history
with this feature disabled, you can (Cargo) compile std with
"panic=abort"

rustbuild will build std with this feature enabled, to maintain the
status quo

fixes #37252
  • Loading branch information
Jorge Aparicio committed Nov 24, 2016
1 parent 127a83d commit ba07a1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ impl Build {
/// Get the space-separated set of activated features for the standard
/// library.
fn std_features(&self) -> String {
let mut features = String::new();
let mut features = "panic-unwind".to_string();
if self.config.debug_jemalloc {
features.push_str(" debug-jemalloc");
}
Expand Down
5 changes: 3 additions & 2 deletions src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ crate-type = ["dylib", "rlib"]
alloc = { path = "../liballoc" }
alloc_jemalloc = { path = "../liballoc_jemalloc", optional = true }
alloc_system = { path = "../liballoc_system" }
panic_unwind = { path = "../libpanic_unwind" }
panic_unwind = { path = "../libpanic_unwind", optional = true }
panic_abort = { path = "../libpanic_abort" }
collections = { path = "../libcollections" }
core = { path = "../libcore" }
Expand All @@ -29,5 +29,6 @@ gcc = "0.3.27"

[features]
backtrace = []
jemalloc = ["alloc_jemalloc"]
debug-jemalloc = ["alloc_jemalloc/debug"]
jemalloc = ["alloc_jemalloc"]
panic-unwind = ["panic_unwind"]
5 changes: 3 additions & 2 deletions src/rustc/std_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ core = { path = "../../libcore" }

# Reexport features from std
[features]
jemalloc = ["std/jemalloc"]
debug-jemalloc = ["std/debug-jemalloc"]
backtrace = ["std/backtrace"]
debug-jemalloc = ["std/debug-jemalloc"]
jemalloc = ["std/jemalloc"]
panic-unwind = ["std/panic-unwind"]

0 comments on commit ba07a1b

Please sign in to comment.