diff options
| author | Cherry Mui <cherryyz@google.com> | 2023-07-10 18:50:06 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2023-08-16 18:42:08 +0000 |
| commit | 040dbf9c181a0e3ea9f7bd3ebe3f75acdc878aaf (patch) | |
| tree | 641622c54a40904e439d1fb82013e080b3db9578 /src/cmd/link/internal | |
| parent | 91bea5a21dc1a951a7fbe491a6da07b664c5a167 (diff) | |
| download | go-040dbf9c181a0e3ea9f7bd3ebe3f75acdc878aaf.tar.xz | |
cmd/link: suppress -bind_at_load deprecation warning for ld-prime
ld-prime emits a deprecation warning for -bind_at_load. The flag
is needed for plugins to not deadlock (#38824) when linking with
older darwin linker. It is supposedly not needed with newer linker
when chained fixups are used. For now, we always pass it, and
suppress the warning.
For #61229.
Change-Id: I4b8a6f864a460c40dc38adbb533f664f7fd5343c
Reviewed-on: https://go-review.googlesource.com/c/go/+/508696
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/link/internal')
| -rw-r--r-- | src/cmd/link/internal/ld/lib.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index de0a54d588..c512d9a089 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -1903,6 +1903,16 @@ func (ctxt *Link) hostlink() { out = append(out[:i], out[i+len(noPieWarning):]...) } } + if ctxt.IsDarwin() { + const bindAtLoadWarning = "ld: warning: -bind_at_load is deprecated on macOS\n" + if i := bytes.Index(out, []byte(bindAtLoadWarning)); i >= 0 { + // -bind_at_load is deprecated with ld-prime, but needed for + // correctness with older versions of ld64. Swallow the warning. + // TODO: maybe pass -bind_at_load conditionally based on C + // linker version. + out = append(out[:i], out[i+len(bindAtLoadWarning):]...) + } + } ctxt.Logf("%s", out) } |
