Skip to content

Commit

Permalink
Properly use the darwin archive format on Apple targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Feb 12, 2020
1 parent e6db669 commit 15adbf6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ pub enum ArchiveKind {
Other,
K_GNU,
K_BSD,
K_DARWIN,
K_COFF,
}

Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/llvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl FromStr for ArchiveKind {
match s {
"gnu" => Ok(ArchiveKind::K_GNU),
"bsd" => Ok(ArchiveKind::K_BSD),
"darwin" => Ok(ArchiveKind::K_DARWIN),
"coff" => Ok(ArchiveKind::K_COFF),
_ => Err(()),
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_target/spec/apple_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub fn opts() -> TargetOptions {
has_rpath: true,
dll_prefix: "lib".to_string(),
dll_suffix: ".dylib".to_string(),
archive_format: "bsd".to_string(),
archive_format: "darwin".to_string(),
pre_link_args: LinkArgs::new(),
has_elf_tls: version >= (10, 7),
abi_return_struct_as_int: true,
Expand Down
3 changes: 3 additions & 0 deletions src/rustllvm/ArchiveWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ enum class LLVMRustArchiveKind {
Other,
GNU,
BSD,
DARWIN,
COFF,
};

Expand All @@ -47,6 +48,8 @@ static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
return Archive::K_GNU;
case LLVMRustArchiveKind::BSD:
return Archive::K_BSD;
case LLVMRustArchiveKind::DARWIN:
return Archive::K_DARWIN;
case LLVMRustArchiveKind::COFF:
return Archive::K_COFF;
default:
Expand Down

0 comments on commit 15adbf6

Please sign in to comment.