gcc/libgo/go/os
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
..
exec libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
issue37161 libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
signal libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
testdata/issue37161 libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
user libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
dir.go libgo: update to Go1.13 2019-09-12 23:22:53 +00:00
dir_gccgo.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
dir_largefile.go
dir_libc64_gccgo.go libgo: fix build on AIX 2019-03-19 14:00:59 +00:00
dir_libc_gccgo.go libgo: fix build on AIX 2019-03-19 14:00:59 +00:00
dir_plan9.go
dir_regfile.go libgo: handle linking to NetBSD's versioned symbols 2020-10-28 18:20:50 -07:00
env.go
env_test.go
env_unix_test.go
error.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
error_errno.go libgo: update to Go1.13 2019-09-12 23:22:53 +00:00
error_plan9.go libgo: update to Go1.13 2019-09-12 23:22:53 +00:00
error_posix.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
error_test.go libgo: update to Go1.13 2019-09-12 23:22:53 +00:00
error_unix_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
error_windows_test.go
example_test.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
exec.go
exec_plan9.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
exec_posix.go libgo: update to almost the 1.14.2 release 2020-04-06 16:37:24 -07:00
exec_unix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
exec_windows.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
executable.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
executable_darwin.go
executable_freebsd.go
executable_path.go
executable_plan9.go
executable_procfs.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
executable_solaris.go
executable_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
executable_windows.go
export_linux_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
export_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
export_unix_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
export_windows_test.go
fifo_test.go
file.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
file_plan9.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
file_posix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
file_unix.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
getwd.go
getwd_darwin.go
os_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
os_unix_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
os_windows_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
path.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
path_plan9.go
path_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
path_unix.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
path_windows.go
path_windows_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
pipe2_bsd.go
pipe_bsd.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
pipe_glibc.go
pipe_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
proc.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
rawconn.go
rawconn_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
readfrom_linux.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
readfrom_linux_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
readfrom_stub.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
removeall_at.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
removeall_noat.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
removeall_test.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
stat.go
stat_aix.go
stat_atim.go
stat_atimespec.go
stat_dragonfly.go
stat_js.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
stat_plan9.go
stat_solaris.go
stat_test.go
stat_unix.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
sticky_bsd.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
sticky_notbsd.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
str.go
sys.go
sys_bsd.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
sys_js.go
sys_linux.go
sys_plan9.go
sys_uname.go
sys_unix.go
timeout_test.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
types.go
types_plan9.go
types_unix.go
types_windows.go libgo: update to Go 1.13beta1 release 2019-09-06 18:12:46 +00:00
wait_unimp.go libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
wait_wait6.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00
wait_waitid.go libgo: update to go1.15rc1 2020-08-01 11:21:40 -07:00