about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2017-01-22 12:58:56 -0800
committerAlex Crichton <alex@alexcrichton.com>2017-01-26 23:48:08 -0800
commit3d6f263b2a162974725cdcb914ba9ad9c2dbef84 (patch)
tree613b60c64368c1877f07193a5a6b86cb8bbf59c4 /src/libstd
parenta5561ce2b94c33add47d288e1826183c511ec9fa (diff)
downloadrust-3d6f263b2a162974725cdcb914ba9ad9c2dbef84.tar.gz
rust-3d6f263b2a162974725cdcb914ba9ad9c2dbef84.zip
std: Compile libbacktrace with -fvisibility=hidden
We don't want these symbols exported from the standard library, this is
just an internal implementation detail of the standard library
currently.

Closes #34984
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/build.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/build.rs b/src/libstd/build.rs
index 5e1c3a28515..9504194393f 100644
--- a/src/libstd/build.rs
+++ b/src/libstd/build.rs
@@ -87,8 +87,9 @@ fn build_libbacktrace(host: &str, target: &str) {
     let compiler = gcc::Config::new().get_compiler();
     // only msvc returns None for ar so unwrap is okay
     let ar = build_helper::cc2ar(compiler.path(), target).unwrap();
-    let cflags = compiler.args().iter().map(|s| s.to_str().unwrap())
-                         .collect::<Vec<_>>().join(" ");
+    let mut cflags = compiler.args().iter().map(|s| s.to_str().unwrap())
+                             .collect::<Vec<_>>().join(" ");
+    cflags.push_str(" -fvisibility=hidden");
     run(Command::new("sh")
                 .current_dir(&build_dir)
                 .arg(src_dir.join("configure").to_str().unwrap()