diff options
| author | Cherry Mui <cherryyz@google.com> | 2022-09-14 21:01:04 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2022-09-16 15:09:42 +0000 |
| commit | 706d84fca2b36fdf670a0d921e6a8a3b481eaa05 (patch) | |
| tree | 8dbba51278ac92189d25752c374efef9b35a70b2 /src/cmd | |
| parent | 5abf200d6528a67032d67d3f50ffd7ce8b536dfa (diff) | |
| download | go-706d84fca2b36fdf670a0d921e6a8a3b481eaa05.tar.xz | |
cmd/link: suppress -no_pie deprecation warning on darwin
Apparently the new darwin linker starts to emit a warning about
-no_pie deprecation. Maybe we want to switch to PIE by default.
For now, suppress the warning. This also makes it easier for
backporting to previous releases.
For #54482.
Change-Id: I1a3b74c237a9d00ec3b030fc3a9940a31e5cd37e
Reviewed-on: https://go-review.googlesource.com/c/go/+/430937
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/link/internal/ld/lib.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 15748c0fbb..f4a1f1800f 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1775,6 +1775,13 @@ func (ctxt *Link) hostlink() { if len(out) > 0 { // always print external output even if the command is successful, so that we don't // swallow linker warnings (see https://golang.org/issue/17935). + if ctxt.IsDarwin() && ctxt.IsAMD64() { + const noPieWarning = "ld: warning: -no_pie is deprecated when targeting new OS versions\n" + if i := bytes.Index(out, []byte(noPieWarning)); i >= 0 { + // swallow -no_pie deprecation warning, issue 54482 + out = append(out[:i], out[i+len(noPieWarning):]...) + } + } ctxt.Logf("%s", out) } |
