about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-11-24 19:03:07 -0600
committerGitHub <noreply@github.com>2016-11-24 19:03:07 -0600
commit2e7176f98bf64c3644408cec40c4b2541d96148e (patch)
treec49aad0c7e5642ac3fee0809b3586c2db7b484a2 /src
parentd9bdc636da951314064d8c3442bc5842a13e5b79 (diff)
parentba07a1b58d72fb460734014f5d314a206dad7359 (diff)
downloadrust-2e7176f98bf64c3644408cec40c4b2541d96148e.tar.gz
rust-2e7176f98bf64c3644408cec40c4b2541d96148e.zip
Auto merge of #37974 - japaric:abort, r=alexcrichton
std: make compilation of libpanic_unwind optional via a Cargo feature

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

r? @alexcrichton
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs2
-rw-r--r--src/libstd/Cargo.toml5
-rw-r--r--src/rustc/std_shim/Cargo.toml5
3 files changed, 7 insertions, 5 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 828e82d3832..b751031e88b 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -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");
         }
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index 21e6acc37f3..b9f52e20fdd 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -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" }
@@ -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"]
diff --git a/src/rustc/std_shim/Cargo.toml b/src/rustc/std_shim/Cargo.toml
index 58a7bd8a1cb..b4b7acc4e66 100644
--- a/src/rustc/std_shim/Cargo.toml
+++ b/src/rustc/std_shim/Cargo.toml
@@ -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"]