summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-07-30 00:08:24 -0700
committerGitHub <noreply@github.com>2016-07-30 00:08:24 -0700
commit7580534c3a142c79340576c109f3cd73950996c0 (patch)
tree9540f76380c558928a9326f2d14149dab1c27433 /src/libstd/sys
parent2ad98a0b42917dbb0914f458829db7511be168d4 (diff)
parent774fbdf40deb9b257dd6aa166096fed1eeac80c2 (diff)
downloadrust-7580534c3a142c79340576c109f3cd73950996c0.tar.gz
rust-7580534c3a142c79340576c109f3cd73950996c0.zip
Auto merge of #35051 - japaric:backtrace, r=alexcrichton
rustbuild: make backtraces (RUST_BACKTRACE) optional

but keep them enabled by default to maintain the status quo.

When disabled shaves ~56KB off every x86_64-unknown-linux-gnu
binary.

To disable backtraces you have to use a config.toml (see
src/bootstrap/config.toml.example for details) when building rustc/std:

$ python bootstrap.py --config=config.toml

---

r? @alexcrichton
cc rust-lang/rfcs#1417
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/common/mod.rs2
-rw-r--r--src/libstd/sys/unix/mod.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs
index c9279883ae5..a1f3f477b3a 100644
--- a/src/libstd/sys/common/mod.rs
+++ b/src/libstd/sys/common/mod.rs
@@ -28,6 +28,7 @@ macro_rules! rtassert {
 
 pub mod args;
 pub mod at_exit_imp;
+#[cfg(any(not(cargobuild), feature = "backtrace"))]
 pub mod backtrace;
 pub mod condvar;
 pub mod io;
@@ -42,6 +43,7 @@ pub mod thread_local;
 pub mod util;
 pub mod wtf8;
 
+#[cfg(any(not(cargobuild), feature = "backtrace"))]
 #[cfg(any(all(unix, not(any(target_os = "macos", target_os = "ios", target_os = "emscripten"))),
           all(windows, target_env = "gnu")))]
 pub mod gnu;
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index f0fd42fc99b..1c25c8f77c1 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -30,6 +30,7 @@ use libc;
 pub mod weak;
 
 pub mod android;
+#[cfg(any(not(cargobuild), feature = "backtrace"))]
 pub mod backtrace;
 pub mod condvar;
 pub mod ext;