1
Fork 0

Limit symbols exported from proc macros

Only __rustc_proc_macro_decls_*__ and rust_metadata_* need to be
exported for proc macros to work. All other symbols only increase binary
size and have the potential to conflict with symbols from the host
compiler.
This commit is contained in:
bjorn3 2022-07-30 12:16:33 +00:00
parent 760d8a2cb1
commit 6098e795a2
4 changed files with 36 additions and 6 deletions

View file

@ -656,9 +656,7 @@ impl<'a> Linker for GccLinker<'a> {
return;
}
if crate_type == CrateType::ProcMacro {
return;
}
// FIXME hide #[no_mangle] symbols for proc-macros
let is_windows = self.sess.target.is_like_windows;
let path = tmpdir.join(if is_windows { "list.def" } else { "list" });