Skip to content

Commit

Permalink
linker: Avoid library duplication with /WHOLEARCHIVE
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed May 6, 2021
1 parent d44f647 commit fb9feb3
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,11 +813,9 @@ impl<'a> Linker for MsvcLinker<'a> {
}

fn link_whole_staticlib(&mut self, lib: Symbol, verbatim: bool, _search_path: &[PathBuf]) {
self.link_staticlib(lib, verbatim);
self.cmd.arg(format!("/WHOLEARCHIVE:{}{}", lib, if verbatim { "" } else { ".lib" }));
}
fn link_whole_rlib(&mut self, path: &Path) {
self.link_rlib(path);
let mut arg = OsString::from("/WHOLEARCHIVE:");
arg.push(path);
self.cmd.arg(arg);
Expand Down

0 comments on commit fb9feb3

Please sign in to comment.