diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-08-10 17:42:56 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-08-10 17:42:56 +0000 |
| commit | 4f8042e22ebaf962ebbffc6056373b387dc65515 (patch) | |
| tree | 956c23ac1c72133d3fe679a57d5ca8cc1073a1ea | |
| parent | 8291d68d926cedcdc77973e4c68f0828156d5bd8 (diff) | |
| download | rust-4f8042e22ebaf962ebbffc6056373b387dc65515.tar.gz rust-4f8042e22ebaf962ebbffc6056373b387dc65515.zip | |
Support reading thin archives in ArArchiveBuilder
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/archive.rs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/archive.rs b/compiler/rustc_codegen_ssa/src/back/archive.rs index ce55d99f506..a35aff096a4 100644 --- a/compiler/rustc_codegen_ssa/src/back/archive.rs +++ b/compiler/rustc_codegen_ssa/src/back/archive.rs @@ -307,10 +307,17 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> { let file_name = String::from_utf8(entry.name().to_vec()) .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?; if !skip(&file_name) { - self.entries.push(( - file_name.into_bytes(), - ArchiveEntry::FromArchive { archive_index, file_range: entry.file_range() }, - )); + if entry.is_thin() { + self.entries.push(( + file_name.clone().into_bytes(), + ArchiveEntry::File(PathBuf::from(file_name)), + )); + } else { + self.entries.push(( + file_name.into_bytes(), + ArchiveEntry::FromArchive { archive_index, file_range: entry.file_range() }, + )); + } } } |
