diff options
| author | Ralf Jung <post@ralfj.de> | 2020-06-19 14:29:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-19 14:29:18 +0200 |
| commit | 7cc45183cac5a4cfea21ecf94aa397781b969ea4 (patch) | |
| tree | b5d564f67f1bfcdc78ef992b210bc714bffb6709 | |
| parent | 70622db43d5e0a58f8fe66ff15115e4fcbb5c274 (diff) | |
| parent | d1c275b350f9ae74be92114f4819d6afb55d6007 (diff) | |
| download | rust-7cc45183cac5a4cfea21ecf94aa397781b969ea4.tar.gz rust-7cc45183cac5a4cfea21ecf94aa397781b969ea4.zip | |
Rollup merge of #72785 - petrochenkov:wholemsvc, r=matthewjasper
linker: MSVC supports linking static libraries as a whole archive
| -rw-r--r-- | src/librustc_codegen_ssa/back/linker.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs index efcabc57e6f..6011d422ca6 100644 --- a/src/librustc_codegen_ssa/back/linker.rs +++ b/src/librustc_codegen_ssa/back/linker.rs @@ -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 |
