From 19bcd2fd8967f26303e85877caa8fb9e31bb9161 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Sun, 15 Nov 2015 14:47:48 -0800 Subject: [PATCH] Remove "-linkmode external" We're having to override it in so many places that it no longer seems worthwhile to bother. On top of that, the reason we did it in the first place was for being able to compile devicemapper statically, which still works after this change (either due to other changes in the way we build, or improvements in Go itself). Signed-off-by: Andrew "Tianon" Page Upstream-commit: 927e1e98b7d37bf0593651d4b639e19277e775ca Component: engine --- components/engine/hack/make.sh | 6 +----- components/engine/hack/make/binary | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/components/engine/hack/make.sh b/components/engine/hack/make.sh index b109d1f39e..f914bf0f2e 100755 --- a/components/engine/hack/make.sh +++ b/components/engine/hack/make.sh @@ -132,11 +132,7 @@ if [ -z "$DOCKER_DEBUG" ]; then LDFLAGS='-w' fi -LDFLAGS_STATIC='-linkmode external' -# Cgo -H windows is incompatible with -linkmode external. -if [ "$(go env GOOS)" == 'windows' ]; then - LDFLAGS_STATIC='' -fi +LDFLAGS_STATIC='' EXTLDFLAGS_STATIC='-static' # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build # with options like -race. diff --git a/components/engine/hack/make/binary b/components/engine/hack/make/binary index 7066eb6cb2..5ddce8db49 100644 --- a/components/engine/hack/make/binary +++ b/components/engine/hack/make/binary @@ -14,7 +14,7 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC windows/amd64) export CC=x86_64-w64-mingw32-gcc export CGO_ENABLED=1 - export LDFLAGS_STATIC_DOCKER="${LDFLAGS_STATIC_DOCKER/-linkmode external/-linkmode internal} -extld=${CC}" + export LDFLAGS_STATIC_DOCKER="$LDFLAGS_STATIC_DOCKER -linkmode internal -extld=${CC}" ;; esac fi