]> git.lizzy.rs Git - rust.git/commitdiff
std: make compilation of libpanic_unwind optional via a Cargo feature
authorJorge Aparicio <japaricious@gmail.com>
Thu, 24 Nov 2016 02:49:54 +0000 (21:49 -0500)
committerJorge Aparicio <japaricious@gmail.com>
Thu, 24 Nov 2016 02:49:54 +0000 (21:49 -0500)
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

src/bootstrap/lib.rs
src/libstd/Cargo.toml
src/rustc/std_shim/Cargo.toml

index 828e82d38321df60efe09df359dbd243e4f6f661..b751031e88b53dee565ae1127f916e805a9dd713 100644 (file)
@@ -507,7 +507,7 @@ fn tool_cmd(&self, compiler: &Compiler, tool: &str) -> Command {
     /// 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");
         }
index 21e6acc37f3d511845b9f8faf4d771a6ae0937e9..b9f52e20fdd8c9933c354509c2cfdafc82e54d24 100644 (file)
@@ -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"]
index 58a7bd8a1cb7519fa31ce820b44c0c0686ea2dc0..b4b7acc4e66b82b02e6847d1846741b27b05305a 100644 (file)
@@ -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"]