gcc/libgo/go/syscall
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
..
js libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
bpf_bsd.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
bpf_darwin.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
clone_linux.c
const_plan9.go
creds_test.go
dir_plan9.go
dirent_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
dirent.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
endian_big.go
endian_little.go libgo: add 32-bit RISC-V (RV32) support 2020-09-30 19:47:48 -07:00
env_unix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
env_windows.go
errno.c
errors_plan9.go
errstr_glibc.go syscall: add Hurd support 2019-02-07 03:11:47 +00:00
errstr.go libgo: add hurd build tags 2019-02-01 21:57:36 +00:00
exec_bsd.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
exec_darwin.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
exec_linux_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
exec_linux.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
exec_stubs.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
exec_unix_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
exec_unix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
exec_windows.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
export_aix_test.go syscall: fix TestForeground for AIX 2020-09-22 20:07:34 -07:00
export_freebsd_test.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
export_linux_test.go
export_test.go
export_unix_test.go syscall: fix TestForeground for AIX 2020-09-22 20:07:34 -07:00
flock_darwin.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
forkpipe2.go libgo: add hurd build tags 2019-02-01 21:57:36 +00:00
forkpipe.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
fs_js.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
getdirentries_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
libcall_aix.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_bsd_largefile.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_bsd_regfile.go syscall: remove Sendfile on NetBSD 2020-10-20 10:57:10 -07:00
libcall_bsd_sendfile.go syscall: remove Sendfile on NetBSD 2020-10-20 10:57:10 -07:00
libcall_bsd.go syscall: don't build libcall_bsd.go on solaris 2020-10-28 12:18:01 -07:00
libcall_glibc.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_hurd_386.go syscall: add Hurd support 2019-02-07 03:11:47 +00:00
libcall_hurd.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_irix.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_linux_386.go
libcall_linux_alpha.go
libcall_linux_amd64.go
libcall_linux_s390.go
libcall_linux_s390x.go
libcall_linux_utimesnano.go
libcall_linux.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_posix_largefile.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_posix_nonhurd.go syscall: add Hurd support 2019-02-07 03:11:47 +00:00
libcall_posix_regfile.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_posix_utimesnano.go libgo: add hurd build tags 2019-02-01 21:57:36 +00:00
libcall_posix.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_solaris_386.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_solaris_amd64.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_solaris_largefile.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_solaris_regfile.go re PR go/89447 (libgo largefile support is incomplete and inconsistent) 2019-03-09 02:10:22 +00:00
libcall_solaris_sparc64.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_solaris_sparc.go syscall: only compile ptrace varargs shim on Linux 2020-10-21 22:29:04 -07:00
libcall_support.go
libcall_uname.go
libcall_wait4_aix.go
libcall_wait4.go
lsf_linux.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
mkasm_darwin.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
mksyscall.awk libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
mmap_unix_test.go libgo: add hurd build tags to test files 2019-02-01 22:11:50 +00:00
msan0.go
net_js.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
net.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
netlink_linux.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
pwd_plan9.go
route_bsd.go syscall: import upstream code for BSD sockets and sysctls 2020-10-21 16:57:59 -07:00
route_darwin.go
route_dragonfly.go
route_freebsd_32bit.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
route_freebsd_64bit.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
route_freebsd.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
route_netbsd.go
route_openbsd.go
security_windows.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
setuidgid_32_linux.go
setuidgid_linux.go
signame.c
sleep_rtems.go
sleep_select.go
sock_cloexec_linux.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
sockcmsg_dragonfly.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
sockcmsg_linux.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
sockcmsg_unix_other.go runtime, syscall: add a couple of hurd build tags 2020-01-29 16:43:57 -08:00
sockcmsg_unix.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
socket_aix.go libgo/go/syscall: add SockAddrDatalink on AIX 2019-04-19 14:20:16 +00:00
socket_bsd.go syscall: import upstream code for BSD sockets and sysctls 2020-10-21 16:57:59 -07:00
socket_irix.go
socket_linux_ppc64x_type.go
socket_linux_type.go
socket_linux.go
socket_posix.go
socket_solaris.go
socket_xnet.go
socket.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
str.go
syscall_aix_ppc64.go
syscall_aix_ppc.go syscall: remove ptrace syscall on ppc64 2020-09-22 19:55:34 -07:00
syscall_aix.go libgo: update to Go1.14rc1 release 2020-02-15 09:14:10 -08:00
syscall_darwin.go
syscall_dragonfly.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
syscall_errno.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
syscall_freebsd_arm64.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
syscall_freebsd_test.go libgo: update to Go1.12beta2 2019-01-18 19:04:36 +00:00
syscall_freebsd.go libgo: update to Go1.13 2019-09-12 23:22:53 +00:00
syscall_funcs_stubs.go libgo: fix build on AIX 2019-03-19 14:00:59 +00:00
syscall_funcs.go libgo: fix build on AIX 2019-03-19 14:00:59 +00:00
syscall_glibc.go syscall: add Hurd support 2019-02-07 03:11:47 +00:00
syscall_js.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
syscall_linux_386.go
syscall_linux_alpha.go
syscall_linux_amd64.go
syscall_linux_mipsx.go
syscall_linux_riscv64.go syscall: fix riscv64 GNU/Linux build 2020-02-03 18:14:19 -08:00
syscall_linux_s390.go
syscall_linux_s390x.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
syscall_linux_test.go syscall: append to environment in tests, don't clobber it 2020-05-11 17:27:46 -07:00
syscall_netbsd_arm64.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
syscall_netbsd.go syscall: import additional BSD-specific syscall wrappers 2020-10-26 15:04:16 -07:00
syscall_openbsd_arm64.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
syscall_openbsd.go
syscall_plan9_test.go
syscall_ptrace_test.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
syscall_solaris.go
syscall_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
syscall_unix_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
syscall_unix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
syscall.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
tables_js.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
time_fake.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
time_nofake.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
timestruct.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
wait.c re PR go/90614 (gcc-9.1.0/libgo/go/syscall/wait.c:54:22: error: unused parameter ‘w’ [-Werror=unused-parameter] Continued (uint32_t *w)) 2019-05-27 00:10:34 +00:00