Browse code

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 <admwiggin@gmail.com>

Tianon Gravi authored on 2015/11/16 07:47:48
Showing 2 changed files
... ...
@@ -132,11 +132,7 @@ if [ -z "$DOCKER_DEBUG" ]; then
132 132
 	LDFLAGS='-w'
133 133
 fi
134 134
 
135
-LDFLAGS_STATIC='-linkmode external'
136
-# Cgo -H windows is incompatible with -linkmode external.
137
-if [ "$(go env GOOS)" == 'windows' ]; then
138
-	LDFLAGS_STATIC=''
139
-fi
135
+LDFLAGS_STATIC=''
140 136
 EXTLDFLAGS_STATIC='-static'
141 137
 # ORIG_BUILDFLAGS is necessary for the cross target which cannot always build
142 138
 # with options like -race.
... ...
@@ -14,7 +14,7 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC
14 14
 		windows/amd64)
15 15
 			export CC=x86_64-w64-mingw32-gcc
16 16
 			export CGO_ENABLED=1
17
-			export LDFLAGS_STATIC_DOCKER="${LDFLAGS_STATIC_DOCKER/-linkmode external/-linkmode internal} -extld=${CC}"
17
+			export LDFLAGS_STATIC_DOCKER="$LDFLAGS_STATIC_DOCKER -linkmode internal -extld=${CC}"
18 18
 			;;
19 19
 	esac
20 20
 fi