gcc/libgo/go
Nikhil Benesch 0cdde1e7ae libgo: handle linking to NetBSD's versioned symbols
On NetBSD, for backwards compatibility, various libc symbols are
renamed to a symbol with a version suffix. For example, this is the
(abbreviated) definition of sigaction:

    int sigaction(...) __asm__ ("__sigaction14")

This poses a challenge for libgo, which attempts to link sigaction by
way of an "//extern" comment:

    //extern sigaction
    func sigaction(...)

This results in a reference to the deprecated compatibility symbol
"sigaction", rather than the desired "__sigaction14" symbol.

This patch introduces a new "//extern-sysinfo" comment to handle this
situation. The new mklinknames.awk script scans a package for these
comments and outputs a "//go:linkname" directive that links the wrapper
to the correct versioned symbol, as determined by parsing the __asm__
annotation on the function's declaration in gen-sysinfo.go.

For now, only the following packages are scanned by mklinknames.awk:

    os
    os/user
    runtime
    syscall

gotools/:
	* Makefile.am (check-runtime): Add runtime_linknames.go to
	--extrafiles.
	* Makefile.in: Regenerate.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/265125
2020-10-28 18:20:50 -07:00
..
archive
bufio
builtin
bytes libgo: update to Go 1.15.3 release 2020-10-27 13:58:02 -07:00
cmd libgo: update to Go 1.15.3 release 2020-10-27 13:58:02 -07:00
compress
container
context
crypto
database/sql
debug libgo: add 32-bit RISC-V (RV32) support 2020-09-30 19:47:48 -07:00
encoding
errors
expvar
flag
fmt
go compiler, go/internal/gccgoimporter: export notinheap annotation 2020-10-27 11:03:11 -07:00
golang.org/x libgo: add 32-bit RISC-V (RV32) support 2020-09-30 19:47:48 -07:00
hash
html
image
index/suffixarray
internal libgo: update to Go 1.15.3 release 2020-10-27 13:58:02 -07:00
io
log
math
mime
net net/http/cgi: merge upstream changes to default env vars 2020-10-23 16:55:57 -07:00
os libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
path
plugin
reflect reflect: ensure uniqueness of type descriptors on AIX. 2020-10-13 17:54:37 -07:00
regexp
runtime libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
sort
strconv
strings
sync
syscall libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
testdata
testing libgo: update to Go 1.15.3 release 2020-10-27 13:58:02 -07:00
text
time
unicode