Skip to content

Commit 3d6f263

Browse files
committed
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
1 parent a5561ce commit 3d6f263

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/liballoc_jemalloc/pthread_atfork_dummy.c

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// See comments in build.rs for why this exists
212
int pthread_atfork(void* prefork,
313
void* postfork_parent,

src/libstd/build.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ fn build_libbacktrace(host: &str, target: &str) {
8787
let compiler = gcc::Config::new().get_compiler();
8888
// only msvc returns None for ar so unwrap is okay
8989
let ar = build_helper::cc2ar(compiler.path(), target).unwrap();
90-
let cflags = compiler.args().iter().map(|s| s.to_str().unwrap())
91-
.collect::<Vec<_>>().join(" ");
90+
let mut cflags = compiler.args().iter().map(|s| s.to_str().unwrap())
91+
.collect::<Vec<_>>().join(" ");
92+
cflags.push_str(" -fvisibility=hidden");
9293
run(Command::new("sh")
9394
.current_dir(&build_dir)
9495
.arg(src_dir.join("configure").to_str().unwrap()

0 commit comments

Comments
 (0)