Skip to content

Commit

Permalink
Merge pull request #2297 from hashicorp/b-fix-arm-build
Browse files Browse the repository at this point in the history
Fix 32bit arm build
  • Loading branch information
schmichael committed Feb 9, 2017
2 parents c1bc077 + 5bb805c commit a703bcf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions build_linux_arm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// +build linux,cgo

// #cgo LDFLAGS: -mfloat-abi=hard

package main
2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a703bcf

Please sign in to comment.