Browse Source

Update contrib/libs/lzma to 5.6.1
0a981b204173e2ede75381ec3e0bcc40c2770a74

robot-contrib 11 months ago
parent
commit
dc2c1c8098

+ 27 - 1
contrib/libs/lzma/NEWS

@@ -2,6 +2,32 @@
 XZ Utils Release Notes
 ======================
 
+5.6.1 (2024-03-09)
+
+    * liblzma: Fixed two bugs relating to GNU indirect function (IFUNC)
+      with GCC. The more serious bug caused a program linked with
+      liblzma to crash on start up if the flag -fprofile-generate was
+      used to build liblzma. The second bug caused liblzma to falsely
+      report an invalid write to Valgrind when loading liblzma.
+
+    * xz: Changed the messages for thread reduction due to memory
+      constraints to only appear under the highest verbosity level.
+
+    * Build:
+
+        - Fixed a build issue when the header file <linux/landlock.h>
+          was present on the system but the Landlock system calls were
+          not defined in <sys/syscall.h>.
+
+        - The CMake build now warns and disables NLS if both gettext
+          tools and pre-created .gmo files are missing. Previously,
+          this caused the CMake build to fail.
+
+    * Minor improvements to man pages.
+
+    * Minor improvements to tests.
+
+
 5.6.0 (2024-02-24)
 
     This bumps the minor version of liblzma because new features were
@@ -23,7 +49,7 @@ XZ Utils Release Notes
     * Sandboxing support in xz:
 
         - Landlock is now used even when xz needs to create files.
-          In this case the sandbox is has to be more permissive than
+          In this case the sandbox has to be more permissive than
           when no files need to be created. A similar thing was
           already in use with pledge(2) since 5.3.4alpha.
 

+ 1 - 1
contrib/libs/lzma/liblzma/api/lzma/version.h

@@ -22,7 +22,7 @@
 #define LZMA_VERSION_MINOR 6
 
 /** \brief Patch version number of the liblzma release. */
-#define LZMA_VERSION_PATCH 0
+#define LZMA_VERSION_PATCH 1
 
 /**
  * \brief Version stability marker

+ 2 - 0
contrib/libs/lzma/liblzma/check/crc32_fast.c

@@ -135,6 +135,8 @@ typedef uint32_t (*crc32_func_type)(
 // This resolver is shared between all three dispatch methods. It serves as
 // the ifunc resolver if ifunc is supported, otherwise it is called as a
 // regular function by the constructor or first call resolution methods.
+// The function attributes are needed for safe IFUNC resolver usage with GCC.
+lzma_resolver_attributes
 static crc32_func_type
 crc32_resolve(void)
 {

+ 1 - 0
contrib/libs/lzma/liblzma/check/crc64_fast.c

@@ -98,6 +98,7 @@ typedef uint64_t (*crc64_func_type)(
 #	pragma GCC diagnostic ignored "-Wunused-function"
 #endif
 
+lzma_resolver_attributes
 static crc64_func_type
 crc64_resolve(void)
 {

+ 25 - 0
contrib/libs/lzma/liblzma/check/crc_common.h

@@ -128,6 +128,31 @@
 #	endif
 #endif
 
+#ifdef CRC_USE_IFUNC
+// Two function attributes are needed to make IFUNC safe with GCC.
+//
+// no-omit-frame-pointer prevents false Valgrind issues when combined with
+// a few other compiler flags. The optimize attribute is supported on
+// GCC >= 4.4 and is not supported with Clang.
+#	if TUKLIB_GNUC_REQ(4,4) && !defined(__clang__)
+#		define no_omit_frame_pointer \
+			__attribute__((optimize("no-omit-frame-pointer")))
+#	else
+#		define no_omit_frame_pointer
+#	endif
+
+// The __no_profile_instrument_function__ attribute support is checked when
+// determining if ifunc can be used, so it is safe to use unconditionally.
+// This attribute is needed because GCC can add profiling to the IFUNC
+// resolver, which calls functions that have not yet been relocated leading
+// to a crash on liblzma start up.
+#	define lzma_resolver_attributes \
+		__attribute__((__no_profile_instrument_function__)) \
+		no_omit_frame_pointer
+#else
+#	define lzma_resolver_attributes
+#endif
+
 // For CRC32 use the generic slice-by-eight implementation if no optimized
 // version is available.
 #if !defined(CRC32_ARCH_OPTIMIZED) && !defined(CRC32_GENERIC)

+ 3 - 3
contrib/libs/lzma/liblzma/simple/riscv.c

@@ -116,7 +116,7 @@ AUIPC with rd != x0
         Zfh, F, D, and Q:
           * RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
           * RV64I has also: LD, LWU, SD
-          * Zhf: FLH, FSH
+          * Zfh: FLH, FSH
           * F: FLW, FSW
           * D: FLD, FSD
           * Q: FLQ, FSQ
@@ -320,11 +320,11 @@ AUIPC with rd == x0
 // The left-hand side takes care of (1) and (2).
 //   (a) The lowest 7 bits are already known to be AUIPC so subtracting 0x17
 //       makes those bits zeros.
-//   (b) If AUIPC rd equals x2, subtracting 0x10 makes bits [11:7] zeros.
+//   (b) If AUIPC rd equals x2, subtracting 0x100 makes bits [11:7] zeros.
 //       If rd doesn't equal x2, then there will be at least one non-zero bit
 //       and the next step (c) is irrelevant.
 //   (c) If the lowest two opcode bits of the packed inst2 are set in [13:12],
-//       then subtracting 0x300 will make those bits zeros. Otherwise there
+//       then subtracting 0x3000 will make those bits zeros. Otherwise there
 //       will be at least one non-zero bit.
 //
 // The shift by 18 removes the high bits from the final '>=' comparison and

+ 2 - 2
contrib/libs/lzma/ya.make

@@ -11,9 +11,9 @@ LICENSE(
 
 LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
 
-VERSION(5.6.0)
+VERSION(5.6.1)
 
-ORIGINAL_SOURCE(https://github.com/tukaani-project/xz/archive/v5.6.0.tar.gz)
+ORIGINAL_SOURCE(https://github.com/tukaani-project/xz/archive/v5.6.1.tar.gz)
 
 ADDINCL(
     GLOBAL contrib/libs/lzma/liblzma/api