diff options
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back/symbol_export.rs')
-rw-r--r-- | compiler/rustc_codegen_ssa/src/back/symbol_export.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs index 8d7e2c5cf..c2ecc4160 100644 --- a/compiler/rustc_codegen_ssa/src/back/symbol_export.rs +++ b/compiler/rustc_codegen_ssa/src/back/symbol_export.rs @@ -13,7 +13,7 @@ use rustc_middle::ty::query::{ExternProviders, Providers}; use rustc_middle::ty::subst::{GenericArgKind, SubstsRef}; use rustc_middle::ty::Instance; use rustc_middle::ty::{self, SymbolName, TyCtxt}; -use rustc_session::config::CrateType; +use rustc_session::config::{CrateType, OomStrategy}; use rustc_target::spec::SanitizerSet; pub fn threshold(tcx: TyCtxt<'_>) -> SymbolExportLevel { @@ -76,7 +76,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, cnum: CrateNum) -> DefIdMap< // let it through if it's included statically. match tcx.hir().get_by_def_id(def_id) { Node::ForeignItem(..) => { - tcx.is_statically_included_foreign_item(def_id).then_some(def_id) + tcx.native_library(def_id).map_or(false, |library| library.kind.is_statically_included()).then_some(def_id) } // Only consider nodes that actually have exported symbols. @@ -206,6 +206,15 @@ fn exported_symbols_provider_local<'tcx>( }, )); } + + symbols.push(( + ExportedSymbol::NoDefId(SymbolName::new(tcx, OomStrategy::SYMBOL)), + SymbolExportInfo { + level: SymbolExportLevel::Rust, + kind: SymbolExportKind::Text, + used: false, + }, + )); } if tcx.sess.instrument_coverage() || tcx.sess.opts.cg.profile_generate.enabled() { |