From a18886a471f8e5caa0ef6d4fd04e91bc8bc4923a Mon Sep 17 00:00:00 2001 From: probonopd Date: Wed, 30 Oct 2019 18:30:13 +0000 Subject: [PATCH] Created GoMips (markdown) --- GoMips.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 GoMips.md diff --git a/GoMips.md b/GoMips.md new file mode 100644 index 00000000..ed6c1b75 --- /dev/null +++ b/GoMips.md @@ -0,0 +1,46 @@ +# Introduction + +Go programs can be cross-compiled e.g., on x86/x86\_64 build systems to run on MIPS target machines. + +# Supported architectures + +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 | + +# Supported operating systems + +* MIPS on Linux. Tested with an ar71xx based OpenWrt device. + +# Recommended Go version + +The tested version for running Go on MIPS systems is Go 1.13. + +# Tips and tricks + +## Building for ar71xx OpenWrt + +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 +``` + +# Success stories + +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. + +## D-Link DIR-505 Mobile Companion + +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. +