Auto merge of #81118 - ojeda:metadata-obj, r=nagisa
Skip linking if it is not required This allows to use `--emit=metadata,obj` and other metadata + non-link combinations. Fixes #81117.
This commit is contained in:
commit
a4cbb44ae2
3 changed files with 23 additions and 4 deletions
|
@ -74,7 +74,7 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(
|
|||
}
|
||||
});
|
||||
|
||||
if outputs.outputs.should_codegen() {
|
||||
if outputs.outputs.should_link() {
|
||||
let tmpdir = TempFileBuilder::new()
|
||||
.prefix("rustc")
|
||||
.tempdir()
|
||||
|
@ -123,9 +123,7 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(
|
|||
}
|
||||
};
|
||||
|
||||
if sess.opts.output_types.should_codegen()
|
||||
&& !preserve_objects_for_their_debuginfo(sess)
|
||||
{
|
||||
if sess.opts.output_types.should_link() && !preserve_objects_for_their_debuginfo(sess) {
|
||||
for module in &codegen_results.modules {
|
||||
remove_temps_from_module(module);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue