File tree 1 file changed +8
-4
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1828,9 +1828,11 @@ pub(crate) fn linked_objects(
1828
1828
are_upstream_rust_objects_already_included ( tcx. sess ) ;
1829
1829
let export_threshold = symbol_export:: crates_export_threshold ( & [ crate_type] ) ;
1830
1830
for_each_exported_symbols_include_dep ( tcx, crate_type, |exported_symbols, cnum| {
1831
- let exported_symbols = exported_symbols
1832
- . iter ( )
1833
- . filter ( |( _, info) | info. level . is_below_threshold ( export_threshold) || info. used ) ;
1831
+ let exported_symbols = exported_symbols. iter ( ) . filter ( |( _, info) | {
1832
+ ( !matches ! ( crate_type, CrateType :: Executable )
1833
+ && info. level . is_below_threshold ( export_threshold) )
1834
+ || info. used
1835
+ } ) ;
1834
1836
if cnum == LOCAL_CRATE {
1835
1837
// Since the local crate is always linked directly to object files, `#[used]` works as expected,
1836
1838
// we only need add undefined symbols.
@@ -1855,7 +1857,9 @@ pub(crate) fn linked_objects(
1855
1857
) ;
1856
1858
return ;
1857
1859
}
1858
- // FIXME: should be `let lto = upstream_rust_objects_already_included && !ignored_for_lto(tcx.sess, &codegen_results.crate_info, cnum);`
1860
+ if matches ! ( crate_type, CrateType :: Executable ) && tcx. is_compiler_builtins ( cnum) {
1861
+ return ;
1862
+ }
1859
1863
let lto = upstream_rust_objects_already_included;
1860
1864
let mut cgus = FxHashSet :: default ( ) ;
1861
1865
for & ( symbol, info) in exported_symbols {
You can’t perform that action at this time.
0 commit comments