diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-02-15 00:51:32 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-02-15 00:51:32 +0000 |
commit | 67421443097d50444537a60d9035b3d1a6c3afcd (patch) | |
tree | 91a02bd1ff8c406c900dbb18c9f61df77734c5f8 /contrib/libs | |
parent | 952ca0f30d296247f95ab781b0a5aa5b485ac2c7 (diff) | |
parent | 784038d7404cb679026c8cc19204497e8411c75a (diff) | |
download | ydb-67421443097d50444537a60d9035b3d1a6c3afcd.tar.gz |
Merge branch 'rightlib' into merge-libs-250215-0050
Diffstat (limited to 'contrib/libs')
-rw-r--r-- | contrib/libs/backtrace/.yandex_meta/override.nix | 6 | ||||
-rw-r--r-- | contrib/libs/backtrace/elf.c | 34 | ||||
-rw-r--r-- | contrib/libs/backtrace/ya.make | 4 | ||||
-rw-r--r-- | contrib/libs/breakpad/src/.yandex_meta/licenses.list.txt | 35 | ||||
-rw-r--r-- | contrib/libs/breakpad/src/common/android/testing/include/wchar.h | 76 | ||||
-rw-r--r-- | contrib/libs/breakpad/src/common/android/testing/mkdtemp.h | 110 | ||||
-rw-r--r-- | contrib/libs/breakpad/src/common/android/testing/pthread_fixes.h | 94 | ||||
-rw-r--r-- | contrib/libs/breakpad/src/ya.make | 3 |
8 files changed, 35 insertions, 327 deletions
diff --git a/contrib/libs/backtrace/.yandex_meta/override.nix b/contrib/libs/backtrace/.yandex_meta/override.nix index b2868617d1..c633909160 100644 --- a/contrib/libs/backtrace/.yandex_meta/override.nix +++ b/contrib/libs/backtrace/.yandex_meta/override.nix @@ -1,11 +1,11 @@ pkgs: attrs: with pkgs; with attrs; rec { - version = "2024-11-29"; + version = "2025-01-30"; src = fetchFromGitHub { owner = "ianlancetaylor"; repo = "libbacktrace"; - rev = "1db85642e3fca189cf4e076f840a45d6934b2456"; - hash = "sha256-hRZqnro0fXFrcyMiC7k5Ztm0qckRV23UbzpmCThQ3Y4="; + rev = "78af4ffa26e15532847c1ba854ece7b3bacc6b1a"; + hash = "sha256-yx++/urCnaBt2QQsevSXjZ1aAHfBEznk5Dq3JscPyiQ="; }; patches = []; diff --git a/contrib/libs/backtrace/elf.c b/contrib/libs/backtrace/elf.c index 380cafe91a..4c8e155573 100644 --- a/contrib/libs/backtrace/elf.c +++ b/contrib/libs/backtrace/elf.c @@ -1147,7 +1147,10 @@ elf_fetch_bits (const unsigned char **ppin, const unsigned char *pinend, next = __builtin_bswap32 (next); #endif #else - next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24); + next = ((uint32_t)pin[0] + | ((uint32_t)pin[1] << 8) + | ((uint32_t)pin[2] << 16) + | ((uint32_t)pin[3] << 24)); #endif val |= (uint64_t)next << bits; @@ -1198,7 +1201,10 @@ elf_fetch_bits_backward (const unsigned char **ppin, next = __builtin_bswap32 (next); #endif #else - next = pin[0] | (pin[1] << 8) | (pin[2] << 16) | (pin[3] << 24); + next = ((uint32_t)pin[0] + | ((uint32_t)pin[1] << 8) + | ((uint32_t)pin[2] << 16) + | ((uint32_t)pin[3] << 24)); #endif val <<= 32; @@ -5872,10 +5878,10 @@ elf_uncompress_lzma_block (const unsigned char *compressed, /* The byte at compressed[off] is ignored for some reason. */ - code = ((compressed[off + 1] << 24) - + (compressed[off + 2] << 16) - + (compressed[off + 3] << 8) - + compressed[off + 4]); + code = ((uint32_t)(compressed[off + 1] << 24) + + ((uint32_t)compressed[off + 2] << 16) + + ((uint32_t)compressed[off + 3] << 8) + + (uint32_t)compressed[off + 4]); off += 5; /* This is the main LZMA decode loop. */ @@ -6198,10 +6204,10 @@ elf_uncompress_lzma_block (const unsigned char *compressed, return 0; } computed_crc = elf_crc32 (0, uncompressed, uncompressed_offset); - stream_crc = (compressed[off] - | (compressed[off + 1] << 8) - | (compressed[off + 2] << 16) - | (compressed[off + 3] << 24)); + stream_crc = ((uint32_t)compressed[off] + | ((uint32_t)compressed[off + 1] << 8) + | ((uint32_t)compressed[off + 2] << 16) + | ((uint32_t)compressed[off + 3] << 24)); if (computed_crc != stream_crc) { elf_uncompress_failed (); @@ -6336,10 +6342,10 @@ elf_uncompress_lzma (struct backtrace_state *state, /* Before that is the size of the index field, which precedes the footer. */ - index_size = (compressed[offset - 4] - | (compressed[offset - 3] << 8) - | (compressed[offset - 2] << 16) - | (compressed[offset - 1] << 24)); + index_size = ((size_t)compressed[offset - 4] + | ((size_t)compressed[offset - 3] << 8) + | ((size_t)compressed[offset - 2] << 16) + | ((size_t)compressed[offset - 1] << 24)); index_size = (index_size + 1) * 4; offset -= 4; diff --git a/contrib/libs/backtrace/ya.make b/contrib/libs/backtrace/ya.make index bf36fcf8c2..b430051ade 100644 --- a/contrib/libs/backtrace/ya.make +++ b/contrib/libs/backtrace/ya.make @@ -6,9 +6,9 @@ LICENSE(BSD-3-Clause) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(2024-11-29) +VERSION(2025-01-30) -ORIGINAL_SOURCE(https://github.com/ianlancetaylor/libbacktrace/archive/1db85642e3fca189cf4e076f840a45d6934b2456.tar.gz) +ORIGINAL_SOURCE(https://github.com/ianlancetaylor/libbacktrace/archive/78af4ffa26e15532847c1ba854ece7b3bacc6b1a.tar.gz) ADDINCL( contrib/libs/backtrace diff --git a/contrib/libs/breakpad/src/.yandex_meta/licenses.list.txt b/contrib/libs/breakpad/src/.yandex_meta/licenses.list.txt index 75fd1567b3..bbd2bbc406 100644 --- a/contrib/libs/breakpad/src/.yandex_meta/licenses.list.txt +++ b/contrib/libs/breakpad/src/.yandex_meta/licenses.list.txt @@ -1194,27 +1194,6 @@ permissive licensing, and of not having licensing issues being an obstacle to adoption, that text has been removed. -====================GPL-2.0-only==================== - *** This header was automatically generated from a Linux kernel header - *** of the same name, to make information necessary for userspace to - *** call into the kernel available to libc. It contains only constants, - *** structures, and macros generated from the original header, and thus, - *** contains no copyrightable information. - - -====================LicenseRef-scancode-other-permissive==================== -Portions of this software are derived from third-party works licensed -under terms compatible with the above MIT license: - - -====================LicenseRef-scancode-unknown-license-reference==================== -have been licensed under extremely permissive terms. - - -====================LicenseRef-scancode-unknown-license-reference==================== -licensed under following terms: "Permission to use, copy, modify, - - ====================MIT==================== Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the @@ -1309,6 +1288,10 @@ all of whom have explicitly granted such permission. ====================MIT-Nagy==================== licensed under following terms: "Permission to use, copy, modify, + + +====================MIT-Nagy==================== +licensed under following terms: "Permission to use, copy, modify, and/or distribute this code for any purpose with or without fee is hereby granted. There is no warranty." @@ -1318,10 +1301,12 @@ hereby granted. There is no warranty." * This code is in the public domain; do with it what you wish. -====================Public-Domain AND LicenseRef-scancode-other-permissive==================== -originally written by Solar Designer and placed into the public -domain. The code also comes with a fallback permissive license for use -in jurisdictions that may not recognize the public domain. +====================Public-Domain==================== + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. ====================Unicode==================== diff --git a/contrib/libs/breakpad/src/common/android/testing/include/wchar.h b/contrib/libs/breakpad/src/common/android/testing/include/wchar.h deleted file mode 100644 index 85373fd2a0..0000000000 --- a/contrib/libs/breakpad/src/common/android/testing/include/wchar.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Android doesn't provide wcscasecmp(), so provide an alternative here. -// -// Note that this header is not needed when Breakpad is compiled against -// a recent version of Googletest. It shall be considered for removal once -// src/testing/ is updated to an appropriate revision in the future. - -#ifndef GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H -#define GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H - -#include_next <wchar.h> - -#if !defined(__aarch64__) && !defined(__x86_64__) && \ - !(defined(__mips__) && _MIPS_SIM == _ABI64) - -// This needs to be in an extern "C" namespace, or Googletest will not -// compile against it. -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -static wchar_t inline wcstolower(wchar_t ch) { - if (ch >= L'a' && ch <= L'A') - ch -= L'a' - L'A'; - return ch; -} - -static int inline wcscasecmp(const wchar_t* s1, const wchar_t* s2) { - for (;;) { - wchar_t c1 = wcstolower(*s1); - wchar_t c2 = wcstolower(*s2); - if (c1 < c2) - return -1; - if (c1 > c2) - return 1; - if (c1 == L'0') - return 0; - s1++; - s2++; - } -} - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus -#endif - -#endif // GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H diff --git a/contrib/libs/breakpad/src/common/android/testing/mkdtemp.h b/contrib/libs/breakpad/src/common/android/testing/mkdtemp.h deleted file mode 100644 index b86e2cd783..0000000000 --- a/contrib/libs/breakpad/src/common/android/testing/mkdtemp.h +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// mkdtemp() wasn't declared in <stdlib.h> until NDK r9b due to a simple -// packaging bug (the function has always been implemented in all versions -// of the C library). This header is provided to build Breakpad with earlier -// NDK revisions (e.g. the one used by Chromium). It may be removed in the -// future once all major projects upgrade to use a more recent NDK. -// -// The reason this is inlined here is to avoid linking a new object file -// into each unit test program (i.e. keep build files simple). - -#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H -#define GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H - -#include <assert.h> -#include <errno.h> -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <sys/stat.h> - -// Using a macro renaming trick here is necessary when building against -// NDK r9b. Otherwise the compiler will complain that calls to mkdtemp() -// are ambiguous. -#define mkdtemp breakpad_mkdtemp - -namespace { - -char* breakpad_mkdtemp(char* path) { - if (path == NULL) { - errno = EINVAL; - return NULL; - } - - // 'path' must be terminated with six 'X' - const char kSuffix[] = "XXXXXX"; - const size_t kSuffixLen = strlen(kSuffix); - char* path_end = path + strlen(path); - - if (static_cast<size_t>(path_end - path) < kSuffixLen || - memcmp(path_end - kSuffixLen, kSuffix, kSuffixLen) != 0) { - errno = EINVAL; - return NULL; - } - - // If 'path' contains a directory separator, check that it exists to - // avoid looping later. - char* sep = strrchr(path, '/'); - if (sep != NULL) { - struct stat st; - int ret; - *sep = '\0'; // temporarily zero-terminate the dirname. - ret = stat(path, &st); - *sep = '/'; // restore full path. - if (ret < 0) - return NULL; - if (!S_ISDIR(st.st_mode)) { - errno = ENOTDIR; - return NULL; - } - } - - // Loop. On each iteration, replace the XXXXXX suffix with a random - // number. - int tries; - for (tries = 128; tries > 0; tries--) { - int random = rand() % 1000000; - - snprintf(path_end - kSuffixLen, kSuffixLen + 1, "%0d", random); - if (mkdir(path, 0700) == 0) - return path; // Success - - if (errno != EEXIST) - return NULL; - } - - assert(errno == EEXIST); - return NULL; -} - -} // namespace - -#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H diff --git a/contrib/libs/breakpad/src/common/android/testing/pthread_fixes.h b/contrib/libs/breakpad/src/common/android/testing/pthread_fixes.h deleted file mode 100644 index b0a3d82e4b..0000000000 --- a/contrib/libs/breakpad/src/common/android/testing/pthread_fixes.h +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) 2012, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// This contains Pthread-related functions not provided by the Android NDK -// but required by the Breakpad unit test. The functions are inlined here -// in a C++ anonymous namespace in order to keep the build files simples. - -#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H -#define GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H - -#include <pthread.h> - -namespace { - -// Android doesn't provide pthread_barrier_t for now. -#ifndef PTHREAD_BARRIER_SERIAL_THREAD - -// Anything except 0 will do here. -#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345 - -typedef struct { - pthread_mutex_t mutex; - pthread_cond_t cond; - unsigned count; -} pthread_barrier_t; - -int pthread_barrier_init(pthread_barrier_t* barrier, - const void* /* barrier_attr */, - unsigned count) { - barrier->count = count; - pthread_mutex_init(&barrier->mutex, NULL); - pthread_cond_init(&barrier->cond, NULL); - return 0; -} - -int pthread_barrier_wait(pthread_barrier_t* barrier) { - // Lock the mutex - pthread_mutex_lock(&barrier->mutex); - // Decrement the count. If this is the first thread to reach 0, wake up - // waiters, unlock the mutex, then return PTHREAD_BARRIER_SERIAL_THREAD. - if (--barrier->count == 0) { - // First thread to reach the barrier - pthread_cond_broadcast(&barrier->cond); - pthread_mutex_unlock(&barrier->mutex); - return PTHREAD_BARRIER_SERIAL_THREAD; - } - // Otherwise, wait for other threads until the count reaches 0, then - // return 0 to indicate this is not the first thread. - do { - pthread_cond_wait(&barrier->cond, &barrier->mutex); - } while (barrier->count > 0); - - pthread_mutex_unlock(&barrier->mutex); - return 0; -} - -int pthread_barrier_destroy(pthread_barrier_t* barrier) { - barrier->count = 0; - pthread_cond_destroy(&barrier->cond); - pthread_mutex_destroy(&barrier->mutex); - return 0; -} - -#endif // defined(PTHREAD_BARRIER_SERIAL_THREAD) - -} // namespace - -#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H diff --git a/contrib/libs/breakpad/src/ya.make b/contrib/libs/breakpad/src/ya.make index 2611d5f447..df8dfb1143 100644 --- a/contrib/libs/breakpad/src/ya.make +++ b/contrib/libs/breakpad/src/ya.make @@ -9,9 +9,6 @@ LICENSE( BSD-4-Clause-UC AND Custom-clarified-artistic-proofread AND FSFAP AND - GPL-2.0-only AND - LicenseRef-scancode-other-permissive AND - LicenseRef-scancode-unknown-license-reference AND MIT AND MIT WITH Musl-Exception AND MIT-Nagy AND |