Skip to content

Commit 047c7cc

Browse files
committed
Remove macOS fat archive support from LlvmArchiveBuilder
its only ever used for wasm targets
1 parent cab4fd6 commit 047c7cc

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

compiler/rustc_codegen_llvm/src/back/archive.rs

+4-10
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use crate::errors::{
1515
use crate::llvm::archive_ro::{ArchiveRO, Child};
1616
use crate::llvm::{self, ArchiveKind, LLVMMachineType, LLVMRustCOFFShortExport};
1717
use rustc_codegen_ssa::back::archive::{
18-
get_native_object_symbols, try_extract_macho_fat_archive, ArArchiveBuilder,
19-
ArchiveBuildFailure, ArchiveBuilder, ArchiveBuilderBuilder, UnknownArchiveKind,
18+
get_native_object_symbols, ArArchiveBuilder, ArchiveBuildFailure, ArchiveBuilder,
19+
ArchiveBuilderBuilder, UnknownArchiveKind,
2020
};
2121

2222
use rustc_session::cstore::DllImport;
@@ -66,21 +66,15 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
6666
archive: &Path,
6767
skip: Box<dyn FnMut(&str) -> bool + 'static>,
6868
) -> io::Result<()> {
69-
let mut archive = archive.to_path_buf();
70-
if self.sess.target.llvm_target.contains("-apple-macosx") {
71-
if let Some(new_archive) = try_extract_macho_fat_archive(&self.sess, &archive)? {
72-
archive = new_archive
73-
}
74-
}
75-
let archive_ro = match ArchiveRO::open(&archive) {
69+
let archive_ro = match ArchiveRO::open(archive) {
7670
Ok(ar) => ar,
7771
Err(e) => return Err(io::Error::new(io::ErrorKind::Other, e)),
7872
};
7973
if self.additions.iter().any(|ar| ar.path() == archive) {
8074
return Ok(());
8175
}
8276
self.additions.push(Addition::Archive {
83-
path: archive,
77+
path: archive.to_path_buf(),
8478
archive: archive_ro,
8579
skip: Box::new(skip),
8680
});

0 commit comments

Comments
 (0)