Skip to content

Commit 012ded4

Browse files
committed
Auto merge of #118568 - DianQK:no-builtins-symbols, r=pnkfelix
Avoid adding builtin functions to `symbols.o` We found performance regressions in #113923. The problem seems to be that `--gc-sections` does not remove these symbols. I tested that lld removes these symbols, but ld and gold do not. I found that `used` adds symbols to `symbols.o` at https://github.com/rust-lang/rust/blob/3e202ead604be31f4c1a5798a296953d3159da7e/compiler/rustc_codegen_ssa/src/back/linker.rs#L1786-L1791. The PR removes builtin functions. Note that under LTO, ld still preserves these symbols. (lld will still remove them.) The first commit also fixes #118559. But I think the second commit also makes sense.
2 parents 63f3ab3 + 80d661c commit 012ded4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bin/miri.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ impl rustc_driver::Callbacks for MiriBeRustCompilerCalls {
165165
level: SymbolExportLevel::C,
166166
kind: SymbolExportKind::Text,
167167
used: false,
168+
used_compiler: false,
168169
},
169170
))
170171
}),

0 commit comments

Comments
 (0)