Properly use the darwin archive format on Apple targets

See https://github.com/servo/servo/issues/25550.
This commit is contained in:
Anthony Ramine 2020-02-12 12:06:14 +01:00
parent e6db6697fa
commit 15adbf6e08
4 changed files with 6 additions and 1 deletions

View file

@ -459,6 +459,7 @@ pub enum ArchiveKind {
Other,
K_GNU,
K_BSD,
K_DARWIN,
K_COFF,
}

View file

@ -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(()),
}

View file

@ -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,

View file

@ -38,6 +38,7 @@ enum class LLVMRustArchiveKind {
Other,
GNU,
BSD,
DARWIN,
COFF,
};
@ -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: