Skip to content

Commit

Permalink
Rollup merge of rust-lang#72785 - petrochenkov:wholemsvc, r=matthewja…
Browse files Browse the repository at this point in the history
…sper

linker: MSVC supports linking static libraries as a whole archive
  • Loading branch information
RalfJung committed Jun 12, 2020
2 parents 35e5dfe + d1c275b commit 97ae4f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/librustc_codegen_ssa/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,14 @@ impl<'a> Linker for MsvcLinker<'a> {
}

fn link_whole_staticlib(&mut self, lib: Symbol, _search_path: &[PathBuf]) {
// not supported?
self.link_staticlib(lib);
self.cmd.arg(format!("/WHOLEARCHIVE:{}.lib", lib));
}
fn link_whole_rlib(&mut self, path: &Path) {
// not supported?
self.link_rlib(path);
let mut arg = OsString::from("/WHOLEARCHIVE:");
arg.push(path);
self.cmd.arg(arg);
}
fn optimize(&mut self) {
// Needs more investigation of `/OPT` arguments
Expand Down

0 comments on commit 97ae4f6

Please sign in to comment.