Rollup merge of #142641 - bjorn3:proc_macro_symbols_o, r=jieyouxu

Generate symbols.o for proc-macros too

To ensure used statics are functioning correctly for proc-macros too.
This commit is contained in:
Matthias Krüger
2025-06-29 06:59:28 +02:00
committed by GitHub
4 changed files with 32 additions and 2 deletions

View File

@@ -1870,8 +1870,13 @@ pub(crate) fn linked_symbols(
crate_type: CrateType,
) -> Vec<(String, SymbolExportKind)> {
match crate_type {
CrateType::Executable | CrateType::Cdylib | CrateType::Dylib | CrateType::Sdylib => (),
CrateType::Staticlib | CrateType::ProcMacro | CrateType::Rlib => {
CrateType::Executable
| CrateType::ProcMacro
| CrateType::Cdylib
| CrateType::Dylib
| CrateType::Sdylib => (),
CrateType::Staticlib | CrateType::Rlib => {
// These are not linked, so no need to generate symbols.o for them.
return Vec::new();
}
}