Skip to content

Commit fd8d0cf

Browse files
committed
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.
1 parent fec47e6 commit fd8d0cf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ import struct TSCBasic.AbsolutePath
1818
extension GenericUnixToolchain {
1919
private func majorArchitectureName(for triple: Triple) -> String {
2020
// The concept of a "major" arch name only applies to Linux triples
21-
guard triple.os == .linux else { return triple.archName }
21+
// We change spellings for amd64/x86_64 for OpenBSD here too to match LLVM.
22+
guard triple.os == .linux || triple.os == .openbsd else { return triple.archName }
23+
24+
if triple.os == .openbsd && triple.archName == "amd64" { return "x86_64" }
2225

2326
// HACK: We don't wrap LLVM's ARM target architecture parsing, and we should
2427
// definitely not try to port it. This check was only normalizing

0 commit comments

Comments
 (0)