about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-27 10:01:45 +0000
committerbors <bors@rust-lang.org>2017-01-27 10:01:45 +0000
commit8367fb7ba6abae89ab7e17c1b3987ee321f5bb71 (patch)
tree21b4f4f8b07ec2058229ef9dbbb316a7155fd1b8 /src/libstd
parentfece9c735678d152da721711f6f4aba1f0b8ab15 (diff)
parent3d6f263b2a162974725cdcb914ba9ad9c2dbef84 (diff)
downloadrust-8367fb7ba6abae89ab7e17c1b3987ee321f5bb71.tar.gz
rust-8367fb7ba6abae89ab7e17c1b3987ee321f5bb71.zip
Auto merge of #39252 - alexcrichton:less-exports, r=nrc
Hide a few more standard library symbols

These commits touch up some of the symbol visibility rules for some crates related to the standard library, notably:

* Symbols that are `pub extern` and `#[no_mangle]` which are internal-to-rust ABI things are no longer at the `C` export level, but the `Rust` export level. This includes allocators, panic runtimes, and compiler builtins.
* The libbacktrace library is now compiled with `-fvisibility=hidden` to ensure that we don't export those symbols.
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()