diff options
author | pg <pg@yandex-team.com> | 2024-02-04 22:49:45 +0300 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-02-09 19:17:54 +0300 |
commit | 403acfd855c1a9763e3f0e9af65504b74f0bbc17 (patch) | |
tree | 57f73b884ac6694a72e01f83fb9a20b896c1fd81 | |
parent | 5bcb87c0c52bc390289595fab80390524701366c (diff) | |
download | ydb-403acfd855c1a9763e3f0e9af65504b74f0bbc17.tar.gz |
-rw-r--r-- | contrib/go/_std_1.21/src/crypto/sha1/boring.go | 25 | ||||
-rw-r--r-- | contrib/go/_std_1.21/src/crypto/sha1/notboring.go | 20 | ||||
-rw-r--r-- | contrib/go/_std_1.21/src/crypto/sha1/ya.make | 28 | ||||
-rw-r--r-- | contrib/go/_std_1.21/src/internal/poll/sock_cloexec_accept.go | 51 | ||||
-rw-r--r-- | contrib/go/_std_1.21/src/internal/poll/ya.make | 26 |
5 files changed, 33 insertions, 117 deletions
diff --git a/contrib/go/_std_1.21/src/crypto/sha1/boring.go b/contrib/go/_std_1.21/src/crypto/sha1/boring.go deleted file mode 100644 index b5786d1bf4..0000000000 --- a/contrib/go/_std_1.21/src/crypto/sha1/boring.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2009 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. - -// Extra indirection here so that when building go_bootstrap -// cmd/internal/boring is not even imported, so that we don't -// have to maintain changes to cmd/dist's deps graph. - -//go:build !cmd_go_bootstrap && cgo -// +build !cmd_go_bootstrap,cgo - -package sha1 - -import ( - "crypto/internal/boring" - "hash" -) - -const boringEnabled = boring.Enabled - -func boringNewSHA1() hash.Hash { return boring.NewSHA1() } - -func boringUnreachable() { boring.Unreachable() } - -func boringSHA1(p []byte) [20]byte { return boring.SHA1(p) } diff --git a/contrib/go/_std_1.21/src/crypto/sha1/notboring.go b/contrib/go/_std_1.21/src/crypto/sha1/notboring.go new file mode 100644 index 0000000000..42ef87937f --- /dev/null +++ b/contrib/go/_std_1.21/src/crypto/sha1/notboring.go @@ -0,0 +1,20 @@ +// Copyright 2009 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 cmd_go_bootstrap || !cgo +// +build cmd_go_bootstrap !cgo + +package sha1 + +import ( + "hash" +) + +const boringEnabled = false + +func boringNewSHA1() hash.Hash { panic("boringcrypto: not available") } + +func boringUnreachable() {} + +func boringSHA1([]byte) [20]byte { panic("boringcrypto: not available") } diff --git a/contrib/go/_std_1.21/src/crypto/sha1/ya.make b/contrib/go/_std_1.21/src/crypto/sha1/ya.make index 249b2e1265..7b6b33eb6c 100644 --- a/contrib/go/_std_1.21/src/crypto/sha1/ya.make +++ b/contrib/go/_std_1.21/src/crypto/sha1/ya.make @@ -1,23 +1,19 @@ GO_LIBRARY() - -SRCS( - boring.go - sha1.go - sha1block.go -) - -IF (ARCH_X86_64) +IF (OS_DARWIN AND ARCH_ARM64 OR OS_LINUX AND ARCH_AARCH64) SRCS( - sha1block_amd64.go - sha1block_amd64.s + notboring.go + sha1.go + sha1block.go + sha1block_arm64.go + sha1block_arm64.s ) -ENDIF() - -IF (ARCH_ARM64) +ELSEIF (OS_DARWIN AND ARCH_X86_64 OR OS_LINUX AND ARCH_X86_64 OR OS_WINDOWS AND ARCH_X86_64) SRCS( - sha1block_arm64.go - sha1block_arm64.s + notboring.go + sha1.go + sha1block.go + sha1block_amd64.go + sha1block_amd64.s ) ENDIF() - END() diff --git a/contrib/go/_std_1.21/src/internal/poll/sock_cloexec_accept.go b/contrib/go/_std_1.21/src/internal/poll/sock_cloexec_accept.go deleted file mode 100644 index 4b86de59e0..0000000000 --- a/contrib/go/_std_1.21/src/internal/poll/sock_cloexec_accept.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2013 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 file implements accept for platforms that provide a fast path for -// setting SetNonblock and CloseOnExec, but don't necessarily have accept4. -// This is the code we used for accept in Go 1.17 and earlier. -// On Linux the accept4 system call was introduced in 2.6.28 kernel, -// and our minimum requirement is 2.6.32, so we simplified the function. -// Unfortunately, on ARM accept4 wasn't added until 2.6.36, so for ARM -// only we continue using the older code. - -//go:build linux && arm - -package poll - -import "syscall" - -// Wrapper around the accept system call that marks the returned file -// descriptor as nonblocking and close-on-exec. -func accept(s int) (int, syscall.Sockaddr, string, error) { - ns, sa, err := Accept4Func(s, syscall.SOCK_NONBLOCK|syscall.SOCK_CLOEXEC) - switch err { - case nil: - return ns, sa, "", nil - default: // errors other than the ones listed - return -1, sa, "accept4", err - case syscall.ENOSYS: // syscall missing - case syscall.EINVAL: // some Linux use this instead of ENOSYS - case syscall.EACCES: // some Linux use this instead of ENOSYS - case syscall.EFAULT: // some Linux use this instead of ENOSYS - } - - // See ../syscall/exec_unix.go for description of ForkLock. - // It is probably okay to hold the lock across syscall.Accept - // because we have put fd.sysfd into non-blocking mode. - // However, a call to the File method will put it back into - // blocking mode. We can't take that risk, so no use of ForkLock here. - ns, sa, err = AcceptFunc(s) - if err == nil { - syscall.CloseOnExec(ns) - } - if err != nil { - return -1, nil, "accept", err - } - if err = syscall.SetNonblock(ns, true); err != nil { - CloseFunc(ns) - return -1, nil, "setnonblock", err - } - return ns, sa, "", nil -} diff --git a/contrib/go/_std_1.21/src/internal/poll/ya.make b/contrib/go/_std_1.21/src/internal/poll/ya.make index bfa2329fb5..fd3ad99553 100644 --- a/contrib/go/_std_1.21/src/internal/poll/ya.make +++ b/contrib/go/_std_1.21/src/internal/poll/ya.make @@ -20,31 +20,7 @@ IF (OS_DARWIN AND ARCH_ARM64 OR OS_DARWIN AND ARCH_X86_64) sys_cloexec.go writev.go ) -ELSEIF (OS_LINUX AND ARCH_AARCH64) - SRCS( - copy_file_range_linux.go - errno_unix.go - fd.go - fd_fsync_posix.go - fd_mutex.go - fd_poll_runtime.go - fd_posix.go - fd_unix.go - fd_unixjs.go - fd_writev_unix.go - hook_cloexec.go - hook_unix.go - iovec_unix.go - sendfile_linux.go - sock_cloexec_accept.go - sockopt.go - sockopt_linux.go - sockopt_unix.go - sockoptip.go - splice_linux.go - writev.go - ) -ELSEIF (OS_LINUX AND ARCH_X86_64) +ELSEIF (OS_LINUX AND ARCH_AARCH64 OR OS_LINUX AND ARCH_X86_64) SRCS( copy_file_range_linux.go errno_unix.go |