Ver código fonte

Windows: Remove linkmode internal hack

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 9 anos atrás
pai
commit
6ca5a2c476
3 arquivos alterados com 11 adições e 10 exclusões
  1. 3 2
      Dockerfile
  2. 8 1
      hack/make/.go-autogen
  3. 0 7
      hack/make/binary

+ 3 - 2
Dockerfile

@@ -234,10 +234,11 @@ RUN set -x \
 	&& rm -rf "$GOPATH"
 
 # Build/install the tool for embedding resources in Windows binaries
-ENV RSRC_VERSION v2
+ENV RSRC_COMMIT ba14da1f827188454a4591717fff29999010887f
 RUN set -x \
 	&& export GOPATH="$(mktemp -d)" \
-	&& git clone --depth 1 -b "$RSRC_VERSION" https://github.com/akavel/rsrc.git "$GOPATH/src/github.com/akavel/rsrc" \
+	&& git clone https://github.com/akavel/rsrc.git "$GOPATH/src/github.com/akavel/rsrc" \
+	&& (cd "$GOPATH/src/github.com/akavel/rsrc" && git checkout -q "$RSRC_COMMIT") \
 	&& go build -v -o /usr/local/bin/rsrc github.com/akavel/rsrc \
 	&& rm -rf "$GOPATH"
 

+ 8 - 1
hack/make/.go-autogen

@@ -55,5 +55,12 @@ if [ "$(go env GOOS)" = 'windows' ]; then
 	rsrc \
 		-manifest hack/make/.resources-windows/docker.exe.manifest \
 		-ico      hack/make/.resources-windows/docker.ico \
-		-o        autogen/winresources/rsrc.syso > /dev/null
+		-arch     "amd64" \
+		-o        autogen/winresources/rsrc_amd64.syso > /dev/null
+
+	rsrc \
+		-manifest hack/make/.resources-windows/docker.exe.manifest \
+		-ico      hack/make/.resources-windows/docker.ico \
+		-arch     "386" \
+		-o        autogen/winresources/rsrc_386.syso > /dev/null
 fi

+ 0 - 7
hack/make/binary

@@ -14,17 +14,10 @@ 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 internal -extld=${CC}"
 			;;
 	esac
 fi
 
-if [ "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" == "windows/amd64" ] && [ "$(go env GOOS)" == "windows" ]; then
-	# native compilation of Windows on Windows with golang 1.5+ needs linkmode internal
-	# https://github.com/golang/go/issues/13070
-	export LDFLAGS_STATIC_DOCKER="$LDFLAGS_STATIC_DOCKER -linkmode=internal"
-fi
-
 if [ "$(go env GOOS)" == "linux" ] ; then
 	case "$(go env GOARCH)" in
 		arm*|386)