Skip to content

Commit

Permalink
Use -z,muldefs on arm,x86
Browse files Browse the repository at this point in the history
Pull in changes from upstream PR#18197:

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 <nalin@redhat.com> (github: nalind)
  • Loading branch information
nalind committed Jan 4, 2016
1 parent 26797f7 commit 42a12ec
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 @@ -19,6 +19,22 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC
esac
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

echo "Building: $DEST/$BINARY_FULLNAME"
go build \
-o "$DEST/$BINARY_FULLNAME" \
Expand Down

0 comments on commit 42a12ec

Please sign in to comment.