From 5bb805cc5e9ed21f79c6618e3455943453f8db20 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 9 Feb 2017 11:22:17 -0800 Subject: [PATCH] Fix 32bit arm build Had to use the hack from https://github.com/golang/go/issues/12443 --- Vagrantfile | 2 +- build_linux_arm.go | 5 +++++ scripts/build.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 build_linux_arm.go diff --git a/Vagrantfile b/Vagrantfile index 3afda0c883b7..ce106db79004 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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" diff --git a/build_linux_arm.go b/build_linux_arm.go new file mode 100644 index 000000000000..db4f8ebf2b15 --- /dev/null +++ b/build_linux_arm.go @@ -0,0 +1,5 @@ +// +build linux,cgo + +// #cgo LDFLAGS: -mfloat-abi=hard + +package main diff --git a/scripts/build.sh b/scripts/build.sh index b54a3591a1cf..eea4c0a1b74d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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"