Merge pull request #18197 from nalind/workaround-go-libgcc

Work around a linking problem on 32-bit arches
This commit is contained in:
Phil Estes 2015-12-10 11:50:03 -05:00
commit 2ea48e9fc0
5 changed files with 20 additions and 4 deletions

View File

@ -1,4 +1,4 @@
// +build linux,!arm
// +build linux
// Package journald provides the log driver for forwarding server logs
// to endpoints that receive the systemd format.

View File

@ -1,4 +1,4 @@
// +build !linux linux,arm
// +build !linux
package journald

View File

@ -1,4 +1,4 @@
// +build linux,cgo,!static_build,journald,!arm
// +build linux,cgo,!static_build,journald
package journald

View File

@ -1,4 +1,4 @@
// +build !linux !cgo static_build !journald linux,arm
// +build !linux !cgo static_build !journald
package journald

View File

@ -25,6 +25,22 @@ if [ "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" == "windows/amd64" ] && [ "$(go e
export LDFLAGS_STATIC_DOCKER="$LDFLAGS_STATIC_DOCKER -linkmode=internal"
fi
if [ "$(go env GOOS)" == "linux" ] ; then
case "$(go env GOARCH)" in
arm*|386)
# linking for Linux on arm or x86 needs external linking to avoid
# https://github.com/golang/go/issues/9510 until we move to Go 1.6
if [ "$IAMSTATIC" == "true" ] ; then
export EXTLDFLAGS_STATIC="$EXTLDFLAGS_STATIC -zmuldefs"
export LDFLAGS_STATIC_DOCKER="$LDFLAGS_STATIC -extldflags \"$EXTLDFLAGS_STATIC\""
else
export LDFLAGS="$LDFLAGS -extldflags -zmuldefs"
fi
;;
esac
fi
if [ "$IAMSTATIC" == "true" ] && [ "$(go env GOHOSTOS)" == "linux" ] && [ "$DOCKER_EXPERIMENTAL" ]; then
if [ "${GOOS}/${GOARCH}" == "darwin/amd64" ]; then
export CGO_ENABLED=1