Skip to content

Commit

Permalink
Avoid exporting symbols more than once.
Browse files Browse the repository at this point in the history
Exporting `__rust_alloc_error_handler_should_panic` multiple times
causes ld.gold to balk with: `error: version script assignment of  to
symbol __rust_alloc_error_handler_should_panic failed: symbol not
defined`

Specifically this breaks builds on DragonFly and YoctoProject with
ld.gold.  Builds with ld.bfd should be unaffected.
  • Loading branch information
Alex Zepeda committed Aug 2, 2023
1 parent 866710c commit 2e29d85
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions compiler/rustc_codegen_ssa/src/back/symbol_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,6 @@ fn exported_symbols_provider_local(
));
}

symbols.push((
ExportedSymbol::NoDefId(SymbolName::new(tcx, OomStrategy::SYMBOL)),
SymbolExportInfo {
level: SymbolExportLevel::Rust,
kind: SymbolExportKind::Text,
used: false,
},
));

let exported_symbol =
ExportedSymbol::NoDefId(SymbolName::new(tcx, NO_ALLOC_SHIM_IS_UNSTABLE));
symbols.push((
Expand Down

0 comments on commit 2e29d85

Please sign in to comment.