-
Notifications
You must be signed in to change notification settings - Fork 17.7k
GoMips
Go programs can be cross-compiled e.g., on x86/x86_64 build systems to run on MIPS target machines.
Go supports the following MIPS architectural families. (Are there more?)
Architecture | Status | GOMIPS value | GOARCH value |
---|---|---|---|
Big endian (e.g., ar71xx) | supported | GOMIPS=softfloat | GOARCH=mips |
Little endian | supported | n/a | GOARCH=mipsle |
- MIPS on Linux. Tested with an ar71xx based OpenWrt device.
The tested version for running Go on MIPS systems is Go 1.13.
This builds a Go program, strips unneeded strings and symbols to minimize its size, and compresses it to further minimize its size:
env GOOS=linux GOARCH=mips GOMIPS=softfloat go build -trimpath -ldflags="-s -w" 'server.go'
upx -9 server
MIPS hardware comes in a myriad of shapes and sizes. If you've had a success story building and running Go on your Arm system, please detail your results here.
Architecture: ar71xx
Operating System: OpenWrt
The D-Link DIR-505 Mobile Companion comes with an Atheros AR1311 processor, 8 MB flash and 64 MB RAM. This space is limited but allows us to load Go applications, e.g., from network into /tmpfs
and execute them from there.
Further information about the device can be found at https://openwrt.org/toh/d-link/dir-505.
Architecture: ar9344
Operating System: RutOS (based on OpenWrt)
The Teltonika RUT955 has a Atheros Wasp MIPS 74Kc CPU running at 550 MHz with 16 MB flash 128 MB RAM. Inbuilt flash will be insufficient for most applications but a Micro SD or USB stick can be added (running application directly from SD was unreliable but copying to /tmpfs and running from there works OK). The inbuilt IO, GPS etc can be accessed via Modbus TCP and the RS232/RS485 ports worked without issue. Tested with Go 1.14.6 & 1.15.3 (GOARCH=mips, GOMIPS=softfloat).
Further information about the device can be found at https://teltonika-networks.com/product/rut955/.