Showing preview only (988K chars total). Download the full file or copy to clipboard to get everything.
Repository: hajimehoshi/hitsumabushi
Branch: main
Commit: 2d81b070ae19
Files: 694
Total size: 826.3 KB
Directory structure:
gitextract_v2i9lf6x/
├── .github/
│ └── workflows/
│ └── test.yml
├── .gitignore
├── 1.19_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ └── testenv/
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ └── big/
│ │ └── link_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ └── hitsumabushi_thread_linux.c
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_linux_test.go.patch
│ │ ├── export_unix_test.go.patch
│ │ ├── internal/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ └── syscall_linux.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── norace_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ └── timestub2.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.19_windows/
│ ├── runtime/
│ │ ├── abi_test.go.patch
│ │ ├── cgo/
│ │ │ ├── gcc_fatalf.c.patch
│ │ │ ├── gcc_libinit.c.patch
│ │ │ ├── gcc_libinit_windows.c.patch
│ │ │ ├── gcc_windows_amd64.c.patch
│ │ │ └── libcgo.h.patch
│ │ ├── crash_test.go.patch
│ │ ├── malloc_test.go.patch
│ │ ├── os_windows.go.patch
│ │ ├── syscall_windows.go.patch
│ │ └── syscall_windows_test.go.patch
│ └── sync/
│ └── mutex_test.go.patch
├── 1.20_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ └── big/
│ │ └── link_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── internal/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── norace_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ └── timestub2.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.20_windows/
│ ├── runtime/
│ │ ├── abi_test.go.patch
│ │ ├── cgo/
│ │ │ └── gcc_windows_amd64.c.patch
│ │ ├── crash_test.go.patch
│ │ ├── malloc_test.go.patch
│ │ ├── os_windows.go.patch
│ │ ├── syscall_windows.go.patch
│ │ └── syscall_windows_test.go.patch
│ └── sync/
│ └── mutex_test.go.patch
├── 1.21_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── internal/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── norace_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.21_windows/
│ ├── runtime/
│ │ ├── abi_test.go.patch
│ │ ├── cgo/
│ │ │ └── gcc_windows_amd64.c.patch
│ │ ├── crash_test.go.patch
│ │ ├── malloc_test.go.patch
│ │ ├── os_windows.go.patch
│ │ ├── runtime-gdb_test.go.patch
│ │ ├── syscall_windows.go.patch
│ │ └── syscall_windows_test.go.patch
│ └── sync/
│ └── mutex_test.go.patch
├── 1.22_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── fds_unix.go.patch
│ │ ├── internal/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── metrics_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── norace_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── rand_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.22_windows/
│ ├── internal/
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ └── testenv.go.patch
│ └── runtime/
│ ├── cgo/
│ │ ├── gcc_windows_amd64.c.patch
│ │ └── libcgo.h.patch
│ ├── os_windows.go.patch
│ ├── signal_windows.go.patch
│ ├── syscall_windows.go.patch
│ └── syscall_windows_test.go.patch
├── 1.23_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── runtime/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── fds_unix.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── metrics_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── norace_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── rand_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.23_windows/
│ ├── internal/
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ └── testenv.go.patch
│ └── runtime/
│ ├── cgo/
│ │ ├── gcc_windows_amd64.c.patch
│ │ └── libcgo.h.patch
│ ├── os_windows.go.patch
│ ├── signal_windows.go.patch
│ ├── syscall_windows.go.patch
│ └── syscall_windows_test.go.patch
├── 1.24_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── runtime/
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ └── panic_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── fds_unix.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── metrics_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── nosan_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── rand_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.24_windows/
│ ├── internal/
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ └── testenv.go.patch
│ └── runtime/
│ ├── cgo/
│ │ ├── gcc_windows_amd64.c.patch
│ │ └── libcgo.h.patch
│ ├── os_windows.go.patch
│ ├── signal_windows.go.patch
│ ├── syscall_windows.go.patch
│ └── syscall_windows_test.go.patch
├── 1.25_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── runtime/
│ │ │ ├── cgroup/
│ │ │ │ └── cgroup_linux.go.patch
│ │ │ └── syscall/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ ├── panic_test.go.patch
│ │ │ └── stack_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── decoratemappings_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── fds_unix.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── metrics_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── nosan_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── rand_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── strconv/
│ │ └── fp_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.25_windows/
│ ├── internal/
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ └── testenv.go.patch
│ └── runtime/
│ ├── cgo/
│ │ ├── gcc_windows_amd64.c.patch
│ │ └── libcgo.h.patch
│ ├── os_windows.go.patch
│ ├── signal_windows.go.patch
│ ├── syscall_windows.go.patch
│ └── syscall_windows_test.go.patch
├── 1.26_linux/
│ ├── internal/
│ │ ├── reflectlite/
│ │ │ └── reflect_mirror_test.go.patch
│ │ ├── runtime/
│ │ │ ├── cgroup/
│ │ │ │ └── cgroup_linux.go.patch
│ │ │ └── syscall/
│ │ │ └── linux/
│ │ │ ├── asm_linux_amd64.s.patch
│ │ │ ├── asm_linux_arm64.s.patch
│ │ │ ├── syscall_linux.go.patch
│ │ │ └── syscall_linux_test.go.patch
│ │ ├── strconv/
│ │ │ └── fp_test.go.patch
│ │ ├── syscall/
│ │ │ └── unix/
│ │ │ └── fcntl_unix.go.patch
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ ├── testenv.go.patch
│ │ ├── testenv_notunix.go.patch
│ │ └── testenv_unix.go.patch
│ ├── math/
│ │ ├── big/
│ │ │ └── link_test.go.patch
│ │ └── rand/
│ │ └── default_test.go.patch
│ ├── runtime/
│ │ ├── align_test.go.patch
│ │ ├── asm_arm64.s.patch
│ │ ├── callers_test.go.patch
│ │ ├── cgo/
│ │ │ ├── cgo.go.patch
│ │ │ ├── gcc_clearenv.c.patch
│ │ │ ├── gcc_linux_amd64.c.patch
│ │ │ ├── gcc_linux_arm64.c.patch
│ │ │ ├── gcc_setenv.c.patch
│ │ │ ├── gcc_sigaction.c.patch
│ │ │ ├── hitsumabushi_clock_linux.c
│ │ │ ├── hitsumabushi_cpu_linux.c
│ │ │ ├── hitsumabushi_filesystem_linux.c
│ │ │ ├── hitsumabushi_futex_linux.c
│ │ │ ├── hitsumabushi_mem_linux.c
│ │ │ ├── hitsumabushi_syscalls_linux.c
│ │ │ ├── hitsumabushi_thread_linux.c
│ │ │ ├── linux_syscall.c.patch
│ │ │ └── sigaction.go.patch
│ │ ├── crash_test.go.patch
│ │ ├── crash_unix_test.go.patch
│ │ ├── debug/
│ │ │ ├── heapdump_test.go.patch
│ │ │ ├── panic_test.go.patch
│ │ │ └── stack_test.go.patch
│ │ ├── debug_test.go.patch
│ │ ├── decoratemappings_test.go.patch
│ │ ├── export_unix_test.go
│ │ ├── fds_unix.go.patch
│ │ ├── mem_linux.go
│ │ ├── memmove_linux_amd64_test.go.patch
│ │ ├── metrics_test.go.patch
│ │ ├── nbpipe_pipe2.go.patch
│ │ ├── nbpipe_test.go.patch
│ │ ├── netpoll_epoll.go.patch
│ │ ├── netpoll_fake.go.patch
│ │ ├── nosan_linux_test.go.patch
│ │ ├── os_linux.go.patch
│ │ ├── os_linux64.go.patch
│ │ ├── panicnil_test.go.patch
│ │ ├── proc_test.go.patch
│ │ ├── rand_test.go.patch
│ │ ├── runtime1.go.patch
│ │ ├── runtime_linux_test.go.patch
│ │ ├── runtime_mmap_test.go.patch
│ │ ├── runtime_test.go.patch
│ │ ├── runtime_unix_test.go.patch
│ │ ├── stack_test.go.patch
│ │ ├── stubs2.go.patch
│ │ ├── stubs3.go.patch
│ │ ├── sys_libc.go.patch
│ │ ├── sys_linux_amd64.s.patch
│ │ ├── sys_linux_arm64.s.patch
│ │ ├── time_linux_amd64.s.patch
│ │ ├── timeasm.go.patch
│ │ ├── timestub.go.patch
│ │ ├── timestub2.go.patch
│ │ └── traceback_test.go.patch
│ ├── sync/
│ │ └── atomic/
│ │ └── atomic_test.go.patch
│ ├── syscall/
│ │ ├── hitsumabushi_stubs_linux_amd64.go
│ │ ├── hitsumabushi_stubs_linux_arm64.go
│ │ ├── rlimit.go.patch
│ │ └── syscall_linux.go.patch
│ ├── testing/
│ │ └── run_example.go
│ └── time/
│ ├── format_test.go.patch
│ ├── internal_test.go.patch
│ ├── sleep_test.go.patch
│ ├── time_test.go.patch
│ ├── tzdata_test.go.patch
│ ├── zoneinfo_test.go.patch
│ ├── zoneinfo_unix.go.patch
│ └── zoneinfo_unix_test.go.patch
├── 1.26_windows/
│ ├── internal/
│ │ └── testenv/
│ │ ├── exec.go.patch
│ │ └── testenv.go.patch
│ └── runtime/
│ ├── cgo/
│ │ ├── gcc_windows_amd64.c.patch
│ │ └── libcgo.h.patch
│ ├── os_windows.go.patch
│ ├── signal_windows.go.patch
│ ├── syscall_windows.go.patch
│ └── syscall_windows_test.go.patch
├── LICENSE
├── README.md
├── doc.go
├── example/
│ └── helloworld/
│ ├── .gitignore
│ ├── genoverlayjson.go
│ ├── main.c
│ ├── main.go
│ ├── run.sh
│ └── run_cross.sh
├── go.mod
├── overlay.go
├── patch.go
└── test.go
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/test.yml
================================================
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
go: ['1.19.13', '1.20.14', '1.21.13', '1.22.12', '1.23.12', '1.24.13', '1.25.9', '1.26.2']
name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up the prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Test (Linux, arm64)
if: runner.os == 'Linux'
run: |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v fmt"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/abi"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/cpu"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/fmtsort"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/reflectlite"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/unsafeheader"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/big"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/bits"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/cmplx"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v math/rand"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v -test.short runtime"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/debug"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v strconv"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v strings"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sort"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sync"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v sync/atomic"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v time"
- name: Test (Linux, arm64, Go <= 1.22)
if: runner.os == 'Linux' && (startsWith(matrix.go, '1.19.') || startsWith(matrix.go, '1.20.') || startsWith(matrix.go, '1.21.') || startsWith(matrix.go, '1.22.'))
run: |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/itoa"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/atomic"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/math"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/sys"
- name: Test (Linux, arm64, Go == 1.23)
if: runner.os == 'Linux' && startsWith(matrix.go, '1.23.')
run: |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/itoa"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/atomic"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/math"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v runtime/internal/sys"
- name: Test (Linux, arm64, Go >= 1.24 && <= 1.25)
if: runner.os == 'Linux' && (startsWith(matrix.go, '1.24.') || startsWith(matrix.go, '1.25.'))
run: |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/itoa"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/atomic"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/math"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/sys"
- name: Test (Linux, arm64, Go == 1.26)
if: runner.os == 'Linux' && startsWith(matrix.go, '1.26.')
run: |
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/strconv"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/atomic"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/math"
GOARCH=arm64 go run test.go -qemu -args="-test.run=^Test -test.v internal/runtime/sys"
- name: Test (amd64)
run: |
go run test.go -args="-test.run=^Test -test.v fmt"
go run test.go -args="-test.run=^Test -test.v internal/abi"
go run test.go -args="-test.run=^Test -test.v internal/cpu"
go run test.go -args="-test.run=^Test -test.v internal/fmtsort"
go run test.go -args="-test.run=^Test -test.v internal/reflectlite"
go run test.go -args="-test.run=^Test -test.v internal/unsafeheader"
go run test.go -args="-test.run=^Test -test.v math"
go run test.go -args="-test.run=^Test -test.v math/big"
go run test.go -args="-test.run=^Test -test.v math/bits"
go run test.go -args="-test.run=^Test -test.v math/cmplx"
# math/rand's TestDefaultRace doesn't work well by default.
# Set an environment to do the default tests.
GO_RAND_TEST_HELPER_CODE=1 go run test.go -args="-test.run=^Test -test.v math/rand"
go run test.go -args="-test.run=^Test -test.v runtime/debug"
go run test.go -args="-test.run=^Test -test.v strconv"
go run test.go -args="-test.run=^Test -test.v strings"
go run test.go -args="-test.run=^Test -test.v sort"
go run test.go -args="-test.run=^Test -test.v sync"
go run test.go -args="-test.run=^Test -test.v sync/atomic"
go run test.go -args="-test.run=^Test -test.v time"
- name: Test (amd64, Go <= 1.22)
if: startsWith(matrix.go, '1.19.') || startsWith(matrix.go, '1.20.') || startsWith(matrix.go, '1.21.') || startsWith(matrix.go, '1.22.')
run: |
go run test.go -args="-test.run=^Test -test.v internal/itoa"
go run test.go -args="-test.run=^Test -test.v runtime/internal/atomic"
go run test.go -args="-test.run=^Test -test.v runtime/internal/math"
go run test.go -args="-test.run=^Test -test.v runtime/internal/sys"
- name: Test (amd64, Go == 1.23)
if: startsWith(matrix.go, '1.23.')
run: |
go run test.go -args="-test.run=^Test -test.v internal/itoa"
go run test.go -args="-test.run=^Test -test.v internal/runtime/atomic"
go run test.go -args="-test.run=^Test -test.v runtime/internal/math"
go run test.go -args="-test.run=^Test -test.v runtime/internal/sys"
- name: Test (amd64, Go >= 1.24 && <= 1.25)
if: startsWith(matrix.go, '1.24.') || startsWith(matrix.go, '1.25.')
run: |
go run test.go -args="-test.run=^Test -test.v internal/itoa"
go run test.go -args="-test.run=^Test -test.v internal/runtime/atomic"
go run test.go -args="-test.run=^Test -test.v internal/runtime/math"
go run test.go -args="-test.run=^Test -test.v internal/runtime/sys"
- name: Test (amd64, Go >= 1.26)
# strconv/ftoa.go is missing in 1.26.
if: startsWith(matrix.go, '1.26.')
run: |
go run test.go -args="-test.run=^Test -test.v internal/strconv"
go run test.go -args="-test.run=^Test -test.v internal/runtime/atomic"
go run test.go -args="-test.run=^Test -test.v internal/runtime/math"
go run test.go -args="-test.run=^Test -test.v internal/runtime/sys"
- name: Test (amd64, runtime)
# Skip runtime tests with Go 1.19 and Windows, as there is an issue (probably golang/go#51007 and golang/go#57455).
if: runner.os == 'Linux' || !startsWith(matrix.go, '1.19.')
run: |
go run test.go -args="-test.run=^Test -test.v -test.short runtime"
================================================
FILE: .gitignore
================================================
*~
.DS_Store
*.a
================================================
FILE: 1.19_linux/internal/reflectlite/reflect_mirror_test.go.patch
================================================
//--from
func TestMirrorWithReflect(t *testing.T) {
//--to
func TestMirrorWithReflect(t *testing.T) {
t.Skip("file is not supported in this environment")
return
================================================
FILE: 1.19_linux/internal/testenv/testenv.go.patch
================================================
//--from
func HasGoBuild() bool {
if os.Getenv("GO_GCFLAGS") != "" {
// It's too much work to require every caller of the go command
// to pass along "-gcflags="+os.Getenv("GO_GCFLAGS").
// For now, if $GO_GCFLAGS is set, report that we simply can't
// run go build.
return false
}
switch runtime.GOOS {
case "android", "js", "ios":
return false
}
return true
}
//--to
func HasGoBuild() bool {
return false
}
//--from
func HasExec() bool {
switch runtime.GOOS {
case "js", "ios":
return false
}
return true
}
//--to
func HasExec() bool {
return false
}
================================================
FILE: 1.19_linux/internal/testenv/testenv_notunix.go.patch
================================================
//--from
//go:build windows || plan9 || (js && wasm)
//--to
//go:build windows || plan9 || (js && wasm) || linux
================================================
FILE: 1.19_linux/internal/testenv/testenv_unix.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.19_linux/math/big/link_test.go.patch
================================================
//--from
import (
"bytes"
"internal/testenv"
"os"
"os/exec"
"path/filepath"
"testing"
)
//--to
import (
"testing"
)
//--from
func TestLinkerGC(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
t.Parallel()
tmp := t.TempDir()
goBin := testenv.GoToolPath(t)
goFile := filepath.Join(tmp, "x.go")
file := []byte(`package main
import _ "math/big"
func main() {}
`)
if err := os.WriteFile(goFile, file, 0644); err != nil {
t.Fatal(err)
}
cmd := exec.Command(goBin, "build", "-o", "x.exe", "x.go")
cmd.Dir = tmp
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("compile: %v, %s", err, out)
}
cmd = exec.Command(goBin, "tool", "nm", "x.exe")
cmd.Dir = tmp
nm, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("nm: %v, %s", err, nm)
}
const want = "runtime.main"
if !bytes.Contains(nm, []byte(want)) {
// Test the test.
t.Errorf("expected symbol %q not found", want)
}
bad := []string{
"math/big.(*Float)",
"math/big.(*Rat)",
"math/big.(*Int)",
}
for _, sym := range bad {
if bytes.Contains(nm, []byte(sym)) {
t.Errorf("unexpected symbol %q found", sym)
}
}
if t.Failed() {
t.Logf("Got: %s", nm)
}
}
//--to
func TestLinkerGC(t *testing.T) {
t.Skip("go tools are not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/align_test.go.patch
================================================
//--from
import (
"bytes"
"go/ast"
"go/build"
"go/importer"
"go/parser"
"go/printer"
"go/token"
"go/types"
"os"
"regexp"
"runtime"
"strings"
"testing"
)
//--to
import (
"bytes"
"go/ast"
"go/build"
"go/printer"
"go/token"
"go/types"
"strings"
"testing"
)
//--from
func TestAtomicAlignment(t *testing.T) {
// Read the code making the tables above, to see which fields and
// variables we are currently checking.
checked := map[string]bool{}
x, err := os.ReadFile("./align_runtime_test.go")
if err != nil {
t.Fatalf("read failed: %v", err)
}
fieldDesc := map[int]string{}
r := regexp.MustCompile(`unsafe[.]Offsetof[(](\w+){}[.](\w+)[)]`)
matches := r.FindAllStringSubmatch(string(x), -1)
for i, v := range matches {
checked["field runtime."+v[1]+"."+v[2]] = true
fieldDesc[i] = v[1] + "." + v[2]
}
varDesc := map[int]string{}
r = regexp.MustCompile(`unsafe[.]Pointer[(]&(\w+)[)]`)
matches = r.FindAllStringSubmatch(string(x), -1)
for i, v := range matches {
checked["var "+v[1]] = true
varDesc[i] = v[1]
}
// Check all of our alignemnts. This is the actual core of the test.
for i, d := range runtime.AtomicFields {
if d%8 != 0 {
t.Errorf("field alignment of %s failed: offset is %d", fieldDesc[i], d)
}
}
for i, p := range runtime.AtomicVariables {
if uintptr(p)%8 != 0 {
t.Errorf("variable alignment of %s failed: address is %x", varDesc[i], p)
}
}
// The code above is the actual test. The code below attempts to check
// that the tables used by the code above are exhaustive.
// Parse the whole runtime package, checking that arguments of
// appropriate atomic operations are in the list above.
fset := token.NewFileSet()
m, err := parser.ParseDir(fset, ".", nil, 0)
if err != nil {
t.Fatalf("parsing runtime failed: %v", err)
}
pkg := m["runtime"] // Note: ignore runtime_test and main packages
// Filter files by those for the current architecture/os being tested.
fileMap := map[string]bool{}
for _, f := range buildableFiles(t, ".") {
fileMap[f] = true
}
var files []*ast.File
for fname, f := range pkg.Files {
if fileMap[fname] {
files = append(files, f)
}
}
// Call go/types to analyze the runtime package.
var info types.Info
info.Types = map[ast.Expr]types.TypeAndValue{}
conf := types.Config{Importer: importer.Default()}
_, err = conf.Check("runtime", fset, files, &info)
if err != nil {
t.Fatalf("typechecking runtime failed: %v", err)
}
// Analyze all atomic.*64 callsites.
v := Visitor{t: t, fset: fset, types: info.Types, checked: checked}
ast.Walk(&v, pkg)
}
//--to
func TestAtomicAlignment(t *testing.T) {
t.Skip("file is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/callers_test.go.patch
================================================
//--from
func TestCallersNilPointerPanic(t *testing.T) {
// Make sure we don't have any extra frames on the stack (due to
// open-coded defer processing)
want := []string{"runtime.Callers", "runtime_test.TestCallersNilPointerPanic.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic",
"runtime_test.TestCallersNilPointerPanic"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
}()
var p *int
if *p == 3 {
t.Fatal("did not see nil pointer panic")
}
}
//--to
func TestCallersNilPointerPanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestCallersDeferNilFuncPanic(t *testing.T) {
// Make sure we don't have any extra frames on the stack. We cut off the check
// at runtime.sigpanic, because non-open-coded defers (which may be used in
// non-opt or race checker mode) include an extra 'deferreturn' frame (which is
// where the nil pointer deref happens).
state := 1
want := []string{"runtime.Callers", "runtime_test.TestCallersDeferNilFuncPanic.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
if state == 1 {
t.Fatal("nil defer func panicked at defer time rather than function exit time")
}
}()
var f func()
defer f()
// Use the value of 'state' to make sure nil defer func f causes panic at
// function exit, rather than at the defer statement.
state = 2
}
//--to
func TestCallersDeferNilFuncPanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) {
state := 1
want := []string{"runtime.Callers", "runtime_test.TestCallersDeferNilFuncPanicWithLoop.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic", "runtime.deferreturn", "runtime_test.TestCallersDeferNilFuncPanicWithLoop"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
if state == 1 {
t.Fatal("nil defer func panicked at defer time rather than function exit time")
}
}()
for i := 0; i < 1; i++ {
var f func()
defer f()
}
// Use the value of 'state' to make sure nil defer func f causes panic at
// function exit, rather than at the defer statement.
state = 2
}
//--to
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/cgo/cgo.go.patch
================================================
//--from
*/
import "C"
//--to
#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all
#cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
*/
import "C"
================================================
FILE: 1.19_linux/runtime/cgo/gcc_linux_arm64.c.patch
================================================
//--from
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
sigset_t ign, oset;
pthread_t p;
size_t size;
int err;
sigfillset(&ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
pthread_attr_init(&attr);
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
pthread_sigmask(SIG_SETMASK, &oset, nil);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--to
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
sigset_t ign, oset;
pthread_t p;
size_t size;
int err;
sigfillset(&ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 16 * 4096); // Hack for some special environments
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
pthread_sigmask(SIG_SETMASK, &oset, nil);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--from
void
x_cgo_init(G *g, void (*setg)(void*), void **tlsg, void **tlsbase)
{
pthread_attr_t *attr;
size_t size;
/* The memory sanitizer distributed with versions of clang
before 3.8 has a bug: if you call mmap before malloc, mmap
may return an address that is later overwritten by the msan
library. Avoid this problem by forcing a call to malloc
here, before we ever call malloc.
This is only required for the memory sanitizer, so it's
unfortunate that we always run it. It should be possible
to remove this when we no longer care about versions of
clang before 3.8. The test for this is
misc/cgo/testsanitizers.
GCC works hard to eliminate a seemingly unnecessary call to
malloc, so we actually use the memory we allocate. */
setg_gcc = setg;
attr = (pthread_attr_t*)malloc(sizeof *attr);
if (attr == NULL) {
fatalf("malloc failed: %s", strerror(errno));
}
pthread_attr_init(attr);
pthread_attr_getstacksize(attr, &size);
g->stacklo = (uintptr)&size - size + 4096;
pthread_attr_destroy(attr);
free(attr);
if (x_cgo_inittls) {
x_cgo_inittls(tlsg, tlsbase);
}
}
//--to
void
x_cgo_init(G *g, void (*setg)(void*), void **tlsg, void **tlsbase)
{
pthread_attr_t *attr;
size_t size;
/* The memory sanitizer distributed with versions of clang
before 3.8 has a bug: if you call mmap before malloc, mmap
may return an address that is later overwritten by the msan
library. Avoid this problem by forcing a call to malloc
here, before we ever call malloc.
This is only required for the memory sanitizer, so it's
unfortunate that we always run it. It should be possible
to remove this when we no longer care about versions of
clang before 3.8. The test for this is
misc/cgo/testsanitizers.
GCC works hard to eliminate a seemingly unnecessary call to
malloc, so we actually use the memory we allocate. */
setg_gcc = setg;
attr = (pthread_attr_t*)malloc(sizeof *attr);
if (attr == NULL) {
fatalf("malloc failed: %s", strerror(errno));
}
pthread_attr_init(attr);
pthread_attr_setstacksize(attr, 16 * 4096); // Hack for some special environments
pthread_attr_getstacksize(attr, &size);
g->stacklo = (uintptr)&size - size + 4096;
pthread_attr_destroy(attr);
free(attr);
if (x_cgo_inittls) {
x_cgo_inittls(tlsg, tlsbase);
}
}
//--from
static void*
threadentry(void *v)
{
//--to
static void*
threadentry(void *v)
{
extern void hitsumabushi_initializeThread(void);
hitsumabushi_initializeThread();
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_clock_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <time.h>
int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
return clock_gettime(clk_id, tp);
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_cpu_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <stdint.h>
int32_t hitsumabushi_getproccount() {
return 1;
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
// This file defines C functions and system calls for Cgo.
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdatomic.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "libcgo.h"
#include "libcgo_unix.h"
static const int kFDOffset = 100;
typedef struct {
const void* content;
size_t content_size;
size_t current;
int32_t fd;
} pseudo_file;
// TODO: Do we need to protect this by mutex?
static pseudo_file pseudo_files[100];
static pthread_mutex_t* pseudo_file_mutex() {
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
return &mutex;
}
static int32_t open_pseudo_file(const void* content, size_t content_size) {
pthread_mutex_lock(pseudo_file_mutex());
int index = 0;
int found = 0;
for (int i = 0; i < sizeof(pseudo_files) / sizeof(pseudo_file); i++) {
if (pseudo_files[i].fd == 0) {
index = i;
found = 1;
break;
}
}
if (!found) {
// Too many pseudo files are opened.
pthread_mutex_unlock(pseudo_file_mutex());
return -1;
}
int32_t fd = index + kFDOffset;
pseudo_files[index].content = content;
pseudo_files[index].content_size = content_size;
pseudo_files[index].current = 0;
pseudo_files[index].fd = fd;
pthread_mutex_unlock(pseudo_file_mutex());
return fd;
}
static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
pthread_mutex_lock(pseudo_file_mutex());
int32_t index = fd - kFDOffset;
pseudo_file *file = &pseudo_files[index];
size_t rest = file->content_size - file->current;
if (rest < n) {
n = rest;
}
memcpy(p, file->content + file->current, n);
pseudo_files[index].current += n;
pthread_mutex_unlock(pseudo_file_mutex());
return n;
}
static void close_pseudo_file(int32_t fd) {
pthread_mutex_lock(pseudo_file_mutex());
int32_t index = fd - kFDOffset;
pseudo_files[index].content = NULL;
pseudo_files[index].content_size = 0;
pseudo_files[index].current = 0;
pseudo_files[index].fd = 0;
pthread_mutex_unlock(pseudo_file_mutex());
}
int32_t hitsumabushi_closefd(int32_t fd) {
if (fd >= kFDOffset) {
close_pseudo_file(fd);
return 0;
}
fprintf(stderr, "syscall close(%d) is not implemented\n", fd);
return 0;
}
int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
if (strcmp(name, "/proc/self/auxv") == 0) {
static const char auxv[] =
"\x06\x00\x00\x00\x00\x00\x00\x00" // _AT_PAGESZ tag (6)
"\x00\x10\x00\x00\x00\x00\x00\x00" // 4096 bytes per page
"\x00\x00\x00\x00\x00\x00\x00\x00" // Dummy bytes
"\x00\x00\x00\x00\x00\x00\x00\x00"; // Dummy bytes
return open_pseudo_file(auxv, sizeof(auxv) / sizeof(char));
}
if (strcmp(name, "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size") == 0) {
static const char hpage_pmd_size[] =
"\x30\x5c"; // '0', '\n'
return open_pseudo_file(hpage_pmd_size, sizeof(hpage_pmd_size) / sizeof(char));
}
fprintf(stderr, "syscall open(%s, %d, %d) is not implemented\n", name, mode, perm);
const static int kENOENT = 0x2;
return kENOENT;
}
int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
if (fd >= kFDOffset) {
return read_pseudo_file(fd, p, n);
}
fprintf(stderr, "syscall read(%d, %p, %d) is not implemented\n", fd, p, n);
const static int kEBADF = 0x9;
return kEBADF;
}
int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
int32_t ret = 0;
pthread_mutex_lock(&m);
switch (fd) {
case 1:
ret = fwrite(p, 1, n, stdout);
fflush(stdout);
break;
case 2:
ret = fwrite(p, 1, n, stderr);
fflush(stderr);
break;
default:
fprintf(stderr, "syscall write(%lu, %p, %d) is not implemented\n", fd, p, n);
ret = -EBADF;
break;
}
pthread_mutex_unlock(&m);
return ret;
}
int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
fprintf(stderr, "syscall lseek(%lu, %lu, %d) is not implemented\n", fd, offset, whence);
return -ENOSYS;
}
int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
{
if (fd == 0 || fd == 1 || fd == 2) {
if (cmd == F_GETFL) {
return 0;
}
}
fprintf(stderr, "syscall fcntl(%d, %d, %d) is not implemented\n", fd, cmd, arg);
return -EBADF;
}
int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
{
fprintf(stderr, "syscall fstat(%d, %p) is not implemented\n", fd, stat);
return -ENOSYS;
}
int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, char* name2)
{
fprintf(stderr, "syscall renameat(%d, %s, %d, %s) is not implemented\n", fd1, name1, fd2, name2);
return -ENOSYS;
}
int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int32_t flags)
{
fprintf(stderr, "syscall fstatat(%d, %s, %p, %d) is not implemented\n", fd, name, p, flags);
return -ENOSYS;
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_futex_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
static const int kPseudoFutexWait = 0;
static const int kPseudoFutexWake = 1;
static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const struct timespec *reltime) {
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
struct timespec abstime;
if (reltime) {
// We are not sure CLOCK_REALTIME is correct or not here.
// However, this time limit is actually not used as the condition variable is shared by
// all the threads. Before the time limit reaches, the thread wakes up in 99.9999...% cases.
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_sec += reltime->tv_sec;
abstime.tv_nsec += reltime->tv_nsec;
if (1000000000 <= abstime.tv_nsec) {
abstime.tv_sec += 1;
abstime.tv_nsec -= 1000000000;
}
}
int ret = pthread_mutex_lock(&mutex);
if (ret) {
fprintf(stderr, "pthread_mutex_lock failed: %d\n", ret);
abort();
}
switch (mode) {
case kPseudoFutexWait:
if (reltime) {
uint32_t v = 0;
__atomic_load(uaddr, &v, __ATOMIC_RELAXED);
if (v == val) {
int ret = pthread_cond_timedwait(&cond, &mutex, &abstime);
if (ret && ret != ETIMEDOUT) {
fprintf(stderr, "pthread_cond_timedwait failed: %d\n", ret);
abort();
}
}
} else {
uint32_t v = 0;
__atomic_load(uaddr, &v, __ATOMIC_RELAXED);
if (v == val) {
int ret = pthread_cond_wait(&cond, &mutex);
if (ret) {
fprintf(stderr, "pthread_cond_wait failed: %d\n", ret);
abort();
}
}
}
break;
case kPseudoFutexWake:
if (val != 1) {
fprintf(stderr, "val for waking must be 1 but %d\n", val);
abort();
}
// TODO: broadcasting is not efficient. Use a mutex for each uaddr.
int ret = pthread_cond_broadcast(&cond);
if (ret) {
fprintf(stderr, "pthread_cond_broadcast failed: %d\n", ret);
abort();
}
break;
}
ret = pthread_mutex_unlock(&mutex);
if (ret) {
fprintf(stderr, "pthread_mutex_unlock failed: %d\n", ret);
abort();
}
}
int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
const struct timespec *timeout,
uint32_t *uaddr2, uint32_t val3) {
enum {
kFutexWaitPrivate = 128,
kFutexWakePrivate = 129,
};
switch (futex_op) {
case kFutexWaitPrivate:
pseudo_futex(uaddr, kPseudoFutexWait, val, timeout);
break;
case kFutexWakePrivate:
pseudo_futex(uaddr, kPseudoFutexWake, val, NULL);
break;
}
// This function should return the number of awaken threads, but now it is impossible.
// Just return 0.
return 0;
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_mem_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <stdint.h>
#include <stdlib.h>
void* hitsumabushi_sysReserveOS(void* v, uintptr_t n);
void* hitsumabushi_sysAllocOS(uintptr_t n) {
return hitsumabushi_sysReserveOS(NULL, n);
}
void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
}
void* hitsumabushi_sysReserveOS(void* v, uintptr_t n) {
if (v) {
return NULL;
}
return calloc(n, 1);
}
void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
// This file defines C functions and system calls for Cgo.
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <stdatomic.h>
#include <unistd.h> // for usleep
#include <stddef.h> // for size_t
#include <signal.h> // for sigset_t and struct sigaction
#include "libcgo.h"
#include "libcgo_unix.h"
typedef unsigned int gid_t;
extern int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp);
extern int32_t hitsumabushi_getproccount();
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) {
abort();
return NULL;
}
int munmap(void *addr, size_t length) {
abort();
return 0;
}
int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) {
// Do nothing.
return 0;
}
int setegid(gid_t gid) {
// Do nothing.
return 0;
}
int seteuid(uid_t gid) {
// Do nothing.
return 0;
}
int setgid(gid_t gid) {
// Do nothing.
return 0;
}
int setgroups(size_t size, const gid_t *list) {
// Do nothing.
return 0;
}
int setregid(gid_t rgid, gid_t egid) {
// Do nothing.
return 0;
}
int setreuid(uid_t ruid, uid_t euid) {
// Do nothing.
return 0;
}
int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
// Do nothing.
return 0;
}
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
// Do nothing.
return 0;
}
int setuid(uid_t gid) {
// Do nothing.
return 0;
}
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
// Do nothing.
return 0;
}
int sigaddset(sigset_t *set, int signum) {
// Do nothing.
return 0;
}
int sigemptyset(sigset_t *set) {
// Do nothing.
return 0;
}
int sigfillset(sigset_t *set) {
// Do nothing.
return 0;
}
int sigismember(const sigset_t *set, int signum) {
// Do nothing.
return 0;
}
uint32_t hitsumabushi_gettid() {
uint64_t tid64 = (uint64_t)(pthread_self());
uint32_t tid = (uint32_t)(tid64 >> 32) ^ (uint32_t)(tid64);
return tid;
}
int64_t hitsumabushi_nanotime1() {
struct timespec tp;
hitsumabushi_clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64_t)(tp.tv_sec) * 1000000000ll + (int64_t)tp.tv_nsec;
}
int32_t hitsumabushi_osyield() {
return sched_yield();
}
int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, void *mask) {
int32_t numcpu = hitsumabushi_getproccount();
for (int32_t i = 0; i < numcpu; i += 8)
((unsigned char*)mask)[i / 8] = (unsigned char)((1u << (numcpu - i)) - 1);
// https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
// > On success, the raw sched_getaffinity() system call returns the
// > number of bytes placed copied into the mask buffer;
return (numcpu + 7) / 8;
}
void hitsumabushi_usleep(useconds_t usec) {
usleep(usec);
}
void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
struct timespec tp;
hitsumabushi_clock_gettime(CLOCK_REALTIME, &tp);
*sec = tp.tv_sec;
*nsec = tp.tv_nsec;
}
void hitsumabushi_exit(int32_t code) {
exit(code);
}
================================================
FILE: 1.19_linux/runtime/cgo/hitsumabushi_thread_linux.c
================================================
void hitsumabushi_initializeThread(void) {
}
================================================
FILE: 1.19_linux/runtime/crash_test.go.patch
================================================
//--from
import (
"bytes"
"errors"
"flag"
"fmt"
"internal/testenv"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"testing"
)
//--to
import (
"bytes"
"flag"
"internal/testenv"
"os"
"os/exec"
"regexp"
"runtime"
"strings"
"sync"
"testing"
)
//--from
func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) {
if *flagQuick {
t.Skip("-quick")
}
testenv.MustHaveGoBuild(t)
testprog.Lock()
if testprog.dir == "" {
dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
testprog.dir = dir
toRemove = append(toRemove, dir)
}
if testprog.target == nil {
testprog.target = make(map[string]*buildexe)
}
name := binary
if len(flags) > 0 {
name += "_" + strings.Join(flags, "_")
}
target, ok := testprog.target[name]
if !ok {
target = &buildexe{}
testprog.target[name] = target
}
dir := testprog.dir
// Unlock testprog while actually building, so that other
// tests can look up executables that were already built.
testprog.Unlock()
target.once.Do(func() {
// Only do two "go build"'s at a time,
// to keep load from getting too high.
serializeBuild <- true
defer func() { <-serializeBuild }()
// Don't get confused if testenv.GoToolPath calls t.Skip.
target.err = errors.New("building test called t.Skip")
exe := filepath.Join(dir, name+".exe")
t.Logf("running go build -o %s %s", exe, strings.Join(flags, " "))
cmd := exec.Command(testenv.GoToolPath(t), append([]string{"build", "-o", exe}, flags...)...)
cmd.Dir = "testdata/" + binary
out, err := testenv.CleanCmdEnv(cmd).CombinedOutput()
if err != nil {
target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out)
} else {
target.exe = exe
target.err = nil
}
})
return target.exe, target.err
}
//--to
func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) {
t.Skip("buildTestProg is not supported in this environment")
return "", nil
}
//--from
func TestPanicInlined(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Fatalf("recover failed")
}
buf := make([]byte, 2048)
n := runtime.Stack(buf, false)
buf = buf[:n]
if !bytes.Contains(buf, []byte("(*point).negate(")) {
t.Fatalf("expecting stack trace to contain call to (*point).negate()")
}
}()
pt := new(point)
pt.negate()
}
//--to
func TestPanicInlined(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
defer func() {
r := recover()
if r == nil {
t.Fatalf("recover failed")
}
buf := make([]byte, 2048)
n := runtime.Stack(buf, false)
buf = buf[:n]
if !bytes.Contains(buf, []byte("(*point).negate(")) {
t.Fatalf("expecting stack trace to contain call to (*point).negate()")
}
}()
pt := new(point)
pt.negate()
}
================================================
FILE: 1.19_linux/runtime/crash_unix_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.19_linux/runtime/debug/heapdump_test.go.patch
================================================
//--from
import (
"os"
"runtime"
. "runtime/debug"
"testing"
)
//--to
import (
"testing"
)
//--from
func TestWriteHeapDumpNonempty(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
WriteHeapDump(f.Fd())
fi, err := f.Stat()
if err != nil {
t.Fatalf("Stat failed: %v", err)
}
const minSize = 1
if size := fi.Size(); size < minSize {
t.Fatalf("Heap dump size %d bytes, expected at least %d bytes", size, minSize)
}
}
//--to
func TestWriteHeapDumpNonempty(t *testing.T) {
t.Skip("file is not supported in this environment")
}
//--from
func TestWriteHeapDumpFinalizers(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
// bug 9172: WriteHeapDump couldn't handle more than one finalizer
println("allocating objects")
x := &Obj{}
runtime.SetFinalizer(x, objfin)
y := &Obj{}
runtime.SetFinalizer(y, objfin)
// Trigger collection of x and y, queueing of their finalizers.
println("starting gc")
runtime.GC()
// Make sure WriteHeapDump doesn't fail with multiple queued finalizers.
println("starting dump")
WriteHeapDump(f.Fd())
println("done dump")
}
//--to
func TestWriteHeapDumpFinalizers(t *testing.T) {
t.Skip("file is not supported in this environment")
}
//--from
func TestWriteHeapDumpTypeName(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
WriteHeapDump(f.Fd())
dummy.M()
dummy2.M()
}
//--to
func TestWriteHeapDumpTypeName(t *testing.T) {
t.Skip("file is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/debug/panic_test.go.patch
================================================
//--from
import (
"runtime"
"runtime/debug"
"syscall"
"testing"
"unsafe"
)
//--to
import (
"testing"
)
//--from
func TestPanicOnFault(t *testing.T) {
if runtime.GOARCH == "s390x" {
t.Skip("s390x fault addresses are missing the low order bits")
}
if runtime.GOOS == "ios" {
t.Skip("iOS doesn't provide fault addresses")
}
if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm" {
t.Skip("netbsd-arm doesn't provide fault address (golang.org/issue/45026)")
}
m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON)
if err != nil {
t.Fatalf("can't map anonymous memory: %s", err)
}
defer syscall.Munmap(m)
old := debug.SetPanicOnFault(true)
defer debug.SetPanicOnFault(old)
const lowBits = 0x3e7
defer func() {
r := recover()
if r == nil {
t.Fatalf("write did not fault")
}
type addressable interface {
Addr() uintptr
}
a, ok := r.(addressable)
if !ok {
t.Fatalf("fault does not contain address")
}
want := uintptr(unsafe.Pointer(&m[lowBits]))
got := a.Addr()
if got != want {
t.Fatalf("fault address %x, want %x", got, want)
}
}()
m[lowBits] = 1 // will fault
}
//--to
func TestPanicOnFault(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/debug_test.go.patch
================================================
//--from
//go:build (amd64 || arm64) && linux && !race
//--to
//go:build ignore
================================================
FILE: 1.19_linux/runtime/export_linux_test.go.patch
================================================
//--from
import "unsafe"
//--to
//--from
func Epollctl(epfd, op, fd int32, ev unsafe.Pointer) int32 {
return epollctl(epfd, op, fd, (*epollevent)(ev))
}
//--to
================================================
FILE: 1.19_linux/runtime/export_unix_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.19_linux/runtime/internal/syscall/asm_linux_amd64.s.patch
================================================
//--from
TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0
// a6 already in R9.
// a5 already in R8.
MOVQ SI, R10 // a4
MOVQ DI, DX // a3
MOVQ CX, SI // a2
MOVQ BX, DI // a1
// num already in AX.
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS ok
NEGQ AX
MOVQ AX, CX // errno
MOVQ $-1, AX // r1
MOVQ $0, BX // r2
RET
ok:
// r1 already in AX.
MOVQ DX, BX // r2
MOVQ $0, CX // errno
RET
//--to
================================================
FILE: 1.19_linux/runtime/internal/syscall/asm_linux_arm64.s.patch
================================================
//--from
TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD num+0(FP), R8 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
MOVD a3+24(FP), R2
MOVD a4+32(FP), R3
MOVD a5+40(FP), R4
MOVD a6+48(FP), R5
SVC
CMN $4095, R0
BCC ok
MOVD $-1, R4
MOVD R4, r1+56(FP)
MOVD ZR, r2+64(FP)
NEG R0, R0
MOVD R0, errno+72(FP)
RET
ok:
MOVD R0, r1+56(FP)
MOVD R1, r2+64(FP)
MOVD ZR, errno+72(FP)
RET
//--to
================================================
FILE: 1.19_linux/runtime/internal/syscall/syscall_linux.go.patch
================================================
//--from
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
//--to
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
println("not implemented syscall at Syscall6", num)
panic("syscall.Syscall6")
return 0, 0, 0x26 // ENOSYS
}
//--from
func syscall_RawSyscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
return Syscall6(num, a1, a2, a3, a4, a5, a6)
}
//--to
func syscall_RawSyscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
println("not implemented syscall at RawSyscall6", num)
panic("syscall.RawSyscall6")
return 0, 0, 0x26 // ENOSYS
}
================================================
FILE: 1.19_linux/runtime/mem_linux.go
================================================
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This implementation is the most fundamental and minimal allocations like Wasm.
// Malloced memory regions are never freed.
package runtime
import (
"internal/abi"
"unsafe"
)
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
//
//go:nosplit
//go:cgo_unsafe_args
func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysAllocOS_trampoline)), unsafe.Pointer(&n))
return
}
func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
//go:nosplit
//go:cgo_unsafe_args
func sysUnusedOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysUnusedOS_trampoline)), unsafe.Pointer(&v))
}
func sysUnusedOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysUsedOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysUsedOS_trampoline)), unsafe.Pointer(&v))
}
func sysUsedOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysHugePageOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysHugePageOS_trampoline)), unsafe.Pointer(&v))
}
func sysHugePageOS_trampoline(n uintptr, size uintptr)
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
//
//go:nosplit
//go:cgo_unsafe_args
func sysFreeOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysFreeOS_trampoline)), unsafe.Pointer(&v))
}
func sysFreeOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysFaultOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysFaultOS_trampoline)), unsafe.Pointer(&v))
}
func sysFaultOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysReserveOS_trampoline)), unsafe.Pointer(&v))
return
}
func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
//go:nosplit
//go:cgo_unsafe_args
func sysMapOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysMapOS_trampoline)), unsafe.Pointer(&v))
}
func sysMapOS_trampoline(n uintptr, size uintptr)
================================================
FILE: 1.19_linux/runtime/memmove_linux_amd64_test.go.patch
================================================
//--from
func TestMemmoveOverflow(t *testing.T) {
//--to
func TestMemmoveOverflow(t *testing.T) {
t.Skip("file is not supported in this environment")
return
================================================
FILE: 1.19_linux/runtime/nbpipe_pipe2.go.patch
================================================
//--from
//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris
//--to
//go:build dragonfly || freebsd || netbsd || openbsd || solaris
================================================
FILE: 1.19_linux/runtime/nbpipe_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.19_linux/runtime/netpoll_epoll.go.patch
================================================
//--from
//go:build linux
//--to
//go:build ignore
================================================
FILE: 1.19_linux/runtime/netpoll_fake.go.patch
================================================
//--from
//go:build js && wasm
//--to
//go:build linux
================================================
FILE: 1.19_linux/runtime/norace_linux_test.go.patch
================================================
//--from
import (
"internal/abi"
"runtime"
"testing"
"time"
"unsafe"
)
//--to
import (
"testing"
)
//--from
func TestNewOSProc0(t *testing.T) {
runtime.NewOSProc0(0x800000, unsafe.Pointer(abi.FuncPCABIInternal(newOSProcCreated)))
check := time.NewTicker(100 * time.Millisecond)
defer check.Stop()
end := time.After(5 * time.Second)
for {
select {
case <-check.C:
if newOSProcDone {
return
}
case <-end:
t.Fatalf("couldn't create new OS process")
}
}
}
//--to
func TestNewOSProc0(t *testing.T) {
t.Skip("newosproc0 is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/os_linux.go.patch
================================================
//--from
import (
"internal/abi"
"internal/goarch"
"runtime/internal/atomic"
"runtime/internal/syscall"
"unsafe"
)
//--to
import (
"internal/abi"
"runtime/internal/atomic"
"runtime/internal/syscall"
"unsafe"
)
//--from
//go:noescape
func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32 {
ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(futex_trampoline)), unsafe.Pointer(&addr))
return ret
}
func futex_trampoline(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32
//--from
func sysargs(argc int32, argv **byte) {
n := argc + 1
// skip over argv, envp to get to auxv
for argv_index(argv, n) != nil {
n++
}
// skip NULL separator
n++
// now argv+n is auxv
auxv := (*[1 << 28]uintptr)(add(unsafe.Pointer(argv), uintptr(n)*goarch.PtrSize))
if sysauxv(auxv[:]) != 0 {
return
}
// In some situations we don't get a loader-provided
// auxv, such as when loaded as a library on Android.
// Fall back to /proc/self/auxv.
fd := open(&procAuxv[0], 0 /* O_RDONLY */, 0)
if fd < 0 {
// On Android, /proc/self/auxv might be unreadable (issue 9229), so we fallback to
// try using mincore to detect the physical page size.
// mincore should return EINVAL when address is not a multiple of system page size.
const size = 256 << 10 // size of memory region to allocate
p, err := mmap(nil, size, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
if err != 0 {
return
}
var n uintptr
for n = 4 << 10; n < size; n <<= 1 {
err := mincore(unsafe.Pointer(uintptr(p)+n), 1, &addrspace_vec[0])
if err == 0 {
physPageSize = n
break
}
}
if physPageSize == 0 {
physPageSize = size
}
munmap(p, size)
return
}
var buf [128]uintptr
n = read(fd, noescape(unsafe.Pointer(&buf[0])), int32(unsafe.Sizeof(buf)))
closefd(fd)
if n < 0 {
return
}
// Make sure buf is terminated, even if we didn't read
// the whole file.
buf[len(buf)-2] = _AT_NULL
sysauxv(buf[:])
}
//--to
func sysargs(argc int32, argv **byte) {
// argc/argv is not reliable on some machines.
// Skip analysing them.
// In some situations we don't get a loader-provided
// auxv, such as when loaded as a library on Android.
// Fall back to /proc/self/auxv.
fd := open(&procAuxv[0], 0 /* O_RDONLY */, 0)
if fd < 0 {
// On Android, /proc/self/auxv might be unreadable (issue 9229), so we fallback to
// try using mincore to detect the physical page size.
// mincore should return EINVAL when address is not a multiple of system page size.
const size = 256 << 10 // size of memory region to allocate
p, err := mmap(nil, size, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
if err != 0 {
return
}
var n uintptr
for n = 4 << 10; n < size; n <<= 1 {
err := mincore(unsafe.Pointer(uintptr(p)+n), 1, &addrspace_vec[0])
if err == 0 {
physPageSize = n
break
}
}
if physPageSize == 0 {
physPageSize = size
}
munmap(p, size)
return
}
var buf [128]uintptr
n := read(fd, noescape(unsafe.Pointer(&buf[0])), int32(unsafe.Sizeof(buf)))
closefd(fd)
if n < 0 {
return
}
// Make sure buf is terminated, even if we didn't read
// the whole file.
buf[len(buf)-2] = _AT_NULL
sysauxv(buf[:])
}
//--from
func getRandomData(r []byte) {
if startupRandomData != nil {
n := copy(r, startupRandomData)
extendRandom(r, n)
return
}
fd := open(&urandom_dev[0], 0 /* O_RDONLY */, 0)
n := read(fd, unsafe.Pointer(&r[0]), int32(len(r)))
closefd(fd)
extendRandom(r, int(n))
}
//--to
// Use getRandomData in os_plan9.go.
//go:nosplit
func getRandomData(r []byte) {
// inspired by wyrand see hash32.go for detail
t := nanotime()
v := getg().m.procid ^ uint64(t)
for len(r) > 0 {
v ^= 0xa0761d6478bd642f
v *= 0xe7037ed1a0b428db
size := 8
if len(r) < 8 {
size = len(r)
}
for i := 0; i < size; i++ {
r[i] = byte(v >> (8 * i))
}
r = r[size:]
v = v>>32 | v<<32
}
}
//--from
func gettid() uint32
//--to
//go:nosplit
//go:cgo_unsafe_args
func gettid() (tid uint32) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(gettid_trampoline)), unsafe.Pointer(&tid))
return
}
func gettid_trampoline() uint32
//--from
//go:noescape
func sigaltstack(new, old *stackt)
//--to
func sigaltstack(new, old *stackt) {
// Do nothing.
}
//--from
func sigprocmask(how int32, new, old *sigset) {
rtsigprocmask(how, new, old, int32(unsafe.Sizeof(*new)))
}
//--to
func sigprocmask(how int32, new, old *sigset) {
// Do nothing.
// rtsigprocmask(how, new, old, int32(unsafe.Sizeof(*new)))
}
//--from
func raise(sig uint32)
//--to
func raise(sig uint32) {
// Do nothing
}
//--from
func raiseproc(sig uint32)
//--to
func raiseproc(sig uint32) {
// Do nothing
}
//--from
//go:noescape
func sched_getaffinity(pid, len uintptr, buf *byte) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func sched_getaffinity(pid, len uintptr, buf *byte) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(sched_getaffinity_trampoline)), unsafe.Pointer(&pid))
}
func sched_getaffinity_trampoline(pid, len uintptr, buf *byte) int32
//--from
func osyield()
//--to
//go:nosplit
//go:cgo_unsafe_args
func osyield() {
libcCall(unsafe.Pointer(abi.FuncPCABI0(osyield_trampoline)), nil)
}
func osyield_trampoline()
//--from
func signalM(mp *m, sig int) {
tgkill(getpid(), int(mp.procid), sig)
}
//--to
func signalM(mp *m, sig int) {
// Do nothiing.
}
//--from
func runPerThreadSyscall() {
gp := getg()
if gp.m.needPerThreadSyscall.Load() == 0 {
return
}
args := perThreadSyscall
r1, r2, errno := syscall.Syscall6(args.trap, args.a1, args.a2, args.a3, args.a4, args.a5, args.a6)
if GOARCH == "ppc64" || GOARCH == "ppc64le" {
// TODO(https://go.dev/issue/51192 ): ppc64 doesn't use r2.
r2 = 0
}
if errno != 0 || r1 != args.r1 || r2 != args.r2 {
print("trap:", args.trap, ", a123456=[", args.a1, ",", args.a2, ",", args.a3, ",", args.a4, ",", args.a5, ",", args.a6, "]\n")
print("results: got {r1=", r1, ",r2=", r2, ",errno=", errno, "}, want {r1=", args.r1, ",r2=", args.r2, ",errno=0\n")
fatal("AllThreadsSyscall6 results differ between threads; runtime corrupted")
}
gp.m.needPerThreadSyscall.Store(0)
}
//--to
func runPerThreadSyscall() {
// Do nothing.
// needPerThreadSyscall should never be 1 as syscall_runtime_doAllThreadsSyscall is not available with Cgo.
}
//--append
//go:linkname hitsumabushi_closefd hitsumabushi_closefd
//go:cgo_import_static hitsumabushi_closefd
var hitsumabushi_closefd byte
//go:linkname hitsumabushi_exit hitsumabushi_exit
//go:cgo_import_static hitsumabushi_exit
var hitsumabushi_exit byte
//go:linkname hitsumabushi_gettid hitsumabushi_gettid
//go:cgo_import_static hitsumabushi_gettid
var hitsumabushi_gettid byte
//go:linkname hitsumabushi_nanotime1 hitsumabushi_nanotime1
//go:cgo_import_static hitsumabushi_nanotime1
var hitsumabushi_nanotime1 byte
//go:linkname hitsumabushi_open hitsumabushi_open
//go:cgo_import_static hitsumabushi_open
var hitsumabushi_open byte
//go:linkname hitsumabushi_osyield hitsumabushi_osyield
//go:cgo_import_static hitsumabushi_osyield
var hitsumabushi_osyield byte
//go:linkname hitsumabushi_read hitsumabushi_read
//go:cgo_import_static hitsumabushi_read
var hitsumabushi_read byte
//go:linkname hitsumabushi_sched_getaffinity hitsumabushi_sched_getaffinity
//go:cgo_import_static hitsumabushi_sched_getaffinity
var hitsumabushi_sched_getaffinity byte
//go:linkname hitsumabushi_usleep hitsumabushi_usleep
//go:cgo_import_static hitsumabushi_usleep
var hitsumabushi_usleep byte
//go:linkname hitsumabushi_walltime1 hitsumabushi_walltime1
//go:cgo_import_static hitsumabushi_walltime1
var hitsumabushi_walltime1 byte
//go:linkname hitsumabushi_write1 hitsumabushi_write1
//go:cgo_import_static hitsumabushi_write1
var hitsumabushi_write1 byte
//go:nosplit
//go:cgo_unsafe_args
func fcntl1(fd, cmd, arg int) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fcntl_trampoline)), unsafe.Pointer(&fd))
}
func fcntl_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func fstat1(fd int, stat unsafe.Pointer) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fstat_trampoline)), unsafe.Pointer(&fd))
}
func fstat_trampoline(fd int, stat unsafe.Pointer) int32
//go:nosplit
//go:cgo_unsafe_args
func lseek1(fd int, offset int64, whence int) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(lseek_trampoline)), unsafe.Pointer(&fd))
}
func lseek_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func renameat(fd1 int, name1 unsafe.Pointer, fd2 int, name2 unsafe.Pointer) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(renameat_trampoline)), unsafe.Pointer(&fd1))
}
func renameat_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func fstatat(fd uintptr, name unsafe.Pointer, p unsafe.Pointer, n int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fstatat_trampoline)), unsafe.Pointer(&fd))
}
func fstatat_trampoline()
================================================
FILE: 1.19_linux/runtime/proc_test.go.patch
================================================
//--from
func TestGoroutineParallelism2(t *testing.T) {
//testGoroutineParallelism2(t, false, false)
testGoroutineParallelism2(t, true, false)
testGoroutineParallelism2(t, false, true)
testGoroutineParallelism2(t, true, true)
}
//--to
func TestGoroutineParallelism2(t *testing.T) {
//testGoroutineParallelism2(t, false, false)
testGoroutineParallelism2(t, true, false)
//testGoroutineParallelism2(t, false, true)
//testGoroutineParallelism2(t, true, true)
}
================================================
FILE: 1.19_linux/runtime/runtime1.go.patch
================================================
//--from
func argv_index(argv **byte, i int32) *byte {
return *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*goarch.PtrSize))
}
//--to
func argv_index(argv **byte, i int32) *byte {
return nil
}
//--from
func args(c int32, v **byte) {
argc = c
argv = v
sysargs(c, v)
}
//--to
func args(c int32, v **byte) {
// In the original code, physPageSize is determined at sysargs.
// Hitsumabushi gives an initial value for physPageSize at its declaration, so sysargs doesn't have to be called.
}
================================================
FILE: 1.19_linux/runtime/runtime_linux_test.go.patch
================================================
//--from
func TestMincoreErrorSign(t *testing.T) {
var dst byte
v := Mincore(Add(unsafe.Pointer(new(int32)), 1), 1, &dst)
const EINVAL = 0x16
if v != -EINVAL {
t.Errorf("mincore = %v, want %v", v, -EINVAL)
}
}
//--to
func TestMincoreErrorSign(t *testing.T) {
t.Skip("mincore is not supported in this environment")
}
//--from
func TestEpollctlErrorSign(t *testing.T) {
v := Epollctl(-1, 1, -1, unsafe.Pointer(&EpollEvent{}))
const EBADF = 0x09
if v != -EBADF {
t.Errorf("epollctl = %v, want %v", v, -EBADF)
}
}
//--to
func TestEpollctlErrorSign(t *testing.T) {
t.Skip("Epollctl is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/runtime_mmap_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.19_linux/runtime/runtime_test.go.patch
================================================
//--from
func testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {
if GOOS == "js" {
t.Skip("js does not support catching faults")
}
defer func() {
if err := recover(); err != nil {
*nfault++
}
}()
// The read should fault, except that sometimes we hit
// addresses that have had C or kernel pages mapped there
// readable by user code. So just log the content.
// If no addresses fault, we'll fail the test.
v := *(*byte)(unsafe.Pointer(addr))
t.Logf("addr %#x: %#x\n", addr, v)
}
//--to
func testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {
t.Skip("catching faults is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/runtime_unix_test.go.patch
================================================
//--from
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || plan9
//--to
//go:build aix || darwin || dragonfly || freebsd || netbsd || openbsd || plan9
================================================
FILE: 1.19_linux/runtime/stack_test.go.patch
================================================
//--from
func TestDeferLeafSigpanic(t *testing.T) {
// Push a defer that will walk the stack.
defer func() {
if err := recover(); err == nil {
t.Fatal("expected panic from nil pointer")
}
GC()
}()
// Call a leaf function. We must set up the exact call stack:
//
// defering function -> leaf function -> sigpanic
//
// On LR machines, the leaf function will have the same SP as
// the SP pushed for the defer frame.
testDeferLeafSigpanic1()
}
//--to
func TestDeferLeafSigpanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestStackWrapperStackPanic(t *testing.T) {
t.Run("sigpanic", func(t *testing.T) {
// nil calls to interface methods cause a sigpanic.
testStackWrapperPanic(t, func() { I.M(nil) }, "runtime_test.I.M")
})
t.Run("panicwrap", func(t *testing.T) {
// Nil calls to value method wrappers call panicwrap.
wrapper := (*structWithMethod).nop
testStackWrapperPanic(t, func() { wrapper(nil) }, "runtime_test.(*structWithMethod).nop")
})
}
//--to
func TestStackWrapperStackPanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestTracebackInlineExcluded(t *testing.T) {
defer func() {
recover()
buf := make([]byte, 4<<10)
stk := string(buf[:Stack(buf, false)])
t.Log(stk)
if not := "tracebackExcluded"; strings.Contains(stk, not) {
t.Errorf("found but did not expect %q", not)
}
if want := "tracebackNotExcluded"; !strings.Contains(stk, want) {
t.Errorf("expected %q in stack", want)
}
}()
tracebackExcluded()
}
//--to
func TestTracebackInlineExcluded(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.19_linux/runtime/stubs2.go.patch
================================================
//--from
import (
"runtime/internal/atomic"
"unsafe"
)
//--to
import (
"internal/abi"
"runtime/internal/atomic"
"unsafe"
)
//--from
func read(fd int32, p unsafe.Pointer, n int32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func read(fd int32, p unsafe.Pointer, n int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(read_trampoline)), unsafe.Pointer(&fd))
}
func read_trampoline(fd int32, p unsafe.Pointer, n int32) int32
//--from
func closefd(fd int32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func closefd(fd int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(closefd_trampoline)), unsafe.Pointer(&fd))
}
func closefd_trampoline(fd int32) int32
//--from
func exit(code int32)
//--to
//go:nosplit
//go:cgo_unsafe_args
func exit(code int32) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(exit_trampoline)), unsafe.Pointer(&code))
}
func exit_trampoline(code int32)
//--from
func usleep(usec uint32)
//--to
//go:nosplit
//go:cgo_unsafe_args
func usleep(usec uint32) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
}
func usleep_trampoline(usec uint32)
//--from
//go:nosplit
func usleep_no_g(usec uint32) {
usleep(usec)
}
//--to
//go:nosplit
//go:cgo_unsafe_args
func usleep_no_g(usec uint32) {
asmcgocall_no_g(unsafe.Pointer(abi.FuncPCABI0(usleep_trampoline)), unsafe.Pointer(&usec))
}
//--from
//go:noescape
func write1(fd uintptr, p unsafe.Pointer, n int32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func write1(fd uintptr, p unsafe.Pointer, n int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(write1_trampoline)), unsafe.Pointer(&fd))
}
func write1_trampoline(fd uintptr, p unsafe.Pointer, n int32) int32
//--from
//go:noescape
func open(name *byte, mode, perm int32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func open(name *byte, mode, perm int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(open_trampoline)), unsafe.Pointer(&name))
}
func open_trampoline(name *byte, mode, perm int32) int32
================================================
FILE: 1.19_linux/runtime/stubs3.go.patch
================================================
//--from
package runtime
//--to
package runtime
import (
"internal/abi"
"unsafe"
)
//--from
func nanotime1() int64
//--to
//go:nosplit
//go:cgo_unsafe_args
func nanotime1() (now int64) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(nanotime1_trampoline)), unsafe.Pointer(&now))
return
}
func nanotime1_trampoline() int64
================================================
FILE: 1.19_linux/runtime/sys_libc.go.patch
================================================
//--from
//go:build darwin || (openbsd && !mips64)
//--to
//go:build darwin || (openbsd && !mips64) || linux
================================================
FILE: 1.19_linux/runtime/sys_linux_amd64.s.patch
================================================
//--from
TEXT runtime·open(SB),NOSPLIT,$0-20
// This uses openat instead of open, because Android O blocks open.
MOVL $AT_FDCWD, DI // AT_FDCWD, so this acts like open
MOVQ name+0(FP), SI
MOVL mode+8(FP), DX
MOVL perm+12(FP), R10
MOVL $SYS_openat, AX
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS 2(PC)
MOVL $-1, AX
MOVL AX, ret+16(FP)
RET
//--to
TEXT runtime·open_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX // BX is callee-saved
MOVL 8(DI), SI // arg 2 flags
MOVL 12(DI), DX // arg 3 mode
MOVQ 0(DI), DI // arg 1 pathname
XORL AX, AX // vararg: say "no float args"
CALL hitsumabushi_open(SB)
MOVQ AX, 16(BX)
POPQ BP
RET
//--from
TEXT runtime·futex(SB),NOSPLIT,$0
MOVQ addr+0(FP), DI
MOVL op+8(FP), SI
MOVL val+12(FP), DX
MOVQ ts+16(FP), R10
MOVQ addr2+24(FP), R8
MOVL val3+32(FP), R9
MOVL $SYS_futex, AX
SYSCALL
MOVL AX, ret+40(FP)
RET
//--to
TEXT runtime·futex_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 0(BX), DI // arg 1 addr
MOVL 8(BX), SI // arg 2 op
MOVL 12(BX), DX // arg 3 val
MOVQ 16(BX), CX // arg 4 ts
MOVQ 24(BX), R8 // arg 5 addr2
MOVL 32(BX), R9 // arg 6 val3
CALL hitsumabushi_futex(SB)
MOVL AX, 40(BX)
POPQ BP
RET
//--from
TEXT runtime·exit(SB),NOSPLIT,$0-4
MOVL code+0(FP), DI
MOVL $SYS_exit_group, AX
SYSCALL
RET
//--to
TEXT runtime·exit_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVL 0(DI), DI // arg 1 exit status
CALL hitsumabushi_exit(SB)
MOVL $0xf1, 0xf1 // crash
POPQ BP
RET
//--from
TEXT runtime·read(SB),NOSPLIT,$0-28
MOVL fd+0(FP), DI
MOVQ p+8(FP), SI
MOVL n+16(FP), DX
MOVL $SYS_read, AX
SYSCALL
MOVL AX, ret+24(FP)
RET
//--to
TEXT runtime·read_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX // BX is callee-saved
MOVQ 0(BX), DI // arg 1 fd
MOVQ 8(BX), SI // arg 2 buf
MOVQ 16(BX), DX // arg 3 count
CALL hitsumabushi_read(SB)
MOVQ AX, 24(BX) // return value
POPQ BP
RET
//--from
TEXT runtime·closefd(SB),NOSPLIT,$0-12
MOVL fd+0(FP), DI
MOVL $SYS_close, AX
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS 2(PC)
MOVL $-1, AX
MOVL AX, ret+8(FP)
RET
//--to
TEXT runtime·closefd_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVL 0(DI), DI // arg 1 fd
CALL hitsumabushi_closefd(SB)
POPQ BP
RET
//--from
TEXT runtime·gettid(SB),NOSPLIT,$0-4
MOVL $SYS_gettid, AX
SYSCALL
MOVL AX, ret+0(FP)
RET
//--to
TEXT runtime·gettid_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
CALL hitsumabushi_gettid(SB)
POPQ BP
RET
//--from
TEXT runtime·sigaltstack(SB),NOSPLIT,$-8
MOVQ new+0(FP), DI
MOVQ old+8(FP), SI
MOVQ $SYS_sigaltstack, AX
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS 2(PC)
MOVL $0xf1, 0xf1 // crash
RET
//--to
TEXT runtime·sigaltstack_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI // arg 2 old
MOVQ 0(DI), DI // arg 1 new
CALL hitsumabushi_sigaltstack(SB)
TESTQ AX, AX
JEQ 2(PC)
MOVL $0xf1, 0xf1 // crash
POPQ BP
RET
//--from
TEXT runtime·raise(SB),NOSPLIT,$0
MOVL $SYS_getpid, AX
SYSCALL
MOVL AX, R12
MOVL $SYS_gettid, AX
SYSCALL
MOVL AX, SI // arg 2 tid
MOVL R12, DI // arg 1 pid
MOVL sig+0(FP), DX // arg 3
MOVL $SYS_tgkill, AX
SYSCALL
RET
//--to
TEXT runtime·raise_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVL 0(DI), DI // arg 1 signal
CALL hitsumabushi_raise(SB)
POPQ BP
RET
//--from
TEXT runtime·raiseproc(SB),NOSPLIT,$0
MOVL $SYS_getpid, AX
SYSCALL
MOVL AX, DI // arg 1 pid
MOVL sig+0(FP), SI // arg 2
MOVL $SYS_kill, AX
SYSCALL
RET
//--to
TEXT runtime·raiseproc_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVL 0(DI), BX // signal
CALL hitsumabushi_getpid(SB)
MOVL AX, DI // arg 1 pid
MOVL BX, SI // arg 2 signal
CALL hitsumabushi_kill(SB)
POPQ BP
RET
//--from
TEXT runtime·sched_getaffinity(SB),NOSPLIT,$0
MOVQ pid+0(FP), DI
MOVQ len+8(FP), SI
MOVQ buf+16(FP), DX
MOVL $SYS_sched_getaffinity, AX
SYSCALL
MOVL AX, ret+24(FP)
RET
//--to
TEXT runtime·sched_getaffinity_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI // arg 2 len
MOVQ 16(DI), DX // arg 3 buf
MOVQ 0(DI), DI // arg 1 pid
CALL hitsumabushi_sched_getaffinity(SB)
POPQ BP
RET
//--from
TEXT runtime·osyield(SB),NOSPLIT,$0
MOVL $SYS_sched_yield, AX
SYSCALL
RET
//--to
TEXT runtime·osyield_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
CALL hitsumabushi_osyield(SB)
POPQ BP
RET
//--from
TEXT runtime·usleep(SB),NOSPLIT,$16
MOVL $0, DX
MOVL usec+0(FP), AX
MOVL $1000000, CX
DIVL CX
MOVQ AX, 0(SP)
MOVL $1000, AX // usec to nsec
MULL DX
MOVQ AX, 8(SP)
// nanosleep(&ts, 0)
MOVQ SP, DI
MOVL $0, SI
MOVL $SYS_nanosleep, AX
SYSCALL
RET
//--to
TEXT runtime·usleep_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVL 0(DI), DI // arg 1 usec
CALL hitsumabushi_usleep(SB)
POPQ BP
RET
//--from
TEXT runtime·write1(SB),NOSPLIT,$0-28
MOVQ fd+0(FP), DI
MOVQ p+8(FP), SI
MOVL n+16(FP), DX
MOVL $SYS_write, AX
SYSCALL
MOVL AX, ret+24(FP)
RET
//--to
TEXT runtime·write1_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI // arg 2 p
MOVQ 16(DI), DX // arg 3 n
MOVQ 0(DI), DI // arg 1 fd
CALL hitsumabushi_write1(SB)
POPQ BP
RET
//--from
TEXT runtime·nanotime1(SB),NOSPLIT,$16-8
// We don't know how much stack space the VDSO code will need,
// so switch to g0.
// In particular, a kernel configured with CONFIG_OPTIMIZE_INLINING=n
// and hardening can use a full page of stack space in gettime_sym
// due to stack probes inserted to avoid stack/heap collisions.
// See issue #20427.
MOVQ SP, R12 // Save old SP; R12 unchanged by C code.
MOVQ g_m(R14), BX // BX unchanged by C code.
// Set vdsoPC and vdsoSP for SIGPROF traceback.
// Save the old values on stack and restore them on exit,
// so this function is reentrant.
MOVQ m_vdsoPC(BX), CX
MOVQ m_vdsoSP(BX), DX
MOVQ CX, 0(SP)
MOVQ DX, 8(SP)
LEAQ ret+0(FP), DX
MOVQ -8(DX), CX
MOVQ CX, m_vdsoPC(BX)
MOVQ DX, m_vdsoSP(BX)
CMPQ R14, m_curg(BX) // Only switch if on curg.
JNE noswitch
MOVQ m_g0(BX), DX
MOVQ (g_sched+gobuf_sp)(DX), SP // Set SP to g0 stack
noswitch:
SUBQ $16, SP // Space for results
ANDQ $~15, SP // Align for C code
MOVL $1, DI // CLOCK_MONOTONIC
LEAQ 0(SP), SI
MOVQ runtime·vdsoClockgettimeSym(SB), AX
CMPQ AX, $0
JEQ fallback
CALL AX
ret:
MOVQ 0(SP), AX // sec
MOVQ 8(SP), DX // nsec
MOVQ R12, SP // Restore real SP
// Restore vdsoPC, vdsoSP
// We don't worry about being signaled between the two stores.
// If we are not in a signal handler, we'll restore vdsoSP to 0,
// and no one will care about vdsoPC. If we are in a signal handler,
// we cannot receive another signal.
MOVQ 8(SP), CX
MOVQ CX, m_vdsoSP(BX)
MOVQ 0(SP), CX
MOVQ CX, m_vdsoPC(BX)
// sec is in AX, nsec in DX
// return nsec in AX
IMULQ $1000000000, AX
ADDQ DX, AX
MOVQ AX, ret+0(FP)
RET
fallback:
MOVQ $SYS_clock_gettime, AX
SYSCALL
JMP ret
//--to
TEXT runtime·nanotime1_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ DI, BX // BX is callee-saved
MOVQ SP, BP
CALL hitsumabushi_nanotime1(SB)
MOVQ AX, 0(BX)
POPQ BP
RET
//--append
TEXT runtime·sysAllocOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 0(DI), DI
CALL hitsumabushi_sysAllocOS(SB)
MOVQ AX, 8(BX)
POPQ BP
RET
TEXT runtime·sysUnusedOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysUnusedOS(SB)
POPQ BP
RET
TEXT runtime·sysUsedOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysUsedOS(SB)
POPQ BP
RET
TEXT runtime·sysHugePageOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysHugePageOS(SB)
POPQ BP
RET
TEXT runtime·sysFreeOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysFreeOS(SB)
POPQ BP
RET
TEXT runtime·sysFaultOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysFaultOS(SB)
POPQ BP
RET
TEXT runtime·sysReserveOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX // BX is callee-saved
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysReserveOS(SB)
MOVQ AX, 16(BX)
POPQ BP
RET
TEXT runtime·sysMapOS_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_sysMapOS(SB)
POPQ BP
RET
TEXT runtime·walltime1_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX // BX is callee-saved
MOVQ 8(DI), SI
MOVQ 0(DI), DI
CALL hitsumabushi_walltime1(SB)
MOVQ AX, 16(BX) // return value
POPQ BP
RET
TEXT runtime·fcntl_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ 8(DI), SI // arg 2 cmd
MOVQ 16(DI), DX // arg 3 arg
MOVQ 0(DI), DI // arg 1 fd
XORL AX, AX // vararg: say "no float args"
CALL hitsumabushi_fcntl(SB)
POPQ BP
RET
TEXT runtime·fstat_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 8(DI), SI // arg 2 stat
MOVQ 0(DI), DI // arg 1 fd
CALL hitsumabushi_fstat(SB)
MOVQ AX, 16(BX) // return value
POPQ BP
RET
TEXT runtime·lseek_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 8(DI), SI // arg 2 offset
MOVQ 16(DI), DX // arg 3 whence
MOVQ 0(DI), DI // arg 1 fd
XORL AX, AX // vararg: say "no float args"
CALL hitsumabushi_lseek(SB)
MOVQ AX, 24(BX) // return value
POPQ BP
RET
TEXT runtime·renameat_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 0(BX), DI // arg 1
MOVQ 8(BX), SI // arg 2
MOVQ 16(BX), DX // arg 3
MOVQ 24(BX), CX // arg 4
CALL hitsumabushi_renameat(SB)
MOVL AX, 32(BX)
POPQ BP
RET
TEXT runtime·fstatat_trampoline(SB),NOSPLIT,$0
PUSHQ BP
MOVQ SP, BP
MOVQ DI, BX
MOVQ 0(BX), DI // arg 1
MOVQ 8(BX), SI // arg 2
MOVQ 16(BX), DX // arg 3
MOVQ 24(BX), CX // arg 4
CALL hitsumabushi_fstatat(SB)
MOVL AX, 32(BX)
POPQ BP
RET
================================================
FILE: 1.19_linux/runtime/sys_linux_arm64.s.patch
================================================
//--from
#define SYS_exit 93
#define SYS_read 63
#define SYS_write 64
#define SYS_openat 56
#define SYS_close 57
#define SYS_pipe2 59
#define SYS_fcntl 25
#define SYS_nanosleep 101
#define SYS_mmap 222
#define SYS_munmap 215
#define SYS_setitimer 103
#define SYS_clone 220
#define SYS_sched_yield 124
#define SYS_rt_sigreturn 139
#define SYS_rt_sigaction 134
#define SYS_rt_sigprocmask 135
#define SYS_sigaltstack 132
#define SYS_madvise 233
#define SYS_mincore 232
#define SYS_getpid 172
#define SYS_gettid 178
#define SYS_kill 129
#define SYS_tgkill 131
#define SYS_futex 98
#define SYS_sched_getaffinity 123
#define SYS_exit_group 94
#define SYS_epoll_create1 20
#define SYS_epoll_ctl 21
#define SYS_epoll_pwait 22
#define SYS_clock_gettime 113
#define SYS_faccessat 48
#define SYS_socket 198
#define SYS_connect 203
#define SYS_brk 214
//--to
#define SYS_exit 2147483647
#define SYS_read 2147483647
#define SYS_write 2147483647
#define SYS_openat 2147483647
#define SYS_close 2147483647
#define SYS_pipe2 2147483647
#define SYS_fcntl 2147483647
#define SYS_nanosleep 2147483647
#define SYS_mmap 2147483647
#define SYS_munmap 2147483647
#define SYS_setitimer 2147483647
#define SYS_clone 2147483647
#define SYS_sched_yield 2147483647
#define SYS_rt_sigreturn 2147483647
#define SYS_rt_sigaction 2147483647
#define SYS_rt_sigprocmask 2147483647
#define SYS_sigaltstack 2147483647
#define SYS_madvise 2147483647
#define SYS_mincore 2147483647
#define SYS_getpid 2147483647
#define SYS_gettid 2147483647
#define SYS_kill 2147483647
#define SYS_tgkill 2147483647
#define SYS_futex 2147483647
#define SYS_sched_getaffinity 2147483647
#define SYS_exit_group 2147483647
#define SYS_epoll_create1 2147483647
#define SYS_epoll_ctl 2147483647
#define SYS_epoll_pwait 2147483647
#define SYS_clock_gettime 2147483647
#define SYS_faccessat 2147483647
#define SYS_socket 2147483647
#define SYS_connect 2147483647
#define SYS_brk 2147483647
//--from
TEXT runtime·exit(SB),NOSPLIT|NOFRAME,$0-4
MOVW code+0(FP), R0
MOVD $SYS_exit_group, R8
SVC
RET
//--to
TEXT runtime·exit_trampoline(SB),NOSPLIT,$0
MOVW 0(R0), R0
BL hitsumabushi_exit(SB)
RET
//--from
TEXT runtime·open(SB),NOSPLIT|NOFRAME,$0-20
MOVD $AT_FDCWD, R0
MOVD name+0(FP), R1
MOVW mode+8(FP), R2
MOVW perm+12(FP), R3
MOVD $SYS_openat, R8
SVC
CMN $4095, R0
BCC done
MOVW $-1, R0
done:
MOVW R0, ret+16(FP)
RET
//--to
TEXT runtime·open_trampoline(SB),NOSPLIT,$0
MOVW 8(R0), R1
MOVW 12(R0), R2
MOVD 0(R0), R0
BL hitsumabushi_open(SB)
RET
//--from
TEXT runtime·closefd(SB),NOSPLIT|NOFRAME,$0-12
MOVW fd+0(FP), R0
MOVD $SYS_close, R8
SVC
CMN $4095, R0
BCC done
MOVW $-1, R0
done:
MOVW R0, ret+8(FP)
RET
//--to
TEXT runtime·closefd_trampoline(SB),NOSPLIT,$0-12
MOVW 0(R0), R0
BL hitsumabushi_closefd(SB)
RET
//--from
TEXT runtime·write1(SB),NOSPLIT|NOFRAME,$0-28
MOVD fd+0(FP), R0
MOVD p+8(FP), R1
MOVW n+16(FP), R2
MOVD $SYS_write, R8
SVC
MOVW R0, ret+24(FP)
RET
//--to
TEXT runtime·write1_trampoline(SB),NOSPLIT,$0-28
MOVD 8(R0), R1
MOVW 16(R0), R2
MOVD 0(R0), R0
BL hitsumabushi_write1(SB)
RET
//--from
TEXT runtime·read(SB),NOSPLIT|NOFRAME,$0-28
MOVW fd+0(FP), R0
MOVD p+8(FP), R1
MOVW n+16(FP), R2
MOVD $SYS_read, R8
SVC
MOVW R0, ret+24(FP)
RET
//--to
TEXT runtime·read_trampoline(SB),NOSPLIT,$0-28
MOVD 8(R0), R1
MOVW 16(R0), R2
MOVW 0(R0), R0
BL hitsumabushi_read(SB)
RET
//--from
TEXT runtime·usleep(SB),NOSPLIT,$24-4
MOVWU usec+0(FP), R3
MOVD R3, R5
MOVW $1000000, R4
UDIV R4, R3
MOVD R3, 8(RSP)
MUL R3, R4
SUB R4, R5
MOVW $1000, R4
MUL R4, R5
MOVD R5, 16(RSP)
// nanosleep(&ts, 0)
ADD $8, RSP, R0
MOVD $0, R1
MOVD $SYS_nanosleep, R8
SVC
RET
//--to
TEXT runtime·usleep_trampoline(SB),NOSPLIT,$0
MOVW 0(R0), R0
BL hitsumabushi_usleep(SB)
RET
//--from
TEXT runtime·gettid(SB),NOSPLIT,$0-4
MOVD $SYS_gettid, R8
SVC
MOVW R0, ret+0(FP)
RET
//--to
TEXT runtime·gettid_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
BL hitsumabushi_gettid(SB)
MOVW R0, 0(R19) // return value
RET
//--from
TEXT runtime·raise(SB),NOSPLIT|NOFRAME,$0
MOVD $SYS_getpid, R8
SVC
MOVW R0, R19
MOVD $SYS_gettid, R8
SVC
MOVW R0, R1 // arg 2 tid
MOVW R19, R0 // arg 1 pid
MOVW sig+0(FP), R2 // arg 3
MOVD $SYS_tgkill, R8
SVC
RET
//--to
//--from
TEXT runtime·raiseproc(SB),NOSPLIT|NOFRAME,$0
MOVD $SYS_getpid, R8
SVC
MOVW R0, R0 // arg 1 pid
MOVW sig+0(FP), R1 // arg 2
MOVD $SYS_kill, R8
SVC
RET
//--to
//--from
TEXT runtime·walltime(SB),NOSPLIT,$24-12
MOVD RSP, R20 // R20 is unchanged by C code
MOVD RSP, R1
MOVD g_m(g), R21 // R21 = m
// Set vdsoPC and vdsoSP for SIGPROF traceback.
// Save the old values on stack and restore them on exit,
// so this function is reentrant.
MOVD m_vdsoPC(R21), R2
MOVD m_vdsoSP(R21), R3
MOVD R2, 8(RSP)
MOVD R3, 16(RSP)
MOVD $ret-8(FP), R2 // caller's SP
MOVD LR, m_vdsoPC(R21)
MOVD R2, m_vdsoSP(R21)
MOVD m_curg(R21), R0
CMP g, R0
BNE noswitch
MOVD m_g0(R21), R3
MOVD (g_sched+gobuf_sp)(R3), R1 // Set RSP to g0 stack
noswitch:
SUB $16, R1
BIC $15, R1 // Align for C code
MOVD R1, RSP
MOVW $CLOCK_REALTIME, R0
MOVD runtime·vdsoClockgettimeSym(SB), R2
CBZ R2, fallback
// Store g on gsignal's stack, so if we receive a signal
// during VDSO code we can find the g.
// If we don't have a signal stack, we won't receive signal,
// so don't bother saving g.
// When using cgo, we already saved g on TLS, also don't save
// g here.
// Also don't save g if we are already on the signal stack.
// We won't get a nested signal.
MOVBU runtime·iscgo(SB), R22
CBNZ R22, nosaveg
MOVD m_gsignal(R21), R22 // g.m.gsignal
CBZ R22, nosaveg
CMP g, R22
BEQ nosaveg
MOVD (g_stack+stack_lo)(R22), R22 // g.m.gsignal.stack.lo
MOVD g, (R22)
BL (R2)
MOVD ZR, (R22) // clear g slot, R22 is unchanged by C code
B finish
nosaveg:
BL (R2)
B finish
fallback:
MOVD $SYS_clock_gettime, R8
SVC
finish:
MOVD 0(RSP), R3 // sec
MOVD 8(RSP), R5 // nsec
MOVD R20, RSP // restore SP
// Restore vdsoPC, vdsoSP
// We don't worry about being signaled between the two stores.
// If we are not in a signal handler, we'll restore vdsoSP to 0,
// and no one will care about vdsoPC. If we are in a signal handler,
// we cannot receive another signal.
MOVD 16(RSP), R1
MOVD R1, m_vdsoSP(R21)
MOVD 8(RSP), R1
MOVD R1, m_vdsoPC(R21)
MOVD R3, sec+0(FP)
MOVW R5, nsec+8(FP)
RET
//--to
TEXT runtime·walltime1_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_walltime1(SB)
RET
//--from
TEXT runtime·nanotime1(SB),NOSPLIT,$24-8
MOVD RSP, R20 // R20 is unchanged by C code
MOVD RSP, R1
MOVD g_m(g), R21 // R21 = m
// Set vdsoPC and vdsoSP for SIGPROF traceback.
// Save the old values on stack and restore them on exit,
// so this function is reentrant.
MOVD m_vdsoPC(R21), R2
MOVD m_vdsoSP(R21), R3
MOVD R2, 8(RSP)
MOVD R3, 16(RSP)
MOVD $ret-8(FP), R2 // caller's SP
MOVD LR, m_vdsoPC(R21)
MOVD R2, m_vdsoSP(R21)
MOVD m_curg(R21), R0
CMP g, R0
BNE noswitch
MOVD m_g0(R21), R3
MOVD (g_sched+gobuf_sp)(R3), R1 // Set RSP to g0 stack
noswitch:
SUB $32, R1
BIC $15, R1
MOVD R1, RSP
MOVW $CLOCK_MONOTONIC, R0
MOVD runtime·vdsoClockgettimeSym(SB), R2
CBZ R2, fallback
// Store g on gsignal's stack, so if we receive a signal
// during VDSO code we can find the g.
// If we don't have a signal stack, we won't receive signal,
// so don't bother saving g.
// When using cgo, we already saved g on TLS, also don't save
// g here.
// Also don't save g if we are already on the signal stack.
// We won't get a nested signal.
MOVBU runtime·iscgo(SB), R22
CBNZ R22, nosaveg
MOVD m_gsignal(R21), R22 // g.m.gsignal
CBZ R22, nosaveg
CMP g, R22
BEQ nosaveg
MOVD (g_stack+stack_lo)(R22), R22 // g.m.gsignal.stack.lo
MOVD g, (R22)
BL (R2)
MOVD ZR, (R22) // clear g slot, R22 is unchanged by C code
B finish
nosaveg:
BL (R2)
B finish
fallback:
MOVD $SYS_clock_gettime, R8
SVC
finish:
MOVD 0(RSP), R3 // sec
MOVD 8(RSP), R5 // nsec
MOVD R20, RSP // restore SP
// Restore vdsoPC, vdsoSP
// We don't worry about being signaled between the two stores.
// If we are not in a signal handler, we'll restore vdsoSP to 0,
// and no one will care about vdsoPC. If we are in a signal handler,
// we cannot receive another signal.
MOVD 16(RSP), R1
MOVD R1, m_vdsoSP(R21)
MOVD 8(RSP), R1
MOVD R1, m_vdsoPC(R21)
// sec is in R3, nsec in R5
// return nsec in R3
MOVD $1000000000, R4
MUL R4, R3
ADD R5, R3
MOVD R3, ret+0(FP)
RET
//--to
TEXT runtime·nanotime1_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
BL hitsumabushi_nanotime1(SB)
MOVD R0, 0(R19) // return value
RET
//--from
TEXT runtime·futex(SB),NOSPLIT|NOFRAME,$0
MOVD addr+0(FP), R0
MOVW op+8(FP), R1
MOVW val+12(FP), R2
MOVD ts+16(FP), R3
MOVD addr2+24(FP), R4
MOVW val3+32(FP), R5
MOVD $SYS_futex, R8
SVC
MOVW R0, ret+40(FP)
RET
//--to
TEXT runtime·futex_trampoline(SB),NOSPLIT,$0
MOVW 8(R0), R1
MOVW 12(R0), R2
MOVD 16(R0), R3
MOVD 24(R0), R4
MOVW 32(R0), R5
MOVD 0(R0), R0
BL hitsumabushi_futex(SB)
RET
//--from
TEXT runtime·sigaltstack(SB),NOSPLIT|NOFRAME,$0
MOVD new+0(FP), R0
MOVD old+8(FP), R1
MOVD $SYS_sigaltstack, R8
SVC
CMN $4095, R0
BCC ok
MOVD $0, R0
MOVD R0, (R0) // crash
ok:
RET
//--to
//--from
TEXT runtime·osyield(SB),NOSPLIT|NOFRAME,$0
MOVD $SYS_sched_yield, R8
SVC
RET
//--to
TEXT runtime·osyield_trampoline(SB),NOSPLIT,$0
BL hitsumabushi_osyield(SB)
RET
//--from
TEXT runtime·sched_getaffinity(SB),NOSPLIT|NOFRAME,$0
MOVD pid+0(FP), R0
MOVD len+8(FP), R1
MOVD buf+16(FP), R2
MOVD $SYS_sched_getaffinity, R8
SVC
MOVW R0, ret+24(FP)
RET
//--to
TEXT runtime·sched_getaffinity_trampoline(SB),NOSPLIT,$0-28
MOVD 8(R0), R1
MOVD 16(R0), R2
MOVD 0(R0), R0
BL hitsumabushi_sched_getaffinity(SB)
RET
//--append
TEXT runtime·sysAllocOS_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 0(R0), R0
BL hitsumabushi_sysAllocOS(SB)
MOVD R0, 8(R19) // return value
RET
TEXT runtime·sysUnusedOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysUnusedOS(SB)
RET
TEXT runtime·sysUsedOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysUsedOS(SB)
RET
TEXT runtime·sysHugePageOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysHugePageOS(SB)
RET
TEXT runtime·sysFreeOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysFreeOS(SB)
RET
TEXT runtime·sysFaultOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysFaultOS(SB)
RET
TEXT runtime·sysReserveOS_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysReserveOS(SB)
MOVD R0, 16(R19) // return value
RET
TEXT runtime·sysMapOS_trampoline(SB),NOSPLIT,$0
MOVD 8(R0), R1
MOVD 0(R0), R0
BL hitsumabushi_sysMapOS(SB)
RET
TEXT runtime·fcntl_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVW 8(R0), R1
MOVW 16(R0), R2
MOVW 0(R0), R0
BL hitsumabushi_fcntl(SB)
MOVW R0, 24(R19) // return value
RET
TEXT runtime·fstat_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 8(R0), R1
MOVW 0(R0), R0
BL hitsumabushi_fstat(SB)
MOVW R0, 16(R19) // return value
RET
TEXT runtime·lseek_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 8(R0), R1
MOVW 16(R0), R2
MOVW 0(R0), R0
BL hitsumabushi_lseek(SB)
MOVW R0, 24(R19) // return value
RET
TEXT runtime·renameat_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 8(R0), R1
MOVD 16(R0), R2
MOVW 24(R0), R3
MOVD 0(R0), R0
BL hitsumabushi_renameat(SB)
MOVW R0, 32(R19) // return value
RET
TEXT runtime·fstatat_trampoline(SB),NOSPLIT,$0
MOVD R0, R19 // R19 is callee-save
MOVD 8(R0), R1
MOVD 16(R0), R2
MOVW 24(R0), R3
MOVD 0(R0), R0
BL hitsumabushi_fstatat(SB)
MOVW R0, 32(R19) // return value
RET
================================================
FILE: 1.19_linux/runtime/time_linux_amd64.s.patch
================================================
//--from
//go:build !faketime
//--to
//go:build ignore
================================================
FILE: 1.19_linux/runtime/timeasm.go.patch
================================================
//--from
//go:build !faketime && (windows || (linux && amd64))
//--to
//go:build !faketime && windows
================================================
FILE: 1.19_linux/runtime/timestub.go.patch
================================================
//--from
//go:build !faketime && !windows && !(linux && amd64)
//--to
//go:build !faketime && !windows
================================================
FILE: 1.19_linux/runtime/timestub2.go.patch
================================================
//--from
//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows && !(linux && amd64)
//--to
//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows
//--from
package runtime
//--to
package runtime
import (
"internal/abi"
"unsafe"
)
//--from
func walltime() (sec int64, nsec int32)
//--to
func walltime() (sec int64, nsec int32) {
walltime1(&sec, &nsec)
return
}
//go:nosplit
//go:cgo_unsafe_args
func walltime1(sec *int64, nsec *int32) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(walltime1_trampoline)), unsafe.Pointer(&sec))
}
func walltime1_trampoline(sec *int64, nsec *int32)
================================================
FILE: 1.19_linux/strconv/fp_test.go.patch
================================================
//--from
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
"testing"
)
//--to
import (
"strconv"
"strings"
"testing"
)
//--from
func TestFp(t *testing.T) {
f, err := os.Open("testdata/testfp.txt")
if err != nil {
t.Fatal("testfp: open testdata/testfp.txt:", err)
}
defer f.Close()
s := bufio.NewScanner(f)
for lineno := 1; s.Scan(); lineno++ {
line := s.Text()
if len(line) == 0 || line[0] == '#' {
continue
}
a := strings.Split(line, " ")
if len(a) != 4 {
t.Error("testdata/testfp.txt:", lineno, ": wrong field count")
continue
}
var s string
var v float64
switch a[0] {
case "float64":
var ok bool
v, ok = myatof64(a[2])
if !ok {
t.Error("testdata/testfp.txt:", lineno, ": cannot atof64 ", a[2])
continue
}
s = fmt.Sprintf(a[1], v)
case "float32":
v1, ok := myatof32(a[2])
if !ok {
t.Error("testdata/testfp.txt:", lineno, ": cannot atof32 ", a[2])
continue
}
s = fmt.Sprintf(a[1], v1)
v = float64(v1)
}
if s != a[3] {
t.Error("testdata/testfp.txt:", lineno, ": ", a[0], " ", a[1], " ", a[2], " (", v, ") ",
"want ", a[3], " got ", s)
}
}
if s.Err() != nil {
t.Fatal("testfp: read testdata/testfp.txt: ", s.Err())
}
}
//--to
func TestFp(t *testing.T) {
t.Skip("file is not supported in this environment")
}
================================================
FILE: 1.19_linux/sync/atomic/atomic_test.go.patch
================================================
//--from
func TestStoreLoadSeqCst32(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int32(1e3)
if testing.Short() {
N = int32(1e2)
}
c := make(chan bool, 2)
X := [2]int32{}
ack := [2][3]int32{{-1, -1, -1}, {-1, -1, -1}}
for p := 0; p < 2; p++ {
go func(me int) {
he := 1 - me
for i := int32(1); i < N; i++ {
StoreInt32(&X[me], i)
my := LoadInt32(&X[he])
StoreInt32(&ack[me][i%3], my)
for w := 1; LoadInt32(&ack[he][i%3]) == -1; w++ {
if w%1000 == 0 {
runtime.Gosched()
}
}
his := LoadInt32(&ack[he][i%3])
if (my != i && my != i-1) || (his != i && his != i-1) {
t.Errorf("invalid values: %d/%d (%d)", my, his, i)
break
}
if my != i && his != i {
t.Errorf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i)
break
}
StoreInt32(&ack[me][(i-1)%3], -1)
}
c <- true
}(p)
}
<-c
<-c
}
//--to
func TestStoreLoadSeqCst32(t *testing.T) {
t.Skip("didn't work on QEMU. see golang/go#50188")
}
//--from
func TestStoreLoadSeqCst64(t *testing.T) {
if runtime.NumCPU() == 1 {
t.Skipf("Skipping test on %v processor machine", runtime.NumCPU())
}
if test64err != nil {
t.Skipf("Skipping 64-bit tests: %v", test64err)
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
N := int64(1e3)
if testing.Short() {
N = int64(1e2)
}
c := make(chan bool, 2)
X := [2]int64{}
ack := [2][3]int64{{-1, -1, -1}, {-1, -1, -1}}
for p := 0; p < 2; p++ {
go func(me int) {
he := 1 - me
for i := int64(1); i < N; i++ {
StoreInt64(&X[me], i)
my := LoadInt64(&X[he])
StoreInt64(&ack[me][i%3], my)
for w := 1; LoadInt64(&ack[he][i%3]) == -1; w++ {
if w%1000 == 0 {
runtime.Gosched()
}
}
his := LoadInt64(&ack[he][i%3])
if (my != i && my != i-1) || (his != i && his != i-1) {
t.Errorf("invalid values: %d/%d (%d)", my, his, i)
break
}
if my != i && his != i {
t.Errorf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i)
break
}
StoreInt64(&ack[me][(i-1)%3], -1)
}
c <- true
}(p)
}
<-c
<-c
}
//--to
func TestStoreLoadSeqCst64(t *testing.T) {
t.Skip("didn't work on QEMU. see golang/go#50188")
}
//--from
func TestNilDeref(t *testing.T) {
funcs := [...]func(){
func() { CompareAndSwapInt32(nil, 0, 0) },
func() { (*Int32)(nil).CompareAndSwap(0, 0) },
func() { CompareAndSwapInt64(nil, 0, 0) },
func() { (*Int64)(nil).CompareAndSwap(0, 0) },
func() { CompareAndSwapUint32(nil, 0, 0) },
func() { (*Uint32)(nil).CompareAndSwap(0, 0) },
func() { CompareAndSwapUint64(nil, 0, 0) },
func() { (*Uint64)(nil).CompareAndSwap(0, 0) },
func() { CompareAndSwapUintptr(nil, 0, 0) },
func() { (*Uintptr)(nil).CompareAndSwap(0, 0) },
func() { CompareAndSwapPointer(nil, nil, nil) },
func() { (*Pointer[byte])(nil).CompareAndSwap(nil, nil) },
func() { SwapInt32(nil, 0) },
func() { (*Int32)(nil).Swap(0) },
func() { SwapUint32(nil, 0) },
func() { (*Uint32)(nil).Swap(0) },
func() { SwapInt64(nil, 0) },
func() { (*Int64)(nil).Swap(0) },
func() { SwapUint64(nil, 0) },
func() { (*Uint64)(nil).Swap(0) },
func() { SwapUintptr(nil, 0) },
func() { (*Uintptr)(nil).Swap(0) },
func() { SwapPointer(nil, nil) },
func() { (*Pointer[byte])(nil).Swap(nil) },
func() { AddInt32(nil, 0) },
func() { (*Int32)(nil).Add(0) },
func() { AddUint32(nil, 0) },
func() { (*Uint32)(nil).Add(0) },
func() { AddInt64(nil, 0) },
func() { (*Int64)(nil).Add(0) },
func() { AddUint64(nil, 0) },
func() { (*Uint64)(nil).Add(0) },
func() { AddUintptr(nil, 0) },
func() { (*Uintptr)(nil).Add(0) },
func() { LoadInt32(nil) },
func() { (*Int32)(nil).Load() },
func() { LoadInt64(nil) },
func() { (*Int64)(nil).Load() },
func() { LoadUint32(nil) },
func() { (*Uint32)(nil).Load() },
func() { LoadUint64(nil) },
func() { (*Uint64)(nil).Load() },
func() { LoadUintptr(nil) },
func() { (*Uintptr)(nil).Load() },
func() { LoadPointer(nil) },
func() { (*Pointer[byte])(nil).Load() },
func() { StoreInt32(nil, 0) },
func() { (*Int32)(nil).Store(0) },
func() { StoreInt64(nil, 0) },
func() { (*Int64)(nil).Store(0) },
func() { StoreUint32(nil, 0) },
func() { (*Uint32)(nil).Store(0) },
func() { StoreUint64(nil, 0) },
func() { (*Uint64)(nil).Store(0) },
func() { StoreUintptr(nil, 0) },
func() { (*Uintptr)(nil).Store(0) },
func() { StorePointer(nil, nil) },
func() { (*Pointer[byte])(nil).Store(nil) },
}
for _, f := range funcs {
func() {
defer func() {
runtime.GC()
recover()
}()
f()
}()
}
}
//--to
func TestNilDeref(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.19_linux/syscall/hitsumabushi_stubs_linux_amd64.go
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
package syscall
const (
SYS_FSTATAT = 0xffffffffffffffff // Stub: on amd64 Go uses SYS_NEWFSTATAT instead
)
================================================
FILE: 1.19_linux/syscall/hitsumabushi_stubs_linux_arm64.go
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
package syscall
const (
SYS_NEWFSTATAT = 0xffffffffffffffff // Stub: on arm64 Go uses SYS_FSTATAT instead
)
================================================
FILE: 1.19_linux/syscall/rlimit.go.patch
================================================
//--from
func init() {
var lim Rlimit
if err := Getrlimit(RLIMIT_NOFILE, &lim); err == nil && lim.Cur != lim.Max {
origRlimitNofile.Store(lim)
lim.Cur = lim.Max
adjustFileLimit(&lim)
setrlimit(RLIMIT_NOFILE, &lim)
}
}
//--to
func init() {
}
================================================
FILE: 1.19_linux/syscall/syscall_linux.go.patch
================================================
//--from
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
return RawSyscall6(trap, a1, a2, a3, 0, 0, 0)
}
//--to
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
println("not implemented syscall at RawSyscall", trap)
panic("syscall.RawSyscall")
return 0, 0, ENOSYS
}
//--from
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
runtime_entersyscall()
// N.B. Calling RawSyscall here is unsafe with atomic coverage
// instrumentation and race mode.
//
// Coverage instrumentation will add a sync/atomic call to RawSyscall.
// Race mode will add race instrumentation to sync/atomic. Race
// instrumentation requires a P, which we no longer have.
//
// RawSyscall6 is fine because it is implemented in assembly and thus
// has no coverage instrumentation.
//
// This is typically not a problem in the runtime because cmd/go avoids
// adding coverage instrumentation to the runtime in race mode.
r1, r2, err = RawSyscall6(trap, a1, a2, a3, 0, 0, 0)
runtime_exitsyscall()
return
}
//--to
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {
var r int32
switch trap {
case SYS_FCNTL:
r = fcntl1(a1, a2, a3)
case SYS_FSTAT:
r = fstat1(a1, unsafe.Pointer(a2))
case SYS_READ:
r = runtime_read(uintptr(a1), unsafe.Pointer(a2), int32(a3))
case SYS_WRITE:
r = write1(a1, unsafe.Pointer(a2), int32(a3))
case SYS_LSEEK:
r = lseek1(a1, int64(a2), int32(a3))
case SYS_CLOSE:
r = runtime_closefd(int32(a1))
case SYS_MKDIRAT:
println("syscall mkdirat() is not implemented")
// Default to permission denied. TODO: implement this
return 0, 0, EPERM
case SYS_GETDENTS64:
println("syscall getdents64() is not implemented")
// Default to empty directory. TODO: implement this
return 0, 0, 0
default:
println("unimplemented syscall at runtime.Syscall", trap)
panic("syscall.Syscall")
return 0, 0, ENOSYS
}
if r < 0 {
return 0, 0, Errno(-r)
}
return uintptr(r), 0, 0
}
//go:linkname open runtime.open
func open(name *byte, mode, perm int32) int32
//go:linkname write1 runtime.write1
func write1(fd uintptr, p unsafe.Pointer, n int32) int32
//go:linkname fcntl1 runtime.fcntl1
func fcntl1(fd uintptr, a uintptr, b uintptr) int32
//go:linkname fstat1 runtime.fstat1
func fstat1(fd uintptr, p unsafe.Pointer) int32
//go:linkname lseek1 runtime.lseek1
func lseek1(fd uintptr, offset int64, whence int32) int32
//go:linkname runtime_read runtime.read
func runtime_read(fd uintptr, p unsafe.Pointer, n int32) int32
//go:linkname runtime_closefd runtime.closefd
func runtime_closefd(fd int32) int32
//go:linkname runtime_fstatat runtime.fstatat
func runtime_fstatat(fd uintptr, name unsafe.Pointer, p unsafe.Pointer, n int32) int32
//go:linkname runtime_renameat runtime.renameat
func runtime_renameat(fd1 uintptr, name1 unsafe.Pointer, fd2 uintptr, name2 unsafe.Pointer) int32
//--from
func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
runtime_entersyscall()
r1, r2, err = RawSyscall6(trap, a1, a2, a3, a4, a5, a6)
runtime_exitsyscall()
return
}
//--to
func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) {
var r int32
switch trap {
case SYS_FSTATAT, SYS_NEWFSTATAT:
r = runtime_fstatat(uintptr(a1), unsafe.Pointer(a2), unsafe.Pointer(a3), int32(a4))
case SYS_RENAMEAT:
r = runtime_renameat(uintptr(a1), unsafe.Pointer(a2), uintptr(a3), unsafe.Pointer(a4))
default:
println("unimplemented syscall at runtime.Syscall6", trap)
panic("syscall.Syscall6")
return 0, 0, ENOSYS
}
if r < 0 {
return 0, 0, Errno(-r)
}
return uintptr(r), 0, 0
}
//--from
func Open(path string, mode int, perm uint32) (fd int, err error) {
return openat(_AT_FDCWD, path, mode|O_LARGEFILE, perm)
}
//--to
func Open(path string, mode int, perm uint32) (fd int, err error) {
p0, err := BytePtrFromString(path)
if err != nil {
return -1, errnoErr(EINVAL)
}
fd = int(open(p0, int32(mode|O_LARGEFILE), int32(perm)))
if fd < 0 {
return -1, errnoErr(ENOENT)
}
return
}
================================================
FILE: 1.19_linux/testing/run_example.go
================================================
package testing
func runExample(eg InternalExample) (ok bool) {
// Do nothing.
// TODO: Implement os.Pipe2 and use this here.
return true
}
================================================
FILE: 1.19_linux/time/format_test.go.patch
================================================
//--from
func TestParseInLocation(t *testing.T) {
baghdad, err := LoadLocation("Asia/Baghdad")
if err != nil {
t.Fatal(err)
}
var t1, t2 Time
t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad)
if err != nil {
t.Fatal(err)
}
_, offset := t1.Zone()
// A zero offset means that ParseInLocation did not recognize the
// 'AST' abbreviation as matching the current location (Baghdad,
// where we'd expect a +03 hrs offset); likely because we're using
// a recent tzdata release (2017a or newer).
// If it happens, skip the Baghdad test.
if offset != 0 {
t2 = Date(2013, February, 1, 00, 00, 00, 0, baghdad)
if t1 != t2 {
t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2)
}
if offset != 3*60*60 {
t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60)
}
}
blancSablon, err := LoadLocation("America/Blanc-Sablon")
if err != nil {
t.Fatal(err)
}
// In this case 'AST' means 'Atlantic Standard Time', and we
// expect the abbreviation to correctly match the american
// location.
t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", blancSablon)
if err != nil {
t.Fatal(err)
}
t2 = Date(2013, February, 1, 00, 00, 00, 0, blancSablon)
if t1 != t2 {
t.Fatalf("ParseInLocation(Feb 01 2013 AST, Blanc-Sablon) = %v, want %v", t1, t2)
}
_, offset = t1.Zone()
if offset != -4*60*60 {
t.Fatalf("ParseInLocation(Feb 01 2013 AST, Blanc-Sablon).Zone = _, %d, want _, %d", offset, -4*60*60)
}
}
//--to
func TestParseInLocation(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestLoadLocationZipFile(t *testing.T) {
undo := DisablePlatformSources()
defer undo()
_, err := LoadLocation("Australia/Sydney")
if err != nil {
t.Fatal(err)
}
}
//--to
func TestLoadLocationZipFile(t *testing.T) {
t.Skip("location is not supported in this environment")
}
================================================
FILE: 1.19_linux/time/internal_test.go.patch
================================================
//--from
func initTestingZone() {
// For hermeticity, use only tzinfo source from the test's GOROOT,
// not the system sources and not whatever GOROOT may happen to be
// set in the process's environment (if any).
// This test runs in GOROOT/src/time, so GOROOT is "../..",
// but it is theoretically possible
sources := []string{"../../lib/time/zoneinfo.zip"}
z, err := loadLocation("America/Los_Angeles", sources)
if err != nil {
panic("cannot load America/Los_Angeles for testing: " + err.Error() + "; you may want to use -tags=timetzdata")
}
z.name = "Local"
localLoc = *z
}
//--to
func initTestingZone() {
// Data from the playground.
// https://go.dev/play/p/VGXU57KZZ-x
// name is replaced with "Local".
// cachStart, cacheEnd, and cacheZone are removed.
localLoc = Location{name:"Local",zone:[]zone{zone{name:"LMT", offset:-28378, isDST:false}, zone{name:"PDT", offset:-25200, isDST:true}, zone{name:"PST", offset:-28800, isDST:false}, zone{name:"PWT", offset:-25200, isDST:true}, zone{name:"PPT", offset:-25200, isDST:true}}, tx:[]zoneTrans{zoneTrans{when:-576460752303423488, index:0x0, isstd:false, isutc:false}, zoneTrans{when:-2717640000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-1633269600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-1615129200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-1601820000, index:0x1, isstd:true, isutc:true}, zoneTrans{when:-1583679600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-880207200, index:0x3, isstd:false, isutc:false}, zoneTrans{when:-769395600, index:0x4, isstd:false, isutc:false}, zoneTrans{when:-765385200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-687967140, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-662655600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-620838000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-608137200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-589388400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-576082800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-557938800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-544633200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-526489200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-513183600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-495039600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-481734000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-463590000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-450284400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-431535600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-418230000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-400086000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-386780400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-368636400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-355330800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-337186800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-323881200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-305737200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-292431600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-273682800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-260982000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-242233200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-226508400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-210783600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-195058800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-179334000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-163609200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-147884400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-131554800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-116434800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-100105200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-84376800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-68655600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-52927200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-37206000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:-21477600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:-5756400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:9972000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:25693200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:41421600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:57747600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:73476000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:89197200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:104925600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:120646800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:126698400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:152096400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:162381600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:183546000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:199274400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:215600400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:230724000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:247050000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:262778400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:278499600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:294228000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:309949200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:325677600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:341398800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:357127200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:372848400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:388576800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:404902800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:420026400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:436352400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:452080800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:467802000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:483530400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:499251600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:514980000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:530701200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:544615200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:562150800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:576064800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:594205200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:607514400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:625654800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:638964000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:657104400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:671018400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:688554000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:702468000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:720003600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:733917600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:752058000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:765367200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:783507600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:796816800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:814957200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:828871200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:846406800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:860320800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:877856400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:891770400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:909306000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:923220000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:941360400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:954669600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:972810000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:986119200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1004259600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1018173600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1035709200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1049623200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1067158800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1081072800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1099213200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1112522400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1130662800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1143972000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1162112400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1173607200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1194166800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1205056800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1225616400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1236506400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1257066000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1268560800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1289120400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1300010400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1320570000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1331460000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1352019600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1362909600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1383469200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1394359200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1414918800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1425808800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1446368400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1457863200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1478422800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1489312800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1509872400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1520762400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1541322000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1552212000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1572771600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1583661600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1604221200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1615716000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1636275600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1647165600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1667725200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1678615200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1699174800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1710064800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1730624400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1741514400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1762074000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1772964000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1793523600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1805018400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1825578000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1836468000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1857027600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1867917600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1888477200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1899367200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1919926800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1930816800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1951376400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1962871200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:1983430800, index:0x2, isstd:false, isutc:false}, zoneTrans{when:1994320800, index:0x1, isstd:false, isutc:false}, zoneTrans{when:2014880400, index:0x2, isstd:false, isutc:false}, zoneTrans{when:2025770400, index:0x1, isstd:false, isutc:false}, zoneTrans{when:2046330000, index:0x2, isstd:false, isutc:false}, zoneTrans{when:2057220000, index:0x1, isstd:false, isutc:false}, zoneTrans{when:2077779600, index:0x2, isstd:false, isutc:false}, zoneTrans{when:2088669600, index:0x1, isstd:false, isutc:false}, zoneTrans{when:2109229200, index:0x2, isstd:false, isutc:false}, zoneTrans{when:2120119200, index:0x1, isstd:false, isutc:false}, zoneTrans{when:2140678800, index:0x2, isstd:false, isutc:false}}, extend:"PST8PDT,M3.2.0,M11.1.0"}
}
================================================
FILE: 1.19_linux/time/sleep_test.go.patch
================================================
//--from
func TestSleep(t *testing.T) {
const delay = 100 * Millisecond
go func() {
Sleep(delay / 2)
Interrupt()
}()
start := Now()
Sleep(delay)
delayadj := delay
if runtime.GOOS == "windows" {
delayadj -= windowsInaccuracy
}
duration := Now().Sub(start)
if duration < delayadj {
t.Fatalf("Sleep(%s) slept for only %s", delay, duration)
}
}
//--to
func TestSleep(t *testing.T) {
t.Skip("Interrupt (syscall.Kill) is not supported in this environment")
}
//--from
func TestIssue5745(t *testing.T) {
ticker := NewTicker(Hour)
defer func() {
// would deadlock here before the fix due to
// lock taken before the segfault.
ticker.Stop()
if r := recover(); r == nil {
t.Error("Expected panic, but none happened.")
}
}()
// cause a panic due to a segfault
var timer *Timer
timer.Stop()
t.Error("Should be unreachable.")
}
//--to
func TestIssue5745(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.19_linux/time/time_test.go.patch
================================================
//--from
func TestLoadFixed(t *testing.T) {
// Issue 4064: handle locations without any zone transitions.
loc, err := LoadLocation("Etc/GMT+1")
if err != nil {
t.Fatal(err)
}
// The tzdata name Etc/GMT+1 uses "east is negative",
// but Go and most other systems use "east is positive".
// So GMT+1 corresponds to -3600 in the Go zone, not +3600.
name, offset := Now().In(loc).Zone()
// The zone abbreviation is "-01" since tzdata-2016g, and "GMT+1"
// on earlier versions; we accept both. (Issue #17276).
if !(name == "GMT+1" || name == "-01") || offset != -1*60*60 {
t.Errorf("Now().In(loc).Zone() = %q, %d, want %q or %q, %d",
name, offset, "GMT+1", "-01", -1*60*60)
}
}
//--to
func TestLoadFixed(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestTimeIsDST(t *testing.T) {
undo := DisablePlatformSources()
defer undo()
tzWithDST, err := LoadLocation("Australia/Sydney")
if err != nil {
t.Fatalf("could not load tz 'Australia/Sydney': %v", err)
}
tzWithoutDST, err := LoadLocation("Australia/Brisbane")
if err != nil {
t.Fatalf("could not load tz 'Australia/Brisbane': %v", err)
}
tzFixed := FixedZone("FIXED_TIME", 12345)
tests := [...]struct {
time Time
want bool
}{
0: {Date(2009, 1, 1, 12, 0, 0, 0, UTC), false},
1: {Date(2009, 6, 1, 12, 0, 0, 0, UTC), false},
2: {Date(2009, 1, 1, 12, 0, 0, 0, tzWithDST), true},
3: {Date(2009, 6, 1, 12, 0, 0, 0, tzWithDST), false},
4: {Date(2009, 1, 1, 12, 0, 0, 0, tzWithoutDST), false},
5: {Date(2009, 6, 1, 12, 0, 0, 0, tzWithoutDST), false},
6: {Date(2009, 1, 1, 12, 0, 0, 0, tzFixed), false},
7: {Date(2009, 6, 1, 12, 0, 0, 0, tzFixed), false},
}
for i, tt := range tests {
got := tt.time.IsDST()
if got != tt.want {
t.Errorf("#%d:: (%#v).IsDST()=%t, want %t", i, tt.time.Format(RFC3339), got, tt.want)
}
}
}
//--to
func TestTimeIsDST(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestTimeWithZoneTransition(t *testing.T) {
undo := DisablePlatformSources()
defer undo()
loc, err := LoadLocation("Asia/Shanghai")
if err != nil {
t.Fatal(err)
}
tests := [...]struct {
give Time
want Time
}{
// 14 Apr 1991 - Daylight Saving Time Started
// When time of "Asia/Shanghai" was about to reach
// Sunday, 14 April 1991, 02:00:00 clocks were turned forward 1 hour to
// Sunday, 14 April 1991, 03:00:00 local daylight time instead.
// The UTC time was 13 April 1991, 18:00:00
0: {Date(1991, April, 13, 17, 50, 0, 0, loc), Date(1991, April, 13, 9, 50, 0, 0, UTC)},
1: {Date(1991, April, 13, 18, 0, 0, 0, loc), Date(1991, April, 13, 10, 0, 0, 0, UTC)},
2: {Date(1991, April, 14, 1, 50, 0, 0, loc), Date(1991, April, 13, 17, 50, 0, 0, UTC)},
3: {Date(1991, April, 14, 3, 0, 0, 0, loc), Date(1991, April, 13, 18, 0, 0, 0, UTC)},
// 15 Sep 1991 - Daylight Saving Time Ended
// When local daylight time of "Asia/Shanghai" was about to reach
// Sunday, 15 September 1991, 02:00:00 clocks were turned backward 1 hour to
// Sunday, 15 September 1991, 01:00:00 local standard time instead.
// The UTC time was 14 September 1991, 17:00:00
4: {Date(1991, September, 14, 16, 50, 0, 0, loc), Date(1991, September, 14, 7, 50, 0, 0, UTC)},
5: {Date(1991, September, 14, 17, 0, 0, 0, loc), Date(1991, September, 14, 8, 0, 0, 0, UTC)},
6: {Date(1991, September, 15, 0, 50, 0, 0, loc), Date(1991, September, 14, 15, 50, 0, 0, UTC)},
7: {Date(1991, September, 15, 2, 00, 0, 0, loc), Date(1991, September, 14, 18, 00, 0, 0, UTC)},
}
for i, tt := range tests {
if !tt.give.Equal(tt.want) {
t.Errorf("#%d:: %#v is not equal to %#v", i, tt.give.Format(RFC3339), tt.want.Format(RFC3339))
}
}
}
//--to
func TestTimeWithZoneTransition(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestMarshalBinaryVersion2(t *testing.T) {
t0, err := Parse(RFC3339, "1880-01-01T00:00:00Z")
if err != nil {
t.Errorf("Failed to parse time, error = %v", err)
}
loc, err := LoadLocation("US/Eastern")
if err != nil {
t.Errorf("Failed to load location, error = %v", err)
}
t1 := t0.In(loc)
b, err := t1.MarshalBinary()
if err != nil {
t.Errorf("Failed to Marshal, error = %v", err)
}
t2 := Time{}
err = t2.UnmarshalBinary(b)
if err != nil {
t.Errorf("Failed to Unmarshal, error = %v", err)
}
if !(t0.Equal(t1) && t1.Equal(t2)) {
if !t0.Equal(t1) {
t.Errorf("The result t1: %+v after Marshal is not matched original t0: %+v", t1, t0)
}
if !t1.Equal(t2) {
t.Errorf("The result t2: %+v after Unmarshal is not matched original t1: %+v", t2, t1)
}
}
}
//--to
func TestMarshalBinaryVersion2(t *testing.T) {
t.Skip("location is not supported in this environment")
}
================================================
FILE: 1.19_linux/time/tzdata_test.go.patch
================================================
//--from
import (
"reflect"
"testing"
"time"
_ "time/tzdata"
)
//--to
import (
"reflect"
"testing"
_ "time/tzdata"
)
//--from
func TestEmbeddedTZData(t *testing.T) {
undo := time.DisablePlatformSources()
defer undo()
for _, zone := range zones {
ref, err := time.LoadLocation(zone)
if err != nil {
t.Errorf("LoadLocation(%q): %v", zone, err)
continue
}
embedded, err := time.LoadFromEmbeddedTZData(zone)
if err != nil {
t.Errorf("LoadFromEmbeddedTZData(%q): %v", zone, err)
continue
}
sample, err := time.LoadLocationFromTZData(zone, []byte(embedded))
if err != nil {
t.Errorf("LoadLocationFromTZData failed for %q: %v", zone, err)
continue
}
// Compare the name and zone fields of ref and sample.
// The tx field changes faster as tzdata is updated.
// The cache fields are expected to differ.
v1 := reflect.ValueOf(ref).Elem()
v2 := reflect.ValueOf(sample).Elem()
typ := v1.Type()
nf := typ.NumField()
found := 0
for i := 0; i < nf; i++ {
ft := typ.Field(i)
if ft.Name != "name" && ft.Name != "zone" {
continue
}
found++
if !equal(t, v1.Field(i), v2.Field(i)) {
t.Errorf("zone %s: system and embedded tzdata field %s differs", zone, ft.Name)
}
}
if found != 2 {
t.Errorf("test must be updated for change to time.Location struct")
}
}
}
//--to
func TestEmbeddedTZData(t *testing.T) {
t.Skip("location is not supported in this environment")
}
================================================
FILE: 1.19_linux/time/zoneinfo_test.go.patch
================================================
//--from
import (
"errors"
"fmt"
"internal/testenv"
"os"
"reflect"
"testing"
"time"
)
//--to
import (
"fmt"
"testing"
"time"
)
//--from
func TestEnvVarUsage(t *testing.T) {
time.ResetZoneinfoForTesting()
const testZoneinfo = "foo.zip"
const env = "ZONEINFO"
t.Setenv(env, testZoneinfo)
// Result isn't important, we're testing the side effect of this command
time.LoadLocation("Asia/Jerusalem")
defer time.ResetZoneinfoForTesting()
if zoneinfo := time.ZoneinfoForTesting(); testZoneinfo != *zoneinfo {
t.Errorf("zoneinfo does not match env variable: got %q want %q", *zoneinfo, testZoneinfo)
}
}
//--to
func TestEnvVarUsage(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestBadLocationErrMsg(t *testing.T) {
time.ResetZoneinfoForTesting()
loc := "Asia/SomethingNotExist"
want := errors.New("unknown time zone " + loc)
_, err := time.LoadLocation(loc)
if err.Error() != want.Error() {
t.Errorf("LoadLocation(%q) error = %v; want %v", loc, err, want)
}
}
//--to
func TestBadLocationErrMsg(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestVersion3(t *testing.T) {
undo := time.DisablePlatformSources()
defer undo()
_, err := time.LoadLocation("Asia/Jerusalem")
if err != nil {
t.Fatal(err)
}
}
//--to
func TestVersion3(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestFirstZone(t *testing.T) {
undo := time.DisablePlatformSources()
defer undo()
const format = "Mon, 02 Jan 2006 15:04:05 -0700 (MST)"
var tests = []struct {
zone string
unix int64
want1 string
want2 string
}{
{
"PST8PDT",
-1633269601,
"Sun, 31 Mar 1918 01:59:59 -0800 (PST)",
"Sun, 31 Mar 1918 03:00:00 -0700 (PDT)",
},
{
"Pacific/Fakaofo",
1325242799,
"Thu, 29 Dec 2011 23:59:59 -1100 (-11)",
"Sat, 31 Dec 2011 00:00:00 +1300 (+13)",
},
}
for _, test := range tests {
z, err := time.LoadLocation(test.zone)
if err != nil {
t.Fatal(err)
}
s := time.Unix(test.unix, 0).In(z).Format(format)
if s != test.want1 {
t.Errorf("for %s %d got %q want %q", test.zone, test.unix, s, test.want1)
}
s = time.Unix(test.unix+1, 0).In(z).Format(format)
if s != test.want2 {
t.Errorf("for %s %d got %q want %q", test.zone, test.unix, s, test.want2)
}
}
}
//--to
func TestFirstZone(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestLoadLocationFromTZData(t *testing.T) {
undo := time.DisablePlatformSources()
defer undo()
const locationName = "Asia/Jerusalem"
reference, err := time.LoadLocation(locationName)
if err != nil {
t.Fatal(err)
}
gorootSource, ok := time.GorootZoneSource(testenv.GOROOT(t))
if !ok {
t.Fatal("Failed to locate tzinfo source in GOROOT.")
}
tzinfo, err := time.LoadTzinfo(locationName, gorootSource)
if err != nil {
t.Fatal(err)
}
sample, err := time.LoadLocationFromTZData(locationName, tzinfo)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(reference, sample) {
t.Errorf("return values of LoadLocationFromTZData and LoadLocation don't match")
}
}
//--to
func TestLoadLocationFromTZData(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestEarlyLocation(t *testing.T) {
undo := time.DisablePlatformSources()
defer undo()
const locName = "America/New_York"
loc, err := time.LoadLocation(locName)
if err != nil {
t.Fatal(err)
}
d := time.Date(1900, time.January, 1, 0, 0, 0, 0, loc)
tzName, tzOffset := d.Zone()
if want := "EST"; tzName != want {
t.Errorf("Zone name == %s, want %s", tzName, want)
}
if want := -18000; tzOffset != want {
t.Errorf("Zone offset == %d, want %d", tzOffset, want)
}
}
//--to
func TestEarlyLocation(t *testing.T) {
t.Skip("location is not supported in this environment")
}
//--from
func TestLoadLocationFromTZDataSlim(t *testing.T) {
for _, test := range slimTests {
tzData, err := os.ReadFile("testdata/" + test.fileName)
if err != nil {
t.Error(err)
continue
}
reference, err := time.LoadLocationFromTZData(test.zoneName, tzData)
if err != nil {
t.Error(err)
continue
}
d := test.date(reference)
tzName, tzOffset := d.Zone()
if tzName != test.wantName {
t.Errorf("Zone name == %s, want %s", tzName, test.wantName)
}
if tzOffset != test.wantOffset {
t.Errorf("Zone offset == %d, want %d", tzOffset, test.wantOffset)
}
}
}
//--to
func TestLoadLocationFromTZDataSlim(t *testing.T) {
t.Skip("location is not supported in this environment")
}
================================================
FILE: 1.19_linux/time/zoneinfo_unix.go.patch
================================================
//--from
import (
"syscall"
)
//--to
//--from
func initLocal() {
// consult $TZ to find the time zone to use.
// no $TZ means use the system default /etc/localtime.
// $TZ="" means use UTC.
// $TZ="foo" or $TZ=":foo" if foo is an absolute path, then the file pointed
// by foo will be used to initialize timezone; otherwise, file
// /usr/share/zoneinfo/foo will be used.
tz, ok := syscall.Getenv("TZ")
switch {
case !ok:
z, err := loadLocation("localtime", []string{"/etc"})
if err == nil {
localLoc = *z
localLoc.name = "Local"
return
}
case tz != "":
if tz[0] == ':' {
tz = tz[1:]
}
if tz != "" && tz[0] == '/' {
if z, err := loadLocation(tz, []string{""}); err == nil {
localLoc = *z
if tz == "/etc/localtime" {
localLoc.name = "Local"
} else {
localLoc.name = tz
}
return
}
} else if tz != "" && tz != "UTC" {
if z, err := loadLocation(tz, platformZoneSources); err == nil {
localLoc = *z
return
}
}
}
// Fall back to UTC.
localLoc.name = "UTC"
}
//--to
func initLocal() {
localLoc.name = "UTC"
}
================================================
FILE: 1.19_linux/time/zoneinfo_unix_test.go.patch
================================================
//--from
import (
"os"
"testing"
"time"
)
//--to
import (
"testing"
)
//--from
func TestEnvTZUsage(t *testing.T) {
const env = "TZ"
tz, ok := os.LookupEnv(env)
if !ok {
defer os.Unsetenv(env)
} else {
defer os.Setenv(env, tz)
}
defer time.ForceUSPacificForTesting()
localZoneName := "Local"
// The file may not exist.
if _, err := os.Stat("/etc/localtime"); os.IsNotExist(err) {
localZoneName = "UTC"
}
cases := []struct {
nilFlag bool
tz string
local string
}{
// no $TZ means use the system default /etc/localtime.
{true, "", localZoneName},
// $TZ="" means use UTC.
{false, "", "UTC"},
{false, ":", "UTC"},
{false, "Asia/Shanghai", "Asia/Shanghai"},
{false, ":Asia/Shanghai", "Asia/Shanghai"},
{false, "/etc/localtime", localZoneName},
{false, ":/etc/localtime", localZoneName},
}
for _, c := range cases {
time.ResetLocalOnceForTest()
if c.nilFlag {
os.Unsetenv(env)
} else {
os.Setenv(env, c.tz)
}
if time.Local.String() != c.local {
t.Errorf("invalid Local location name for %q: got %q want %q", c.tz, time.Local, c.local)
}
}
time.ResetLocalOnceForTest()
// The file may not exist on Solaris 2 and IRIX 6.
path := "/usr/share/zoneinfo/Asia/Shanghai"
os.Setenv(env, path)
if _, err := os.Stat(path); os.IsNotExist(err) {
if time.Local.String() != "UTC" {
t.Errorf(`invalid path should fallback to UTC: got %q want "UTC"`, time.Local)
}
return
}
if time.Local.String() != path {
t.Errorf(`custom path should lead to path itself: got %q want %q`, time.Local, path)
}
timeInUTC := time.Date(2009, 1, 1, 12, 0, 0, 0, time.UTC)
sameTimeInShanghai := time.Date(2009, 1, 1, 20, 0, 0, 0, time.Local)
if !timeInUTC.Equal(sameTimeInShanghai) {
t.Errorf("invalid timezone: got %q want %q", timeInUTC, sameTimeInShanghai)
}
time.ResetLocalOnceForTest()
os.Setenv(env, ":"+path)
if time.Local.String() != path {
t.Errorf(`custom path should lead to path itself: got %q want %q`, time.Local, path)
}
time.ResetLocalOnceForTest()
os.Setenv(env, path[:len(path)-1])
if time.Local.String() != "UTC" {
t.Errorf(`invalid path should fallback to UTC: got %q want "UTC"`, time.Local)
}
}
//--to
func TestEnvTZUsage(t *testing.T) {
t.Skip("location is not supported in this environment")
}
================================================
FILE: 1.19_windows/runtime/abi_test.go.patch
================================================
//--from
func TestFinalizerRegisterABI(t *testing.T) {
//--to
func TestFinalizerRegisterABI(t *testing.T) {
t.Skip("creating a new process with os.Args[0] doesn't work in this environment")
================================================
FILE: 1.19_windows/runtime/cgo/gcc_fatalf.c.patch
================================================
//--from
#include <stdio.h>
//--to
================================================
FILE: 1.19_windows/runtime/cgo/gcc_libinit.c.patch
================================================
//--from
#include <stdio.h>
//--to
================================================
FILE: 1.19_windows/runtime/cgo/gcc_libinit_windows.c.patch
================================================
//--from
#include <stdio.h>
//--to
================================================
FILE: 1.19_windows/runtime/cgo/gcc_windows_amd64.c.patch
================================================
//--from
#include <stdio.h>
//--to
//--from
static void
threadentry(void *v)
{
//--to
static int getproccount() {
static int proccount = 0;
if (!proccount) {
SYSTEM_INFO info;
GetSystemInfo(&info);
proccount = info.dwNumberOfProcessors;
}
return proccount;
}
static void
threadentry(void *v)
{
SetThreadAffinityMask(GetCurrentThread(), (1<<getproccount())-1);
================================================
FILE: 1.19_windows/runtime/cgo/libcgo.h.patch
================================================
//--from
#include <stdio.h>
//--to
//--append
#define fprintf dummy_fprintf
#define stderr dummy_stderr
// TODO: Use OutputDebugMessage.
#define dummy_fprintf(stream, format, ...)
#define dummy_stderr 2
================================================
FILE: 1.19_windows/runtime/crash_test.go.patch
================================================
//--from
func TestRuntimePanic(t *testing.T) {
testenv.MustHaveExec(t)
cmd := testenv.CleanCmdEnv(exec.Command(os.Args[0], "-test.run=TestRuntimePanic"))
cmd.Env = append(cmd.Env, "GO_TEST_RUNTIME_PANIC=1")
out, err := cmd.CombinedOutput()
t.Logf("%s", out)
if err == nil {
t.Error("child process did not fail")
} else if want := "runtime.unexportedPanicForTesting"; !bytes.Contains(out, []byte(want)) {
t.Errorf("output did not contain expected string %q", want)
}
}
//--to
func TestRuntimePanic(t *testing.T) {
t.Skip("analyzing output is not supported in this environment")
}
//--from
func TestG0StackOverflow(t *testing.T) {
testenv.MustHaveExec(t)
switch runtime.GOOS {
case "darwin", "dragonfly", "freebsd", "linux", "netbsd", "openbsd", "android":
t.Skipf("g0 stack is wrong on pthread platforms (see golang.org/issue/26061)")
}
if os.Getenv("TEST_G0_STACK_OVERFLOW") != "1" {
cmd := testenv.CleanCmdEnv(exec.Command(os.Args[0], "-test.run=TestG0StackOverflow", "-test.v"))
cmd.Env = append(cmd.Env, "TEST_G0_STACK_OVERFLOW=1")
out, err := cmd.CombinedOutput()
// Don't check err since it's expected to crash.
if n := strings.Count(string(out), "morestack on g0\n"); n != 1 {
t.Fatalf("%s\n(exit status %v)", out, err)
}
// Check that it's a signal-style traceback.
if runtime.GOOS != "windows" {
if want := "PC="; !strings.Contains(string(out), want) {
t.Errorf("output does not contain %q:\n%s", want, out)
}
}
return
}
runtime.G0StackOverflow()
}
//--to
func TestG0StackOverflow(t *testing.T) {
t.Skip("analyzing output is not supported in this environment")
}
================================================
FILE: 1.19_windows/runtime/malloc_test.go.patch
================================================
//--from
func TestArenaCollision(t *testing.T) {
//--to
func TestArenaCollision(t *testing.T) {
t.Skip("creating a new process with os.Args[0] doesn't work in this environment")
================================================
FILE: 1.19_windows/runtime/os_windows.go.patch
================================================
//--from
//go:cgo_import_dynamic runtime._GetConsoleMode GetConsoleMode%2 "kernel32.dll"
//--to
//--from
//go:cgo_import_dynamic runtime._SetConsoleCtrlHandler SetConsoleCtrlHandler%2 "kernel32.dll"
//--to
//--from
//go:cgo_import_dynamic runtime._WriteConsoleW WriteConsoleW%5 "kernel32.dll"
//--to
//go:cgo_import_dynamic runtime._OutputDebugStringW OutputDebugStringW%1 "kernel32.dll"
//--from
_GetConsoleMode,
//--to
//--from
_SetConsoleCtrlHandler,
//--to
//--from
_WriteConsoleW,
//--to
_OutputDebugStringW,
//--from
_timeBeginPeriod,
_timeEndPeriod,
//--to
//--from
var winmmdll = []byte("winmm.dll\000")
m32 := windowsLoadSystemLib(winmmdll)
if m32 == 0 {
throw("winmm.dll not found")
}
_timeBeginPeriod = windowsFindfunc(m32, []byte("timeBeginPeriod\000"))
_timeEndPeriod = windowsFindfunc(m32, []byte("timeEndPeriod\000"))
if _timeBeginPeriod == nil || _timeEndPeriod == nil {
throw("timeBegin/EndPeriod not found")
}
//--to
//--from
// We call these all the way here, late in init, so that malloc works
// for the callback functions these generate.
var fn any = ctrlHandler
ctrlHandlerPC := compileCallback(*efaceOf(&fn), true)
stdcall2(_SetConsoleCtrlHandler, ctrlHandlerPC, 1)
//--to
//--from
func osRelax(relax bool) uint32 {
if haveHighResTimer {
// If the high resolution timer is available, the runtime uses the timer
// to sleep for short durations. This means there's no need to adjust
// the global clock frequency.
return 0
}
if relax {
return uint32(stdcall1(_timeEndPeriod, 1))
} else {
return uint32(stdcall1(_timeBeginPeriod, 1))
}
}
//--to
func osRelax(relax bool) uint32 {
if haveHighResTimer {
// If the high resolution timer is available, the runtime uses the timer
// to sleep for short durations. This means there's no need to adjust
// the global clock frequency.
return 0
}
throw("not reached")
return 0
}
//--from
func write1(fd uintptr, buf unsafe.Pointer, n int32) int32 {
const (
_STD_OUTPUT_HANDLE = ^uintptr(10) // -11
_STD_ERROR_HANDLE = ^uintptr(11) // -12
)
var handle uintptr
switch fd {
case 1:
handle = stdcall1(_GetStdHandle, _STD_OUTPUT_HANDLE)
case 2:
handle = stdcall1(_GetStdHandle, _STD_ERROR_HANDLE)
default:
// assume fd is real windows handle.
handle = fd
}
isASCII := true
b := (*[1 << 30]byte)(buf)[:n]
for _, x := range b {
if x >= 0x80 {
isASCII = false
break
}
}
if !isASCII {
var m uint32
isConsole := stdcall2(_GetConsoleMode, handle, uintptr(unsafe.Pointer(&m))) != 0
// If this is a console output, various non-unicode code pages can be in use.
// Use the dedicated WriteConsole call to ensure unicode is printed correctly.
if isConsole {
return int32(writeConsole(handle, buf, n))
}
}
var written uint32
stdcall5(_WriteFile, handle, uintptr(buf), uintptr(n), uintptr(unsafe.Pointer(&written)), 0)
return int32(written)
}
//--to
func write1(fd uintptr, buf unsafe.Pointer, n int32) int32 {
const (
_STD_OUTPUT_HANDLE = ^uintptr(10) // -11
_STD_ERROR_HANDLE = ^uintptr(11) // -12
)
var handle uintptr
switch fd {
case 1:
handle = stdcall1(_GetStdHandle, _STD_OUTPUT_HANDLE)
case 2:
handle = stdcall1(_GetStdHandle, _STD_ERROR_HANDLE)
default:
// assume fd is real windows handle.
handle = fd
}
if fd == 1 || fd == 2 {
// Note that handle is not used anyway.
return int32(writeConsole(handle, buf, n))
}
var written uint32
stdcall5(_WriteFile, handle, uintptr(buf), uintptr(n), uintptr(unsafe.Pointer(&written)), 0)
return int32(written)
}
//--from
func writeConsoleUTF16(handle uintptr, b []uint16) {
l := uint32(len(b))
if l == 0 {
return
}
var written uint32
stdcall5(_WriteConsoleW,
handle,
uintptr(unsafe.Pointer(&b[0])),
uintptr(l),
uintptr(unsafe.Pointer(&written)),
0,
)
return
}
//--to
func writeConsoleUTF16(handle uintptr, b []uint16) {
b = b[:len(b)+1]
b[len(b)-1] = 0
l := uint32(len(b))
if l <= 1 {
return
}
stdcall1(_OutputDebugStringW,
uintptr(unsafe.Pointer(&b[0])),
)
return
}
================================================
FILE: 1.19_windows/runtime/syscall_windows.go.patch
================================================
//--from
func syscall_SyscallN(trap uintptr, args ...uintptr) (r1, r2, err uintptr) {
//--to
func syscall_SyscallN(trap uintptr, args ...uintptr) (r1, r2, err uintptr) {
if trap == 0 {
panic("trap must not be 0 at SyscallN")
}
================================================
FILE: 1.19_windows/runtime/syscall_windows_test.go.patch
================================================
//--from
func TestNumCPU(t *testing.T) {
//--to
func TestNumCPU(t *testing.T) {
t.Skip("creating a new process with os.Args[0] doesn't work in this environment")
================================================
FILE: 1.19_windows/sync/mutex_test.go.patch
================================================
//--from
import (
"fmt"
"internal/testenv"
"os"
"os/exec"
"runtime"
"strings"
. "sync"
"testing"
"time"
)
//--to
import (
"fmt"
"os"
"runtime"
. "sync"
"testing"
"time"
)
//--from
func TestMutexMisuse(t *testing.T) {
testenv.MustHaveExec(t)
for _, test := range misuseTests {
out, err := exec.Command(os.Args[0], "TESTMISUSE", test.name).CombinedOutput()
if err == nil || !strings.Contains(string(out), "unlocked") {
t.Errorf("%s: did not find failure with message about unlocked lock: %s\n%s\n", test.name, err, out)
}
}
}
//--to
func TestMutexMisuse(t *testing.T) {
t.Skip("analyzing output is not supported in this environment")
}
================================================
FILE: 1.20_linux/internal/reflectlite/reflect_mirror_test.go.patch
================================================
//--from
func TestMirrorWithReflect(t *testing.T) {
//--to
func TestMirrorWithReflect(t *testing.T) {
t.Skip("file is not supported in this environment")
return
================================================
FILE: 1.20_linux/internal/testenv/exec.go.patch
================================================
//--from
func HasExec() bool {
switch runtime.GOOS {
case "js", "ios":
return false
}
return true
}
//--to
func HasExec() bool {
return false
}
================================================
FILE: 1.20_linux/internal/testenv/testenv.go.patch
================================================
//--from
func HasGoBuild() bool {
if os.Getenv("GO_GCFLAGS") != "" {
// It's too much work to require every caller of the go command
// to pass along "-gcflags="+os.Getenv("GO_GCFLAGS").
// For now, if $GO_GCFLAGS is set, report that we simply can't
// run go build.
return false
}
switch runtime.GOOS {
case "android", "js", "ios":
return false
}
return true
}
//--to
func HasGoBuild() bool {
return false
}
================================================
FILE: 1.20_linux/internal/testenv/testenv_notunix.go.patch
================================================
//--from
//go:build windows || plan9 || (js && wasm)
//--to
//go:build windows || plan9 || (js && wasm) || linux
================================================
FILE: 1.20_linux/internal/testenv/testenv_unix.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.20_linux/math/big/link_test.go.patch
================================================
//--from
import (
"bytes"
"internal/testenv"
"os"
"os/exec"
"path/filepath"
"testing"
)
//--to
import (
"testing"
)
//--from
func TestLinkerGC(t *testing.T) {
if testing.Short() {
t.Skip("skipping in short mode")
}
t.Parallel()
tmp := t.TempDir()
goBin := testenv.GoToolPath(t)
goFile := filepath.Join(tmp, "x.go")
file := []byte(`package main
import _ "math/big"
func main() {}
`)
if err := os.WriteFile(goFile, file, 0644); err != nil {
t.Fatal(err)
}
cmd := exec.Command(goBin, "build", "-o", "x.exe", "x.go")
cmd.Dir = tmp
if out, err := cmd.CombinedOutput(); err != nil {
t.Fatalf("compile: %v, %s", err, out)
}
cmd = exec.Command(goBin, "tool", "nm", "x.exe")
cmd.Dir = tmp
nm, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("nm: %v, %s", err, nm)
}
const want = "runtime.main"
if !bytes.Contains(nm, []byte(want)) {
// Test the test.
t.Errorf("expected symbol %q not found", want)
}
bad := []string{
"math/big.(*Float)",
"math/big.(*Rat)",
"math/big.(*Int)",
}
for _, sym := range bad {
if bytes.Contains(nm, []byte(sym)) {
t.Errorf("unexpected symbol %q found", sym)
}
}
if t.Failed() {
t.Logf("Got: %s", nm)
}
}
//--to
func TestLinkerGC(t *testing.T) {
t.Skip("go tools are not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/align_test.go.patch
================================================
//--from
import (
"go/ast"
"go/build"
"go/importer"
"go/parser"
"go/printer"
"go/token"
"go/types"
"internal/testenv"
"os"
"regexp"
"runtime"
"strings"
"testing"
)
//--to
import (
"go/ast"
"go/build"
"go/printer"
"go/token"
"go/types"
"strings"
"testing"
)
//--from
func TestAtomicAlignment(t *testing.T) {
testenv.MustHaveGoBuild(t) // go command needed to resolve std .a files for importer.Default().
// Read the code making the tables above, to see which fields and
// variables we are currently checking.
checked := map[string]bool{}
x, err := os.ReadFile("./align_runtime_test.go")
if err != nil {
t.Fatalf("read failed: %v", err)
}
fieldDesc := map[int]string{}
r := regexp.MustCompile(`unsafe[.]Offsetof[(](\w+){}[.](\w+)[)]`)
matches := r.FindAllStringSubmatch(string(x), -1)
for i, v := range matches {
checked["field runtime."+v[1]+"."+v[2]] = true
fieldDesc[i] = v[1] + "." + v[2]
}
varDesc := map[int]string{}
r = regexp.MustCompile(`unsafe[.]Pointer[(]&(\w+)[)]`)
matches = r.FindAllStringSubmatch(string(x), -1)
for i, v := range matches {
checked["var "+v[1]] = true
varDesc[i] = v[1]
}
// Check all of our alignemnts. This is the actual core of the test.
for i, d := range runtime.AtomicFields {
if d%8 != 0 {
t.Errorf("field alignment of %s failed: offset is %d", fieldDesc[i], d)
}
}
for i, p := range runtime.AtomicVariables {
if uintptr(p)%8 != 0 {
t.Errorf("variable alignment of %s failed: address is %x", varDesc[i], p)
}
}
// The code above is the actual test. The code below attempts to check
// that the tables used by the code above are exhaustive.
// Parse the whole runtime package, checking that arguments of
// appropriate atomic operations are in the list above.
fset := token.NewFileSet()
m, err := parser.ParseDir(fset, ".", nil, 0)
if err != nil {
t.Fatalf("parsing runtime failed: %v", err)
}
pkg := m["runtime"] // Note: ignore runtime_test and main packages
// Filter files by those for the current architecture/os being tested.
fileMap := map[string]bool{}
for _, f := range buildableFiles(t, ".") {
fileMap[f] = true
}
var files []*ast.File
for fname, f := range pkg.Files {
if fileMap[fname] {
files = append(files, f)
}
}
// Call go/types to analyze the runtime package.
var info types.Info
info.Types = map[ast.Expr]types.TypeAndValue{}
conf := types.Config{Importer: importer.Default()}
_, err = conf.Check("runtime", fset, files, &info)
if err != nil {
t.Fatalf("typechecking runtime failed: %v", err)
}
// Analyze all atomic.*64 callsites.
v := Visitor{t: t, fset: fset, types: info.Types, checked: checked}
ast.Walk(&v, pkg)
}
//--to
func TestAtomicAlignment(t *testing.T) {
t.Skip("file is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/callers_test.go.patch
================================================
//--from
func TestCallersNilPointerPanic(t *testing.T) {
// Make sure we don't have any extra frames on the stack (due to
// open-coded defer processing)
want := []string{"runtime.Callers", "runtime_test.TestCallersNilPointerPanic.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic",
"runtime_test.TestCallersNilPointerPanic"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
}()
var p *int
if *p == 3 {
t.Fatal("did not see nil pointer panic")
}
}
//--to
func TestCallersNilPointerPanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestCallersDeferNilFuncPanic(t *testing.T) {
// Make sure we don't have any extra frames on the stack. We cut off the check
// at runtime.sigpanic, because non-open-coded defers (which may be used in
// non-opt or race checker mode) include an extra 'deferreturn' frame (which is
// where the nil pointer deref happens).
state := 1
want := []string{"runtime.Callers", "runtime_test.TestCallersDeferNilFuncPanic.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
if state == 1 {
t.Fatal("nil defer func panicked at defer time rather than function exit time")
}
}()
var f func()
defer f()
// Use the value of 'state' to make sure nil defer func f causes panic at
// function exit, rather than at the defer statement.
state = 2
}
//--to
func TestCallersDeferNilFuncPanic(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
//--from
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) {
state := 1
want := []string{"runtime.Callers", "runtime_test.TestCallersDeferNilFuncPanicWithLoop.func1",
"runtime.gopanic", "runtime.panicmem", "runtime.sigpanic", "runtime.deferreturn", "runtime_test.TestCallersDeferNilFuncPanicWithLoop"}
defer func() {
if r := recover(); r == nil {
t.Fatal("did not panic")
}
pcs := make([]uintptr, 20)
pcs = pcs[:runtime.Callers(0, pcs)]
testCallersEqual(t, pcs, want)
if state == 1 {
t.Fatal("nil defer func panicked at defer time rather than function exit time")
}
}()
for i := 0; i < 1; i++ {
var f func()
defer f()
}
// Use the value of 'state' to make sure nil defer func f causes panic at
// function exit, rather than at the defer statement.
state = 2
}
//--to
func TestCallersDeferNilFuncPanicWithLoop(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/cgo/cgo.go.patch
================================================
//--from
*/
import "C"
//--to
#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all
#cgo darwin LDFLAGS: -Wl,-undefined,dynamic_lookup
*/
import "C"
================================================
FILE: 1.20_linux/runtime/cgo/gcc_linux_amd64.c.patch
================================================
//--from
#include <pthread.h>
#include <errno.h>
#include <string.h> // strerror
#include <signal.h>
#include <stdlib.h>
#include "libcgo.h"
#include "libcgo_unix.h"
//--to
#include <pthread.h>
#include <errno.h>
#include <string.h> // strerror
#include <stdlib.h>
#include "libcgo.h"
#include "libcgo_unix.h"
//--from
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
sigset_t ign, oset;
pthread_t p;
size_t size;
int err;
sigfillset(&ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
pthread_attr_init(&attr);
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
pthread_sigmask(SIG_SETMASK, &oset, nil);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--to
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
pthread_t p;
size_t size;
int err;
pthread_attr_init(&attr);
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--from
static void*
threadentry(void *v)
{
//--to
static void*
threadentry(void *v)
{
extern void hitsumabushi_initializeThread(void);
hitsumabushi_initializeThread();
================================================
FILE: 1.20_linux/runtime/cgo/gcc_linux_arm64.c.patch
================================================
//--from
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
sigset_t ign, oset;
pthread_t p;
size_t size;
int err;
sigfillset(&ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
pthread_attr_init(&attr);
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
pthread_sigmask(SIG_SETMASK, &oset, nil);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--to
void
_cgo_sys_thread_start(ThreadStart *ts)
{
pthread_attr_t attr;
sigset_t ign, oset;
pthread_t p;
size_t size;
int err;
sigfillset(&ign);
pthread_sigmask(SIG_SETMASK, &ign, &oset);
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, 16 * 4096); // Hack for some special environments
pthread_attr_getstacksize(&attr, &size);
// Leave stacklo=0 and set stackhi=size; mstart will do the rest.
ts->g->stackhi = size;
err = _cgo_try_pthread_create(&p, &attr, threadentry, ts);
pthread_sigmask(SIG_SETMASK, &oset, nil);
if (err != 0) {
fatalf("pthread_create failed: %s", strerror(err));
}
}
//--from
void
x_cgo_init(G *g, void (*setg)(void*), void **tlsg, void **tlsbase)
{
pthread_attr_t *attr;
size_t size;
/* The memory sanitizer distributed with versions of clang
before 3.8 has a bug: if you call mmap before malloc, mmap
may return an address that is later overwritten by the msan
library. Avoid this problem by forcing a call to malloc
here, before we ever call malloc.
This is only required for the memory sanitizer, so it's
unfortunate that we always run it. It should be possible
to remove this when we no longer care about versions of
clang before 3.8. The test for this is
misc/cgo/testsanitizers.
GCC works hard to eliminate a seemingly unnecessary call to
malloc, so we actually use the memory we allocate. */
setg_gcc = setg;
attr = (pthread_attr_t*)malloc(sizeof *attr);
if (attr == NULL) {
fatalf("malloc failed: %s", strerror(errno));
}
pthread_attr_init(attr);
pthread_attr_getstacksize(attr, &size);
g->stacklo = (uintptr)&size - size + 4096;
pthread_attr_destroy(attr);
free(attr);
if (x_cgo_inittls) {
x_cgo_inittls(tlsg, tlsbase);
}
}
//--to
void
x_cgo_init(G *g, void (*setg)(void*), void **tlsg, void **tlsbase)
{
pthread_attr_t *attr;
size_t size;
/* The memory sanitizer distributed with versions of clang
before 3.8 has a bug: if you call mmap before malloc, mmap
may return an address that is later overwritten by the msan
library. Avoid this problem by forcing a call to malloc
here, before we ever call malloc.
This is only required for the memory sanitizer, so it's
unfortunate that we always run it. It should be possible
to remove this when we no longer care about versions of
clang before 3.8. The test for this is
misc/cgo/testsanitizers.
GCC works hard to eliminate a seemingly unnecessary call to
malloc, so we actually use the memory we allocate. */
setg_gcc = setg;
attr = (pthread_attr_t*)malloc(sizeof *attr);
if (attr == NULL) {
fatalf("malloc failed: %s", strerror(errno));
}
pthread_attr_init(attr);
pthread_attr_setstacksize(attr, 16 * 4096); // Hack for some special environments
pthread_attr_getstacksize(attr, &size);
g->stacklo = (uintptr)&size - size + 4096;
pthread_attr_destroy(attr);
free(attr);
if (x_cgo_inittls) {
x_cgo_inittls(tlsg, tlsbase);
}
}
//--from
static void*
threadentry(void *v)
{
//--to
static void*
threadentry(void *v)
{
extern void hitsumabushi_initializeThread(void);
hitsumabushi_initializeThread();
================================================
FILE: 1.20_linux/runtime/cgo/gcc_setenv.c.patch
================================================
//--from
void
x_cgo_setenv(char **arg)
{
_cgo_tsan_acquire();
setenv(arg[0], arg[1], 1);
_cgo_tsan_release();
}
//--to
void
x_cgo_setenv(char **arg)
{
}
//--from
void
x_cgo_unsetenv(char **arg)
{
_cgo_tsan_acquire();
unsetenv(arg[0]);
_cgo_tsan_release();
}
//--to
void
x_cgo_unsetenv(char **arg)
{
}
================================================
FILE: 1.20_linux/runtime/cgo/gcc_sigaction.c.patch
================================================
//--from
// +build linux,amd64 linux,arm64 linux,ppc64le
//--to
// +build linux,arm64 linux,ppc64le
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_clock_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <time.h>
int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
return clock_gettime(clk_id, tp);
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_cpu_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <stdint.h>
int32_t hitsumabushi_getproccount() {
return 1;
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
// This file defines C functions and system calls for Cgo.
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdatomic.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "libcgo.h"
#include "libcgo_unix.h"
static const int kFDOffset = 100;
typedef struct {
const void* content;
size_t content_size;
size_t current;
int32_t fd;
} pseudo_file;
// TODO: Do we need to protect this by mutex?
static pseudo_file pseudo_files[100];
static pthread_mutex_t* pseudo_file_mutex() {
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
return &mutex;
}
static int32_t open_pseudo_file(const void* content, size_t content_size) {
pthread_mutex_lock(pseudo_file_mutex());
int index = 0;
int found = 0;
for (int i = 0; i < sizeof(pseudo_files) / sizeof(pseudo_file); i++) {
if (pseudo_files[i].fd == 0) {
index = i;
found = 1;
break;
}
}
if (!found) {
// Too many pseudo files are opened.
pthread_mutex_unlock(pseudo_file_mutex());
return -1;
}
int32_t fd = index + kFDOffset;
pseudo_files[index].content = content;
pseudo_files[index].content_size = content_size;
pseudo_files[index].current = 0;
pseudo_files[index].fd = fd;
pthread_mutex_unlock(pseudo_file_mutex());
return fd;
}
static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
pthread_mutex_lock(pseudo_file_mutex());
int32_t index = fd - kFDOffset;
pseudo_file *file = &pseudo_files[index];
size_t rest = file->content_size - file->current;
if (rest < n) {
n = rest;
}
memcpy(p, file->content + file->current, n);
pseudo_files[index].current += n;
pthread_mutex_unlock(pseudo_file_mutex());
return n;
}
static void close_pseudo_file(int32_t fd) {
pthread_mutex_lock(pseudo_file_mutex());
int32_t index = fd - kFDOffset;
pseudo_files[index].content = NULL;
pseudo_files[index].content_size = 0;
pseudo_files[index].current = 0;
pseudo_files[index].fd = 0;
pthread_mutex_unlock(pseudo_file_mutex());
}
int32_t hitsumabushi_closefd(int32_t fd) {
if (fd >= kFDOffset) {
close_pseudo_file(fd);
return 0;
}
fprintf(stderr, "syscall close(%d) is not implemented\n", fd);
return 0;
}
int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
if (strcmp(name, "/proc/self/auxv") == 0) {
static const char auxv[] =
"\x06\x00\x00\x00\x00\x00\x00\x00" // _AT_PAGESZ tag (6)
"\x00\x10\x00\x00\x00\x00\x00\x00" // 4096 bytes per page
"\x00\x00\x00\x00\x00\x00\x00\x00" // Dummy bytes
"\x00\x00\x00\x00\x00\x00\x00\x00"; // Dummy bytes
return open_pseudo_file(auxv, sizeof(auxv) / sizeof(char));
}
if (strcmp(name, "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size") == 0) {
static const char hpage_pmd_size[] =
"\x30\x5c"; // '0', '\n'
return open_pseudo_file(hpage_pmd_size, sizeof(hpage_pmd_size) / sizeof(char));
}
fprintf(stderr, "syscall open(%s, %d, %d) is not implemented\n", name, mode, perm);
const static int kENOENT = 0x2;
return kENOENT;
}
int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
if (fd >= kFDOffset) {
return read_pseudo_file(fd, p, n);
}
fprintf(stderr, "syscall read(%d, %p, %d) is not implemented\n", fd, p, n);
const static int kEBADF = 0x9;
return kEBADF;
}
int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
int32_t ret = 0;
pthread_mutex_lock(&m);
switch (fd) {
case 1:
ret = fwrite(p, 1, n, stdout);
fflush(stdout);
break;
case 2:
ret = fwrite(p, 1, n, stderr);
fflush(stderr);
break;
default:
fprintf(stderr, "syscall write(%lu, %p, %d) is not implemented\n", fd, p, n);
ret = -EBADF;
break;
}
pthread_mutex_unlock(&m);
return ret;
}
int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
fprintf(stderr, "syscall lseek(%lu, %lu, %d) is not implemented\n", fd, offset, whence);
return -ENOSYS;
}
int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
{
if (fd == 0 || fd == 1 || fd == 2) {
if (cmd == F_GETFL) {
return 0;
}
}
fprintf(stderr, "syscall fcntl(%d, %d, %d) is not implemented\n", fd, cmd, arg);
return -EBADF;
}
int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
{
fprintf(stderr, "syscall fstat(%d, %p) is not implemented\n", fd, stat);
return -ENOSYS;
}
int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, char* name2)
{
fprintf(stderr, "syscall renameat(%d, %s, %d, %s) is not implemented\n", fd1, name1, fd2, name2);
return -ENOSYS;
}
int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int32_t flags)
{
fprintf(stderr, "syscall fstatat(%d, %s, %p, %d) is not implemented\n", fd, name, p, flags);
return -ENOSYS;
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_futex_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
static const int kPseudoFutexWait = 0;
static const int kPseudoFutexWake = 1;
static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const struct timespec *reltime) {
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
struct timespec abstime;
if (reltime) {
// We are not sure CLOCK_REALTIME is correct or not here.
// However, this time limit is actually not used as the condition variable is shared by
// all the threads. Before the time limit reaches, the thread wakes up in 99.9999...% cases.
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_sec += reltime->tv_sec;
abstime.tv_nsec += reltime->tv_nsec;
if (1000000000 <= abstime.tv_nsec) {
abstime.tv_sec += 1;
abstime.tv_nsec -= 1000000000;
}
}
int ret = pthread_mutex_lock(&mutex);
if (ret) {
fprintf(stderr, "pthread_mutex_lock failed: %d\n", ret);
abort();
}
switch (mode) {
case kPseudoFutexWait:
if (reltime) {
uint32_t v = 0;
__atomic_load(uaddr, &v, __ATOMIC_RELAXED);
if (v == val) {
int ret = pthread_cond_timedwait(&cond, &mutex, &abstime);
if (ret && ret != ETIMEDOUT) {
fprintf(stderr, "pthread_cond_timedwait failed: %d\n", ret);
abort();
}
}
} else {
uint32_t v = 0;
__atomic_load(uaddr, &v, __ATOMIC_RELAXED);
if (v == val) {
int ret = pthread_cond_wait(&cond, &mutex);
if (ret) {
fprintf(stderr, "pthread_cond_wait failed: %d\n", ret);
abort();
}
}
}
break;
case kPseudoFutexWake:
if (val != 1) {
fprintf(stderr, "val for waking must be 1 but %d\n", val);
abort();
}
// TODO: broadcasting is not efficient. Use a mutex for each uaddr.
int ret = pthread_cond_broadcast(&cond);
if (ret) {
fprintf(stderr, "pthread_cond_broadcast failed: %d\n", ret);
abort();
}
break;
}
ret = pthread_mutex_unlock(&mutex);
if (ret) {
fprintf(stderr, "pthread_mutex_unlock failed: %d\n", ret);
abort();
}
}
int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
const struct timespec *timeout,
uint32_t *uaddr2, uint32_t val3) {
enum {
kFutexWaitPrivate = 128,
kFutexWakePrivate = 129,
};
switch (futex_op) {
case kFutexWaitPrivate:
pseudo_futex(uaddr, kPseudoFutexWait, val, timeout);
break;
case kFutexWakePrivate:
pseudo_futex(uaddr, kPseudoFutexWake, val, NULL);
break;
}
// This function should return the number of awaken threads, but now it is impossible.
// Just return 0.
return 0;
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_mem_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
#include <stdint.h>
#include <stdlib.h>
void* hitsumabushi_sysReserveOS(void* v, uintptr_t n);
void* hitsumabushi_sysAllocOS(uintptr_t n) {
return hitsumabushi_sysReserveOS(NULL, n);
}
void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
}
void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
}
void* hitsumabushi_sysReserveOS(void* v, uintptr_t n) {
if (v) {
return NULL;
}
return calloc(n, 1);
}
void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
================================================
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors
// This file defines C functions and system calls for Cgo.
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdatomic.h>
#include <unistd.h> // for usleep
#include <stddef.h> // for size_t
#include "libcgo.h"
#include "libcgo_unix.h"
typedef unsigned int gid_t;
extern int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp);
extern int32_t hitsumabushi_getproccount();
void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset) {
abort();
return NULL;
}
int munmap(void *addr, size_t length) {
abort();
return 0;
}
int pthread_sigmask(int how, void *set, void *oldset) {
// Do nothing.
return 0;
}
int setegid(gid_t gid) {
// Do nothing.
return 0;
}
int seteuid(uid_t gid) {
// Do nothing.
return 0;
}
int setgid(gid_t gid) {
// Do nothing.
return 0;
}
int setgroups(size_t size, const gid_t *list) {
// Do nothing.
return 0;
}
int setregid(gid_t rgid, gid_t egid) {
// Do nothing.
return 0;
}
int setreuid(uid_t ruid, uid_t euid) {
// Do nothing.
return 0;
}
int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
// Do nothing.
return 0;
}
int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
// Do nothing.
return 0;
}
int setuid(uid_t gid) {
// Do nothing.
return 0;
}
int sigaction(int signum, void *act, void *oldact) {
// Do nothing.
return 0;
}
int sigaddset(void *set, int signum) {
// Do nothing.
return 0;
}
int sigemptyset(void *set) {
// Do nothing.
return 0;
}
int sigfillset(void *set) {
// Do nothing.
return 0;
}
int sigismember(void *set, int signum) {
// Do nothing.
return 0;
}
uint32_t hitsumabushi_gettid() {
uint64_t tid64 = (uint64_t)(pthread_self());
uint32_t tid = (uint32_t)(tid64 >> 32) ^ (uint32_t)(tid64);
return tid;
}
int64_t hitsumabushi_nanotime1() {
struct timespec tp;
hitsumabushi_clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64_t)(tp.tv_sec) * 1000000000ll + (int64_t)tp.tv_nsec;
}
int32_t hitsumabushi_osyield() {
return sched_yield();
}
int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, void *mask) {
int32_t numcpu = hitsumabushi_getproccount();
for (int32_t i = 0; i < numcpu; i += 8)
((unsigned char*)mask)[i / 8] = (unsigned char)((1u << (numcpu - i)) - 1);
// https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html
// > On success, the raw sched_getaffinity() system call returns the
// > number of bytes placed copied into the mask buffer;
return (numcpu + 7) / 8;
}
void hitsumabushi_usleep(useconds_t usec) {
usleep(usec);
}
void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
struct timespec tp;
hitsumabushi_clock_gettime(CLOCK_REALTIME, &tp);
*sec = tp.tv_sec;
*nsec = tp.tv_nsec;
}
void hitsumabushi_exit(int32_t code) {
exit(code);
}
================================================
FILE: 1.20_linux/runtime/cgo/hitsumabushi_thread_linux.c
================================================
void hitsumabushi_initializeThread(void) {
}
================================================
FILE: 1.20_linux/runtime/cgo/linux_syscall.c.patch
================================================
//--from
#include <grp.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include "libcgo.h"
//--to
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include "libcgo.h"
//--from
void
_cgo_libc_setegid(argset_t* x) {
SET_RETVAL(setegid((gid_t) x->args[0]));
}
//--to
void
_cgo_libc_setegid(argset_t* x) {
}
//--from
void
_cgo_libc_seteuid(argset_t* x) {
SET_RETVAL(seteuid((uid_t) x->args[0]));
}
//--to
void
_cgo_libc_seteuid(argset_t* x) {
}
//--from
void
_cgo_libc_setgid(argset_t* x) {
SET_RETVAL(setgid((gid_t) x->args[0]));
}
//--to
void
_cgo_libc_setgid(argset_t* x) {
}
//--from
void
_cgo_libc_setgroups(argset_t* x) {
SET_RETVAL(setgroups((size_t) x->args[0], (const gid_t *) x->args[1]));
}
//--to
void
_cgo_libc_setgroups(argset_t* x) {
}
//--from
void
_cgo_libc_setregid(argset_t* x) {
SET_RETVAL(setregid((gid_t) x->args[0], (gid_t) x->args[1]));
}
//--to
void
_cgo_libc_setregid(argset_t* x) {
}
//--from
void
_cgo_libc_setresgid(argset_t* x) {
SET_RETVAL(setresgid((gid_t) x->args[0], (gid_t) x->args[1],
(gid_t) x->args[2]));
}
//--to
void
_cgo_libc_setresgid(argset_t* x) {
}
//--from
void
_cgo_libc_setreuid(argset_t* x) {
SET_RETVAL(setreuid((uid_t) x->args[0], (uid_t) x->args[1]));
}
//--to
void
_cgo_libc_setreuid(argset_t* x) {
}
//--from
void
_cgo_libc_setuid(argset_t* x) {
SET_RETVAL(setuid((uid_t) x->args[0]));
}
//--to
void
_cgo_libc_setuid(argset_t* x) {
}
================================================
FILE: 1.20_linux/runtime/cgo/sigaction.go.patch
================================================
//--from
//go:build (linux && amd64) || (freebsd && amd64) || (linux && arm64) || (linux && ppc64le)
//--to
//go:build (freebsd && amd64) || (linux && arm64) || (linux && ppc64le)
================================================
FILE: 1.20_linux/runtime/crash_test.go.patch
================================================
//--from
import (
"bytes"
"errors"
"flag"
"fmt"
"internal/testenv"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"testing"
"time"
)
//--to
import (
"bytes"
"errors"
"flag"
"internal/testenv"
"os"
"os/exec"
"regexp"
"runtime"
"strings"
"sync"
"testing"
"time"
)
//--from
func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) {
if *flagQuick {
t.Skip("-quick")
}
testenv.MustHaveGoBuild(t)
testprog.Lock()
if testprog.dir == "" {
dir, err := os.MkdirTemp("", "go-build")
if err != nil {
t.Fatalf("failed to create temp directory: %v", err)
}
testprog.dir = dir
toRemove = append(toRemove, dir)
}
if testprog.target == nil {
testprog.target = make(map[string]*buildexe)
}
name := binary
if len(flags) > 0 {
name += "_" + strings.Join(flags, "_")
}
target, ok := testprog.target[name]
if !ok {
target = &buildexe{}
testprog.target[name] = target
}
dir := testprog.dir
// Unlock testprog while actually building, so that other
// tests can look up executables that were already built.
testprog.Unlock()
target.once.Do(func() {
// Only do two "go build"'s at a time,
// to keep load from getting too high.
serializeBuild <- true
defer func() { <-serializeBuild }()
// Don't get confused if testenv.GoToolPath calls t.Skip.
target.err = errors.New("building test called t.Skip")
exe := filepath.Join(dir, name+".exe")
t.Logf("running go build -o %s %s", exe, strings.Join(flags, " "))
cmd := exec.Command(testenv.GoToolPath(t), append([]string{"build", "-o", exe}, flags...)...)
cmd.Dir = "testdata/" + binary
out, err := testenv.CleanCmdEnv(cmd).CombinedOutput()
if err != nil {
target.err = fmt.Errorf("building %s %v: %v\n%s", binary, flags, err, out)
} else {
target.exe = exe
target.err = nil
}
})
return target.exe, target.err
}
//--to
func buildTestProg(t *testing.T, binary string, flags ...string) (string, error) {
t.Skip("buildTestProg is not supported in this environment")
return "", nil
}
//--from
func TestPanicInlined(t *testing.T) {
defer func() {
r := recover()
if r == nil {
t.Fatalf("recover failed")
}
buf := make([]byte, 2048)
n := runtime.Stack(buf, false)
buf = buf[:n]
if !bytes.Contains(buf, []byte("(*point).negate(")) {
t.Fatalf("expecting stack trace to contain call to (*point).negate()")
}
}()
pt := new(point)
pt.negate()
}
//--to
func TestPanicInlined(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
defer func() {
r := recover()
if r == nil {
t.Fatalf("recover failed")
}
buf := make([]byte, 2048)
n := runtime.Stack(buf, false)
buf = buf[:n]
if !bytes.Contains(buf, []byte("(*point).negate(")) {
t.Fatalf("expecting stack trace to contain call to (*point).negate()")
}
}()
pt := new(point)
pt.negate()
}
================================================
FILE: 1.20_linux/runtime/crash_unix_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.20_linux/runtime/debug/heapdump_test.go.patch
================================================
//--from
import (
"os"
"runtime"
. "runtime/debug"
"testing"
)
//--to
import (
"testing"
)
//--from
func TestWriteHeapDumpNonempty(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
WriteHeapDump(f.Fd())
fi, err := f.Stat()
if err != nil {
t.Fatalf("Stat failed: %v", err)
}
const minSize = 1
if size := fi.Size(); size < minSize {
t.Fatalf("Heap dump size %d bytes, expected at least %d bytes", size, minSize)
}
}
//--to
func TestWriteHeapDumpNonempty(t *testing.T) {
t.Skip("file is not supported in this environment")
}
//--from
func TestWriteHeapDumpFinalizers(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
// bug 9172: WriteHeapDump couldn't handle more than one finalizer
println("allocating objects")
x := &Obj{}
runtime.SetFinalizer(x, objfin)
y := &Obj{}
runtime.SetFinalizer(y, objfin)
// Trigger collection of x and y, queueing of their finalizers.
println("starting gc")
runtime.GC()
// Make sure WriteHeapDump doesn't fail with multiple queued finalizers.
println("starting dump")
WriteHeapDump(f.Fd())
println("done dump")
}
//--to
func TestWriteHeapDumpFinalizers(t *testing.T) {
t.Skip("file is not supported in this environment")
}
//--from
func TestWriteHeapDumpTypeName(t *testing.T) {
if runtime.GOOS == "js" {
t.Skipf("WriteHeapDump is not available on %s.", runtime.GOOS)
}
f, err := os.CreateTemp("", "heapdumptest")
if err != nil {
t.Fatalf("TempFile failed: %v", err)
}
defer os.Remove(f.Name())
defer f.Close()
WriteHeapDump(f.Fd())
dummy.M()
dummy2.M()
}
//--to
func TestWriteHeapDumpTypeName(t *testing.T) {
t.Skip("file is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/debug/panic_test.go.patch
================================================
//--from
import (
"runtime"
"runtime/debug"
"syscall"
"testing"
"unsafe"
)
//--to
import (
"testing"
)
//--from
func TestPanicOnFault(t *testing.T) {
if runtime.GOARCH == "s390x" {
t.Skip("s390x fault addresses are missing the low order bits")
}
if runtime.GOOS == "ios" {
t.Skip("iOS doesn't provide fault addresses")
}
if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm" {
t.Skip("netbsd-arm doesn't provide fault address (golang.org/issue/45026)")
}
m, err := syscall.Mmap(-1, 0, 0x1000, syscall.PROT_READ /* Note: no PROT_WRITE */, syscall.MAP_SHARED|syscall.MAP_ANON)
if err != nil {
t.Fatalf("can't map anonymous memory: %s", err)
}
defer syscall.Munmap(m)
old := debug.SetPanicOnFault(true)
defer debug.SetPanicOnFault(old)
const lowBits = 0x3e7
defer func() {
r := recover()
if r == nil {
t.Fatalf("write did not fault")
}
type addressable interface {
Addr() uintptr
}
a, ok := r.(addressable)
if !ok {
t.Fatalf("fault does not contain address")
}
want := uintptr(unsafe.Pointer(&m[lowBits]))
got := a.Addr()
if got != want {
t.Fatalf("fault address %x, want %x", got, want)
}
}()
m[lowBits] = 1 // will fault
}
//--to
func TestPanicOnFault(t *testing.T) {
t.Skip("handling nil pointer access is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/debug_test.go.patch
================================================
//--from
//go:build (amd64 || arm64) && linux && !race
//--to
//go:build ignore
================================================
FILE: 1.20_linux/runtime/export_unix_test.go
================================================
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build unix
package runtime
const (
O_WRONLY = _O_WRONLY
O_CREAT = _O_CREAT
O_TRUNC = _O_TRUNC
)
================================================
FILE: 1.20_linux/runtime/internal/syscall/asm_linux_amd64.s.patch
================================================
//--from
TEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0
// a6 already in R9.
// a5 already in R8.
MOVQ SI, R10 // a4
MOVQ DI, DX // a3
MOVQ CX, SI // a2
MOVQ BX, DI // a1
// num already in AX.
SYSCALL
CMPQ AX, $0xfffffffffffff001
JLS ok
NEGQ AX
MOVQ AX, CX // errno
MOVQ $-1, AX // r1
MOVQ $0, BX // r2
RET
ok:
// r1 already in AX.
MOVQ DX, BX // r2
MOVQ $0, CX // errno
RET
//--to
================================================
FILE: 1.20_linux/runtime/internal/syscall/asm_linux_arm64.s.patch
================================================
//--from
TEXT ·Syscall6(SB),NOSPLIT,$0-80
MOVD num+0(FP), R8 // syscall entry
MOVD a1+8(FP), R0
MOVD a2+16(FP), R1
MOVD a3+24(FP), R2
MOVD a4+32(FP), R3
MOVD a5+40(FP), R4
MOVD a6+48(FP), R5
SVC
CMN $4095, R0
BCC ok
MOVD $-1, R4
MOVD R4, r1+56(FP)
MOVD ZR, r2+64(FP)
NEG R0, R0
MOVD R0, errno+72(FP)
RET
ok:
MOVD R0, r1+56(FP)
MOVD R1, r2+64(FP)
MOVD ZR, errno+72(FP)
RET
//--to
================================================
FILE: 1.20_linux/runtime/internal/syscall/syscall_linux.go.patch
================================================
//--from
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)
//--to
func Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
println("not implemented syscall at Syscall6", num)
panic("syscall.Syscall6")
return 0, 0, 0x26 // ENOSYS
}
//--from
func syscall_RawSyscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
return Syscall6(num, a1, a2, a3, a4, a5, a6)
}
//--to
func syscall_RawSyscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr) {
println("not implemented syscall at RawSyscall6", num)
panic("syscall.RawSyscall6")
return 0, 0, 0x26 // ENOSYS
}
================================================
FILE: 1.20_linux/runtime/internal/syscall/syscall_linux_test.go.patch
================================================
//--from
import (
"runtime/internal/syscall"
"testing"
)
//--to
import (
"testing"
)
//--from
func TestEpollctlErrorSign(t *testing.T) {
v := syscall.EpollCtl(-1, 1, -1, &syscall.EpollEvent{})
const EBADF = 0x09
if v != EBADF {
t.Errorf("epollctl = %v, want %v", v, EBADF)
}
}
//--to
func TestEpollctlErrorSign(t *testing.T) {
t.Skip("Epollctl is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/mem_linux.go
================================================
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This implementation is the most fundamental and minimal allocations like Wasm.
// Malloced memory regions are never freed.
package runtime
import (
"internal/abi"
"unsafe"
)
// Don't split the stack as this method may be invoked without a valid G, which
// prevents us from allocating more stack.
//
//go:nosplit
//go:cgo_unsafe_args
func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysAllocOS_trampoline)), unsafe.Pointer(&n))
return
}
func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
//go:nosplit
//go:cgo_unsafe_args
func sysUnusedOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysUnusedOS_trampoline)), unsafe.Pointer(&v))
}
func sysUnusedOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysUsedOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysUsedOS_trampoline)), unsafe.Pointer(&v))
}
func sysUsedOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysHugePageOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysHugePageOS_trampoline)), unsafe.Pointer(&v))
}
func sysHugePageOS_trampoline(n uintptr, size uintptr)
// Don't split the stack as this function may be invoked without a valid G,
// which prevents us from allocating more stack.
//
//go:nosplit
//go:cgo_unsafe_args
func sysFreeOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysFreeOS_trampoline)), unsafe.Pointer(&v))
}
func sysFreeOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysFaultOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysFaultOS_trampoline)), unsafe.Pointer(&v))
}
func sysFaultOS_trampoline(n uintptr, size uintptr)
//go:nosplit
//go:cgo_unsafe_args
func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysReserveOS_trampoline)), unsafe.Pointer(&v))
return
}
func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
//go:nosplit
//go:cgo_unsafe_args
func sysMapOS(v unsafe.Pointer, n uintptr) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(sysMapOS_trampoline)), unsafe.Pointer(&v))
}
func sysMapOS_trampoline(n uintptr, size uintptr)
================================================
FILE: 1.20_linux/runtime/memmove_linux_amd64_test.go.patch
================================================
//--from
func TestMemmoveOverflow(t *testing.T) {
//--to
func TestMemmoveOverflow(t *testing.T) {
t.Skip("file is not supported in this environment")
return
================================================
FILE: 1.20_linux/runtime/nbpipe_pipe2.go.patch
================================================
//--from
//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris
//--to
//go:build dragonfly || freebsd || netbsd || openbsd || solaris
================================================
FILE: 1.20_linux/runtime/nbpipe_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.20_linux/runtime/netpoll_epoll.go.patch
================================================
//--from
//go:build linux
//--to
//go:build ignore
================================================
FILE: 1.20_linux/runtime/netpoll_fake.go.patch
================================================
//--from
//go:build js && wasm
//--to
//go:build linux
================================================
FILE: 1.20_linux/runtime/norace_linux_test.go.patch
================================================
//--from
import (
"internal/abi"
"runtime"
"testing"
"time"
"unsafe"
)
//--to
import (
"testing"
)
//--from
func TestNewOSProc0(t *testing.T) {
runtime.NewOSProc0(0x800000, unsafe.Pointer(abi.FuncPCABIInternal(newOSProcCreated)))
check := time.NewTicker(100 * time.Millisecond)
defer check.Stop()
end := time.After(5 * time.Second)
for {
select {
case <-check.C:
if newOSProcDone {
return
}
case <-end:
t.Fatalf("couldn't create new OS process")
}
}
}
//--to
func TestNewOSProc0(t *testing.T) {
t.Skip("newosproc0 is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/os_linux.go.patch
================================================
//--from
import (
"internal/abi"
"internal/goarch"
"runtime/internal/atomic"
"runtime/internal/syscall"
"unsafe"
)
//--to
import (
"internal/abi"
"runtime/internal/atomic"
"runtime/internal/syscall"
"unsafe"
)
//--from
//go:noescape
func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func futex(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32 {
ret := libcCall(unsafe.Pointer(abi.FuncPCABI0(futex_trampoline)), unsafe.Pointer(&addr))
return ret
}
func futex_trampoline(addr unsafe.Pointer, op int32, val uint32, ts, addr2 unsafe.Pointer, val3 uint32) int32
//--from
func sysargs(argc int32, argv **byte) {
n := argc + 1
// skip over argv, envp to get to auxv
for argv_index(argv, n) != nil {
n++
}
// skip NULL separator
n++
// now argv+n is auxv
auxv := (*[1 << 28]uintptr)(add(unsafe.Pointer(argv), uintptr(n)*goarch.PtrSize))
if sysauxv(auxv[:]) != 0 {
return
}
// In some situations we don't get a loader-provided
// auxv, such as when loaded as a library on Android.
// Fall back to /proc/self/auxv.
fd := open(&procAuxv[0], 0 /* O_RDONLY */, 0)
if fd < 0 {
// On Android, /proc/self/auxv might be unreadable (issue 9229), so we fallback to
// try using mincore to detect the physical page size.
// mincore should return EINVAL when address is not a multiple of system page size.
const size = 256 << 10 // size of memory region to allocate
p, err := mmap(nil, size, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
if err != 0 {
return
}
var n uintptr
for n = 4 << 10; n < size; n <<= 1 {
err := mincore(unsafe.Pointer(uintptr(p)+n), 1, &addrspace_vec[0])
if err == 0 {
physPageSize = n
break
}
}
if physPageSize == 0 {
physPageSize = size
}
munmap(p, size)
return
}
var buf [128]uintptr
n = read(fd, noescape(unsafe.Pointer(&buf[0])), int32(unsafe.Sizeof(buf)))
closefd(fd)
if n < 0 {
return
}
// Make sure buf is terminated, even if we didn't read
// the whole file.
buf[len(buf)-2] = _AT_NULL
sysauxv(buf[:])
}
//--to
func sysargs(argc int32, argv **byte) {
// argc/argv is not reliable on some machines.
// Skip analysing them.
// In some situations we don't get a loader-provided
// auxv, such as when loaded as a library on Android.
// Fall back to /proc/self/auxv.
fd := open(&procAuxv[0], 0 /* O_RDONLY */, 0)
if fd < 0 {
// On Android, /proc/self/auxv might be unreadable (issue 9229), so we fallback to
// try using mincore to detect the physical page size.
// mincore should return EINVAL when address is not a multiple of system page size.
const size = 256 << 10 // size of memory region to allocate
p, err := mmap(nil, size, _PROT_READ|_PROT_WRITE, _MAP_ANON|_MAP_PRIVATE, -1, 0)
if err != 0 {
return
}
var n uintptr
for n = 4 << 10; n < size; n <<= 1 {
err := mincore(unsafe.Pointer(uintptr(p)+n), 1, &addrspace_vec[0])
if err == 0 {
physPageSize = n
break
}
}
if physPageSize == 0 {
physPageSize = size
}
munmap(p, size)
return
}
var buf [128]uintptr
n := read(fd, noescape(unsafe.Pointer(&buf[0])), int32(unsafe.Sizeof(buf)))
closefd(fd)
if n < 0 {
return
}
// Make sure buf is terminated, even if we didn't read
// the whole file.
buf[len(buf)-2] = _AT_NULL
sysauxv(buf[:])
}
//--from
func getRandomData(r []byte) {
if startupRandomData != nil {
n := copy(r, startupRandomData)
extendRandom(r, n)
return
}
fd := open(&urandom_dev[0], 0 /* O_RDONLY */, 0)
n := read(fd, unsafe.Pointer(&r[0]), int32(len(r)))
closefd(fd)
extendRandom(r, int(n))
}
//--to
// Use getRandomData in os_plan9.go.
//go:nosplit
func getRandomData(r []byte) {
// inspired by wyrand see hash32.go for detail
t := nanotime()
v := getg().m.procid ^ uint64(t)
for len(r) > 0 {
v ^= 0xa0761d6478bd642f
v *= 0xe7037ed1a0b428db
size := 8
if len(r) < 8 {
size = len(r)
}
for i := 0; i < size; i++ {
r[i] = byte(v >> (8 * i))
}
r = r[size:]
v = v>>32 | v<<32
}
}
//--from
func gettid() uint32
//--to
//go:nosplit
//go:cgo_unsafe_args
func gettid() (tid uint32) {
libcCall(unsafe.Pointer(abi.FuncPCABI0(gettid_trampoline)), unsafe.Pointer(&tid))
return
}
func gettid_trampoline() uint32
//--from
//go:noescape
func sigaltstack(new, old *stackt)
//--to
func sigaltstack(new, old *stackt) {
// Do nothing.
}
//--from
func sigprocmask(how int32, new, old *sigset) {
rtsigprocmask(how, new, old, int32(unsafe.Sizeof(*new)))
}
//--to
func sigprocmask(how int32, new, old *sigset) {
// Do nothing.
// rtsigprocmask(how, new, old, int32(unsafe.Sizeof(*new)))
}
//--from
func raise(sig uint32)
//--to
func raise(sig uint32) {
// Do nothing
}
//--from
func raiseproc(sig uint32)
//--to
func raiseproc(sig uint32) {
// Do nothing
}
//--from
//go:noescape
func sched_getaffinity(pid, len uintptr, buf *byte) int32
//--to
//go:nosplit
//go:cgo_unsafe_args
func sched_getaffinity(pid, len uintptr, buf *byte) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(sched_getaffinity_trampoline)), unsafe.Pointer(&pid))
}
func sched_getaffinity_trampoline(pid, len uintptr, buf *byte) int32
//--from
func osyield()
//--to
//go:nosplit
//go:cgo_unsafe_args
func osyield() {
libcCall(unsafe.Pointer(abi.FuncPCABI0(osyield_trampoline)), nil)
}
func osyield_trampoline()
//--from
func sysSigaction(sig uint32, new, old *sigactiont) {
//--to
func sysSigaction(sig uint32, new, old *sigactiont) {
// Do nothing.
return
//--from
func signalM(mp *m, sig int) {
tgkill(getpid(), int(mp.procid), sig)
}
//--to
func signalM(mp *m, sig int) {
// Do nothiing.
}
//--from
func runPerThreadSyscall() {
gp := getg()
if gp.m.needPerThreadSyscall.Load() == 0 {
return
}
args := perThreadSyscall
r1, r2, errno := syscall.Syscall6(args.trap, args.a1, args.a2, args.a3, args.a4, args.a5, args.a6)
if GOARCH == "ppc64" || GOARCH == "ppc64le" {
// TODO(https://go.dev/issue/51192 ): ppc64 doesn't use r2.
r2 = 0
}
if errno != 0 || r1 != args.r1 || r2 != args.r2 {
print("trap:", args.trap, ", a123456=[", args.a1, ",", args.a2, ",", args.a3, ",", args.a4, ",", args.a5, ",", args.a6, "]\n")
print("results: got {r1=", r1, ",r2=", r2, ",errno=", errno, "}, want {r1=", args.r1, ",r2=", args.r2, ",errno=0}\n")
fatal("AllThreadsSyscall6 results differ between threads; runtime corrupted")
}
gp.m.needPerThreadSyscall.Store(0)
}
//--to
func runPerThreadSyscall() {
// Do nothing.
// needPerThreadSyscall should never be 1 as syscall_runtime_doAllThreadsSyscall is not available with Cgo.
}
//--append
//go:linkname hitsumabushi_closefd hitsumabushi_closefd
//go:cgo_import_static hitsumabushi_closefd
var hitsumabushi_closefd byte
//go:linkname hitsumabushi_exit hitsumabushi_exit
//go:cgo_import_static hitsumabushi_exit
var hitsumabushi_exit byte
//go:linkname hitsumabushi_gettid hitsumabushi_gettid
//go:cgo_import_static hitsumabushi_gettid
var hitsumabushi_gettid byte
//go:linkname hitsumabushi_nanotime1 hitsumabushi_nanotime1
//go:cgo_import_static hitsumabushi_nanotime1
var hitsumabushi_nanotime1 byte
//go:linkname hitsumabushi_open hitsumabushi_open
//go:cgo_import_static hitsumabushi_open
var hitsumabushi_open byte
//go:linkname hitsumabushi_osyield hitsumabushi_osyield
//go:cgo_import_static hitsumabushi_osyield
var hitsumabushi_osyield byte
//go:linkname hitsumabushi_read hitsumabushi_read
//go:cgo_import_static hitsumabushi_read
var hitsumabushi_read byte
//go:linkname hitsumabushi_sched_getaffinity hitsumabushi_sched_getaffinity
//go:cgo_import_static hitsumabushi_sched_getaffinity
var hitsumabushi_sched_getaffinity byte
//go:linkname hitsumabushi_usleep hitsumabushi_usleep
//go:cgo_import_static hitsumabushi_usleep
var hitsumabushi_usleep byte
//go:linkname hitsumabushi_walltime1 hitsumabushi_walltime1
//go:cgo_import_static hitsumabushi_walltime1
var hitsumabushi_walltime1 byte
//go:linkname hitsumabushi_write1 hitsumabushi_write1
//go:cgo_import_static hitsumabushi_write1
var hitsumabushi_write1 byte
//go:nosplit
//go:cgo_unsafe_args
func fcntl1(fd, cmd, arg int) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fcntl_trampoline)), unsafe.Pointer(&fd))
}
func fcntl_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func fstat1(fd int, stat unsafe.Pointer) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fstat_trampoline)), unsafe.Pointer(&fd))
}
func fstat_trampoline(fd int, stat unsafe.Pointer) int32
//go:nosplit
//go:cgo_unsafe_args
func lseek1(fd int, offset int64, whence int) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(lseek_trampoline)), unsafe.Pointer(&fd))
}
func lseek_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func renameat(fd1 int, name1 unsafe.Pointer, fd2 int, name2 unsafe.Pointer) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(renameat_trampoline)), unsafe.Pointer(&fd1))
}
func renameat_trampoline()
//go:nosplit
//go:cgo_unsafe_args
func fstatat(fd uintptr, name unsafe.Pointer, p unsafe.Pointer, n int32) int32 {
return libcCall(unsafe.Pointer(abi.FuncPCABI0(fstatat_trampoline)), unsafe.Pointer(&fd))
}
func fstatat_trampoline()
================================================
FILE: 1.20_linux/runtime/proc_test.go.patch
================================================
//--from
func TestGoroutineParallelism2(t *testing.T) {
//testGoroutineParallelism2(t, false, false)
testGoroutineParallelism2(t, true, false)
testGoroutineParallelism2(t, false, true)
testGoroutineParallelism2(t, true, true)
}
//--to
func TestGoroutineParallelism2(t *testing.T) {
//testGoroutineParallelism2(t, false, false)
testGoroutineParallelism2(t, true, false)
//testGoroutineParallelism2(t, false, true)
//testGoroutineParallelism2(t, true, true)
}
================================================
FILE: 1.20_linux/runtime/runtime1.go.patch
================================================
//--from
func argv_index(argv **byte, i int32) *byte {
return *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*goarch.PtrSize))
}
//--to
func argv_index(argv **byte, i int32) *byte {
return nil
}
//--from
func args(c int32, v **byte) {
argc = c
argv = v
sysargs(c, v)
}
//--to
func args(c int32, v **byte) {
// In the original code, physPageSize is determined at sysargs.
// Hitsumabushi gives an initial value for physPageSize at its declaration, so sysargs doesn't have to be called.
}
//--append
// Expose the entry point for some special environments.
//go:cgo_export_static _rt0_amd64_linux_lib
//go:cgo_export_dynamic _rt0_amd64_linux_lib
================================================
FILE: 1.20_linux/runtime/runtime_linux_test.go.patch
================================================
//--from
func TestMincoreErrorSign(t *testing.T) {
var dst byte
v := Mincore(Add(unsafe.Pointer(new(int32)), 1), 1, &dst)
const EINVAL = 0x16
if v != -EINVAL {
t.Errorf("mincore = %v, want %v", v, -EINVAL)
}
}
//--to
func TestMincoreErrorSign(t *testing.T) {
t.Skip("mincore is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/runtime_mmap_test.go.patch
================================================
//--from
//go:build unix
//--to
//go:build unix && !linux
================================================
FILE: 1.20_linux/runtime/runtime_test.go.patch
================================================
//--from
func testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {
if GOOS == "js" {
t.Skip("js does not support catching faults")
}
defer func() {
if err := recover(); err != nil {
*nfault++
}
}()
// The read should fault, except that sometimes we hit
// addresses that have had C or kernel pages mapped there
// readable by user code. So just log the content.
// If no addresses fault, we'll fail the test.
v := *(*byte)(unsafe.Pointer(addr))
t.Logf("addr %#x: %#x\n", addr, v)
}
//--to
func testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {
t.Skip("catching faults is not supported in this environment")
}
================================================
FILE: 1.20_linux/runtime/runtime_unix_test.go.patch
================================================
//--from
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || plan9
//--to
//go:build aix || darwin || dragonfly || freebsd || netbsd |
gitextract_v2i9lf6x/ ├── .github/ │ └── workflows/ │ └── test.yml ├── .gitignore ├── 1.19_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ └── testenv/ │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ └── big/ │ │ └── link_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ └── hitsumabushi_thread_linux.c │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_linux_test.go.patch │ │ ├── export_unix_test.go.patch │ │ ├── internal/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ └── syscall_linux.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── norace_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── proc_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ └── timestub2.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.19_windows/ │ ├── runtime/ │ │ ├── abi_test.go.patch │ │ ├── cgo/ │ │ │ ├── gcc_fatalf.c.patch │ │ │ ├── gcc_libinit.c.patch │ │ │ ├── gcc_libinit_windows.c.patch │ │ │ ├── gcc_windows_amd64.c.patch │ │ │ └── libcgo.h.patch │ │ ├── crash_test.go.patch │ │ ├── malloc_test.go.patch │ │ ├── os_windows.go.patch │ │ ├── syscall_windows.go.patch │ │ └── syscall_windows_test.go.patch │ └── sync/ │ └── mutex_test.go.patch ├── 1.20_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ └── big/ │ │ └── link_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_unix_test.go │ │ ├── internal/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── norace_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── proc_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ └── timestub2.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.20_windows/ │ ├── runtime/ │ │ ├── abi_test.go.patch │ │ ├── cgo/ │ │ │ └── gcc_windows_amd64.c.patch │ │ ├── crash_test.go.patch │ │ ├── malloc_test.go.patch │ │ ├── os_windows.go.patch │ │ ├── syscall_windows.go.patch │ │ └── syscall_windows_test.go.patch │ └── sync/ │ └── mutex_test.go.patch ├── 1.21_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_unix_test.go │ │ ├── internal/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── norace_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.21_windows/ │ ├── runtime/ │ │ ├── abi_test.go.patch │ │ ├── cgo/ │ │ │ └── gcc_windows_amd64.c.patch │ │ ├── crash_test.go.patch │ │ ├── malloc_test.go.patch │ │ ├── os_windows.go.patch │ │ ├── runtime-gdb_test.go.patch │ │ ├── syscall_windows.go.patch │ │ └── syscall_windows_test.go.patch │ └── sync/ │ └── mutex_test.go.patch ├── 1.22_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_unix_test.go │ │ ├── fds_unix.go.patch │ │ ├── internal/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── metrics_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── norace_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── rand_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.22_windows/ │ ├── internal/ │ │ └── testenv/ │ │ ├── exec.go.patch │ │ └── testenv.go.patch │ └── runtime/ │ ├── cgo/ │ │ ├── gcc_windows_amd64.c.patch │ │ └── libcgo.h.patch │ ├── os_windows.go.patch │ ├── signal_windows.go.patch │ ├── syscall_windows.go.patch │ └── syscall_windows_test.go.patch ├── 1.23_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── runtime/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_unix_test.go │ │ ├── fds_unix.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── metrics_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── norace_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── rand_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.23_windows/ │ ├── internal/ │ │ └── testenv/ │ │ ├── exec.go.patch │ │ └── testenv.go.patch │ └── runtime/ │ ├── cgo/ │ │ ├── gcc_windows_amd64.c.patch │ │ └── libcgo.h.patch │ ├── os_windows.go.patch │ ├── signal_windows.go.patch │ ├── syscall_windows.go.patch │ └── syscall_windows_test.go.patch ├── 1.24_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── runtime/ │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ └── panic_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── export_unix_test.go │ │ ├── fds_unix.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── metrics_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── nosan_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── rand_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.24_windows/ │ ├── internal/ │ │ └── testenv/ │ │ ├── exec.go.patch │ │ └── testenv.go.patch │ └── runtime/ │ ├── cgo/ │ │ ├── gcc_windows_amd64.c.patch │ │ └── libcgo.h.patch │ ├── os_windows.go.patch │ ├── signal_windows.go.patch │ ├── syscall_windows.go.patch │ └── syscall_windows_test.go.patch ├── 1.25_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── runtime/ │ │ │ ├── cgroup/ │ │ │ │ └── cgroup_linux.go.patch │ │ │ └── syscall/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ ├── panic_test.go.patch │ │ │ └── stack_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── decoratemappings_test.go.patch │ │ ├── export_unix_test.go │ │ ├── fds_unix.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── metrics_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── nosan_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── rand_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── strconv/ │ │ └── fp_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.25_windows/ │ ├── internal/ │ │ └── testenv/ │ │ ├── exec.go.patch │ │ └── testenv.go.patch │ └── runtime/ │ ├── cgo/ │ │ ├── gcc_windows_amd64.c.patch │ │ └── libcgo.h.patch │ ├── os_windows.go.patch │ ├── signal_windows.go.patch │ ├── syscall_windows.go.patch │ └── syscall_windows_test.go.patch ├── 1.26_linux/ │ ├── internal/ │ │ ├── reflectlite/ │ │ │ └── reflect_mirror_test.go.patch │ │ ├── runtime/ │ │ │ ├── cgroup/ │ │ │ │ └── cgroup_linux.go.patch │ │ │ └── syscall/ │ │ │ └── linux/ │ │ │ ├── asm_linux_amd64.s.patch │ │ │ ├── asm_linux_arm64.s.patch │ │ │ ├── syscall_linux.go.patch │ │ │ └── syscall_linux_test.go.patch │ │ ├── strconv/ │ │ │ └── fp_test.go.patch │ │ ├── syscall/ │ │ │ └── unix/ │ │ │ └── fcntl_unix.go.patch │ │ └── testenv/ │ │ ├── exec.go.patch │ │ ├── testenv.go.patch │ │ ├── testenv_notunix.go.patch │ │ └── testenv_unix.go.patch │ ├── math/ │ │ ├── big/ │ │ │ └── link_test.go.patch │ │ └── rand/ │ │ └── default_test.go.patch │ ├── runtime/ │ │ ├── align_test.go.patch │ │ ├── asm_arm64.s.patch │ │ ├── callers_test.go.patch │ │ ├── cgo/ │ │ │ ├── cgo.go.patch │ │ │ ├── gcc_clearenv.c.patch │ │ │ ├── gcc_linux_amd64.c.patch │ │ │ ├── gcc_linux_arm64.c.patch │ │ │ ├── gcc_setenv.c.patch │ │ │ ├── gcc_sigaction.c.patch │ │ │ ├── hitsumabushi_clock_linux.c │ │ │ ├── hitsumabushi_cpu_linux.c │ │ │ ├── hitsumabushi_filesystem_linux.c │ │ │ ├── hitsumabushi_futex_linux.c │ │ │ ├── hitsumabushi_mem_linux.c │ │ │ ├── hitsumabushi_syscalls_linux.c │ │ │ ├── hitsumabushi_thread_linux.c │ │ │ ├── linux_syscall.c.patch │ │ │ └── sigaction.go.patch │ │ ├── crash_test.go.patch │ │ ├── crash_unix_test.go.patch │ │ ├── debug/ │ │ │ ├── heapdump_test.go.patch │ │ │ ├── panic_test.go.patch │ │ │ └── stack_test.go.patch │ │ ├── debug_test.go.patch │ │ ├── decoratemappings_test.go.patch │ │ ├── export_unix_test.go │ │ ├── fds_unix.go.patch │ │ ├── mem_linux.go │ │ ├── memmove_linux_amd64_test.go.patch │ │ ├── metrics_test.go.patch │ │ ├── nbpipe_pipe2.go.patch │ │ ├── nbpipe_test.go.patch │ │ ├── netpoll_epoll.go.patch │ │ ├── netpoll_fake.go.patch │ │ ├── nosan_linux_test.go.patch │ │ ├── os_linux.go.patch │ │ ├── os_linux64.go.patch │ │ ├── panicnil_test.go.patch │ │ ├── proc_test.go.patch │ │ ├── rand_test.go.patch │ │ ├── runtime1.go.patch │ │ ├── runtime_linux_test.go.patch │ │ ├── runtime_mmap_test.go.patch │ │ ├── runtime_test.go.patch │ │ ├── runtime_unix_test.go.patch │ │ ├── stack_test.go.patch │ │ ├── stubs2.go.patch │ │ ├── stubs3.go.patch │ │ ├── sys_libc.go.patch │ │ ├── sys_linux_amd64.s.patch │ │ ├── sys_linux_arm64.s.patch │ │ ├── time_linux_amd64.s.patch │ │ ├── timeasm.go.patch │ │ ├── timestub.go.patch │ │ ├── timestub2.go.patch │ │ └── traceback_test.go.patch │ ├── sync/ │ │ └── atomic/ │ │ └── atomic_test.go.patch │ ├── syscall/ │ │ ├── hitsumabushi_stubs_linux_amd64.go │ │ ├── hitsumabushi_stubs_linux_arm64.go │ │ ├── rlimit.go.patch │ │ └── syscall_linux.go.patch │ ├── testing/ │ │ └── run_example.go │ └── time/ │ ├── format_test.go.patch │ ├── internal_test.go.patch │ ├── sleep_test.go.patch │ ├── time_test.go.patch │ ├── tzdata_test.go.patch │ ├── zoneinfo_test.go.patch │ ├── zoneinfo_unix.go.patch │ └── zoneinfo_unix_test.go.patch ├── 1.26_windows/ │ ├── internal/ │ │ └── testenv/ │ │ ├── exec.go.patch │ │ └── testenv.go.patch │ └── runtime/ │ ├── cgo/ │ │ ├── gcc_windows_amd64.c.patch │ │ └── libcgo.h.patch │ ├── os_windows.go.patch │ ├── signal_windows.go.patch │ ├── syscall_windows.go.patch │ └── syscall_windows_test.go.patch ├── LICENSE ├── README.md ├── doc.go ├── example/ │ └── helloworld/ │ ├── .gitignore │ ├── genoverlayjson.go │ ├── main.c │ ├── main.go │ ├── run.sh │ └── run_cross.sh ├── go.mod ├── overlay.go ├── patch.go └── test.go
SYMBOL INDEX (635 symbols across 101 files)
FILE: 1.19_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.19_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.19_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 61) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 77) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 89) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 98) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 117) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 126) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 148) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 153) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 164) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 170) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 176) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.19_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 82) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.19_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.19_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 19) | typedef unsigned int gid_t;
type timespec (line 21) | struct timespec
function munmap (line 29) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 34) | int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) {
function setegid (line 39) | int setegid(gid_t gid) {
function seteuid (line 44) | int seteuid(uid_t gid) {
function setgid (line 49) | int setgid(gid_t gid) {
function setgroups (line 54) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 59) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 64) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 69) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 74) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 79) | int setuid(uid_t gid) {
function sigaction (line 84) | int sigaction(int signum, const struct sigaction *act, struct sigaction ...
function sigaddset (line 89) | int sigaddset(sigset_t *set, int signum) {
function sigemptyset (line 94) | int sigemptyset(sigset_t *set) {
function sigfillset (line 99) | int sigfillset(sigset_t *set) {
function sigismember (line 104) | int sigismember(const sigset_t *set, int signum) {
function hitsumabushi_gettid (line 109) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 115) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 121) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 125) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 135) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 139) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 146) | void hitsumabushi_exit(int32_t code) {
FILE: 1.19_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.19_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysFreeOS (line 52) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 55) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 59) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 62) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 66) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 70) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 74) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 77) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.19_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.19_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.19_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.20_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.20_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.20_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 61) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 77) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 89) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 98) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 117) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 126) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 148) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 153) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 164) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 170) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 176) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.20_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 82) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.20_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.20_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.20_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.20_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.20_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysFreeOS (line 52) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 55) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 59) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 62) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 66) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 70) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 74) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 77) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.20_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.20_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.20_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.21_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.21_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.21_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 61) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 77) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 89) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 98) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 117) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 126) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 148) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 153) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 164) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 170) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 176) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.21_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 82) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.21_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.21_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.21_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.21_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.21_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 47) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 50) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 58) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 61) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 65) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 68) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 72) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 76) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 80) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 83) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.21_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.21_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.21_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.22_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.22_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.22_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 61) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 77) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 89) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 98) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 117) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 126) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 148) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 153) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 164) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 170) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 176) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.22_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 82) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.22_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.22_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.22_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.22_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.22_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 47) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 50) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 58) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 61) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 65) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 68) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 72) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 76) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 80) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 83) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.22_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.22_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.22_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.23_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.23_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.23_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 63) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 82) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 95) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 104) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 124) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 134) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 156) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 161) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 172) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 178) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 184) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.23_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 83) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.23_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.23_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.23_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.23_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.23_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 47) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 50) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 58) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 61) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 65) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 68) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 72) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 76) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 80) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 83) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.23_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.23_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.23_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.24_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.24_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.24_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 63) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 82) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 95) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 104) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 124) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 134) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 157) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 162) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 173) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 179) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 185) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.24_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 83) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.24_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 35) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.24_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.24_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.24_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.24_linux/runtime/mem_linux.go
function sysAllocOS (line 20) | func sysAllocOS(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 24) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 28) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 31) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 35) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 38) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 42) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 45) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 47) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 50) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 58) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 61) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 65) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 68) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 72) | func sysReserveOS(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 76) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 80) | func sysMapOS(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 83) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.24_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.24_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.24_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.25_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.25_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.25_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 63) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 82) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 95) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 104) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 124) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 134) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 157) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 162) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 173) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 179) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 185) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.25_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 83) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.25_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 39) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.25_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.25_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.25_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.25_linux/runtime/mem_linux.go
constant _EINVAL (line 16) | _EINVAL = 22
function sysAllocOS (line 23) | func sysAllocOS(n uintptr, vmaName string) (ptr unsafe.Pointer) {
function sysAllocOSImpl (line 29) | func sysAllocOSImpl(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 33) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 37) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 40) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 44) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 47) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 51) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 54) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 56) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 59) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 67) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 70) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 74) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 77) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 80) | func sysReserveOS(v unsafe.Pointer, n uintptr, vmaName string) (ptr unsa...
function sysReserveOSImpl (line 86) | func sysReserveOSImpl(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 90) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 93) | func sysMapOS(v unsafe.Pointer, n uintptr, vmaName string) {
function sysMapOSImpl (line 99) | func sysMapOSImpl(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 102) | func sysMapOS_trampoline(n uintptr, size uintptr)
FILE: 1.25_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.25_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.25_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: 1.26_linux/runtime/cgo/hitsumabushi_clock_linux.c
function hitsumabushi_clock_gettime (line 6) | int hitsumabushi_clock_gettime(clockid_t clk_id, struct timespec *tp) {
FILE: 1.26_linux/runtime/cgo/hitsumabushi_cpu_linux.c
function hitsumabushi_getproccount (line 6) | int32_t hitsumabushi_getproccount() {
FILE: 1.26_linux/runtime/cgo/hitsumabushi_filesystem_linux.c
type pseudo_file (line 19) | typedef struct {
function pthread_mutex_t (line 29) | static pthread_mutex_t* pseudo_file_mutex() {
function open_pseudo_file (line 34) | static int32_t open_pseudo_file(const void* content, size_t content_size) {
function read_pseudo_file (line 63) | static size_t read_pseudo_file(int32_t fd, void *p, int32_t n) {
function close_pseudo_file (line 82) | static void close_pseudo_file(int32_t fd) {
function hitsumabushi_closefd (line 95) | int32_t hitsumabushi_closefd(int32_t fd) {
function hitsumabushi_open (line 104) | int32_t hitsumabushi_open(char *name, int32_t mode, int32_t perm) {
function hitsumabushi_read (line 124) | int32_t hitsumabushi_read(int32_t fd, void *p, int32_t n) {
function hitsumabushi_write1 (line 134) | int32_t hitsumabushi_write1(uintptr_t fd, void *p, int32_t n) {
function hitsumabushi_lseek (line 157) | int32_t hitsumabushi_lseek(uintptr_t fd, off_t offset, int32_t whence) {
function hitsumabushi_fcntl (line 162) | int32_t hitsumabushi_fcntl(int32_t fd, int32_t cmd, int32_t arg)
function hitsumabushi_fstat (line 173) | int32_t hitsumabushi_fstat(int32_t fd, struct stat *stat)
function hitsumabushi_renameat (line 179) | int32_t hitsumabushi_renameat(int32_t fd1, char* name1, int32_t fd2, cha...
function hitsumabushi_fstatat (line 185) | int32_t hitsumabushi_fstatat(int32_t fd, char* name, struct stat* p, int...
FILE: 1.26_linux/runtime/cgo/hitsumabushi_futex_linux.c
function pseudo_futex (line 13) | static void pseudo_futex(uint32_t *uaddr, int mode, uint32_t val, const ...
function hitsumabushi_futex (line 83) | int32_t hitsumabushi_futex(uint32_t *uaddr, int32_t futex_op, uint32_t val,
FILE: 1.26_linux/runtime/cgo/hitsumabushi_mem_linux.c
function hitsumabushi_sysUnusedOS (line 13) | void hitsumabushi_sysUnusedOS(void* v, uintptr_t n) {
function hitsumabushi_sysUsedOS (line 16) | void hitsumabushi_sysUsedOS(void* v, uintptr_t n) {
function hitsumabushi_sysHugePageOS (line 19) | void hitsumabushi_sysHugePageOS(void* v, uintptr_t n) {
function hitsumabushi_sysFreeOS (line 22) | void hitsumabushi_sysFreeOS(void* v, uintptr_t n) {
function hitsumabushi_sysFaultOS (line 25) | void hitsumabushi_sysFaultOS(void* v, uintptr_t n) {
function hitsumabushi_sysMapOS (line 39) | void hitsumabushi_sysMapOS(void* v, uintptr_t n) {
FILE: 1.26_linux/runtime/cgo/hitsumabushi_syscalls_linux.c
type gid_t (line 17) | typedef unsigned int gid_t;
type timespec (line 19) | struct timespec
function munmap (line 27) | int munmap(void *addr, size_t length) {
function pthread_sigmask (line 32) | int pthread_sigmask(int how, void *set, void *oldset) {
function setegid (line 37) | int setegid(gid_t gid) {
function seteuid (line 42) | int seteuid(uid_t gid) {
function setgid (line 47) | int setgid(gid_t gid) {
function setgroups (line 52) | int setgroups(size_t size, const gid_t *list) {
function setregid (line 57) | int setregid(gid_t rgid, gid_t egid) {
function setreuid (line 62) | int setreuid(uid_t ruid, uid_t euid) {
function setresgid (line 67) | int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
function setresuid (line 72) | int setresuid(uid_t ruid, uid_t euid, uid_t suid) {
function setuid (line 77) | int setuid(uid_t gid) {
function sigaction (line 82) | int sigaction(int signum, void *act, void *oldact) {
function sigaddset (line 87) | int sigaddset(void *set, int signum) {
function sigemptyset (line 92) | int sigemptyset(void *set) {
function sigfillset (line 97) | int sigfillset(void *set) {
function sigismember (line 102) | int sigismember(void *set, int signum) {
function hitsumabushi_gettid (line 107) | uint32_t hitsumabushi_gettid() {
function hitsumabushi_nanotime1 (line 113) | int64_t hitsumabushi_nanotime1() {
function hitsumabushi_osyield (line 119) | int32_t hitsumabushi_osyield() {
function hitsumabushi_sched_getaffinity (line 123) | int32_t hitsumabushi_sched_getaffinity(pid_t pid, size_t cpusetsize, voi...
function hitsumabushi_usleep (line 133) | void hitsumabushi_usleep(useconds_t usec) {
function hitsumabushi_walltime1 (line 137) | void hitsumabushi_walltime1(int64_t* sec, int32_t* nsec) {
function hitsumabushi_exit (line 144) | void hitsumabushi_exit(int32_t code) {
FILE: 1.26_linux/runtime/cgo/hitsumabushi_thread_linux.c
function hitsumabushi_initializeThread (line 1) | void hitsumabushi_initializeThread(void) {
FILE: 1.26_linux/runtime/export_unix_test.go
constant O_WRONLY (line 10) | O_WRONLY = _O_WRONLY
constant O_CREAT (line 11) | O_CREAT = _O_CREAT
constant O_TRUNC (line 12) | O_TRUNC = _O_TRUNC
FILE: 1.26_linux/runtime/mem_linux.go
constant _EINVAL (line 16) | _EINVAL = 22
function sysAllocOS (line 23) | func sysAllocOS(n uintptr, vmaName string) (ptr unsafe.Pointer) {
function sysAllocOSImpl (line 29) | func sysAllocOSImpl(n uintptr) (ptr unsafe.Pointer) {
function sysAllocOS_trampoline (line 33) | func sysAllocOS_trampoline(n uintptr, size uintptr) uintptr
function sysUnusedOS (line 37) | func sysUnusedOS(v unsafe.Pointer, n uintptr) {
function sysUnusedOS_trampoline (line 40) | func sysUnusedOS_trampoline(n uintptr, size uintptr)
function sysUsedOS (line 44) | func sysUsedOS(v unsafe.Pointer, n uintptr) {
function sysUsedOS_trampoline (line 47) | func sysUsedOS_trampoline(n uintptr, size uintptr)
function sysHugePageOS (line 51) | func sysHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageOS_trampoline (line 54) | func sysHugePageOS_trampoline(n uintptr, size uintptr)
function sysNoHugePageOS (line 56) | func sysNoHugePageOS(v unsafe.Pointer, n uintptr) {
function sysHugePageCollapseOS (line 59) | func sysHugePageCollapseOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS (line 67) | func sysFreeOS(v unsafe.Pointer, n uintptr) {
function sysFreeOS_trampoline (line 70) | func sysFreeOS_trampoline(n uintptr, size uintptr)
function sysFaultOS (line 74) | func sysFaultOS(v unsafe.Pointer, n uintptr) {
function sysFaultOS_trampoline (line 77) | func sysFaultOS_trampoline(n uintptr, size uintptr)
function sysReserveOS (line 80) | func sysReserveOS(v unsafe.Pointer, n uintptr, vmaName string) (ptr unsa...
function sysReserveOSImpl (line 86) | func sysReserveOSImpl(v unsafe.Pointer, n uintptr) (ptr unsafe.Pointer) {
function sysReserveOS_trampoline (line 90) | func sysReserveOS_trampoline(n uintptr, size uintptr) uintptr
function sysMapOS (line 93) | func sysMapOS(v unsafe.Pointer, n uintptr, vmaName string) {
function sysMapOSImpl (line 99) | func sysMapOSImpl(v unsafe.Pointer, n uintptr) {
function sysMapOS_trampoline (line 102) | func sysMapOS_trampoline(n uintptr, size uintptr)
function needZeroAfterSysUnusedOS (line 104) | func needZeroAfterSysUnusedOS() bool {
FILE: 1.26_linux/syscall/hitsumabushi_stubs_linux_amd64.go
constant SYS_FSTATAT (line 7) | SYS_FSTATAT = 0xffffffffffffffff
FILE: 1.26_linux/syscall/hitsumabushi_stubs_linux_arm64.go
constant SYS_NEWFSTATAT (line 7) | SYS_NEWFSTATAT = 0xffffffffffffffff
FILE: 1.26_linux/testing/run_example.go
function runExample (line 3) | func runExample(eg InternalExample) (ok bool) {
FILE: example/helloworld/genoverlayjson.go
function main (line 15) | func main() {
function build (line 22) | func build() error {
FILE: example/helloworld/main.c
function main (line 7) | int main() {
FILE: example/helloworld/main.go
function HelloWorld (line 8) | func HelloWorld() {
function main (line 12) | func main() {
FILE: overlay.go
type Option (line 25) | type Option
type replaceString (line 27) | type replaceString struct
type config (line 32) | type config struct
function TestPkg (line 44) | func TestPkg(pkg string) Option {
function OverlayDir (line 51) | func OverlayDir(dir string) Option {
function Args (line 59) | func Args(args ...string) Option {
function GOOS (line 67) | func GOOS(os string) Option {
function PageSize (line 77) | func PageSize(pageSize int) Option {
function ReplaceDLL (line 86) | func ReplaceDLL(from, to string) Option {
function Overlay (line 96) | func Overlay(from, to string) Option {
function goVersion (line 112) | func goVersion() string {
function goMajorMinorVersion (line 117) | func goMajorMinorVersion() (int, int) {
function GenOverlayJSON (line 128) | func GenOverlayJSON(options ...Option) ([]byte, error) {
function goPkgDir (line 529) | func goPkgDir(pkg string, goos string) (string, error) {
function goExternalTestFile (line 541) | func goExternalTestFile(pkg string) (string, error) {
function goPkgName (line 564) | func goPkgName(pkg string) (string, error) {
function replace (line 575) | func replace(tmpDir string, replaces map[string]string, pkg string, file...
function utf16FromString (line 618) | func utf16FromString(s string) ([]uint16, error) {
function replacementFilePath (line 627) | func replacementFilePath(fn, pkg, os, file string) (string, error) {
function ClockFilePath (line 660) | func ClockFilePath(os string) (string, error) {
function FutexFilePath (line 672) | func FutexFilePath(os string) (string, error) {
function FilesystemFilePath (line 692) | func FilesystemFilePath(os string) (string, error) {
function MemoryFilePath (line 715) | func MemoryFilePath(os string) (string, error) {
function CPUFilePath (line 727) | func CPUFilePath(os string) (string, error) {
function ThreadFilePath (line 731) | func ThreadFilePath(os string) (string, error) {
FILE: patch.go
type patch (line 14) | type patch struct
method apply (line 90) | func (p *patch) apply(r io.Reader) (io.Reader, error) {
function parsePatch (line 20) | func parsePatch(name string, r io.Reader) (*patch, error) {
FILE: test.go
function main (line 25) | func main() {
function run (line 34) | func run() error {
function createJSON (line 60) | func createJSON(args []string) (string, error) {
function buildTestBinary (line 87) | func buildTestBinary(jsonPath string, args []string) error {
function runTestBinary (line 130) | func runTestBinary(dir string) error {
function isSpaceByte (line 158) | func isSpaceByte(c byte) bool {
function splitArgs (line 162) | func splitArgs(s string) ([]string, error) {
function pkgDir (line 200) | func pkgDir(pkg string) (string, error) {
Condensed preview — 694 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (958K chars).
[
{
"path": ".github/workflows/test.yml",
"chars": 7996,
"preview": "name: Test\n\non: [push, pull_request]\n\njobs:\n test:\n strategy:\n matrix:\n os: [ubuntu-latest, windows-late"
},
{
"path": ".gitignore",
"chars": 17,
"preview": "*~\n.DS_Store\n*.a\n"
},
{
"path": "1.19_linux/internal/reflectlite/reflect_mirror_test.go.patch",
"chars": 175,
"preview": "//--from\nfunc TestMirrorWithReflect(t *testing.T) {\n//--to\nfunc TestMirrorWithReflect(t *testing.T) {\n t.Skip(\"fil"
},
{
"path": "1.19_linux/internal/testenv/testenv.go.patch",
"chars": 579,
"preview": "//--from\nfunc HasGoBuild() bool {\n\tif os.Getenv(\"GO_GCFLAGS\") != \"\" {\n\t\t// It's too much work to require every caller of"
},
{
"path": "1.19_linux/internal/testenv/testenv_notunix.go.patch",
"chars": 113,
"preview": "//--from\n//go:build windows || plan9 || (js && wasm)\n//--to\n//go:build windows || plan9 || (js && wasm) || linux\n"
},
{
"path": "1.19_linux/internal/testenv/testenv_unix.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.19_linux/math/big/link_test.go.patch",
"chars": 1290,
"preview": "//--from\nimport (\n\t\"bytes\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\""
},
{
"path": "1.19_linux/runtime/align_test.go.patch",
"chars": 2689,
"preview": "//--from\nimport (\n\t\"bytes\"\n\t\"go/ast\"\n\t\"go/build\"\n\t\"go/importer\"\n\t\"go/parser\"\n\t\"go/printer\"\n\t\"go/token\"\n\t\"go/types\"\n\t\"os\""
},
{
"path": "1.19_linux/runtime/callers_test.go.patch",
"chars": 2784,
"preview": "//--from\nfunc TestCallersNilPointerPanic(t *testing.T) {\n\t// Make sure we don't have any extra frames on the stack (due "
},
{
"path": "1.19_linux/runtime/cgo/cgo.go.patch",
"chars": 152,
"preview": "//--from\n*/\nimport \"C\"\n//--to\n#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all\n#cgo darwin LDFLAGS: -Wl,-undefin"
},
{
"path": "1.19_linux/runtime/cgo/gcc_linux_arm64.c.patch",
"chars": 3695,
"preview": "//--from\nvoid\n_cgo_sys_thread_start(ThreadStart *ts)\n{\n\tpthread_attr_t attr;\n\tsigset_t ign, oset;\n\tpthread_t p;\n\tsize_t "
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_clock_linux.c",
"chars": 226,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <time.h>\n\nint "
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_cpu_linux.c",
"chars": 169,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n\nin"
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_filesystem_linux.c",
"chars": 4950,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_futex_linux.c",
"chars": 2936,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <errno.h>\n#inc"
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_mem_linux.c",
"chars": 736,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n#in"
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_syscalls_linux.c",
"chars": 3092,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.19_linux/runtime/cgo/hitsumabushi_thread_linux.c",
"chars": 45,
"preview": "void hitsumabushi_initializeThread(void) {\n}\n"
},
{
"path": "1.19_linux/runtime/crash_test.go.patch",
"chars": 2870,
"preview": "//--from\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"ru"
},
{
"path": "1.19_linux/runtime/crash_unix_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.19_linux/runtime/debug/heapdump_test.go.patch",
"chars": 2060,
"preview": "//--from\nimport (\n\t\"os\"\n\t\"runtime\"\n\t. \"runtime/debug\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestWriteH"
},
{
"path": "1.19_linux/runtime/debug/panic_test.go.patch",
"chars": 1312,
"preview": "//--from\nimport (\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"syscall\"\n\t\"testing\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfu"
},
{
"path": "1.19_linux/runtime/debug_test.go.patch",
"chars": 80,
"preview": "//--from\n//go:build (amd64 || arm64) && linux && !race\n//--to\n//go:build ignore\n"
},
{
"path": "1.19_linux/runtime/export_linux_test.go.patch",
"chars": 161,
"preview": "//--from\nimport \"unsafe\"\n//--to\n//--from\nfunc Epollctl(epfd, op, fd int32, ev unsafe.Pointer) int32 {\n\treturn epollctl(e"
},
{
"path": "1.19_linux/runtime/export_unix_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.19_linux/runtime/internal/syscall/asm_linux_amd64.s.patch",
"chars": 402,
"preview": "//--from\nTEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0\n\t// a6 already in R9.\n\t// a5 already in R8.\n\tMOVQ\tSI, R10 // a4\n\tMOV"
},
{
"path": "1.19_linux/runtime/internal/syscall/asm_linux_arm64.s.patch",
"chars": 399,
"preview": "//--from\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tMOVD\tnum+0(FP), R8\t// syscall entry\n\tMOVD\ta1+8(FP), R0\n\tMOVD\ta2+16(FP), R1\n\tM"
},
{
"path": "1.19_linux/runtime/internal/syscall/syscall_linux.go.patch",
"chars": 636,
"preview": "//--from\nfunc Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)\n//--to\nfunc Syscall6(num, a1, a2, a3"
},
{
"path": "1.19_linux/runtime/mem_linux.go",
"chars": 2425,
"preview": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "1.19_linux/runtime/memmove_linux_amd64_test.go.patch",
"chars": 159,
"preview": "//--from\nfunc TestMemmoveOverflow(t *testing.T) {\n//--to\nfunc TestMemmoveOverflow(t *testing.T) {\n\tt.Skip(\"file is not s"
},
{
"path": "1.19_linux/runtime/nbpipe_pipe2.go.patch",
"chars": 153,
"preview": "//--from\n//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris\n//--to\n//go:build dragonfly || freebsd"
},
{
"path": "1.19_linux/runtime/nbpipe_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.19_linux/runtime/netpoll_epoll.go.patch",
"chars": 51,
"preview": "//--from\n//go:build linux\n//--to\n//go:build ignore\n"
},
{
"path": "1.19_linux/runtime/netpoll_fake.go.patch",
"chars": 55,
"preview": "//--from\n//go:build js && wasm\n//--to\n//go:build linux\n"
},
{
"path": "1.19_linux/runtime/norace_linux_test.go.patch",
"chars": 589,
"preview": "//--from\nimport (\n\t\"internal/abi\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc T"
},
{
"path": "1.19_linux/runtime/os_linux.go.patch",
"chars": 9023,
"preview": "//--from\nimport (\n\t\"internal/abi\"\n\t\"internal/goarch\"\n\t\"runtime/internal/atomic\"\n\t\"runtime/internal/syscall\"\n\t\"unsafe\"\n)\n"
},
{
"path": "1.19_linux/runtime/proc_test.go.patch",
"chars": 466,
"preview": "//--from\nfunc TestGoroutineParallelism2(t *testing.T) {\n\t//testGoroutineParallelism2(t, false, false)\n\ttestGoroutinePara"
},
{
"path": "1.19_linux/runtime/runtime1.go.patch",
"chars": 493,
"preview": "//--from\nfunc argv_index(argv **byte, i int32) *byte {\n\treturn *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*goarch.Ptr"
},
{
"path": "1.19_linux/runtime/runtime_linux_test.go.patch",
"chars": 635,
"preview": "//--from\nfunc TestMincoreErrorSign(t *testing.T) {\n\tvar dst byte\n\tv := Mincore(Add(unsafe.Pointer(new(int32)), 1), 1, &d"
},
{
"path": "1.19_linux/runtime/runtime_mmap_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.19_linux/runtime/runtime_test.go.patch",
"chars": 654,
"preview": "//--from\nfunc testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {\n\tif GOOS == \"js\" {\n\t\tt.Skip(\"js does not su"
},
{
"path": "1.19_linux/runtime/runtime_unix_test.go.patch",
"chars": 183,
"preview": "//--from\n//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || plan9\n//--to\n//go:build aix |"
},
{
"path": "1.19_linux/runtime/stack_test.go.patch",
"chars": 1739,
"preview": "//--from\nfunc TestDeferLeafSigpanic(t *testing.T) {\n\t// Push a defer that will walk the stack.\n\tdefer func() {\n\t\tif err "
},
{
"path": "1.19_linux/runtime/stubs2.go.patch",
"chars": 1999,
"preview": "//--from\nimport (\n\t\"runtime/internal/atomic\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"internal/abi\"\n\t\"runtime/internal/atomic\"\n\t\"un"
},
{
"path": "1.19_linux/runtime/stubs3.go.patch",
"chars": 320,
"preview": "//--from\npackage runtime\n//--to\npackage runtime\n\nimport (\n\t\"internal/abi\"\n\t\"unsafe\"\n)\n//--from\nfunc nanotime1() int64\n//"
},
{
"path": "1.19_linux/runtime/sys_libc.go.patch",
"chars": 109,
"preview": "//--from\n//go:build darwin || (openbsd && !mips64)\n//--to\n//go:build darwin || (openbsd && !mips64) || linux\n"
},
{
"path": "1.19_linux/runtime/sys_linux_amd64.s.patch",
"chars": 9821,
"preview": "//--from\nTEXT runtime·open(SB),NOSPLIT,$0-20\n\t// This uses openat instead of open, because Android O blocks open.\n\tMOVL\t"
},
{
"path": "1.19_linux/runtime/sys_linux_arm64.s.patch",
"chars": 11998,
"preview": "//--from\n#define SYS_exit\t\t93\n#define SYS_read\t\t63\n#define SYS_write\t\t64\n#define SYS_openat\t\t56\n#define SYS_close\t\t57\n#d"
},
{
"path": "1.19_linux/runtime/time_linux_amd64.s.patch",
"chars": 55,
"preview": "//--from\n//go:build !faketime\n//--to\n//go:build ignore\n"
},
{
"path": "1.19_linux/runtime/timeasm.go.patch",
"chars": 102,
"preview": "//--from\n//go:build !faketime && (windows || (linux && amd64))\n//--to\n//go:build !faketime && windows\n"
},
{
"path": "1.19_linux/runtime/timestub.go.patch",
"chars": 103,
"preview": "//--from\n//go:build !faketime && !windows && !(linux && amd64)\n//--to\n//go:build !faketime && !windows\n"
},
{
"path": "1.19_linux/runtime/timestub2.go.patch",
"chars": 620,
"preview": "//--from\n//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows && !(linux && amd64)\n//--to\n//go:bui"
},
{
"path": "1.19_linux/strconv/fp_test.go.patch",
"chars": 1321,
"preview": "//--from\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"testi"
},
{
"path": "1.19_linux/sync/atomic/atomic_test.go.patch",
"chars": 4836,
"preview": "//--from\nfunc TestStoreLoadSeqCst32(t *testing.T) {\n\tif runtime.NumCPU() == 1 {\n\t\tt.Skipf(\"Skipping test on %v processor"
},
{
"path": "1.19_linux/syscall/hitsumabushi_stubs_linux_amd64.go",
"chars": 207,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\npackage syscall\n\nconst "
},
{
"path": "1.19_linux/syscall/hitsumabushi_stubs_linux_arm64.go",
"chars": 207,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\npackage syscall\n\nconst "
},
{
"path": "1.19_linux/syscall/rlimit.go.patch",
"chars": 252,
"preview": "//--from\nfunc init() {\n\tvar lim Rlimit\n\tif err := Getrlimit(RLIMIT_NOFILE, &lim); err == nil && lim.Cur != lim.Max {\n\t\to"
},
{
"path": "1.19_linux/syscall/syscall_linux.go.patch",
"chars": 4048,
"preview": "//--from\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {\n\treturn RawSyscall6(trap, a1, a2, a3, 0"
},
{
"path": "1.19_linux/testing/run_example.go",
"chars": 144,
"preview": "package testing\n\nfunc runExample(eg InternalExample) (ok bool) {\n\t// Do nothing.\n\t// TODO: Implement os.Pipe2 and use th"
},
{
"path": "1.19_linux/time/format_test.go.patch",
"chars": 1940,
"preview": "//--from\nfunc TestParseInLocation(t *testing.T) {\n\n\tbaghdad, err := LoadLocation(\"Asia/Baghdad\")\n\tif err != nil {\n\t\tt.Fa"
},
{
"path": "1.19_linux/time/internal_test.go.patch",
"chars": 13194,
"preview": "//--from\nfunc initTestingZone() {\n\t// For hermeticity, use only tzinfo source from the test's GOROOT,\n\t// not the system"
},
{
"path": "1.19_linux/time/sleep_test.go.patch",
"chars": 977,
"preview": "//--from\nfunc TestSleep(t *testing.T) {\n\tconst delay = 100 * Millisecond\n\tgo func() {\n\t\tSleep(delay / 2)\n\t\tInterrupt()\n\t"
},
{
"path": "1.19_linux/time/time_test.go.patch",
"chars": 4749,
"preview": "//--from\nfunc TestLoadFixed(t *testing.T) {\n\t// Issue 4064: handle locations without any zone transitions.\n\tloc, err := "
},
{
"path": "1.19_linux/time/tzdata_test.go.patch",
"chars": 1447,
"preview": "//--from\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\t_ \"time/tzdata\"\n)\n//--to\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t_ \"time/tzdata"
},
{
"path": "1.19_linux/time/zoneinfo_test.go.patch",
"chars": 4573,
"preview": "//--from\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n)\n//--to\nimport (\n\t\"fmt\"\n\t\"te"
},
{
"path": "1.19_linux/time/zoneinfo_unix.go.patch",
"chars": 1096,
"preview": "//--from\nimport (\n\t\"syscall\"\n)\n//--to\n//--from\nfunc initLocal() {\n\t// consult $TZ to find the time zone to use.\n\t// no $"
},
{
"path": "1.19_linux/time/zoneinfo_unix_test.go.patch",
"chars": 2296,
"preview": "//--from\nimport (\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestEnvTZUsage(t *testing.T) {\n\t"
},
{
"path": "1.19_windows/runtime/abi_test.go.patch",
"chars": 191,
"preview": "//--from\nfunc TestFinalizerRegisterABI(t *testing.T) {\n//--to\nfunc TestFinalizerRegisterABI(t *testing.T) {\n\tt.Skip(\"cre"
},
{
"path": "1.19_windows/runtime/cgo/gcc_fatalf.c.patch",
"chars": 35,
"preview": "//--from\n#include <stdio.h>\n//--to\n"
},
{
"path": "1.19_windows/runtime/cgo/gcc_libinit.c.patch",
"chars": 35,
"preview": "//--from\n#include <stdio.h>\n//--to\n"
},
{
"path": "1.19_windows/runtime/cgo/gcc_libinit_windows.c.patch",
"chars": 35,
"preview": "//--from\n#include <stdio.h>\n//--to\n"
},
{
"path": "1.19_windows/runtime/cgo/gcc_windows_amd64.c.patch",
"chars": 372,
"preview": "//--from\n#include <stdio.h>\n//--to\n//--from\nstatic void\nthreadentry(void *v)\n{\n//--to\nstatic int getproccount() {\n\tstati"
},
{
"path": "1.19_windows/runtime/cgo/libcgo.h.patch",
"chars": 204,
"preview": "//--from\n#include <stdio.h>\n//--to\n//--append\n#define fprintf dummy_fprintf\n#define stderr dummy_stderr\n\n// TODO: Use Ou"
},
{
"path": "1.19_windows/runtime/crash_test.go.patch",
"chars": 1630,
"preview": "//--from\nfunc TestRuntimePanic(t *testing.T) {\n\ttestenv.MustHaveExec(t)\n\tcmd := testenv.CleanCmdEnv(exec.Command(os.Args"
},
{
"path": "1.19_windows/runtime/malloc_test.go.patch",
"chars": 179,
"preview": "//--from\nfunc TestArenaCollision(t *testing.T) {\n//--to\nfunc TestArenaCollision(t *testing.T) {\n\tt.Skip(\"creating a new "
},
{
"path": "1.19_windows/runtime/os_windows.go.patch",
"chars": 4027,
"preview": "//--from\n//go:cgo_import_dynamic runtime._GetConsoleMode GetConsoleMode%2 \"kernel32.dll\"\n//--to\n//--from\n//go:cgo_import"
},
{
"path": "1.19_windows/runtime/syscall_windows.go.patch",
"chars": 231,
"preview": "//--from\nfunc syscall_SyscallN(trap uintptr, args ...uintptr) (r1, r2, err uintptr) {\n//--to\nfunc syscall_SyscallN(trap "
},
{
"path": "1.19_windows/runtime/syscall_windows_test.go.patch",
"chars": 163,
"preview": "//--from\nfunc TestNumCPU(t *testing.T) {\n//--to\nfunc TestNumCPU(t *testing.T) {\n\tt.Skip(\"creating a new process with os."
},
{
"path": "1.19_windows/sync/mutex_test.go.patch",
"chars": 662,
"preview": "//--from\nimport (\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\t. \"sync\"\n\t\"testing\"\n\t\"time\"\n)\n//--t"
},
{
"path": "1.20_linux/internal/reflectlite/reflect_mirror_test.go.patch",
"chars": 175,
"preview": "//--from\nfunc TestMirrorWithReflect(t *testing.T) {\n//--to\nfunc TestMirrorWithReflect(t *testing.T) {\n t.Skip(\"fil"
},
{
"path": "1.20_linux/internal/testenv/exec.go.patch",
"chars": 151,
"preview": "//--from\nfunc HasExec() bool {\n\tswitch runtime.GOOS {\n\tcase \"js\", \"ios\":\n\t\treturn false\n\t}\n\treturn true\n}\n//--to\nfunc Ha"
},
{
"path": "1.20_linux/internal/testenv/testenv.go.patch",
"chars": 428,
"preview": "//--from\nfunc HasGoBuild() bool {\n\tif os.Getenv(\"GO_GCFLAGS\") != \"\" {\n\t\t// It's too much work to require every caller of"
},
{
"path": "1.20_linux/internal/testenv/testenv_notunix.go.patch",
"chars": 113,
"preview": "//--from\n//go:build windows || plan9 || (js && wasm)\n//--to\n//go:build windows || plan9 || (js && wasm) || linux\n"
},
{
"path": "1.20_linux/internal/testenv/testenv_unix.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.20_linux/math/big/link_test.go.patch",
"chars": 1290,
"preview": "//--from\nimport (\n\t\"bytes\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\""
},
{
"path": "1.20_linux/runtime/align_test.go.patch",
"chars": 2789,
"preview": "//--from\nimport (\n\t\"go/ast\"\n\t\"go/build\"\n\t\"go/importer\"\n\t\"go/parser\"\n\t\"go/printer\"\n\t\"go/token\"\n\t\"go/types\"\n\t\"internal/tes"
},
{
"path": "1.20_linux/runtime/callers_test.go.patch",
"chars": 2784,
"preview": "//--from\nfunc TestCallersNilPointerPanic(t *testing.T) {\n\t// Make sure we don't have any extra frames on the stack (due "
},
{
"path": "1.20_linux/runtime/cgo/cgo.go.patch",
"chars": 152,
"preview": "//--from\n*/\nimport \"C\"\n//--to\n#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all\n#cgo darwin LDFLAGS: -Wl,-undefin"
},
{
"path": "1.20_linux/runtime/cgo/gcc_linux_amd64.c.patch",
"chars": 1435,
"preview": "//--from\n#include <pthread.h>\n#include <errno.h>\n#include <string.h> // strerror\n#include <signal.h>\n#include <stdlib.h>"
},
{
"path": "1.20_linux/runtime/cgo/gcc_linux_arm64.c.patch",
"chars": 3695,
"preview": "//--from\nvoid\n_cgo_sys_thread_start(ThreadStart *ts)\n{\n\tpthread_attr_t attr;\n\tsigset_t ign, oset;\n\tpthread_t p;\n\tsize_t "
},
{
"path": "1.20_linux/runtime/cgo/gcc_setenv.c.patch",
"chars": 307,
"preview": "//--from\nvoid\nx_cgo_setenv(char **arg)\n{\n\t_cgo_tsan_acquire();\n\tsetenv(arg[0], arg[1], 1);\n\t_cgo_tsan_release();\n}\n//--t"
},
{
"path": "1.20_linux/runtime/cgo/gcc_sigaction.c.patch",
"chars": 100,
"preview": "//--from\n// +build linux,amd64 linux,arm64 linux,ppc64le\n//--to\n// +build linux,arm64 linux,ppc64le\n"
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_clock_linux.c",
"chars": 226,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <time.h>\n\nint "
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_cpu_linux.c",
"chars": 169,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n\nin"
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_filesystem_linux.c",
"chars": 4950,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_futex_linux.c",
"chars": 2936,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <errno.h>\n#inc"
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_mem_linux.c",
"chars": 736,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n#in"
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_syscalls_linux.c",
"chars": 2949,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.20_linux/runtime/cgo/hitsumabushi_thread_linux.c",
"chars": 45,
"preview": "void hitsumabushi_initializeThread(void) {\n}\n"
},
{
"path": "1.20_linux/runtime/cgo/linux_syscall.c.patch",
"chars": 1430,
"preview": "//--from\n#include <grp.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <errno.h>\n#include \"libcgo.h\"\n//--to\n#incl"
},
{
"path": "1.20_linux/runtime/cgo/sigaction.go.patch",
"chars": 180,
"preview": "//--from\n//go:build (linux && amd64) || (freebsd && amd64) || (linux && arm64) || (linux && ppc64le)\n//--to\n//go:build ("
},
{
"path": "1.20_linux/runtime/crash_test.go.patch",
"chars": 2896,
"preview": "//--from\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"ru"
},
{
"path": "1.20_linux/runtime/crash_unix_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.20_linux/runtime/debug/heapdump_test.go.patch",
"chars": 2060,
"preview": "//--from\nimport (\n\t\"os\"\n\t\"runtime\"\n\t. \"runtime/debug\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestWriteH"
},
{
"path": "1.20_linux/runtime/debug/panic_test.go.patch",
"chars": 1312,
"preview": "//--from\nimport (\n\t\"runtime\"\n\t\"runtime/debug\"\n\t\"syscall\"\n\t\"testing\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfu"
},
{
"path": "1.20_linux/runtime/debug_test.go.patch",
"chars": 80,
"preview": "//--from\n//go:build (amd64 || arm64) && linux && !race\n//--to\n//go:build ignore\n"
},
{
"path": "1.20_linux/runtime/export_unix_test.go",
"chars": 268,
"preview": "// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "1.20_linux/runtime/internal/syscall/asm_linux_amd64.s.patch",
"chars": 402,
"preview": "//--from\nTEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0\n\t// a6 already in R9.\n\t// a5 already in R8.\n\tMOVQ\tSI, R10 // a4\n\tMOV"
},
{
"path": "1.20_linux/runtime/internal/syscall/asm_linux_arm64.s.patch",
"chars": 399,
"preview": "//--from\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tMOVD\tnum+0(FP), R8\t// syscall entry\n\tMOVD\ta1+8(FP), R0\n\tMOVD\ta2+16(FP), R1\n\tM"
},
{
"path": "1.20_linux/runtime/internal/syscall/syscall_linux.go.patch",
"chars": 636,
"preview": "//--from\nfunc Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)\n//--to\nfunc Syscall6(num, a1, a2, a3"
},
{
"path": "1.20_linux/runtime/internal/syscall/syscall_linux_test.go.patch",
"chars": 396,
"preview": "//--from\nimport (\n\t\"runtime/internal/syscall\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestEpollctlErrorS"
},
{
"path": "1.20_linux/runtime/mem_linux.go",
"chars": 2425,
"preview": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "1.20_linux/runtime/memmove_linux_amd64_test.go.patch",
"chars": 159,
"preview": "//--from\nfunc TestMemmoveOverflow(t *testing.T) {\n//--to\nfunc TestMemmoveOverflow(t *testing.T) {\n\tt.Skip(\"file is not s"
},
{
"path": "1.20_linux/runtime/nbpipe_pipe2.go.patch",
"chars": 153,
"preview": "//--from\n//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris\n//--to\n//go:build dragonfly || freebsd"
},
{
"path": "1.20_linux/runtime/nbpipe_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.20_linux/runtime/netpoll_epoll.go.patch",
"chars": 51,
"preview": "//--from\n//go:build linux\n//--to\n//go:build ignore\n"
},
{
"path": "1.20_linux/runtime/netpoll_fake.go.patch",
"chars": 55,
"preview": "//--from\n//go:build js && wasm\n//--to\n//go:build linux\n"
},
{
"path": "1.20_linux/runtime/norace_linux_test.go.patch",
"chars": 589,
"preview": "//--from\nimport (\n\t\"internal/abi\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc T"
},
{
"path": "1.20_linux/runtime/os_linux.go.patch",
"chars": 9172,
"preview": "//--from\nimport (\n\t\"internal/abi\"\n\t\"internal/goarch\"\n\t\"runtime/internal/atomic\"\n\t\"runtime/internal/syscall\"\n\t\"unsafe\"\n)\n"
},
{
"path": "1.20_linux/runtime/proc_test.go.patch",
"chars": 466,
"preview": "//--from\nfunc TestGoroutineParallelism2(t *testing.T) {\n\t//testGoroutineParallelism2(t, false, false)\n\ttestGoroutinePara"
},
{
"path": "1.20_linux/runtime/runtime1.go.patch",
"chars": 651,
"preview": "//--from\nfunc argv_index(argv **byte, i int32) *byte {\n\treturn *(**byte)(add(unsafe.Pointer(argv), uintptr(i)*goarch.Ptr"
},
{
"path": "1.20_linux/runtime/runtime_linux_test.go.patch",
"chars": 325,
"preview": "//--from\nfunc TestMincoreErrorSign(t *testing.T) {\n\tvar dst byte\n\tv := Mincore(Add(unsafe.Pointer(new(int32)), 1), 1, &d"
},
{
"path": "1.20_linux/runtime/runtime_mmap_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.20_linux/runtime/runtime_test.go.patch",
"chars": 654,
"preview": "//--from\nfunc testSetPanicOnFault(t *testing.T, addr uintptr, nfault *int) {\n\tif GOOS == \"js\" {\n\t\tt.Skip(\"js does not su"
},
{
"path": "1.20_linux/runtime/runtime_unix_test.go.patch",
"chars": 183,
"preview": "//--from\n//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || plan9\n//--to\n//go:build aix |"
},
{
"path": "1.20_linux/runtime/stack_test.go.patch",
"chars": 1739,
"preview": "//--from\nfunc TestDeferLeafSigpanic(t *testing.T) {\n\t// Push a defer that will walk the stack.\n\tdefer func() {\n\t\tif err "
},
{
"path": "1.20_linux/runtime/stubs2.go.patch",
"chars": 1999,
"preview": "//--from\nimport (\n\t\"runtime/internal/atomic\"\n\t\"unsafe\"\n)\n//--to\nimport (\n\t\"internal/abi\"\n\t\"runtime/internal/atomic\"\n\t\"un"
},
{
"path": "1.20_linux/runtime/stubs3.go.patch",
"chars": 320,
"preview": "//--from\npackage runtime\n//--to\npackage runtime\n\nimport (\n\t\"internal/abi\"\n\t\"unsafe\"\n)\n//--from\nfunc nanotime1() int64\n//"
},
{
"path": "1.20_linux/runtime/sys_libc.go.patch",
"chars": 109,
"preview": "//--from\n//go:build darwin || (openbsd && !mips64)\n//--to\n//go:build darwin || (openbsd && !mips64) || linux\n"
},
{
"path": "1.20_linux/runtime/sys_linux_amd64.s.patch",
"chars": 9821,
"preview": "//--from\nTEXT runtime·open(SB),NOSPLIT,$0-20\n\t// This uses openat instead of open, because Android O blocks open.\n\tMOVL\t"
},
{
"path": "1.20_linux/runtime/sys_linux_arm64.s.patch",
"chars": 11953,
"preview": "//--from\n#define SYS_exit\t\t93\n#define SYS_read\t\t63\n#define SYS_write\t\t64\n#define SYS_openat\t\t56\n#define SYS_close\t\t57\n#d"
},
{
"path": "1.20_linux/runtime/time_linux_amd64.s.patch",
"chars": 55,
"preview": "//--from\n//go:build !faketime\n//--to\n//go:build ignore\n"
},
{
"path": "1.20_linux/runtime/timeasm.go.patch",
"chars": 102,
"preview": "//--from\n//go:build !faketime && (windows || (linux && amd64))\n//--to\n//go:build !faketime && windows\n"
},
{
"path": "1.20_linux/runtime/timestub.go.patch",
"chars": 103,
"preview": "//--from\n//go:build !faketime && !windows && !(linux && amd64)\n//--to\n//go:build !faketime && !windows\n"
},
{
"path": "1.20_linux/runtime/timestub2.go.patch",
"chars": 620,
"preview": "//--from\n//go:build !aix && !darwin && !freebsd && !openbsd && !solaris && !windows && !(linux && amd64)\n//--to\n//go:bui"
},
{
"path": "1.20_linux/strconv/fp_test.go.patch",
"chars": 1321,
"preview": "//--from\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"strconv\"\n\t\"strings\"\n\t\"testi"
},
{
"path": "1.20_linux/sync/atomic/atomic_test.go.patch",
"chars": 4760,
"preview": "//--from\nfunc TestStoreLoadSeqCst32(t *testing.T) {\n\tif runtime.NumCPU() == 1 {\n\t\tt.Skipf(\"Skipping test on %v processor"
},
{
"path": "1.20_linux/syscall/hitsumabushi_stubs_linux_amd64.go",
"chars": 207,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\npackage syscall\n\nconst "
},
{
"path": "1.20_linux/syscall/hitsumabushi_stubs_linux_arm64.go",
"chars": 207,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\npackage syscall\n\nconst "
},
{
"path": "1.20_linux/syscall/rlimit.go.patch",
"chars": 252,
"preview": "//--from\nfunc init() {\n\tvar lim Rlimit\n\tif err := Getrlimit(RLIMIT_NOFILE, &lim); err == nil && lim.Cur != lim.Max {\n\t\to"
},
{
"path": "1.20_linux/syscall/syscall_linux.go.patch",
"chars": 4048,
"preview": "//--from\nfunc RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) {\n\treturn RawSyscall6(trap, a1, a2, a3, 0"
},
{
"path": "1.20_linux/testing/run_example.go",
"chars": 144,
"preview": "package testing\n\nfunc runExample(eg InternalExample) (ok bool) {\n\t// Do nothing.\n\t// TODO: Implement os.Pipe2 and use th"
},
{
"path": "1.20_linux/time/format_test.go.patch",
"chars": 1940,
"preview": "//--from\nfunc TestParseInLocation(t *testing.T) {\n\n\tbaghdad, err := LoadLocation(\"Asia/Baghdad\")\n\tif err != nil {\n\t\tt.Fa"
},
{
"path": "1.20_linux/time/internal_test.go.patch",
"chars": 13194,
"preview": "//--from\nfunc initTestingZone() {\n\t// For hermeticity, use only tzinfo source from the test's GOROOT,\n\t// not the system"
},
{
"path": "1.20_linux/time/sleep_test.go.patch",
"chars": 977,
"preview": "//--from\nfunc TestSleep(t *testing.T) {\n\tconst delay = 100 * Millisecond\n\tgo func() {\n\t\tSleep(delay / 2)\n\t\tInterrupt()\n\t"
},
{
"path": "1.20_linux/time/time_test.go.patch",
"chars": 4749,
"preview": "//--from\nfunc TestLoadFixed(t *testing.T) {\n\t// Issue 4064: handle locations without any zone transitions.\n\tloc, err := "
},
{
"path": "1.20_linux/time/tzdata_test.go.patch",
"chars": 1447,
"preview": "//--from\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\t_ \"time/tzdata\"\n)\n//--to\nimport (\n\t\"reflect\"\n\t\"testing\"\n\t_ \"time/tzdata"
},
{
"path": "1.20_linux/time/zoneinfo_test.go.patch",
"chars": 4573,
"preview": "//--from\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n)\n//--to\nimport (\n\t\"fmt\"\n\t\"te"
},
{
"path": "1.20_linux/time/zoneinfo_unix.go.patch",
"chars": 1096,
"preview": "//--from\nimport (\n\t\"syscall\"\n)\n//--to\n//--from\nfunc initLocal() {\n\t// consult $TZ to find the time zone to use.\n\t// no $"
},
{
"path": "1.20_linux/time/zoneinfo_unix_test.go.patch",
"chars": 2296,
"preview": "//--from\nimport (\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestEnvTZUsage(t *testing.T) {\n\t"
},
{
"path": "1.20_windows/runtime/abi_test.go.patch",
"chars": 191,
"preview": "//--from\nfunc TestFinalizerRegisterABI(t *testing.T) {\n//--to\nfunc TestFinalizerRegisterABI(t *testing.T) {\n\tt.Skip(\"cre"
},
{
"path": "1.20_windows/runtime/cgo/gcc_windows_amd64.c.patch",
"chars": 337,
"preview": "//--from\nstatic void\nthreadentry(void *v)\n{\n//--to\nstatic int getproccount() {\n\tstatic int proccount = 0;\n\tif (!proccoun"
},
{
"path": "1.20_windows/runtime/crash_test.go.patch",
"chars": 1630,
"preview": "//--from\nfunc TestRuntimePanic(t *testing.T) {\n\ttestenv.MustHaveExec(t)\n\tcmd := testenv.CleanCmdEnv(exec.Command(os.Args"
},
{
"path": "1.20_windows/runtime/malloc_test.go.patch",
"chars": 179,
"preview": "//--from\nfunc TestArenaCollision(t *testing.T) {\n//--to\nfunc TestArenaCollision(t *testing.T) {\n\tt.Skip(\"creating a new "
},
{
"path": "1.20_windows/runtime/os_windows.go.patch",
"chars": 4027,
"preview": "//--from\n//go:cgo_import_dynamic runtime._GetConsoleMode GetConsoleMode%2 \"kernel32.dll\"\n//--to\n//--from\n//go:cgo_import"
},
{
"path": "1.20_windows/runtime/syscall_windows.go.patch",
"chars": 231,
"preview": "//--from\nfunc syscall_SyscallN(trap uintptr, args ...uintptr) (r1, r2, err uintptr) {\n//--to\nfunc syscall_SyscallN(trap "
},
{
"path": "1.20_windows/runtime/syscall_windows_test.go.patch",
"chars": 163,
"preview": "//--from\nfunc TestNumCPU(t *testing.T) {\n//--to\nfunc TestNumCPU(t *testing.T) {\n\tt.Skip(\"creating a new process with os."
},
{
"path": "1.20_windows/sync/mutex_test.go.patch",
"chars": 662,
"preview": "//--from\nimport (\n\t\"fmt\"\n\t\"internal/testenv\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n\t. \"sync\"\n\t\"testing\"\n\t\"time\"\n)\n//--t"
},
{
"path": "1.21_linux/internal/reflectlite/reflect_mirror_test.go.patch",
"chars": 161,
"preview": "//--from\nfunc TestMirrorWithReflect(t *testing.T) {\n//--to\nfunc TestMirrorWithReflect(t *testing.T) {\n t.Skip(\"fil"
},
{
"path": "1.21_linux/internal/syscall/unix/fcntl_unix.go.patch",
"chars": 287,
"preview": "//--from\nfunc Fcntl(fd int, cmd int, arg int) (int, error) {\n\tval, errno := fcntl(int32(fd), int32(cmd), int32(arg))\n\tif"
},
{
"path": "1.21_linux/internal/testenv/exec.go.patch",
"chars": 113,
"preview": "//--from\nfunc tryExec() error {\n//--to\nfunc tryExec() error {\n\treturn fmt.Errorf(\"can't probe for exec support\")\n"
},
{
"path": "1.21_linux/internal/testenv/testenv.go.patch",
"chars": 80,
"preview": "//--from\nfunc HasGoBuild() bool {\n//--to\nfunc HasGoBuild() bool {\n\treturn false\n"
},
{
"path": "1.21_linux/internal/testenv/testenv_notunix.go.patch",
"chars": 133,
"preview": "//--from\n//go:build windows || plan9 || (js && wasm) || wasip1\n//--to\n//go:build windows || plan9 || (js && wasm) || was"
},
{
"path": "1.21_linux/internal/testenv/testenv_unix.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.21_linux/math/big/link_test.go.patch",
"chars": 142,
"preview": "//--from\nfunc TestLinkerGC(t *testing.T) {\n//--to\nfunc TestLinkerGC(t *testing.T) {\n\tt.Skip(\"go tools are not supported "
},
{
"path": "1.21_linux/math/rand/default_test.go.patch",
"chars": 172,
"preview": "//--from\nfunc TestDefaultRace(t *testing.T) {\n//--to\nfunc TestDefaultRace(t *testing.T) {\n\tt.Skip(\"os.Getenv and creatin"
},
{
"path": "1.21_linux/runtime/align_test.go.patch",
"chars": 151,
"preview": "//--from\nfunc TestAtomicAlignment(t *testing.T) {\n//--to\nfunc TestAtomicAlignment(t *testing.T) {\n\tt.Skip(\"file is not s"
},
{
"path": "1.21_linux/runtime/callers_test.go.patch",
"chars": 588,
"preview": "//--from\nfunc TestCallersNilPointerPanic(t *testing.T) {\n//--to\nfunc TestCallersNilPointerPanic(t *testing.T) {\n\tt.Skip("
},
{
"path": "1.21_linux/runtime/cgo/cgo.go.patch",
"chars": 152,
"preview": "//--from\n*/\nimport \"C\"\n//--to\n#cgo !darwin LDFLAGS: -Wl,-unresolved-symbols=ignore-all\n#cgo darwin LDFLAGS: -Wl,-undefin"
},
{
"path": "1.21_linux/runtime/cgo/gcc_linux_amd64.c.patch",
"chars": 1435,
"preview": "//--from\n#include <pthread.h>\n#include <errno.h>\n#include <string.h> // strerror\n#include <signal.h>\n#include <stdlib.h>"
},
{
"path": "1.21_linux/runtime/cgo/gcc_linux_arm64.c.patch",
"chars": 3770,
"preview": "//--from\nvoid\n_cgo_sys_thread_start(ThreadStart *ts)\n{\n\tpthread_attr_t attr;\n\tsigset_t ign, oset;\n\tpthread_t p;\n\tsize_t "
},
{
"path": "1.21_linux/runtime/cgo/gcc_setenv.c.patch",
"chars": 307,
"preview": "//--from\nvoid\nx_cgo_setenv(char **arg)\n{\n\t_cgo_tsan_acquire();\n\tsetenv(arg[0], arg[1], 1);\n\t_cgo_tsan_release();\n}\n//--t"
},
{
"path": "1.21_linux/runtime/cgo/gcc_sigaction.c.patch",
"chars": 103,
"preview": "//--from\n//go:build linux && (amd64 || arm64 || ppc64le)\n//--to\n//go:build linux && (arm64 || ppc64le)\n"
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_clock_linux.c",
"chars": 226,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <time.h>\n\nint "
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_cpu_linux.c",
"chars": 169,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n\nin"
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_filesystem_linux.c",
"chars": 4950,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_futex_linux.c",
"chars": 2936,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <errno.h>\n#inc"
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_mem_linux.c",
"chars": 736,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n#include <stdint.h>\n#in"
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_syscalls_linux.c",
"chars": 2949,
"preview": "// SPDX-License-Identifier: Apache-2.0\n// SPDX-FileCopyrightText: 2022 The Hitsumabushi Authors\n\n// This file defines C "
},
{
"path": "1.21_linux/runtime/cgo/hitsumabushi_thread_linux.c",
"chars": 45,
"preview": "void hitsumabushi_initializeThread(void) {\n}\n"
},
{
"path": "1.21_linux/runtime/cgo/linux_syscall.c.patch",
"chars": 1430,
"preview": "//--from\n#include <grp.h>\n#include <sys/types.h>\n#include <unistd.h>\n#include <errno.h>\n#include \"libcgo.h\"\n//--to\n#incl"
},
{
"path": "1.21_linux/runtime/cgo/sigaction.go.patch",
"chars": 180,
"preview": "//--from\n//go:build (linux && amd64) || (freebsd && amd64) || (linux && arm64) || (linux && ppc64le)\n//--to\n//go:build ("
},
{
"path": "1.21_linux/runtime/crash_test.go.patch",
"chars": 412,
"preview": "//--from\nfunc buildTestProg(t *testing.T, binary string, flags ...string) (string, error) {\n//--to\nfunc buildTestProg(t "
},
{
"path": "1.21_linux/runtime/crash_unix_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.21_linux/runtime/debug/heapdump_test.go.patch",
"chars": 493,
"preview": "//--from\nfunc TestWriteHeapDumpNonempty(t *testing.T) {\n//--to\nfunc TestWriteHeapDumpNonempty(t *testing.T) {\n\tt.Skip(\"f"
},
{
"path": "1.21_linux/runtime/debug/panic_test.go.patch",
"chars": 168,
"preview": "//--from\nfunc TestPanicOnFault(t *testing.T) {\n//--to\nfunc TestPanicOnFault(t *testing.T) {\n\tt.Skip(\"handling nil pointe"
},
{
"path": "1.21_linux/runtime/debug_test.go.patch",
"chars": 80,
"preview": "//--from\n//go:build (amd64 || arm64) && linux && !race\n//--to\n//go:build ignore\n"
},
{
"path": "1.21_linux/runtime/export_unix_test.go",
"chars": 268,
"preview": "// Copyright 2017 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "1.21_linux/runtime/internal/syscall/asm_linux_amd64.s.patch",
"chars": 402,
"preview": "//--from\nTEXT ·Syscall6<ABIInternal>(SB),NOSPLIT,$0\n\t// a6 already in R9.\n\t// a5 already in R8.\n\tMOVQ\tSI, R10 // a4\n\tMOV"
},
{
"path": "1.21_linux/runtime/internal/syscall/asm_linux_arm64.s.patch",
"chars": 399,
"preview": "//--from\nTEXT ·Syscall6(SB),NOSPLIT,$0-80\n\tMOVD\tnum+0(FP), R8\t// syscall entry\n\tMOVD\ta1+8(FP), R0\n\tMOVD\ta2+16(FP), R1\n\tM"
},
{
"path": "1.21_linux/runtime/internal/syscall/syscall_linux.go.patch",
"chars": 636,
"preview": "//--from\nfunc Syscall6(num, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, errno uintptr)\n//--to\nfunc Syscall6(num, a1, a2, a3"
},
{
"path": "1.21_linux/runtime/internal/syscall/syscall_linux_test.go.patch",
"chars": 396,
"preview": "//--from\nimport (\n\t\"runtime/internal/syscall\"\n\t\"testing\"\n)\n//--to\nimport (\n\t\"testing\"\n)\n//--from\nfunc TestEpollctlErrorS"
},
{
"path": "1.21_linux/runtime/mem_linux.go",
"chars": 2541,
"preview": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license "
},
{
"path": "1.21_linux/runtime/memmove_linux_amd64_test.go.patch",
"chars": 151,
"preview": "//--from\nfunc TestMemmoveOverflow(t *testing.T) {\n//--to\nfunc TestMemmoveOverflow(t *testing.T) {\n\tt.Skip(\"file is not s"
},
{
"path": "1.21_linux/runtime/nbpipe_pipe2.go.patch",
"chars": 153,
"preview": "//--from\n//go:build dragonfly || freebsd || linux || netbsd || openbsd || solaris\n//--to\n//go:build dragonfly || freebsd"
},
{
"path": "1.21_linux/runtime/nbpipe_test.go.patch",
"chars": 58,
"preview": "//--from\n//go:build unix\n//--to\n//go:build unix && !linux\n"
},
{
"path": "1.21_linux/runtime/netpoll_epoll.go.patch",
"chars": 51,
"preview": "//--from\n//go:build linux\n//--to\n//go:build ignore\n"
},
{
"path": "1.21_linux/runtime/netpoll_fake.go.patch",
"chars": 55,
"preview": "//--from\n//go:build js && wasm\n//--to\n//go:build linux\n"
},
{
"path": "1.21_linux/runtime/norace_linux_test.go.patch",
"chars": 147,
"preview": "//--from\nfunc TestNewOSProc0(t *testing.T) {\n//--to\nfunc TestNewOSProc0(t *testing.T) {\n\tt.Skip(\"newosproc0 is not suppo"
},
{
"path": "1.21_linux/runtime/os_linux.go.patch",
"chars": 9365,
"preview": "//--from\nimport (\n\t\"internal/abi\"\n\t\"internal/goarch\"\n\t\"runtime/internal/atomic\"\n\t\"runtime/internal/syscall\"\n\t\"unsafe\"\n)\n"
}
]
// ... and 494 more files (download for full content)
About this extraction
This page contains the full source code of the hajimehoshi/hitsumabushi GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 694 files (826.3 KB), approximately 317.0k tokens, and a symbol index with 635 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.