On the originating system, firstly you need to ensure GO's own libraries are prepared to perform the cross-compilation (normally it only prepares the ones for the system you're on):
Find where you downloaded GO and within the src folder run:
GOOS=linux GOARCH=arm GOARM=5 make.bash
You should see a number of additional libraries being compiled, you shouldn't need to do this again.
Now, go back to your GO project and run:
GOOS=linux GOARCH=arm GOARM=5 go build
The binary you just created can now be copied to the raspberry pi for execution
No comments:
Post a Comment