File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ 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
10
11
+ # https://golang.org/issue/14851
12
+ COPY no-pic.patch /
13
+
11
14
RUN set -ex \
12
15
&& apk add --no-cache --virtual .build-deps \
13
16
bash \
@@ -30,9 +33,10 @@ RUN set -ex \
30
33
&& tar -C /usr/local -xzf golang.tar.gz \
31
34
&& rm golang.tar.gz \
32
35
&& cd /usr/local/go/src \
36
+ && patch -p2 -i /no-pic.patch \
33
37
&& ./make.bash \
34
38
\
35
- && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap \
39
+ && rm -rf /usr/local/bootstrap /usr/local/go/pkg/bootstrap /*.patch \
36
40
&& apk del .build-deps
37
41
38
42
ENV GOPATH /go
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