Skip to content

Support AIX-style archive type #106704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Recognize AIX style archive kind
  • Loading branch information
ecnelises committed Apr 19, 2023
commit 7037ff99af21cd34eb4bcb95fe91d210bc8e4f3f
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ pub enum ArchiveKind {
K_BSD,
K_DARWIN,
K_COFF,
K_AIXBIG,
}

// LLVMRustThinLTOData
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_llvm/src/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ impl FromStr for ArchiveKind {
"bsd" => Ok(ArchiveKind::K_BSD),
"darwin" => Ok(ArchiveKind::K_DARWIN),
"coff" => Ok(ArchiveKind::K_COFF),
"aix_big" => Ok(ArchiveKind::K_AIXBIG),
_ => Err(()),
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ impl<'a> ArArchiveBuilder<'a> {
"bsd" => ArchiveKind::Bsd,
"darwin" => ArchiveKind::Darwin,
"coff" => ArchiveKind::Coff,
"aix_big" => ArchiveKind::AixBig,
kind => {
self.sess.emit_fatal(UnknownArchiveKind { kind });
}
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum class LLVMRustArchiveKind {
BSD,
DARWIN,
COFF,
AIX_BIG,
};

static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
Expand All @@ -51,6 +52,8 @@ static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
return Archive::K_DARWIN;
case LLVMRustArchiveKind::COFF:
return Archive::K_COFF;
case LLVMRustArchiveKind::AIX_BIG:
return Archive::K_AIXBIG;
default:
report_fatal_error("Bad ArchiveKind.");
}
Expand Down