Skip to content

Commit

Permalink
Use -z,muldefs on arm,x86
Browse files Browse the repository at this point in the history
Assume that the linker can make sense of us passing in the -z,muldefs
option to tell it to ignore symbol-multiply-defined errors triggered by
golang/go#9510.  We should be able to stop
doing this once we move to Go 1.6.

Signed-off-by: Nalin Dahyabhai <[email protected]> (github: nalind)
  • Loading branch information
nalind committed Dec 2, 2015
1 parent 0ca6d77 commit 8005057
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions hack/make/binary
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8005057

Please sign in to comment.