Skip to content

Commit 44bc7a9

Browse files
authored
Merge pull request #52 from sjavora/bpf-endianness
Parse endian-dependent BPF architecture.
2 parents c356d50 + 1230da7 commit 44bc7a9

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)