fix cross compilation for arm platforms
@@ -47,11 +47,25 @@ hash_files() {
;;
linux/arm)
case "${GOARM}" in
- 5 | "")
+ 5)
export CC="${CC:-arm-linux-gnueabi-gcc}"
export CGO_ENABLED=1
+ export CGO_CFLAGS="-march=armv5t"
+ export CGO_CXXFLAGS="-march=armv5t"
+ ;;
+ 6)
+ export CC="${CC:-arm-linux-gnueabi-gcc}"
+ export CGO_ENABLED=1
+ export CGO_CFLAGS="-march=armv6"
+ export CGO_CXXFLAGS="-march=armv6"
;;
7)
+ export CC="${CC:-arm-linux-gnueabihf-gcc}"
+ export CGO_ENABLED=1
+ export CGO_CFLAGS="-march=armv7-a"
+ export CGO_CXXFLAGS="-march=armv7-a"
+ ;;
+ *)
export CC="${CC:-arm-linux-gnueabihf-gcc}"
export CGO_ENABLED=1
;;
