Compare commits
36 Commits
Author | SHA1 | Date |
---|---|---|
Jia Tan | af071ef770 | |
Lasse Collin | 0b99783d63 | |
Lasse Collin | 8a25ba024d | |
Lasse Collin | 49324b711f | |
Lasse Collin | c273123ed0 | |
Lasse Collin | df7f487648 | |
Lasse Collin | 3217b82b3e | |
Sergey Kosukhin | 096bc0e3f8 | |
Lasse Collin | 2ad7fad670 | |
Lasse Collin | 82f0c0d39e | |
Lasse Collin | 45d33bfc45 | |
Sergey Kosukhin | f56ed6fac6 | |
Jia Tan | a4f2e20d84 | |
Jia Tan | f01be8ad75 | |
Jia Tan | 6e636819e8 | |
Jia Tan | a3a29bbd5d | |
Jia Tan | 0b4ccc9145 | |
Jia Tan | 8c9b8b2063 | |
Jia Tan | b93a8d7631 | |
Jia Tan | 82ecc53819 | |
Lasse Collin | 3007e74ef2 | |
Jia Tan | 72d2933bfa | |
Jia Tan | e5faaebbcf | |
Lasse Collin | 7eeadd279a | |
Lasse Collin | 5f3d059529 | |
Lasse Collin | 4cd1042ee7 | |
Lasse Collin | a94b42362c | |
Jia Tan | bbf112e323 | |
Lasse Collin | 649f644744 | |
Jia Tan | 1255b7d849 | |
Chien Wong | eee579fff5 | |
Jia Tan | 328c52da8a | |
Jia Tan | eb8ad59e9b | |
Jia Tan | 9eed1b9a3a | |
Jia Tan | 8bf9f72ee1 | |
Jia Tan | 5d8d915ebe |
|
@ -16,13 +16,7 @@ the chance that the exploit will be used before a patch is released.
|
||||||
You may submit a report by emailing us at
|
You may submit a report by emailing us at
|
||||||
[xz@tukaani.org](mailto:xz@tukaani.org), or through
|
[xz@tukaani.org](mailto:xz@tukaani.org), or through
|
||||||
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
|
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
|
||||||
While both options are available, we prefer email. In any case, please
|
While both options are available, we prefer email.
|
||||||
provide a clear description of the vulnerability including:
|
|
||||||
|
|
||||||
- Affected versions of XZ Utils
|
|
||||||
- Estimated severity (low, moderate, high, critical)
|
|
||||||
- Steps to recreate the vulnerability
|
|
||||||
- All relevant files (core dumps, build logs, input files, etc.)
|
|
||||||
|
|
||||||
This project is maintained by a team of volunteers on a reasonable-effort
|
This project is maintained by a team of volunteers on a reasonable-effort
|
||||||
basis. As such, please give us 90 days to work on a fix before
|
basis. As such, please give us 90 days to work on a fix before
|
||||||
|
|
|
@ -67,6 +67,7 @@ coverage
|
||||||
/tests/test_index
|
/tests/test_index
|
||||||
/tests/test_index_hash
|
/tests/test_index_hash
|
||||||
/tests/test_lzip_decoder
|
/tests/test_lzip_decoder
|
||||||
|
/tests/test_microlzma
|
||||||
/tests/test_memlimit
|
/tests/test_memlimit
|
||||||
/tests/test_stream_flags
|
/tests/test_stream_flags
|
||||||
/tests/test_vli
|
/tests/test_vli
|
||||||
|
|
167
CMakeLists.txt
167
CMakeLists.txt
|
@ -273,14 +273,48 @@ endif()
|
||||||
# Translation support requires CMake 3.20 because it added the Intl::Intl
|
# Translation support requires CMake 3.20 because it added the Intl::Intl
|
||||||
# target so we don't need to play with the individual variables.
|
# target so we don't need to play with the individual variables.
|
||||||
#
|
#
|
||||||
# The defintion ENABLE_NLS is added only to those targets that use it, thus
|
# The definition ENABLE_NLS is added only to those targets that use it, thus
|
||||||
# it's not done here. (xz has translations, xzdec doesn't.)
|
# it's not done here. (xz has translations, xzdec doesn't.)
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
||||||
find_package(Intl)
|
find_package(Intl)
|
||||||
find_package(Gettext)
|
find_package(Gettext)
|
||||||
|
|
||||||
if(Intl_FOUND)
|
if(Intl_FOUND)
|
||||||
option(ENABLE_NLS "Native Language Support (translated messages)" ON)
|
option(ENABLE_NLS "Native Language Support (translated messages)" ON)
|
||||||
|
|
||||||
|
# If translation support is enabled but neither gettext tools or
|
||||||
|
# pre-generated .gmo files exist, translation support cannot be
|
||||||
|
# enabled.
|
||||||
|
#
|
||||||
|
# The detection of pre-generated .gmo files is done by only
|
||||||
|
# checking for the existence of a single .gmo file; Ukrainian
|
||||||
|
# is one of many translations that gets regular updates.
|
||||||
|
if(ENABLE_NLS AND NOT GETTEXT_FOUND AND
|
||||||
|
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po/uk.gmo")
|
||||||
|
# This only sets the variable, not the cache variable!
|
||||||
|
set(ENABLE_NLS OFF)
|
||||||
|
|
||||||
|
# This message is shown only when new enough CMake is used and
|
||||||
|
# library support for translations was found. The assumptions is
|
||||||
|
# that in this situation the user might have interest in the
|
||||||
|
# translations. This also keeps this code simpler.
|
||||||
|
message(WARNING "Native language support (NLS) has been disabled. "
|
||||||
|
"NLS support requires either gettext tools or "
|
||||||
|
"pre-generated .gmo files. The latter are only "
|
||||||
|
"available in distribution tarballs. "
|
||||||
|
"To avoid this warning, NLS can be explicitly "
|
||||||
|
"disabled by passing -DENABLE_NLS=OFF to cmake.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Warn if NLS is enabled but translated man pages are missing.
|
||||||
|
if(UNIX AND ENABLE_NLS AND
|
||||||
|
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po4a/man")
|
||||||
|
message(WARNING "Native language support (NLS) has been enabled "
|
||||||
|
"but pre-generated translated man pages "
|
||||||
|
"were not found and thus they won't be installed. "
|
||||||
|
"Run 'po4a/update-po' to generate them.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# The *installed* name of the translation files is "xz.mo".
|
# The *installed* name of the translation files is "xz.mo".
|
||||||
set(TRANSLATION_DOMAIN "xz")
|
set(TRANSLATION_DOMAIN "xz")
|
||||||
endif()
|
endif()
|
||||||
|
@ -299,6 +333,69 @@ endif()
|
||||||
|
|
||||||
option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static")
|
option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static")
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
# Symbol versioning only affects ELF shared libraries. The option is
|
||||||
|
# ignored for static libraries.
|
||||||
|
#
|
||||||
|
# Determine the default value so that it's always set with
|
||||||
|
# shared libraries in mind which helps if the build dir is reconfigured
|
||||||
|
# from static to shared libs without resetting the cache variables.
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT OFF)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
||||||
|
(CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze" OR
|
||||||
|
CMAKE_C_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
|
# As a special case, GNU/Linux on MicroBlaze gets the generic
|
||||||
|
# symbol versioning because GCC 12 doesn't support the __symver__
|
||||||
|
# attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
|
||||||
|
# from "uname -m" for native builds (should be "microblaze") or from
|
||||||
|
# the CMake toolchain file (not perfectly standardized but it very
|
||||||
|
# likely has "microblaze" in lower case or mixed case somewhere in
|
||||||
|
# the string).
|
||||||
|
#
|
||||||
|
# NVIDIA HPC Compiler doesn't support symbol versioning but
|
||||||
|
# it uses the linked from the system so the linker script
|
||||||
|
# can still be used to get the generic symbol versioning.
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "generic")
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
# GNU/Linux-specific symbol versioning for shared liblzma.
|
||||||
|
# This includes a few extra compatibility symbols for RHEL/CentOS 7
|
||||||
|
# which are pointless on non-glibc non-Linux systems.
|
||||||
|
#
|
||||||
|
# Avoid symvers on Linux with non-glibc like musl and uClibc.
|
||||||
|
# In Autoconf it's enough to check that $host_os equals linux-gnu
|
||||||
|
# instead of, for example, linux-musl. CMake doesn't provide such
|
||||||
|
# a method.
|
||||||
|
#
|
||||||
|
# This check is here for now since it's not strictly required
|
||||||
|
# by anything else.
|
||||||
|
check_c_source_compiles(
|
||||||
|
"#include <features.h>
|
||||||
|
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||||
|
int main(void) { return 0; }
|
||||||
|
#else
|
||||||
|
compile error
|
||||||
|
#endif
|
||||||
|
"
|
||||||
|
IS_LINUX_WITH_GLIBC)
|
||||||
|
|
||||||
|
if(IS_LINUX_WITH_GLIBC)
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "generic")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SYMBOL_VERSIONING "${SYMBOL_VERSIONING_DEFAULT}" CACHE STRING
|
||||||
|
"Enable ELF shared library symbol versioning (OFF, generic, linux)")
|
||||||
|
|
||||||
|
# Show a dropdown menu in CMake GUI:
|
||||||
|
set_property(CACHE SYMBOL_VERSIONING PROPERTY STRINGS "OFF;generic;linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_library(liblzma
|
add_library(liblzma
|
||||||
src/common/mythread.h
|
src/common/mythread.h
|
||||||
src/common/sysdefs.h
|
src/common/sysdefs.h
|
||||||
|
@ -819,10 +916,6 @@ if(MICROLZMA_DECODER)
|
||||||
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
|
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MICROLZMA_ENCODER OR MICROLZMA_DECODER)
|
|
||||||
add_compile_definitions(HAVE_MICROLZMA)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# lzip (.lz) format support #
|
# lzip (.lz) format support #
|
||||||
|
@ -901,10 +994,29 @@ endif()
|
||||||
|
|
||||||
# Sandboxing: Landlock
|
# Sandboxing: Landlock
|
||||||
if(NOT SANDBOX_FOUND AND ENABLE_SANDBOX MATCHES "^ON$|^landlock$")
|
if(NOT SANDBOX_FOUND AND ENABLE_SANDBOX MATCHES "^ON$|^landlock$")
|
||||||
check_include_file(linux/landlock.h HAVE_LINUX_LANDLOCK_H)
|
# A compile check is done here because some systems have
|
||||||
|
# linux/landlock.h, but do not have the syscalls defined
|
||||||
|
# in order to actually use Linux Landlock.
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <linux/landlock.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
.
|
||||||
|
void my_sandbox(void)
|
||||||
|
{
|
||||||
|
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||||
|
(void)SYS_landlock_create_ruleset;
|
||||||
|
(void)SYS_landlock_restrict_self;
|
||||||
|
(void)LANDLOCK_CREATE_RULESET_VERSION;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(HAVE_LINUX_LANDLOCK_H)
|
int main(void) { return 0; }
|
||||||
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK_H")
|
"
|
||||||
|
HAVE_LINUX_LANDLOCK)
|
||||||
|
|
||||||
|
if(HAVE_LINUX_LANDLOCK)
|
||||||
|
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK")
|
||||||
set(SANDBOX_FOUND ON)
|
set(SANDBOX_FOUND ON)
|
||||||
|
|
||||||
# Of our three sandbox methods, only Landlock is incompatible
|
# Of our three sandbox methods, only Landlock is incompatible
|
||||||
|
@ -1029,6 +1141,13 @@ if(USE_ATTR_IFUNC STREQUAL "auto")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void func(void) { return; }
|
static void func(void) { return; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The attribute __no_profile_instrument_function__ is
|
||||||
|
* needed with GCC to prevent improper instrumentation in
|
||||||
|
* the ifunc resolver.
|
||||||
|
*/
|
||||||
|
__attribute__((__no_profile_instrument_function__))
|
||||||
static void (*resolve_func(void)) (void) { return func; }
|
static void (*resolve_func(void)) (void) { return func; }
|
||||||
void func_ifunc(void)
|
void func_ifunc(void)
|
||||||
__attribute__((__ifunc__(\"resolve_func\")));
|
__attribute__((__ifunc__(\"resolve_func\")));
|
||||||
|
@ -1220,22 +1339,7 @@ if(WIN32)
|
||||||
# Disable __declspec(dllimport) when linking against static liblzma.
|
# Disable __declspec(dllimport) when linking against static liblzma.
|
||||||
target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC)
|
target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC)
|
||||||
endif()
|
endif()
|
||||||
elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "linux")
|
||||||
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze")
|
|
||||||
# GNU/Linux-specific symbol versioning for shared liblzma.
|
|
||||||
# This includes a few extra compatibility symbols for RHEL/CentOS 7
|
|
||||||
# which are pointless on non-glibc non-Linux systems.
|
|
||||||
#
|
|
||||||
# As a special case, GNU/Linux on MicroBlaze gets the generic
|
|
||||||
# symbol versioning because GCC 12 doesn't support the __symver__
|
|
||||||
# attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
|
|
||||||
# from "uname -m" for native builds (should be "microblaze") or from
|
|
||||||
# the CMake toolchain file (not perfectly standardized but it very
|
|
||||||
# likely has "microblaze" in lower case or mixed case somewhere in
|
|
||||||
# the string).
|
|
||||||
#
|
|
||||||
# FIXME? Avoid symvers on Linux with non-glibc like musl?
|
|
||||||
#
|
|
||||||
# Note that adding link options doesn't affect static builds
|
# Note that adding link options doesn't affect static builds
|
||||||
# but HAVE_SYMBOL_VERSIONS_LINUX must not be used with static builds
|
# but HAVE_SYMBOL_VERSIONS_LINUX must not be used with static builds
|
||||||
# because it would put symbol versions into the static library which
|
# because it would put symbol versions into the static library which
|
||||||
|
@ -1251,10 +1355,7 @@ elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
||||||
set_target_properties(liblzma PROPERTIES
|
set_target_properties(liblzma PROPERTIES
|
||||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
|
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
|
||||||
)
|
)
|
||||||
elseif(BUILD_SHARED_LIBS AND (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "generic")
|
||||||
CMAKE_SYSTEM_NAME STREQUAL "Linux"))
|
|
||||||
# Generic symbol versioning for shared liblzma is used on FreeBSD and
|
|
||||||
# also on GNU/Linux on MicroBlaze.
|
|
||||||
target_link_options(liblzma PRIVATE
|
target_link_options(liblzma PRIVATE
|
||||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
|
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
|
||||||
)
|
)
|
||||||
|
@ -1988,6 +2089,16 @@ if(BUILD_TESTING)
|
||||||
test_vli
|
test_vli
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# MicroLZMA encoder is needed for both encoder and decoder tests.
|
||||||
|
# If MicroLZMA decoder is not configured but LZMA1 decoder is, then
|
||||||
|
# test_microlzma will fail to compile because this configuration is
|
||||||
|
# not possible in the Autotools build, so the test was not made to
|
||||||
|
# support it since it would have required additional changes.
|
||||||
|
if (MICROLZMA_ENCODER AND (MICROLZMA_DECODER
|
||||||
|
OR NOT "lzma1" IN_LIST DECODERS))
|
||||||
|
list(APPEND LIBLZMA_TESTS test_microlzma)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(TEST IN LISTS LIBLZMA_TESTS)
|
foreach(TEST IN LISTS LIBLZMA_TESTS)
|
||||||
add_executable("${TEST}" "tests/${TEST}.c")
|
add_executable("${TEST}" "tests/${TEST}.c")
|
||||||
|
|
||||||
|
|
43
INSTALL
43
INSTALL
|
@ -561,10 +561,45 @@ XZ Utils Installation
|
||||||
sandboxing. If no Landlock support
|
sandboxing. If no Landlock support
|
||||||
is found, configure will give an error.
|
is found, configure will give an error.
|
||||||
|
|
||||||
--enable-symbol-versions
|
--enable-symbol-versions[=VARIANT]
|
||||||
Use symbol versioning for liblzma. This is enabled by
|
Use symbol versioning for liblzma shared library.
|
||||||
default on GNU/Linux, other GNU-based systems, and
|
This is enabled by default on GNU/Linux (glibc only),
|
||||||
FreeBSD.
|
other GNU-based systems, and FreeBSD.
|
||||||
|
|
||||||
|
Symbol versioning is never used for static liblzma. This
|
||||||
|
option is ignored when not building a shared library.
|
||||||
|
|
||||||
|
Supported VARIANTs:
|
||||||
|
|
||||||
|
no Disable symbol versioning. This is the
|
||||||
|
same as using --disable-symbol-versions.
|
||||||
|
|
||||||
|
auto Autodetect between "no", "linux",
|
||||||
|
and "generic".
|
||||||
|
|
||||||
|
yes Autodetect between "linux" and
|
||||||
|
"generic". This forces symbol
|
||||||
|
versioning to be used when
|
||||||
|
building a shared library.
|
||||||
|
|
||||||
|
generic Generic version is the default for
|
||||||
|
FreeBSD and GNU/Linux on MicroBlaze.
|
||||||
|
|
||||||
|
This is also used on GNU/Linux when
|
||||||
|
building with NVIDIA HPC Compiler
|
||||||
|
because the compiler doesn't support
|
||||||
|
the features required for the "linux"
|
||||||
|
variant below.
|
||||||
|
|
||||||
|
linux Special version for GNU/Linux (glibc
|
||||||
|
only). This adds a few extra symbol
|
||||||
|
versions for compatibility with binaries
|
||||||
|
that have been linked against a liblzma
|
||||||
|
version that has been patched with
|
||||||
|
"xz-5.2.2-compat-libs.patch" from
|
||||||
|
RHEL/CentOS 7. That patch was used
|
||||||
|
by some build tools outside of
|
||||||
|
RHEL/CentOS 7 too.
|
||||||
|
|
||||||
--enable-debug
|
--enable-debug
|
||||||
This enables the assert() macro and possibly some other
|
This enables the assert() macro and possibly some other
|
||||||
|
|
28
NEWS
28
NEWS
|
@ -2,6 +2,32 @@
|
||||||
XZ Utils Release Notes
|
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)
|
5.6.0 (2024-02-24)
|
||||||
|
|
||||||
This bumps the minor version of liblzma because new features were
|
This bumps the minor version of liblzma because new features were
|
||||||
|
@ -23,7 +49,7 @@ XZ Utils Release Notes
|
||||||
* Sandboxing support in xz:
|
* Sandboxing support in xz:
|
||||||
|
|
||||||
- Landlock is now used even when xz needs to create files.
|
- 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
|
when no files need to be created. A similar thing was
|
||||||
already in use with pledge(2) since 5.3.4alpha.
|
already in use with pledge(2) since 5.3.4alpha.
|
||||||
|
|
||||||
|
|
4
THANKS
4
THANKS
|
@ -76,6 +76,7 @@ has been important. :-) In alphabetical order:
|
||||||
- Richard Koch
|
- Richard Koch
|
||||||
- Anton Kochkov
|
- Anton Kochkov
|
||||||
- Ville Koskinen
|
- Ville Koskinen
|
||||||
|
- Sergey Kosukhin
|
||||||
- Marcin Kowalczyk
|
- Marcin Kowalczyk
|
||||||
- Jan Kratochvil
|
- Jan Kratochvil
|
||||||
- Christian Kujau
|
- Christian Kujau
|
||||||
|
@ -152,9 +153,9 @@ has been important. :-) In alphabetical order:
|
||||||
- Dan Stromberg
|
- Dan Stromberg
|
||||||
- Jia Tan
|
- Jia Tan
|
||||||
- Vincent Torri
|
- Vincent Torri
|
||||||
|
- Alexey Tourbin
|
||||||
- Paul Townsend
|
- Paul Townsend
|
||||||
- Mohammed Adnène Trojette
|
- Mohammed Adnène Trojette
|
||||||
- Alexey Tourbin
|
|
||||||
- Taiki Tsunekawa
|
- Taiki Tsunekawa
|
||||||
- Maksym Vatsyk
|
- Maksym Vatsyk
|
||||||
- Loganaden Velvindron
|
- Loganaden Velvindron
|
||||||
|
@ -171,6 +172,7 @@ has been important. :-) In alphabetical order:
|
||||||
- Charles Wilson
|
- Charles Wilson
|
||||||
- Lars Wirzenius
|
- Lars Wirzenius
|
||||||
- Pilorz Wojciech
|
- Pilorz Wojciech
|
||||||
|
- Chien Wong
|
||||||
- Ryan Young
|
- Ryan Young
|
||||||
- Andreas Zieringer
|
- Andreas Zieringer
|
||||||
|
|
||||||
|
|
152
configure.ac
152
configure.ac
|
@ -304,13 +304,8 @@ AC_ARG_ENABLE([microlzma], AS_HELP_STRING([--disable-microlzma],
|
||||||
for example, erofs-utils.]),
|
for example, erofs-utils.]),
|
||||||
[], [enable_microlzma=yes])
|
[], [enable_microlzma=yes])
|
||||||
case $enable_microlzma in
|
case $enable_microlzma in
|
||||||
yes)
|
yes | no)
|
||||||
AC_DEFINE([HAVE_MICROLZMA], [1],
|
AC_MSG_RESULT([$enable_microlzma])
|
||||||
[Define to 1 if MicroLZMA support is enabled.])
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
|
@ -714,61 +709,80 @@ fi
|
||||||
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
||||||
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
||||||
# being built for a shared library.
|
# being built for a shared library.
|
||||||
if test "x$enable_symbol_versions" = xno ; then
|
AS_IF([test "x$enable_symbol_versions" = xno], [
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
elif test "x$enable_shared" = xno ; then
|
], [test "x$enable_shared" = xno], [
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no (not building a shared library)])
|
AC_MSG_RESULT([no (not building a shared library)])
|
||||||
else
|
], [
|
||||||
case "$host_cpu-$host_os" in
|
# "yes" means that symbol version are to be used but we need to
|
||||||
microblaze*)
|
# autodetect which variant to use.
|
||||||
# GCC 12 on MicroBlaze doesn't support __symver__
|
if test "x$enable_symbol_versions" = xyes ; then
|
||||||
# attribute. It's simplest and safest to use the
|
case "$host_cpu-$host_os" in
|
||||||
# generic version on that platform since then only
|
microblaze*)
|
||||||
# the linker script is needed. The RHEL/CentOS 7
|
# GCC 12 on MicroBlaze doesn't support
|
||||||
# compatibility symbols don't matter on MicroBlaze.
|
# __symver__ attribute. It's simplest and
|
||||||
enable_symbol_versions=generic
|
# safest to use the generic version on that
|
||||||
;;
|
# platform since then only the linker script
|
||||||
*-linux*)
|
# is needed. The RHEL/CentOS 7 compatibility
|
||||||
case "$pic_mode-$enable_static" in
|
# symbols don't matter on MicroBlaze.
|
||||||
default-*)
|
enable_symbol_versions=generic
|
||||||
# Use symvers if PIC is defined.
|
;;
|
||||||
have_symbol_versions_linux=2
|
*-linux*)
|
||||||
;;
|
# NVIDIA HPC Compiler doesn't support symbol
|
||||||
*-no)
|
# versioning but the linker script can still
|
||||||
# Not building static library.
|
# be used.
|
||||||
# Use symvers unconditionally.
|
AC_EGREP_CPP([use_generic_symbol_versioning],
|
||||||
have_symbol_versions_linux=1
|
[#ifdef __NVCOMPILER
|
||||||
;;
|
use_generic_symbol_versioning
|
||||||
*)
|
#endif],
|
||||||
AC_MSG_RESULT([])
|
[enable_symbol_versions=generic],
|
||||||
AC_MSG_ERROR([
|
[enable_symbol_versions=linux])
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
enable_symbol_versions=generic
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$enable_symbol_versions" = xlinux ; then
|
||||||
|
case "$pic_mode-$enable_static" in
|
||||||
|
default-*)
|
||||||
|
# Use symvers if PIC is defined.
|
||||||
|
have_symbol_versions_linux=2
|
||||||
|
;;
|
||||||
|
*-no)
|
||||||
|
# Not building static library.
|
||||||
|
# Use symvers unconditionally.
|
||||||
|
have_symbol_versions_linux=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_RESULT([])
|
||||||
|
AC_MSG_ERROR([
|
||||||
On GNU/Linux, building both shared and static library at the same time
|
On GNU/Linux, building both shared and static library at the same time
|
||||||
is not supported if --with-pic or --without-pic is used.
|
is not supported if --with-pic or --without-pic is used.
|
||||||
Use either --disable-shared or --disable-static to build one type
|
Use either --disable-shared or --disable-static to build one type
|
||||||
of library at a time. If both types are needed, build one at a time,
|
of library at a time. If both types are needed, build one at a time,
|
||||||
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
enable_symbol_versions=linux
|
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
[$have_symbol_versions_linux],
|
||||||
[$have_symbol_versions_linux],
|
[Define to 1 to if GNU/Linux-specific details
|
||||||
[Define to 1 to if GNU/Linux-specific details
|
are unconditionally wanted for symbol
|
||||||
are unconditionally wanted for symbol
|
versioning. Define to 2 to if these are wanted
|
||||||
versioning. Define to 2 to if these are wanted
|
only if also PIC is defined (allows building
|
||||||
only if also PIC is defined (allows building
|
both shared and static liblzma at the same
|
||||||
both shared and static liblzma at the same
|
time with Libtool if neither --with-pic nor
|
||||||
time with Libtool if neither --with-pic nor
|
--without-pic is used). This define must be
|
||||||
--without-pic is used). This define must be
|
used together with liblzma_linux.map.])
|
||||||
used together with liblzma_linux.map.])
|
elif test "x$enable_symbol_versions" != xgeneric ; then
|
||||||
;;
|
AC_MSG_RESULT([])
|
||||||
*)
|
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
|
||||||
enable_symbol_versions=generic
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
||||||
fi
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
||||||
[test "x$enable_symbol_versions" = xlinux])
|
[test "x$enable_symbol_versions" = xlinux])
|
||||||
|
@ -915,6 +929,13 @@ if test "x$enable_ifunc" = xauto ; then
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void func(void) { return; }
|
static void func(void) { return; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The attribute __no_profile_instrument_function__ is
|
||||||
|
* needed with GCC to prevent improper instrumentation in
|
||||||
|
* the ifunc resolver.
|
||||||
|
*/
|
||||||
|
__attribute__((__no_profile_instrument_function__))
|
||||||
static void (*resolve_func (void)) (void) { return func; }
|
static void (*resolve_func (void)) (void) { return func; }
|
||||||
void func_ifunc (void)
|
void func_ifunc (void)
|
||||||
__attribute__((__ifunc__("resolve_func")));
|
__attribute__((__ifunc__("resolve_func")));
|
||||||
|
@ -1177,12 +1198,37 @@ AS_CASE([$enable_sandbox],
|
||||||
)
|
)
|
||||||
AS_CASE([$enable_sandbox],
|
AS_CASE([$enable_sandbox],
|
||||||
[auto | landlock], [
|
[auto | landlock], [
|
||||||
AC_CHECK_HEADERS([linux/landlock.h], [
|
AC_MSG_CHECKING([if Linux Landlock is usable])
|
||||||
|
|
||||||
|
# A compile check is done here because some systems have
|
||||||
|
# linux/landlock.h, but do not have the syscalls defined
|
||||||
|
# in order to actually use Linux Landlock.
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#include <linux/landlock.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
|
||||||
|
void my_sandbox(void)
|
||||||
|
{
|
||||||
|
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||||
|
(void)SYS_landlock_create_ruleset;
|
||||||
|
(void)SYS_landlock_restrict_self;
|
||||||
|
(void)LANDLOCK_CREATE_RULESET_VERSION;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
]])], [
|
||||||
enable_sandbox=found
|
enable_sandbox=found
|
||||||
|
|
||||||
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
||||||
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
||||||
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
|
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
|
||||||
|
|
||||||
|
AC_DEFINE([HAVE_LINUX_LANDLOCK], [1],
|
||||||
|
[Define to 1 if Linux Landlock is supported.
|
||||||
|
See configure.ac for details.])
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
702
po4a/de.po
702
po4a/de.po
File diff suppressed because it is too large
Load Diff
549
po4a/fr.po
549
po4a/fr.po
File diff suppressed because it is too large
Load Diff
702
po4a/ko.po
702
po4a/ko.po
File diff suppressed because it is too large
Load Diff
641
po4a/pt_BR.po
641
po4a/pt_BR.po
File diff suppressed because it is too large
Load Diff
702
po4a/ro.po
702
po4a/ro.po
File diff suppressed because it is too large
Load Diff
702
po4a/uk.po
702
po4a/uk.po
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,7 @@ liblzma_la_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/src/liblzma/simple \
|
-I$(top_srcdir)/src/liblzma/simple \
|
||||||
-I$(top_srcdir)/src/common \
|
-I$(top_srcdir)/src/common \
|
||||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||||
liblzma_la_LDFLAGS = -no-undefined -version-info 10:99:5
|
liblzma_la_LDFLAGS = -no-undefined -version-info 11:99:6
|
||||||
|
|
||||||
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
||||||
if COND_SYMVERS_GENERIC
|
if COND_SYMVERS_GENERIC
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
#define LZMA_VERSION_MAJOR 5
|
#define LZMA_VERSION_MAJOR 5
|
||||||
|
|
||||||
/** \brief Minor version number of the liblzma release. */
|
/** \brief Minor version number of the liblzma release. */
|
||||||
#define LZMA_VERSION_MINOR 5
|
#define LZMA_VERSION_MINOR 7
|
||||||
|
|
||||||
/** \brief Patch version number of the liblzma release. */
|
/** \brief Patch version number of the liblzma release. */
|
||||||
#define LZMA_VERSION_PATCH 2
|
#define LZMA_VERSION_PATCH 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Version stability marker
|
* \brief Version stability marker
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
* - LZMA_VERSION_STABILITY_BETA
|
* - LZMA_VERSION_STABILITY_BETA
|
||||||
* - LZMA_VERSION_STABILITY_STABLE
|
* - LZMA_VERSION_STABILITY_STABLE
|
||||||
*/
|
*/
|
||||||
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_BETA
|
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_ALPHA
|
||||||
|
|
||||||
/** \brief Commit version number of the liblzma release */
|
/** \brief Commit version number of the liblzma release */
|
||||||
#ifndef LZMA_VERSION_COMMIT
|
#ifndef LZMA_VERSION_COMMIT
|
||||||
|
|
|
@ -135,6 +135,8 @@ typedef uint32_t (*crc32_func_type)(
|
||||||
// This resolver is shared between all three dispatch methods. It serves as
|
// 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
|
// the ifunc resolver if ifunc is supported, otherwise it is called as a
|
||||||
// regular function by the constructor or first call resolution methods.
|
// 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
|
static crc32_func_type
|
||||||
crc32_resolve(void)
|
crc32_resolve(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,6 +98,7 @@ typedef uint64_t (*crc64_func_type)(
|
||||||
# pragma GCC diagnostic ignored "-Wunused-function"
|
# pragma GCC diagnostic ignored "-Wunused-function"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
lzma_resolver_attributes
|
||||||
static crc64_func_type
|
static crc64_func_type
|
||||||
crc64_resolve(void)
|
crc64_resolve(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -128,6 +128,31 @@
|
||||||
# endif
|
# endif
|
||||||
#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
|
// For CRC32 use the generic slice-by-eight implementation if no optimized
|
||||||
// version is available.
|
// version is available.
|
||||||
#if !defined(CRC32_ARCH_OPTIMIZED) && !defined(CRC32_GENERIC)
|
#if !defined(CRC32_ARCH_OPTIMIZED) && !defined(CRC32_GENERIC)
|
||||||
|
|
|
@ -67,6 +67,19 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
|
||||||
// This is only for x86-64 and ARM64 for now. This might be fine on
|
// This is only for x86-64 and ARM64 for now. This might be fine on
|
||||||
// other 64-bit processors too. On big endian one should use xor
|
// other 64-bit processors too. On big endian one should use xor
|
||||||
// instead of subtraction and switch to __builtin_clzll().
|
// instead of subtraction and switch to __builtin_clzll().
|
||||||
|
//
|
||||||
|
// Reasons to use subtraction instead of xor:
|
||||||
|
//
|
||||||
|
// - On some x86-64 processors (Intel Sandy Bridge to Tiger Lake),
|
||||||
|
// sub+jz and sub+jnz can be fused but xor+jz or xor+jnz cannot.
|
||||||
|
// Thus using subtraction has potential to be a tiny amount faster
|
||||||
|
// since the code checks if the quotient is non-zero.
|
||||||
|
//
|
||||||
|
// - Some processors (Intel Pentium 4) used to have more ALU
|
||||||
|
// resources for add/sub instructions than and/or/xor.
|
||||||
|
//
|
||||||
|
// The processor info is based on Agner Fog's microarchitecture.pdf
|
||||||
|
// version 2023-05-26. https://www.agner.org/optimize/
|
||||||
#define LZMA_MEMCMPLEN_EXTRA 8
|
#define LZMA_MEMCMPLEN_EXTRA 8
|
||||||
while (len < limit) {
|
while (len < limit) {
|
||||||
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
|
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
|
||||||
|
|
|
@ -217,12 +217,14 @@ typedef struct {
|
||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
// NVHPC has problems with unions that contain pointers that
|
||||||
|
// are not the first members, so keep "map" at the top.
|
||||||
|
const name_value_map *map;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint32_t min;
|
uint32_t min;
|
||||||
uint32_t max;
|
uint32_t max;
|
||||||
} range;
|
} range;
|
||||||
|
|
||||||
const name_value_map *map;
|
|
||||||
} u;
|
} u;
|
||||||
} option_map;
|
} option_map;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,11 @@ decode_buffer(lzma_delta_coder *coder, uint8_t *buffer, size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// For an unknown reason NVIDIA HPC Compiler needs this pragma
|
||||||
|
// to produce working code.
|
||||||
|
#ifdef __NVCOMPILER
|
||||||
|
# pragma routine novector
|
||||||
|
#endif
|
||||||
static lzma_ret
|
static lzma_ret
|
||||||
delta_decode(void *coder_ptr, const lzma_allocator *allocator,
|
delta_decode(void *coder_ptr, const lzma_allocator *allocator,
|
||||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||||
|
|
|
@ -122,7 +122,7 @@ global:
|
||||||
lzma_str_to_filters;
|
lzma_str_to_filters;
|
||||||
} XZ_5.2;
|
} XZ_5.2;
|
||||||
|
|
||||||
XZ_5.5.2beta {
|
XZ_5.6.0 {
|
||||||
global:
|
global:
|
||||||
lzma_mt_block_size;
|
lzma_mt_block_size;
|
||||||
} XZ_5.4;
|
} XZ_5.4;
|
||||||
|
|
|
@ -137,7 +137,7 @@ global:
|
||||||
lzma_str_to_filters;
|
lzma_str_to_filters;
|
||||||
} XZ_5.2;
|
} XZ_5.2;
|
||||||
|
|
||||||
XZ_5.5.2beta {
|
XZ_5.6.0 {
|
||||||
global:
|
global:
|
||||||
lzma_mt_block_size;
|
lzma_mt_block_size;
|
||||||
} XZ_5.4;
|
} XZ_5.4;
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
// and different processors. Overall 0x1F0 seems to be the best choice.
|
// and different processors. Overall 0x1F0 seems to be the best choice.
|
||||||
#ifndef LZMA_RANGE_DECODER_CONFIG
|
#ifndef LZMA_RANGE_DECODER_CONFIG
|
||||||
# if defined(__x86_64__) && !defined(__ILP32__) \
|
# if defined(__x86_64__) && !defined(__ILP32__) \
|
||||||
|
&& !defined(__NVCOMPILER) \
|
||||||
&& (defined(__GNUC__) || defined(__clang__))
|
&& (defined(__GNUC__) || defined(__clang__))
|
||||||
# define LZMA_RANGE_DECODER_CONFIG 0x1F0
|
# define LZMA_RANGE_DECODER_CONFIG 0x1F0
|
||||||
# else
|
# else
|
||||||
|
|
|
@ -116,7 +116,7 @@ AUIPC with rd != x0
|
||||||
Zfh, F, D, and Q:
|
Zfh, F, D, and Q:
|
||||||
* RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
|
* RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
|
||||||
* RV64I has also: LD, LWU, SD
|
* RV64I has also: LD, LWU, SD
|
||||||
* Zhf: FLH, FSH
|
* Zfh: FLH, FSH
|
||||||
* F: FLW, FSW
|
* F: FLW, FSW
|
||||||
* D: FLD, FSD
|
* D: FLD, FSD
|
||||||
* Q: FLQ, FSQ
|
* Q: FLQ, FSQ
|
||||||
|
@ -320,11 +320,11 @@ AUIPC with rd == x0
|
||||||
// The left-hand side takes care of (1) and (2).
|
// The left-hand side takes care of (1) and (2).
|
||||||
// (a) The lowest 7 bits are already known to be AUIPC so subtracting 0x17
|
// (a) The lowest 7 bits are already known to be AUIPC so subtracting 0x17
|
||||||
// makes those bits zeros.
|
// 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
|
// If rd doesn't equal x2, then there will be at least one non-zero bit
|
||||||
// and the next step (c) is irrelevant.
|
// and the next step (c) is irrelevant.
|
||||||
// (c) If the lowest two opcode bits of the packed inst2 are set in [13:12],
|
// (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.
|
// will be at least one non-zero bit.
|
||||||
//
|
//
|
||||||
// The shift by 18 removes the high bits from the final '>=' comparison and
|
// The shift by 18 removes the high bits from the final '>=' comparison and
|
||||||
|
|
|
@ -581,7 +581,14 @@ coder_set_compression_settings(void)
|
||||||
|
|
||||||
if (memory_usage <= memory_limit) {
|
if (memory_usage <= memory_limit) {
|
||||||
// The memory usage is now low enough.
|
// The memory usage is now low enough.
|
||||||
message(V_WARNING, _("Reduced the number of "
|
//
|
||||||
|
// Since 5.6.1: This is only shown at
|
||||||
|
// V_DEBUG instead of V_WARNING because
|
||||||
|
// changing the number of threads doesn't
|
||||||
|
// affect the output. On some systems this
|
||||||
|
// message would be too common now that
|
||||||
|
// multithreaded compression is the default.
|
||||||
|
message(V_DEBUG, _("Reduced the number of "
|
||||||
"threads from %s to %s to not exceed "
|
"threads from %s to %s to not exceed "
|
||||||
"the memory usage limit of %s MiB"),
|
"the memory usage limit of %s MiB"),
|
||||||
uint64_to_str(
|
uint64_to_str(
|
||||||
|
@ -600,8 +607,11 @@ coder_set_compression_settings(void)
|
||||||
// way -T0 won't use insane amount of memory but at the same
|
// way -T0 won't use insane amount of memory but at the same
|
||||||
// time the soft limit will never make xz fail and never make
|
// time the soft limit will never make xz fail and never make
|
||||||
// xz change settings that would affect the compressed output.
|
// xz change settings that would affect the compressed output.
|
||||||
|
//
|
||||||
|
// Since 5.6.1: Like above, this is now shown at V_DEBUG
|
||||||
|
// instead of V_WARNING.
|
||||||
if (hardware_memlimit_mtenc_is_default()) {
|
if (hardware_memlimit_mtenc_is_default()) {
|
||||||
message(V_WARNING, _("Reduced the number of threads "
|
message(V_DEBUG, _("Reduced the number of threads "
|
||||||
"from %s to one. The automatic memory usage "
|
"from %s to one. The automatic memory usage "
|
||||||
"limit of %s MiB is still being exceeded. "
|
"limit of %s MiB is still being exceeded. "
|
||||||
"%s MiB of memory is required. "
|
"%s MiB of memory is required. "
|
||||||
|
|
|
@ -109,7 +109,7 @@ sandbox_enable_strict_if_allowed(int src_fd lzma_attribute((__unused__)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#elif defined(HAVE_LINUX_LANDLOCK_H)
|
#elif defined(HAVE_LINUX_LANDLOCK)
|
||||||
|
|
||||||
//////////////
|
//////////////
|
||||||
// Landlock //
|
// Landlock //
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#if defined(HAVE_PLEDGE) || defined(HAVE_LINUX_LANDLOCK_H) \
|
#if defined(HAVE_PLEDGE) || defined(HAVE_LINUX_LANDLOCK) \
|
||||||
|| defined(HAVE_CAP_RIGHTS_LIMIT)
|
|| defined(HAVE_CAP_RIGHTS_LIMIT)
|
||||||
# define ENABLE_SANDBOX 1
|
# define ENABLE_SANDBOX 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
.\" Authors: Lasse Collin
|
.\" Authors: Lasse Collin
|
||||||
.\" Jia Tan
|
.\" Jia Tan
|
||||||
.\"
|
.\"
|
||||||
.TH XZ 1 "2024-02-13" "Tukaani" "XZ Utils"
|
.TH XZ 1 "2024-02-25" "Tukaani" "XZ Utils"
|
||||||
.
|
.
|
||||||
.SH NAME
|
.SH NAME
|
||||||
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
|
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
|
||||||
|
@ -1812,6 +1812,8 @@ and
|
||||||
\fB\-\-ia64\fR[\fB=\fIoptions\fR]
|
\fB\-\-ia64\fR[\fB=\fIoptions\fR]
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-sparc\fR[\fB=\fIoptions\fR]
|
\fB\-\-sparc\fR[\fB=\fIoptions\fR]
|
||||||
|
.TP
|
||||||
|
\fB\-\-riscv\fR[\fB=\fIoptions\fR]
|
||||||
.PD
|
.PD
|
||||||
Add a branch/call/jump (BCJ) filter to the filter chain.
|
Add a branch/call/jump (BCJ) filter to the filter chain.
|
||||||
These filters can be used only as a non-last filter
|
These filters can be used only as a non-last filter
|
||||||
|
|
|
@ -24,14 +24,14 @@
|
||||||
# include <sys/capsicum.h>
|
# include <sys/capsicum.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_LANDLOCK_H
|
#ifdef HAVE_LINUX_LANDLOCK
|
||||||
# include <linux/landlock.h>
|
# include <linux/landlock.h>
|
||||||
# include <sys/prctl.h>
|
# include <sys/prctl.h>
|
||||||
# include <sys/syscall.h>
|
# include <sys/syscall.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_CAP_RIGHTS_LIMIT) || defined(HAVE_PLEDGE) \
|
#if defined(HAVE_CAP_RIGHTS_LIMIT) || defined(HAVE_PLEDGE) \
|
||||||
|| defined(HAVE_LINUX_LANDLOCK_H)
|
|| defined(HAVE_LINUX_LANDLOCK)
|
||||||
# define ENABLE_SANDBOX 1
|
# define ENABLE_SANDBOX 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ sandbox_enter(int src_fd)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
(void)src_fd;
|
(void)src_fd;
|
||||||
#elif defined(HAVE_LINUX_LANDLOCK_H)
|
#elif defined(HAVE_LINUX_LANDLOCK)
|
||||||
int landlock_abi = syscall(SYS_landlock_create_ruleset,
|
int landlock_abi = syscall(SYS_landlock_create_ruleset,
|
||||||
(void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
|
(void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_LINUX_LANDLOCK_H
|
#ifdef HAVE_LINUX_LANDLOCK
|
||||||
// Prevent the process from gaining new privileges. The return
|
// Prevent the process from gaining new privileges. The return
|
||||||
// is ignored to keep compatibility with old kernels.
|
// is ignored to keep compatibility with old kernels.
|
||||||
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
|
||||||
|
|
|
@ -42,8 +42,7 @@ check_PROGRAMS = \
|
||||||
test_bcj_exact_size \
|
test_bcj_exact_size \
|
||||||
test_memlimit \
|
test_memlimit \
|
||||||
test_lzip_decoder \
|
test_lzip_decoder \
|
||||||
test_vli \
|
test_vli
|
||||||
test_microlzma
|
|
||||||
|
|
||||||
TESTS = \
|
TESTS = \
|
||||||
test_check \
|
test_check \
|
||||||
|
@ -58,7 +57,6 @@ TESTS = \
|
||||||
test_memlimit \
|
test_memlimit \
|
||||||
test_lzip_decoder \
|
test_lzip_decoder \
|
||||||
test_vli \
|
test_vli \
|
||||||
test_microlzma \
|
|
||||||
test_files.sh \
|
test_files.sh \
|
||||||
test_suffix.sh \
|
test_suffix.sh \
|
||||||
test_compress_prepared_bcj_sparc \
|
test_compress_prepared_bcj_sparc \
|
||||||
|
@ -67,6 +65,11 @@ TESTS = \
|
||||||
test_compress_generated_random \
|
test_compress_generated_random \
|
||||||
test_compress_generated_text
|
test_compress_generated_text
|
||||||
|
|
||||||
|
if COND_MICROLZMA
|
||||||
|
check_PROGRAMS += test_microlzma
|
||||||
|
TESTS += test_microlzma
|
||||||
|
endif
|
||||||
|
|
||||||
if COND_SCRIPTS
|
if COND_SCRIPTS
|
||||||
TESTS += test_scripts.sh
|
TESTS += test_scripts.sh
|
||||||
endif
|
endif
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -149,6 +149,17 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Test that --single-stream can decompress bad-3-corrupt_lzma2.xz.
|
||||||
|
# The first Stream in this file should decompress without errors.
|
||||||
|
# This file cannot be decompressed with xzdec.
|
||||||
|
I="$srcdir/files/bad-3-corrupt_lzma2.xz"
|
||||||
|
if test -z "$XZ" || "$XZ" -dc --single-stream $NO_WARN "$I" > /dev/null; then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
echo "Good first Stream failed xz with --single-stream: $I"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#########
|
#########
|
||||||
# .lzma #
|
# .lzma #
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
/// \file test_microlzma.c
|
/// \file test_microlzma.c
|
||||||
|
@ -5,15 +7,10 @@
|
||||||
//
|
//
|
||||||
// Author: Jia Tan
|
// Author: Jia Tan
|
||||||
//
|
//
|
||||||
// This file has been put into the public domain.
|
|
||||||
// You can do whatever you want with this file.
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
|
|
||||||
#ifdef HAVE_MICROLZMA
|
|
||||||
|
|
||||||
#define BUFFER_SIZE 1024
|
#define BUFFER_SIZE 1024
|
||||||
|
|
||||||
#ifdef HAVE_ENCODER_LZMA1
|
#ifdef HAVE_ENCODER_LZMA1
|
||||||
|
@ -514,7 +511,6 @@ test_decode_bad_lzma_properties(void)
|
||||||
lzma_end(&strm);
|
lzma_end(&strm);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
|
@ -522,17 +518,16 @@ main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
tuktest_start(argc, argv);
|
tuktest_start(argc, argv);
|
||||||
|
|
||||||
#ifndef HAVE_MICROLZMA
|
#ifndef HAVE_ENCODER_LZMA1
|
||||||
tuktest_early_skip("MicroLZMA disabled");
|
tuktest_early_skip("LZMA1 encoder disabled");
|
||||||
#else
|
#else
|
||||||
# ifdef HAVE_ENCODER_LZMA1
|
|
||||||
tuktest_run(test_encode_options);
|
tuktest_run(test_encode_options);
|
||||||
tuktest_run(test_encode_basic);
|
tuktest_run(test_encode_basic);
|
||||||
tuktest_run(test_encode_small_out);
|
tuktest_run(test_encode_small_out);
|
||||||
tuktest_run(test_encode_actions);
|
tuktest_run(test_encode_actions);
|
||||||
# endif
|
|
||||||
|
|
||||||
# if defined(HAVE_DECODER_LZMA1) && defined(HAVE_ENCODER_LZMA1)
|
// MicroLZMA decoder tests require the basic encoder functionality.
|
||||||
|
# ifdef HAVE_DECODER_LZMA1
|
||||||
goodbye_world_encoded_size = basic_microlzma_encode(goodbye_world,
|
goodbye_world_encoded_size = basic_microlzma_encode(goodbye_world,
|
||||||
ARRAY_SIZE(goodbye_world), &goodbye_world_encoded);
|
ARRAY_SIZE(goodbye_world), &goodbye_world_encoded);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue