diff --git a/lib/Basic/Platform.cpp b/lib/Basic/Platform.cpp index 4b6b827ef6594..107159f9dab37 100644 --- a/lib/Basic/Platform.cpp +++ b/lib/Basic/Platform.cpp @@ -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; }