Browse code

Patch Go with fix for OSX Sierra

Backport this patch to the Go 1.6.3 runtime needed for OSX Sierra.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>

Justin Cormack authored on 2016/09/24 07:24:20
Showing 1 changed files
... ...
@@ -121,11 +121,6 @@ RUN set -x \
121 121
 #            will need updating, to avoid errors. Ping #docker-maintainers on IRC
122 122
 #            with a heads-up.
123 123
 ENV GO_VERSION 1.6.3
124
-RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
125
-	| tar -xzC /usr/local
126
-
127
-ENV PATH /go/bin:/usr/local/go/bin:$PATH
128
-ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
129 124
 
130 125
 # Compile Go for cross compilation
131 126
 ENV DOCKER_CROSSPLATFORMS \
... ...
@@ -134,6 +129,20 @@ ENV DOCKER_CROSSPLATFORMS \
134 134
 	freebsd/amd64 freebsd/386 freebsd/arm \
135 135
 	windows/amd64 windows/386
136 136
 
137
+RUN curl -fsSL "https://storage.googleapis.com/golang/go1.4.3.linux-amd64.tar.gz" \
138
+	| tar -xzC /root && \
139
+	mv /root/go /root/go1.4 && \
140
+	cd /usr/local && \
141
+	curl -fsSL "https://storage.googleapis.com/golang/go$GO_VERSION.src.tar.gz" \
142
+	| tar -xzC /usr/local && \
143
+	cd go && \
144
+	printf 'diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s\nindex e09b906..fa8ff2f 100644\n--- a/src/runtime/sys_darwin_amd64.s\n+++ b/src/runtime/sys_darwin_amd64.s\n@@ -157,6 +157,7 @@ systime:\n\t// Fall back to system call (usually first call in this thread).\n\tMOVQ\tSP, DI\n\tMOVQ\t$0, SI\n+\tMOVQ\t$0, DX  // required as of Sierra; Issue 16570\n\tMOVL\t$(0x2000000+116), AX\n\tSYSCALL\n\tCMPQ\tAX, $0\n' | patch -p1 && \
145
+	cd src && \
146
+	./make.bash
147
+
148
+ENV PATH /go/bin:/usr/local/go/bin:$PATH
149
+ENV GOPATH /go:/go/src/github.com/docker/docker/vendor
150
+
137 151
 # This has been commented out and kept as reference because we don't support compiling with older Go anymore.
138 152
 # ENV GOFMT_VERSION 1.3.3
139 153
 # RUN curl -sSL https://storage.googleapis.com/golang/go${GOFMT_VERSION}.$(go env GOOS)-$(go env GOARCH).tar.gz | tar -C /go/bin -xz --strip-components=2 go/bin/gofmt