fs714/goiftop

How do I cross compile this project to armv5 linux(like merlin router) on ubuntu 20?

egg1234 opened this issue · 2 comments

Thank you!

fs714 commented

The easy way is to build this project on your armv5 router:

  1. Install golang arm version on armv5 router from https://go.dev/dl/
  2. Install build tools by sudo apt-get install build-essential
  3. Install required libs by sudo apt-get install linux-libc-dev libpcap-dev libnetfilter-queue-dev libnetfilter-log-dev
  4. Build this project by make

If you want to do cross compile, it is more complex. You can:

  • Install gcc compiler with arm target set by sudo apt-get install gcc-arm-linux-gnueabi
  • Update build command in Makefile like env GOOS=linux GOARCH=arm GOARM=5 CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc go build -o bin/${BINARY} ${LDFLAGS}
  • You also have to solve the dependency of C libs like pcap, nfnetlink and netfilter_log for ARM

I see.
Thanks a lot!