Skip to content

Commit 1230da7

Browse files
committed
Parse endian-dependent BPF architecture.
1 parent e09783a commit 1230da7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/SwiftDriver/Utilities/Triple.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,12 @@ extension Triple {
574574
}
575575

576576
private static func parseBPFArch<S: StringProtocol>(_ archName: S) -> Triple.Arch? {
577+
578+
let isLittleEndianHost = 1.littleEndian == 1
579+
577580
switch archName {
578581
case "bpf":
579-
// FIXME: need to determine host endianness
580-
return nil
582+
return isLittleEndianHost ? .bpfel : .bpfeb
581583
case "bpf_be", "bpfeb":
582584
return .bpfeb
583585
case "bpf_le", "bpfel":

0 commit comments

Comments
 (0)