Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1c6b4d5
rustc: codegen: Build import library for all windows targets
chouquette May 27, 2019
c1b6716
libstd: windows: compat: Allow use of attributes
chouquette May 27, 2019
863cd6b
bootstrap: Build startup object for all windows-gnu target
chouquette May 27, 2019
e5d7043
std: Link UWP with allowed libraries only
chouquette May 27, 2019
98f9bba
libunwind: Use libunwind when targeting UWP
chouquette May 27, 2019
20eb746
std: rand: Use BCrypt on UWP
chouquette May 27, 2019
0f15466
std: win: Don't use SetHandleInformation on UWP
chouquette May 27, 2019
5466e9f
std: win: Don't expose link() on UWP
chouquette May 27, 2019
b514557
std: win: Don't use GetUserProfileDirectoryW on UWP
chouquette May 27, 2019
07d11ae
std: win: Don't use GetFileInformationByHandle on UWP
chouquette May 27, 2019
a7ad699
std: win: Don't use console APIs on UWP
chouquette May 27, 2019
1a0a263
std: win: Disable stack overflow handling on UWP
chouquette May 27, 2019
1726259
Add UWP targets
chouquette May 27, 2019
9e2714a
Update rustfmt to 1.3.1
topecongiro Jun 30, 2019
0ffb643
Make sure `#[rustc_doc_only_macro]` and other rustc attributes are re…
petrochenkov Jun 29, 2019
e4e7eb2
Feature gate `rustc` attributes harder
petrochenkov Jun 30, 2019
069c52f
Check if the archive has already been added to avoid duplicates
petrhosek Jul 2, 2019
b9344e3
Derive which queries to save using the proc macro
Zoxc Jun 27, 2019
de8bf5b
libstd: windows: Use qualified path for cfg_if
chouquette Jul 3, 2019
848962f
libstd: windows: Use cfg_if instead of NIH ifdef macro
chouquette Jul 3, 2019
096a2a2
libstd: windows: Reindent after last change
chouquette Jul 3, 2019
bb7fbb9
Add separate 'async_closure' feature gate.
Centril Jul 2, 2019
43315bc
Adjust tests wrt. 'async_closure' feature gate.
Centril Jul 2, 2019
3eef0cb
Reduce reliance on feature(await_macro).
Centril Jul 3, 2019
71b4b46
Rollup merge of #60260 - videolabs:rust_uwp2, r=alexcrichton
Centril Jul 4, 2019
0668f38
Rollup merge of #62133 - petrochenkov:norustc, r=eddyb
Centril Jul 4, 2019
4bd46d1
Rollup merge of #62169 - Zoxc:store-query-results, r=eddyb
Centril Jul 4, 2019
bba6a13
Rollup merge of #62244 - topecongiro:rustfmt-1.3.1, r=alexcrichton
Centril Jul 4, 2019
f045805
Rollup merge of #62286 - petrhosek:rustc-no-duplicate-archives, r=cra…
Centril Jul 4, 2019
566909b
Rollup merge of #62292 - Centril:split-async-closures, r=cramertj
Centril Jul 4, 2019
a0493aa
Rollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertj
Centril Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check if the archive has already been added to avoid duplicates
This avoids adding archives multiple times, which results in duplicate
objects in the resulting rlib, leading to symbol collision and link
failures. This could happen when crate contains multiple link attributes
that all reference the same archive.
  • Loading branch information
petrhosek committed Jul 2, 2019
commit 069c52fa111e592f65605c54f5e9b77be0676595
19 changes: 16 additions & 3 deletions src/librustc_codegen_llvm/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,20 @@ enum Addition {
name_in_archive: String,
},
Archive {
path: PathBuf,
archive: ArchiveRO,
skip: Box<dyn FnMut(&str) -> bool>,
},
}

impl Addition {
fn path(&self) -> &Path {
match self {
Addition::File { path, .. } | Addition::Archive { path, .. } => path,
}
}
}

fn is_relevant_child(c: &Child<'_>) -> bool {
match c.name() {
Some(name) => !name.contains("SYMDEF"),
Expand Down Expand Up @@ -188,12 +197,16 @@ impl<'a> LlvmArchiveBuilder<'a> {
-> io::Result<()>
where F: FnMut(&str) -> bool + 'static
{
let archive = match ArchiveRO::open(archive) {
let archive_ro = match ArchiveRO::open(archive) {
Ok(ar) => ar,
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
};
if self.additions.iter().any(|ar| ar.path() == archive) {
return Ok(())
}
self.additions.push(Addition::Archive {
archive,
path: archive.to_path_buf(),
archive: archive_ro,
skip: Box::new(skip),
});
Ok(())
Expand Down Expand Up @@ -243,7 +256,7 @@ impl<'a> LlvmArchiveBuilder<'a> {
strings.push(path);
strings.push(name);
}
Addition::Archive { archive, skip } => {
Addition::Archive { archive, skip, .. } => {
for child in archive.iter() {
let child = child.map_err(string_to_io_error)?;
if !is_relevant_child(&child) {
Expand Down