diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 6252871..94ef43c 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1293,6 +1293,11 @@ func (l *Link) hostlink() { argv = append(argv, peimporteddlls()...) } + // The Go linker does not currently support building PIE + // executables when using the external linker. See: + // https://github.com/golang/go/issues/6940 + argv = append(argv, "-fno-PIC") + if l.Debugvlog != 0 { l.Logf("%5.2f host link:", Cputime()) for _, v := range argv {