Add a limit_rdylib_exports option and disable it for Solaris

This commit is contained in:
John Kåre Alsaker 2019-04-14 19:05:21 +02:00
parent 185dcebbff
commit 52bd4f263b
6 changed files with 18 additions and 7 deletions

View file

@ -381,15 +381,12 @@ impl<'a> Linker for GccLinker<'a> {
// The object files have far more public symbols than we actually want to export,
// so we hide them all here.
if crate_type == CrateType::ProcMacro {
return
if !self.sess.target.target.options.limit_rdylib_exports {
return;
}
// Symbol visibility takes care of this for the WebAssembly.
// Additionally the only known linker, LLD, doesn't support the script
// arguments just yet
if self.sess.target.target.arch == "wasm32" {
return;
if crate_type == CrateType::ProcMacro {
return
}
let mut arg = OsString::new();