TOOLCHAIN_PREFIX=armv7-linux-gnueabihf \
CC=${TOOLCHAIN_PREFIX}-gcc \
CXX=${TOOLCHAIN_PREFIX}-g++ \
CGO_LDFLAGS="-Os -s -Wl,--gc-sections -fwhole-program -dead_strip" \
CGO_CFLAGS="-fdata-sections -ffunction-sections -Os --sysroot=<sysroot path>" \
CGO_ENABLED=1 \
GOARCH=arm \
GOOS=linux \
GOARM=7 \
go build -v -a -ldflags "-X main.Version=$(git describe --tags) -linkmode external -v" -tags 'sqlite3'
Last active
January 4, 2020 05:29
-
-
Save troian/06d00b0e65eba79c218fd9a096d03b66 to your computer and use it in GitHub Desktop.
Crosscompile golang-migrate command for RPI2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment