Fix 32bit arm build

Had to use the hack from https://github.com/golang/go/issues/12443
This commit is contained in:
Michael Schurter 2017-02-09 11:22:17 -08:00
parent 4da380bbbf
commit f2cf2b1df1
3 changed files with 7 additions and 2 deletions

2
Vagrantfile vendored
View File

@ -20,7 +20,7 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential curl git-
liblxc1 lxc-dev lxc-templates \
gcc-5-aarch64-linux-gnu binutils-aarch64-linux-gnu \
libc6-dev-i386 linux-libc-dev:i386 \
gcc-5-arm-linux-gnueabi gcc-5-multilib-arm-linux-gnueabi binutils-arm-linux-gnueabi
gcc-5-arm-linux-gnueabihf gcc-5-multilib-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
# Setup go, for development of Nomad
SRCROOT="/opt/go"

5
build_linux_arm.go Normal file
View File

@ -0,0 +1,5 @@
// +build linux,cgo
// #cgo LDFLAGS: -mfloat-abi=hard
package main

View File

@ -33,7 +33,7 @@ if [[ $(uname) == "Linux" ]]; then
CGO_ENBALED=1 GOARCH="amd64" GOOS="linux" go build -ldflags "-X $LDFLAG" -o "pkg/linux_amd64-lxc/nomad" -tags "lxc"
echo "==> Building linux arm..."
CC="arm-linux-gnueabi-gcc-5" GOOS=linux GOARCH="arm" CGO_ENABLED=1 go build -ldflags "-X $LDFLAG" -o "pkg/linux_arm/nomad"
CC="arm-linux-gnueabihf-gcc-5" GOOS=linux GOARCH="arm" CGO_ENABLED=1 go build -ldflags "-X $LDFLAG" -o "pkg/linux_arm/nomad"
echo "==> Building linux arm64..."
CC="aarch64-linux-gnu-gcc-5" GOOS=linux GOARCH="arm64" CGO_ENABLED=1 go build -ldflags "-X $LDFLAG" -o "pkg/linux_arm64/nomad"