Skip to content
Draft
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,12 @@ pub trait ArchiveBuilderBuilder {
.map_err(|e| ExtractBundledLibsError::ArchiveMember { rlib, error: Box::new(e) })?;
let name = std::str::from_utf8(entry.name())
.map_err(|e| ExtractBundledLibsError::ConvertName { rlib, error: Box::new(e) })?;
// PATCH: link.exe stores archive members with their full paths. Extract only the file name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is only called for rlibs. Rlibs are always generated by rustc, not link.exe.

let name = if let Some(file_name) = Path::new(name).file_name() {
file_name.to_str().unwrap_or(name)
} else {
name
};
if !bundled_lib_file_names.contains(&Symbol::intern(name)) {
continue; // We need to extract only native libraries.
}
Expand Down
Loading