about summary refs log tree commit diff
path: root/src
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
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')
-rw-r--r--src/liballoc_jemalloc/pthread_atfork_dummy.c10
-rw-r--r--src/libstd/build.rs5
2 files changed, 13 insertions, 2 deletions
diff --git a/src/liballoc_jemalloc/pthread_atfork_dummy.c b/src/liballoc_jemalloc/pthread_atfork_dummy.c
index f798afe741f..4e3df0ab26c 100644
--- a/src/liballoc_jemalloc/pthread_atfork_dummy.c
+++ b/src/liballoc_jemalloc/pthread_atfork_dummy.c
@@ -1,3 +1,13 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
 // See comments in build.rs for why this exists
 int pthread_atfork(void* prefork,
                    void* postfork_parent,
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()