mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use LLVM-default spellings for amd64 on OpenBSD.
OpenBSD spells the common 64-bit x86 architecture as amd64, while LLVM defaults it to x86_64. A while back we tried to stick with the amd64 spelling, but this was difficult to make the change properly and consistently. A while back we decided to just stick with LLVM spellings, but there are a few minor cases missing. This change is necessary for properly finding swiftrt.o.
This commit is contained in:
@@ -291,6 +291,13 @@ StringRef swift::getMajorArchitectureName(const llvm::Triple &Triple) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Triple.isOSOpenBSD()) {
|
||||
if (Triple.getArchName() == "amd64") {
|
||||
return "x86_64";
|
||||
}
|
||||
}
|
||||
|
||||
return Triple.getArchName();
|
||||
}
|
||||
|
||||
@@ -422,6 +429,11 @@ llvm::Triple swift::getTargetSpecificModuleTriple(const llvm::Triple &triple) {
|
||||
return swift::getUnversionedTriple(triple);
|
||||
}
|
||||
|
||||
if (triple.isOSOpenBSD()) {
|
||||
StringRef arch = swift::getMajorArchitectureName(triple);
|
||||
return llvm::Triple(arch, triple.getVendorName(), triple.getOSName());
|
||||
}
|
||||
|
||||
// Other platforms get no normalization.
|
||||
return triple;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user