Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
egg1234 opened this issue Aug 8, 2023 · 2 comments

Comments

@egg1234
Copy link

egg1234 commented Aug 8, 2023

Thank you!

@fs714
Copy link
Owner

fs714 commented Aug 9, 2023

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

@egg1234
Copy link
Author

egg1234 commented Aug 9, 2023

I see.
Thanks a lot!

@egg1234 egg1234 closed this as completed Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants