File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ ENV GOLANG_SRC_SHA256 a96cce8ce43a9bf9b2a4c7d470bc7ee0cb00410da815980681c8353218
7
7
ENV GOLANG_BOOTSTRAP_VERSION 1.4.3
8
8
ENV GOLANG_BOOTSTRAP_URL https://golang.org/dl/go$GOLANG_BOOTSTRAP_VERSION.src.tar.gz
9
9
ENV GOLANG_BOOTSTRAP_SHA1 486db10dc571a55c8d795365070f66d343458c48
10
+ COPY no-pic.patch /
10
11
11
12
RUN set -ex \
12
13
&& apk add --no-cache --virtual .build-deps \
@@ -30,11 +31,13 @@ RUN set -ex \
30
31
&& tar -C /usr/local -xzf golang.tar.gz \
31
32
&& rm golang.tar.gz \
32
33
&& cd /usr/local/go/src \
34
+ && patch -p2 -i /no-pic.patch \
33
35
&& ./make.bash \
34
36
\
35
- && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap \
37
+ && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap /*.patch \
36
38
&& apk del .build-deps
37
39
40
+
38
41
ENV GOPATH /go
39
42
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
40
43
Original file line number Diff line number Diff line change
1
+ diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go
2
+ index 8ccbec9dd634..4e96bfadc260 100644
3
+ --- a/src/cmd/link/internal/ld/lib.go
4
+ +++ b/src/cmd/link/internal/ld/lib.go
5
+ @@ -1194,6 +1194,11 @@ func hostlink() {
6
+ argv = append(argv, peimporteddlls()...)
7
+ }
8
+
9
+ + // The Go linker does not currently support building PIE
10
+ + // executables when using the external linker. See:
11
+ + // https://github.com/golang/go/issues/6940
12
+ + argv = append(argv, "-fno-PIC")
13
+ +
14
+ if Debug['v'] != 0 {
15
+ fmt.Fprintf(&Bso, "host link:")
16
+ for _, v := range argv {
You can’t perform that action at this time.
0 commit comments