From 2780627062e0546309b53cd69477a44f3d8629d1 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 15 Jun 2020 10:14:07 +0200 Subject: [PATCH] cpu: add all GOARCHes supported by gccgo Extend hostByteOrder to return the correct byte order for all GOARCHes currently supported by gccgo. Change-Id: I019de33aa598c58fe75cd7ad55479e6fce82dd8e Reviewed-on: https://go-review.googlesource.com/c/sys/+/237897 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- cpu/byteorder.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/byteorder.go b/cpu/byteorder.go index ed8da8de..ff3eb5b4 100644 --- a/cpu/byteorder.go +++ b/cpu/byteorder.go @@ -44,15 +44,20 @@ func (bigEndian) Uint64(b []byte) uint64 { func hostByteOrder() byteOrder { switch runtime.GOARCH { case "386", "amd64", "amd64p32", + "alpha", "arm", "arm64", "mipsle", "mips64le", "mips64p32le", + "nios2", "ppc64le", - "riscv", "riscv64": + "riscv", "riscv64", + "sh": return littleEndian{} case "armbe", "arm64be", + "m68k", "mips", "mips64", "mips64p32", "ppc", "ppc64", "s390", "s390x", + "shbe", "sparc", "sparc64": return bigEndian{} }