]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: process //go:linknames after declarations
authorMatthew Dempsky <mdempsky@google.com>
Sun, 29 Nov 2020 22:06:17 +0000 (14:06 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 1 Dec 2020 17:08:36 +0000 (17:08 +0000)
commit2d6ff998edc0f3877ee24d28647a494491742f25
tree4a1a70d3583a8a5d7ef00bc7ced841935f14bf18
parentecff7628ead3b0191f5fe191864ee47fcc90bb92
[dev.regabi] cmd/compile: process //go:linknames after declarations

Allows emitting errors about ineffectual //go:linkname directives.

In particular, this exposed: a typo in os2_aix.go; redundant (but
harmless) directives for libc_pipe in both os3_solaris.go and
syscall2_solaris.go; and a bunch of useless //go:linkname directives
in macOS wrapper code.

However, because there's also ineffectual directives in the vendored
macOS code from x/sys, that can't be an error just yet. So instead we
print a warning (including a heads up that it will be promoted to an
error in Go 1.17) to prevent backsliding while we fix and re-vendor
that code.

Passes toolstash-check.

Change-Id: I59badeab5df0d8b3abfd14c6066e9bb00e840f73
Reviewed-on: https://go-review.googlesource.com/c/go/+/273986
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
13 files changed:
src/cmd/compile/internal/gc/noder.go
src/crypto/x509/internal/macos/corefoundation.go
src/crypto/x509/internal/macos/security.go
src/go/types/stdlib_test.go
src/runtime/os2_aix.go
src/runtime/syscall2_solaris.go
src/syscall/mksyscall.pl
src/syscall/syscall_darwin.go
src/syscall/syscall_darwin_amd64.go
src/syscall/syscall_darwin_arm64.go
src/syscall/zsyscall_darwin_amd64.go
src/syscall/zsyscall_darwin_arm64.go
test/linkname2.go [new file with mode: 0644]