aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2024-06-04 01:14:43 +0000
committerXin LI <delphij@FreeBSD.org>2024-06-04 01:14:43 +0000
commit3b35e7ee8de9b0260149a2b77e87a2b9c7a36244 (patch)
tree93a784d59bcb2144fa0e234cd6b32b40e236ad2d /contrib
parenta9b55a66440ce67e545b60f2861badbfc5ec6327 (diff)
parentb599c3410cda4294a1f24783c500a7ee63f2f3af (diff)
downloadsrc-3b35e7ee8de9b0260149a2b77e87a2b9c7a36244.tar.gz
src-3b35e7ee8de9b0260149a2b77e87a2b9c7a36244.zip
MFV: xz 5.6.2.
MFC after: 4 weeks
Diffstat (limited to 'contrib')
-rw-r--r--contrib/xz/AUTHORS49
-rw-r--r--contrib/xz/COPYING103
-rw-r--r--contrib/xz/COPYING.0BSD11
-rw-r--r--contrib/xz/ChangeLog17568
-rw-r--r--contrib/xz/README57
-rw-r--r--contrib/xz/THANKS13
-rw-r--r--contrib/xz/TODO4
-rw-r--r--contrib/xz/doxygen/Doxyfile2672
-rwxr-xr-xcontrib/xz/doxygen/update-doxygen137
-rw-r--r--contrib/xz/src/common/mythread.h30
-rw-r--r--contrib/xz/src/common/sysdefs.h18
-rw-r--r--contrib/xz/src/common/tuklib_common.h27
-rw-r--r--contrib/xz/src/common/tuklib_config.h2
-rw-r--r--contrib/xz/src/common/tuklib_cpucores.c5
-rw-r--r--contrib/xz/src/common/tuklib_cpucores.h5
-rw-r--r--contrib/xz/src/common/tuklib_exit.c5
-rw-r--r--contrib/xz/src/common/tuklib_exit.h9
-rw-r--r--contrib/xz/src/common/tuklib_gettext.h5
-rw-r--r--contrib/xz/src/common/tuklib_integer.h56
-rw-r--r--contrib/xz/src/common/tuklib_mbstr.h5
-rw-r--r--contrib/xz/src/common/tuklib_mbstr_fw.c5
-rw-r--r--contrib/xz/src/common/tuklib_mbstr_width.c5
-rw-r--r--contrib/xz/src/common/tuklib_open_stdxxx.c5
-rw-r--r--contrib/xz/src/common/tuklib_open_stdxxx.h5
-rw-r--r--contrib/xz/src/common/tuklib_physmem.c25
-rw-r--r--contrib/xz/src/common/tuklib_physmem.h5
-rw-r--r--contrib/xz/src/common/tuklib_progname.c5
-rw-r--r--contrib/xz/src/common/tuklib_progname.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma.h31
-rw-r--r--contrib/xz/src/liblzma/api/lzma/base.h25
-rw-r--r--contrib/xz/src/liblzma/api/lzma/bcj.h10
-rw-r--r--contrib/xz/src/liblzma/api/lzma/block.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/check.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/container.h17
-rw-r--r--contrib/xz/src/liblzma/api/lzma/delta.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/filter.h11
-rw-r--r--contrib/xz/src/liblzma/api/lzma/hardware.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/index.h42
-rw-r--r--contrib/xz/src/liblzma/api/lzma/index_hash.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/lzma12.h7
-rw-r--r--contrib/xz/src/liblzma/api/lzma/stream_flags.h5
-rw-r--r--contrib/xz/src/liblzma/api/lzma/version.h9
-rw-r--r--contrib/xz/src/liblzma/api/lzma/vli.h10
-rw-r--r--contrib/xz/src/liblzma/check/check.c5
-rw-r--r--contrib/xz/src/liblzma/check/check.h5
-rw-r--r--contrib/xz/src/liblzma/check/crc32_arm64.h122
-rw-r--r--contrib/xz/src/liblzma/check/crc32_fast.c158
-rw-r--r--contrib/xz/src/liblzma/check/crc32_small.c5
-rw-r--r--contrib/xz/src/liblzma/check/crc32_table.c34
-rw-r--r--contrib/xz/src/liblzma/check/crc32_table_be.h4
-rw-r--r--contrib/xz/src/liblzma/check/crc32_table_le.h4
-rw-r--r--contrib/xz/src/liblzma/check/crc32_tablegen.c23
-rw-r--r--contrib/xz/src/liblzma/check/crc32_x86.S5
-rw-r--r--contrib/xz/src/liblzma/check/crc64_fast.c446
-rw-r--r--contrib/xz/src/liblzma/check/crc64_small.c5
-rw-r--r--contrib/xz/src/liblzma/check/crc64_table.c16
-rw-r--r--contrib/xz/src/liblzma/check/crc64_table_be.h4
-rw-r--r--contrib/xz/src/liblzma/check/crc64_table_le.h4
-rw-r--r--contrib/xz/src/liblzma/check/crc64_tablegen.c15
-rw-r--r--contrib/xz/src/liblzma/check/crc64_x86.S5
-rw-r--r--contrib/xz/src/liblzma/check/crc_common.h137
-rw-r--r--contrib/xz/src/liblzma/check/crc_macros.h30
-rw-r--r--contrib/xz/src/liblzma/check/crc_x86_clmul.h428
-rw-r--r--contrib/xz/src/liblzma/common/alone_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/alone_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/alone_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/auto_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_buffer_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_buffer_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_buffer_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/block_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/block_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/block_header_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_header_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/block_util.c5
-rw-r--r--contrib/xz/src/liblzma/common/common.c5
-rw-r--r--contrib/xz/src/liblzma/common/common.h5
-rw-r--r--contrib/xz/src/liblzma/common/easy_buffer_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/easy_decoder_memusage.c5
-rw-r--r--contrib/xz/src/liblzma/common/easy_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/easy_encoder_memusage.c5
-rw-r--r--contrib/xz/src/liblzma/common/easy_preset.c5
-rw-r--r--contrib/xz/src/liblzma/common/easy_preset.h10
-rw-r--r--contrib/xz/src/liblzma/common/file_info.c5
-rw-r--r--contrib/xz/src/liblzma/common/filter_buffer_decoder.c7
-rw-r--r--contrib/xz/src/liblzma/common/filter_buffer_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/filter_common.c16
-rw-r--r--contrib/xz/src/liblzma/common/filter_common.h5
-rw-r--r--contrib/xz/src/liblzma/common/filter_decoder.c28
-rw-r--r--contrib/xz/src/liblzma/common/filter_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/filter_encoder.c38
-rw-r--r--contrib/xz/src/liblzma/common/filter_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/filter_flags_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/filter_flags_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/hardware_cputhreads.c5
-rw-r--r--contrib/xz/src/liblzma/common/hardware_physmem.c5
-rw-r--r--contrib/xz/src/liblzma/common/index.c5
-rw-r--r--contrib/xz/src/liblzma/common/index.h5
-rw-r--r--contrib/xz/src/liblzma/common/index_decoder.c16
-rw-r--r--contrib/xz/src/liblzma/common/index_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/index_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/index_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/index_hash.c5
-rw-r--r--contrib/xz/src/liblzma/common/lzip_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/lzip_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/memcmplen.h37
-rw-r--r--contrib/xz/src/liblzma/common/microlzma_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/microlzma_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/outqueue.c5
-rw-r--r--contrib/xz/src/liblzma/common/outqueue.h10
-rw-r--r--contrib/xz/src/liblzma/common/stream_buffer_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_buffer_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/common/stream_decoder_mt.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_encoder_mt.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_flags_common.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_flags_common.h5
-rw-r--r--contrib/xz/src/liblzma/common/stream_flags_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/stream_flags_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/string_conversion.c26
-rw-r--r--contrib/xz/src/liblzma/common/vli_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/vli_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/common/vli_size.c5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_common.c5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_common.h5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_decoder.c10
-rw-r--r--contrib/xz/src/liblzma/delta/delta_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/delta/delta_private.h5
-rw-r--r--contrib/xz/src/liblzma/liblzma.pc.in6
-rw-r--r--contrib/xz/src/liblzma/liblzma_generic.map4
-rw-r--r--contrib/xz/src/liblzma/liblzma_linux.map4
-rw-r--r--contrib/xz/src/liblzma/lz/lz_decoder.c48
-rw-r--r--contrib/xz/src/liblzma/lz/lz_decoder.h116
-rw-r--r--contrib/xz/src/liblzma/lz/lz_encoder.c9
-rw-r--r--contrib/xz/src/liblzma/lz/lz_encoder.h15
-rw-r--r--contrib/xz/src/liblzma/lz/lz_encoder_hash.h5
-rw-r--r--contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h4
-rw-r--r--contrib/xz/src/liblzma/lz/lz_encoder_mf.c5
-rw-r--r--contrib/xz/src/liblzma/lzma/fastpos.h5
-rw-r--r--contrib/xz/src/liblzma/lzma/fastpos_table.c4
-rw-r--r--contrib/xz/src/liblzma/lzma/fastpos_tablegen.c17
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma2_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma2_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma2_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma2_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_common.h41
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_decoder.c760
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder.c18
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c7
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c5
-rw-r--r--contrib/xz/src/liblzma/lzma/lzma_encoder_private.h9
-rw-r--r--contrib/xz/src/liblzma/rangecoder/price.h5
-rw-r--r--contrib/xz/src/liblzma/rangecoder/price_table.c4
-rw-r--r--contrib/xz/src/liblzma/rangecoder/price_tablegen.c22
-rw-r--r--contrib/xz/src/liblzma/rangecoder/range_common.h14
-rw-r--r--contrib/xz/src/liblzma/rangecoder/range_decoder.h839
-rw-r--r--contrib/xz/src/liblzma/rangecoder/range_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/simple/arm.c5
-rw-r--r--contrib/xz/src/liblzma/simple/arm64.c5
-rw-r--r--contrib/xz/src/liblzma/simple/armthumb.c5
-rw-r--r--contrib/xz/src/liblzma/simple/ia64.c5
-rw-r--r--contrib/xz/src/liblzma/simple/powerpc.c5
-rw-r--r--contrib/xz/src/liblzma/simple/riscv.c755
-rw-r--r--contrib/xz/src/liblzma/simple/simple_coder.c5
-rw-r--r--contrib/xz/src/liblzma/simple/simple_coder.h22
-rw-r--r--contrib/xz/src/liblzma/simple/simple_decoder.c5
-rw-r--r--contrib/xz/src/liblzma/simple/simple_decoder.h5
-rw-r--r--contrib/xz/src/liblzma/simple/simple_encoder.c5
-rw-r--r--contrib/xz/src/liblzma/simple/simple_encoder.h5
-rw-r--r--contrib/xz/src/liblzma/simple/simple_private.h5
-rw-r--r--contrib/xz/src/liblzma/simple/sparc.c5
-rw-r--r--contrib/xz/src/liblzma/simple/x86.c16
-rw-r--r--contrib/xz/src/liblzma/validate_map.sh6
-rw-r--r--contrib/xz/src/lzmainfo/lzmainfo.14
-rw-r--r--contrib/xz/src/lzmainfo/lzmainfo.c5
-rw-r--r--contrib/xz/src/xz/args.c186
-rw-r--r--contrib/xz/src/xz/args.h8
-rw-r--r--contrib/xz/src/xz/coder.c607
-rw-r--r--contrib/xz/src/xz/coder.h42
-rw-r--r--contrib/xz/src/xz/file_io.c144
-rw-r--r--contrib/xz/src/xz/file_io.h21
-rw-r--r--contrib/xz/src/xz/hardware.c11
-rw-r--r--contrib/xz/src/xz/hardware.h5
-rw-r--r--contrib/xz/src/xz/list.c31
-rw-r--r--contrib/xz/src/xz/list.h5
-rw-r--r--contrib/xz/src/xz/main.c91
-rw-r--r--contrib/xz/src/xz/main.h5
-rw-r--r--contrib/xz/src/xz/message.c94
-rw-r--r--contrib/xz/src/xz/message.h16
-rw-r--r--contrib/xz/src/xz/mytime.c105
-rw-r--r--contrib/xz/src/xz/mytime.h11
-rw-r--r--contrib/xz/src/xz/options.c7
-rw-r--r--contrib/xz/src/xz/options.h5
-rw-r--r--contrib/xz/src/xz/private.h26
-rw-r--r--contrib/xz/src/xz/sandbox.c355
-rw-r--r--contrib/xz/src/xz/sandbox.h43
-rw-r--r--contrib/xz/src/xz/signals.c29
-rw-r--r--contrib/xz/src/xz/signals.h5
-rw-r--r--contrib/xz/src/xz/suffix.c17
-rw-r--r--contrib/xz/src/xz/suffix.h5
-rw-r--r--contrib/xz/src/xz/util.c36
-rw-r--r--contrib/xz/src/xz/util.h19
-rw-r--r--contrib/xz/src/xz/xz.1469
-rw-r--r--contrib/xz/src/xzdec/xzdec.16
-rw-r--r--contrib/xz/src/xzdec/xzdec.c180
214 files changed, 15186 insertions, 13263 deletions
diff --git a/contrib/xz/AUTHORS b/contrib/xz/AUTHORS
index 69bbfc3ef609..5eff238ae413 100644
--- a/contrib/xz/AUTHORS
+++ b/contrib/xz/AUTHORS
@@ -2,22 +2,20 @@
Authors of XZ Utils
===================
- XZ Utils is developed and maintained by Lasse Collin
- <lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>.
+ XZ Utils is developed and maintained by
+ Lasse Collin <lasse.collin@tukaani.org>.
Major parts of liblzma are based on code written by Igor Pavlov,
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
this code, XZ Utils wouldn't exist.
- The SHA-256 implementation in liblzma is based on the code found from
- 7-Zip <https://7-zip.org/>, which has a modified version of the SHA-256
- code found from Crypto++ <https://www.cryptopp.com/>. The SHA-256 code
- in Crypto++ was written by Kevin Springle and Wei Dai.
+ The SHA-256 implementation in liblzma is based on code written by
+ Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
- Some scripts have been adapted from gzip. The original versions
- were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
- Andrew Dudman helped adapting the scripts and their man pages for
- XZ Utils.
+ A few scripts have been adapted from GNU gzip. The original
+ versions were written by Jean-loup Gailly, Charles Levert, and
+ Paul Eggert. Andrew Dudman helped adapting the scripts and their
+ man pages for XZ Utils.
The initial version of the threaded .xz decompressor was written
by Sebastian Andrzej Siewior.
@@ -25,15 +23,36 @@ Authors of XZ Utils
The initial version of the .lz (lzip) decoder was written
by Michał Górny.
- CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov.
+ Architecture-specific CRC optimizations were contributed by
+ Ilya Kurdyukov, Hans Jansen, and Chenxi Mao.
Other authors:
- Jonathan Nieder
- Joachim Henke
- The GNU Autotools-based build system contains files from many authors,
- which I'm not trying to list here.
+ Special author: Jia Tan was a co-maintainer in 2022-2024. He and
+ the team behind him inserted a backdoor (CVE-2024-3094) into
+ XZ Utils 5.6.0 and 5.6.1 releases. He suddenly disappeared when
+ this was discovered.
- Several people have contributed fixes or reported bugs. Most of them
- are mentioned in the file THANKS.
+ Many people have contributed improvements or reported bugs.
+ Most of these people are mentioned in the file THANKS.
+
+ The translations of the command line tools and man pages have been
+ contributed by many people via the Translation Project:
+
+ - https://translationproject.org/domain/xz.html
+ - https://translationproject.org/domain/xz-man.html
+
+ The authors of the translated man pages are in the header comments
+ of the man page files. In the source package, the authors of the
+ translations are in po/*.po and po4a/*.po files.
+
+ Third-party code whose authors aren't listed here:
+
+ - GNU getopt_long() in the 'lib' directory is included for
+ platforms that don't have a usable getopt_long().
+
+ - The build system files from GNU Autoconf, GNU Automake,
+ GNU Libtool, GNU Gettext, Autoconf Archive, and related files.
diff --git a/contrib/xz/COPYING b/contrib/xz/COPYING
index e54eeacfbf3f..aed21531497c 100644
--- a/contrib/xz/COPYING
+++ b/contrib/xz/COPYING
@@ -3,74 +3,81 @@ XZ Utils Licensing
==================
Different licenses apply to different files in this package. Here
- is a rough summary of which licenses apply to which parts of this
- package (but check the individual files to be sure!):
+ is a summary of which licenses apply to which parts of this package:
- - liblzma is in the public domain.
+ - liblzma is under the BSD Zero Clause License (0BSD).
- - xz, xzdec, and lzmadec command line tools are in the public
- domain unless GNU getopt_long had to be compiled and linked
- in from the lib directory. The getopt_long code is under
- GNU LGPLv2.1+.
+ - The command line tools xz, xzdec, lzmadec, and lzmainfo are
+ under 0BSD except that, on systems that don't have a usable
+ getopt_long, GNU getopt_long is compiled and linked in from the
+ 'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been
- adapted from gzip. These scripts and their documentation are
- under GNU GPLv2+.
+ adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
+ and xzmore) are under GNU GPLv2+. The man pages of the scripts
+ are under 0BSD; they aren't based on the man pages of GNU gzip.
- - All the documentation in the doc directory and most of the
- XZ Utils specific documentation files in other directories
- are in the public domain.
+ - Most of the XZ Utils specific documentation that is in
+ plain text files (like README, INSTALL, PACKAGERS, NEWS,
+ and ChangeLog) are under 0BSD unless stated otherwise in
+ the file itself. The files xz-file-format.txt and
+ lzma-file-format.xt are in the public domain but may
+ be distributed under the terms of 0BSD too.
- Note: The JavaScript files (under the MIT license) have
- been removed from the Doxygen-generated HTML version of the
- liblzma API documentation. Doxygen itself is under the GNU GPL
- but the remaining files generated by Doxygen are not affected
- by the licenses used in Doxygen because Doxygen licensing has
- the following exception:
+ - Translated messages and man pages are under 0BSD except that
+ some old translations are in the public domain.
- "Documents produced by doxygen are derivative works
- derived from the input used in their production;
- they are not affected by this license."
+ - Test files and test code in the 'tests' directory, and
+ debugging utilities in the 'debug' directory are under
+ the BSD Zero Clause License (0BSD).
- - Translated messages are in the public domain.
+ - The GNU Autotools based build system contains files that are
+ under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses.
+ These files don't affect the licensing of the binaries being
+ built.
- - The build system contains public domain files, and files that
- are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
- in the binaries being built.
+ - The 'extra' directory contains files that are under various
+ free software licenses. These aren't built or installed as
+ part of XZ Utils.
- - Test files and test code in the tests directory, and debugging
- utilities in the debug directory are in the public domain.
+ For the files under the BSD Zero Clause License (0BSD), if
+ a copyright notice is needed, the following is sufficient:
- - The extra directory may contain public domain files, and files
- that are under various free software licenses.
+ Copyright (C) The XZ Utils authors and contributors
- You can do whatever you want with the files that have been put into
- the public domain. If you find public domain legally problematic,
- take the previous sentence as a license grant. If you still find
- the lack of copyright legally problematic, you have too many
- lawyers.
-
- As usual, this software is provided "as is", without any warranty.
-
- If you copy significant amounts of public domain code from XZ Utils
+ If you copy significant amounts of 0BSD-licensed code from XZ Utils
into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but
- naturally it is not legally required. Here is an example of a good
- notice to put into "about box" or into documentation:
+ it is not legally required by the license terms. Here is an example
+ of a good notice to put into "about box" or into documentation:
This software includes code from XZ Utils <https://tukaani.org/xz/>.
The following license texts are included in the following files:
+ - COPYING.0BSD: BSD Zero Clause License
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3
- Note that the toolchain (compiler, linker etc.) may add some code
- pieces that are copyrighted. Thus, it is possible that e.g. liblzma
- binary wouldn't actually be in the public domain in its entirety
- even though it contains no copyrighted code from the XZ Utils source
- package.
-
- If you have questions, don't hesitate to ask the author(s) for more
- information.
+ A note about old XZ Utils releases:
+
+ XZ Utils releases 5.4.6 and older and 5.5.1alpha have a
+ significant amount of code put into the public domain and
+ that obviously remains so. The switch from public domain to
+ 0BSD for newer releases was made in Febrary 2024 because
+ public domain has (real or perceived) legal ambiguities in
+ some jurisdictions.
+
+ There is very little *practical* difference between public
+ domain and 0BSD. The main difference likely is that one
+ shouldn't claim that 0BSD-licensed code is in the public
+ domain; 0BSD-licensed code is copyrighted but available under
+ an extremely permissive license. Neither 0BSD nor public domain
+ require retaining or reproducing author, copyright holder, or
+ license notices when distributing the software. (Compare to,
+ for example, BSD 2-Clause "Simplified" License which does have
+ such requirements.)
+
+ If you have questions, don't hesitate to ask for more information.
+ The contact information is in the README file.
diff --git a/contrib/xz/COPYING.0BSD b/contrib/xz/COPYING.0BSD
new file mode 100644
index 000000000000..4322122aecf1
--- /dev/null
+++ b/contrib/xz/COPYING.0BSD
@@ -0,0 +1,11 @@
+Permission to use, copy, modify, and/or distribute this
+software for any purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/contrib/xz/ChangeLog b/contrib/xz/ChangeLog
index 4dd0978ef313..c7795974ba23 100644
--- a/contrib/xz/ChangeLog
+++ b/contrib/xz/ChangeLog
@@ -1,11756 +1,12662 @@
-commit 49053c0a649f4c8bd2b8d97ce915f401fbc0f3d9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-10-31 22:30:29 +0800
+commit 3ec664d3f652133136587a51d4505b1abe1acdd7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-29 18:03:51 +0300
- Bump version and soname for 5.4.5.
+ Bump version and soname for 5.6.2
src/liblzma/Makefile.am | 2 +-
src/liblzma/api/lzma/version.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
-commit 84c0cfc556287628df871703672879e530d0391f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-11-01 20:18:30 +0800
+commit 3cc0aa702e50b786c52c6f3d3f831a635c4df197
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-29 18:03:04 +0300
- Add NEWS for 5.4.5.
+ Add NEWS for 5.6.2
- NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 74 insertions(+)
+ NEWS | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 130 insertions(+)
-commit d90ed84db9770712e2421e170076b43bda9b64a7
+commit 526d3f7f2c2d5e134157d08b37fb5fd0b125799e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-31 21:41:09 +0200
+Date: 2024-05-29 18:03:04 +0300
- liblzma: Fix compilation of fastpos_tablegen.c.
-
- The macro lzma_attr_visibility_hidden has to be defined to make
- fastpos.h usable. The visibility attribute is irrelevant to
- fastpos_tablegen.c so simply #define the macro to an empty value.
-
- fastpos_tablegen.c is never built by the included build systems
- and so the problem wasn't noticed earlier. It's just a standalone
- program for generating fastpos_table.c.
-
- Fixes: https://github.com/tukaani-project/xz/pull/69
- Thanks to GitHub user Jamaika1.
+ Add NEWS for 5.4.7
- src/liblzma/lzma/fastpos_tablegen.c | 2 ++
- 1 file changed, 2 insertions(+)
+ NEWS | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 89 insertions(+)
-commit 9b1268538b0b2c6c0a121f95165de65fc71ad23c
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-10-31 21:51:40 +0800
+commit 660b09279e8f544acf120d29194d5c3051b484eb
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-29 18:03:04 +0300
- Build: Fix text wrapping in an output message.
+ Add NEWS for 5.2.13
- configure.ac | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
+ NEWS | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 115 insertions(+)
-commit 068ee436f4a8a706125ef43e8228b30001b1554e
+commit 7d76282dac766c0ced8ae24e0f7ce0005f3e377d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-22 17:59:11 +0300
+Date: 2024-05-29 17:47:13 +0300
- liblzma: Use lzma_always_inline in memcmplen.h.
+ Translations: Run po4a/update-po
+
+ Now the files are in the new formatting without source file
+ line numbers. Future updates should keep the diffs much smaller.
- src/liblzma/common/memcmplen.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
+ po4a/de.po | 1592 ++++++++++---------
+ po4a/fr.po | 4450 +++++++++++++++++-----------------------------------
+ po4a/ko.po | 1592 ++++++++++---------
+ po4a/pt_BR.po | 4817 ++++++++++++++++++---------------------------------------
+ po4a/ro.po | 1592 ++++++++++---------
+ po4a/uk.po | 1592 ++++++++++---------
+ 6 files changed, 6114 insertions(+), 9521 deletions(-)
-commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5
+commit 4470c3f7d8954bb47b280ec07ad0bd4be2223083
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-30 17:43:03 +0200
+Date: 2024-05-29 17:44:53 +0300
- liblzma: #define lzma_always_inline in common.h.
+ Translations: Run "make -C po update-po"
+
+ In the past this wasn't done before releases; the Git repository
+ just contained the files from the Translation Project. But this
+ way it is clearer when comparing release tarballs against the
+ Git repository. In future releases this might no longer be necessary
+ within a stable branch as the .po files won't change so easily anymore
+ when creating a tarball.
- src/liblzma/common/common.h | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
+ po/ca.po | 567 +++++++++++++++++++++++++---------------
+ po/cs.po | 821 +++++++++++++++++++++++++++++++++++++--------------------
+ po/da.po | 809 +++++++++++++++++++++++++++++++++++---------------------
+ po/de.po | 403 ++++++++++++++--------------
+ po/eo.po | 403 ++++++++++++++--------------
+ po/es.po | 403 ++++++++++++++--------------
+ po/fi.po | 578 +++++++++++++++++++++++++---------------
+ po/fr.po | 538 +++++++++++++++++++++++---------------
+ po/hr.po | 403 ++++++++++++++--------------
+ po/hu.po | 403 ++++++++++++++--------------
+ po/it.po | 854 +++++++++++++++++++++++++++++++++++++++---------------------
+ po/ko.po | 403 ++++++++++++++--------------
+ po/pl.po | 403 ++++++++++++++--------------
+ po/pt.po | 842 +++++++++++++++++++++++++++++++++++++++--------------------
+ po/pt_BR.po | 567 +++++++++++++++++++++++++---------------
+ po/ro.po | 403 ++++++++++++++--------------
+ po/sr.po | 838 ++++++++++++++++++++++++++++++++++++++--------------------
+ po/sv.po | 403 ++++++++++++++--------------
+ po/tr.po | 567 +++++++++++++++++++++++++---------------
+ po/uk.po | 403 ++++++++++++++--------------
+ po/vi.po | 403 ++++++++++++++--------------
+ po/zh_CN.po | 417 +++++++++++++++--------------
+ po/zh_TW.po | 558 ++++++++++++++++++++++++---------------
+ 23 files changed, 7257 insertions(+), 5132 deletions(-)
-commit 33daad3961a4f07f3902b40f13e823e6e43e85da
+commit 33b8a85face5392b5ac843bdbe3a72f024cad6ef
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-22 17:15:32 +0300
+Date: 2024-05-29 16:33:24 +0300
- liblzma: Use lzma_attr_visibility_hidden on private extern declarations.
+ Build: Update po/*.po files only when needed
- These variables are internal to liblzma and not exposed in the API.
+ When po/xz.pot doesn't exist, running "make" or "make dist" will
+ create it. Then the .po files will be updated but only if they
+ actually would change more than the POT-Creation-Date line.
+ Then the .gmo files would be generated from the .po files.
+ This is the case before and after this commit.
+
+ However, "make dist" and thus "make mydist" did a forced update
+ to the files, updating them even if the only change was the
+ POT-Creation-Date line. This had pros and cons: It made it clear
+ that the .po file really is in sync with the recent strings in
+ the package. On the other hand, it added noise in form of changed
+ files in the source tree and distribution tarballs. It can be
+ ignored with something like "diff -I'^"POT-Creation-Date: '" but
+ it's still a minor annoyance *if* there's not enough value in
+ having the most recent timestamp.
+
+ Setting DIST_DEPENDS_ON_UPDATE_PO = no means that such forced
+ update won't happen in "make dist" anymore. However, the "mydist"
+ target will use xz.pot-update target which is the same target that
+ is run when xz.pot doesn't exist at all yet. Thus "mydist" will
+ ensure that the translations are up to date, without noise from
+ changes that would affect only the POT-Creation-Date line.
+
+ Note that po4a always uses msgmerge with --update, so POT-Creation-Date
+ in the man page translations is never the only change in .po files.
+ In that sense this commit makes the message translations behave more
+ similarly to the man page translations.
+
+ Distribution tarballs will still have non-reproducible POT-Creation-Date
+ in po/xz.pot and po4a/xz-man.pot but those are just two files. Even they
+ could be made reproducible from a Git timestamp if desired.
+
+ (cherry picked from commit 9284f1aea31f0eb23e2ea72f7218b271e2234762)
- src/liblzma/check/check.h | 7 +++++++
- src/liblzma/common/stream_flags_common.h | 3 +++
- src/liblzma/lz/lz_encoder_hash.h | 1 +
- src/liblzma/lzma/fastpos.h | 1 +
- src/liblzma/rangecoder/price.h | 1 +
- 5 files changed, 13 insertions(+)
+ Makefile.am | 3 ++-
+ po/Makevars | 6 +++++-
+ 2 files changed, 7 insertions(+), 2 deletions(-)
-commit 6961a5ac7df178bfc2b7a181c40575847bc3035f
+commit 09daebd66b55799bbc495b84310a86c91bbfc1c8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-22 17:08:39 +0300
+Date: 2024-05-28 21:10:33 +0300
- liblzma: #define lzma_attr_visibility_hidden in common.h.
+ po4a/update-po: Disable wrapping in .pot and .po files
- In ELF shared libs:
+ The .po files from the Translation Project come with unwrapped
+ strings so this matches it.
- -fvisibility=hidden affects definitions of symbols but not
- declarations.[*] This doesn't affect direct calls to functions
- inside liblzma as a linker can replace a call to lzma_foo@plt
- with a call directly to lzma_foo when -fvisibility=hidden is used.
-
- [*] It has to be like this because otherwise every installed
- header file would need to explictly set the symbol visibility
- to default.
+ This may reduce the noise in diffs too. When the beginning of
+ a paragraph had changed, the rest of the lines got rewrapped
+ in msgsid. Now it's just one very long line that changes when
+ a paragraph has been edited.
- When accessing extern variables that aren't defined in the
- same translation unit, compiler assumes that the variable has
- the default visibility and thus indirection is needed. Unlike
- function calls, linker cannot optimize this.
+ The --add-location=file option was removed as redundant. The line
+ numbers don't exist in the .pot file due to --porefs file and thus
+ they cannot get copied to the .po files either.
- Using __attribute__((__visibility__("hidden"))) with the extern
- variable declarations tells the compiler that indirection isn't
- needed because the definition is in the same shared library.
-
- About 15+ years ago, someone told me that it would be good if
- the CRC tables would be defined in the same translation unit
- as the C code of the CRC functions. While I understood that it
- could help a tiny amount, I didn't want to change the code because
- a separate translation unit for the CRC tables was needed for the
- x86 assembly code anyway. But when visibility attributes are
- supported, simply marking the extern declaration with the
- hidden attribute will get identical result. When there are only
- a few affected variables, this is trivial to do. I wish I had
- understood this back then already.
+ (cherry picked from commit 4beba1cd62d7f8f7a6f1e899b68292d94c53b599)
- src/liblzma/common/common.h | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ po4a/update-po | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
-commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb
+commit 51ad72dae4e516e9292f6f399bd1e4970b77f7c1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-30 22:54:28 +0300
+Date: 2024-05-28 18:36:53 +0300
- liblzma: Refer to MinGW-w64 instead of MinGW in the API headers.
+ Update contact info in README
- MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project
- at <https://osdn.net/projects/mingw/>) has GCC 9.2.0 as the
- most recent GCC package (released 2021-02-02). The project might
- still be alive but majority of people have switched to MinGW-w64.
- Thus it seems clearer to refer to MinGW-w64 in our API headers too.
- Building with MinGW is likely to still work but I haven't tested it
- in the recent years.
+ (cherry picked from commit b14c130a58a649f9a73392eeb122cb252327c569)
- src/liblzma/api/lzma.h | 4 ++--
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
+ README | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
-commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4
+commit 18463917f9b255b8f925fa54ab9388319735b14a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-27 00:58:17 +0300
+Date: 2024-05-28 13:25:07 +0300
- CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed.
+ Translations: Use --package-name=xz-man with po4a
- A CMake option LARGE_FILE_SUPPORT is created if and only if
- -D_FILE_OFFSET_BITS=64 affects sizeof(off_t).
+ This is to match reality. See the added comment.
- This is needed on many 32-bit platforms and even with 64-bit builds
- with MinGW-w64 to get support for files larger than 2 GiB.
+ (cherry picked from commit 75f5f2e014b0ee646963f36bc6a9c840fb272353)
- CMakeLists.txt | 7 ++++-
- cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++
- 2 files changed, 58 insertions(+), 1 deletion(-)
+ po4a/update-po | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
-commit 989c8c354cbd2d20fbae4a432a3e31f5bc1cb9bf
+commit 26bbcb13cd2bbb56fe406544a484b4edfc7e0837
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-30 02:14:25 +0300
+Date: 2024-05-28 13:03:40 +0300
- CMake: Generate and install liblzma.pc if not using MSVC.
+ Translations: Omit --package-name from po/Makevars
- Autotools based build uses -pthread and thus adds it to Libs.private
- in liblzma.pc. CMake doesn't use -pthread at all if pthread functions
- are available in libc so Libs.private doesn't get -pthread either.
+ This is closer to the reality in the po/*.po files.
+
+ (cherry picked from commit eb217d016cfbbba1babc19a61095b3ea25898af6)
- CMakeLists.txt | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
+ po/Makevars | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
-commit 983f3b458dc79c5976a4237fdfe4f8079f8d8830
+commit c35ee804b89556d15bc8cdc16867f4316e69392f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-30 01:13:13 +0300
+Date: 2024-05-28 01:17:45 +0300
- CMake: Rearrange the PACKAGE_ variables.
+ Translations: Omit man page line numbers from .pot and .po files
- The windres workaround now replaces spaces with \x20 so
- the package name isn't repeated.
+ (cherry picked from commit 9114267038deaecf4832a5cacb5acbe6591ac839)
+
+ po4a/update-po | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+commit 0f4429d47f9cfe2cdfbad115a7bc2f11221cb217
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-28 01:06:30 +0300
+
+ Translations: Use the xgettext option --add-location=file
- These changes will help with creation of liblzma.pc.
+ (cherry picked from commit 093490b58271e9424ce38a7b1b38bcf61b9c86c6)
- CMakeLists.txt | 26 +++++++++++++++-----------
- 1 file changed, 15 insertions(+), 11 deletions(-)
+ po/Makevars | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27
+commit a93e2c2d1d34a6f609d24a8e62072ce78df7a734
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-29 20:46:11 +0300
+Date: 2024-05-28 00:43:53 +0300
- liblzma: Add Cflags.private to liblzma.pc.in for MSYS2.
+ Translations: Use the msgmerge option --add-location=file
- It properly adds -DLZMA_API_STATIC when compiling code that
- will be linked against static liblzma. Having it there on
- systems other than Windows does no harm.
+ This way the PO file diffs are less noisy but the locations of the
+ strings are still present at file level, just without line numbers.
- See: https://www.msys2.org/docs/pkgconfig/
+ The option is available since gettext 0.19 (2014).
+ configure.ac requires 0.19.6.
+
+ (cherry picked from commit fccebe2b4fd513488fc920e4dac32562ed3c7637)
- src/liblzma/liblzma.pc.in | 1 +
- 1 file changed, 1 insertion(+)
+ po/Makevars | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 661549ecb7a9b136d72a01c137d9776c75d52d51
+commit d4389895592e9a8e0f6391fdad816ae0537bb07b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-27 22:46:20 +0300
+Date: 2024-05-27 12:22:08 +0300
- CMake: Create liblzma.def when building liblzma.dll with MinGW-w64.
+ Build: Use $(SHELL) instead of sh to run scripts in Makefile.am
+
+ (cherry picked from commit f361d9ae85707a87eb28db400eb7229cec103d58)
- CMakeLists.txt | 20 ++++++++++++++++++++
- cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++
- 2 files changed, 46 insertions(+)
+ Makefile.am | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
-commit 0e546eb4da05c52b7d257e5bd85e15c51c4d86a3
+commit 5781414b6e3120098b0060d073aa2b0580ff6f40
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-26 21:44:42 +0300
+Date: 2024-05-23 17:25:13 +0300
- CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR.
+ Translations: Change the home page URLs in man page translations
- In this case they have identical values.
+ Since the source strings have changed, these would get marked as
+ fuzzy and the original string would be used instead. The original
+ and translated strings are identical in this case so it wouldn't
+ matter. But patching the translations helps still because then
+ po4a will show the correct translation percentage.
+
+ (cherry picked from commit a26dece34793a09aac2476f954d162d03e9cf62b)
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ po4a/de.po | 8 ++++----
+ po4a/fr.po | 4 ++--
+ po4a/ko.po | 4 ++--
+ po4a/pt_BR.po | 4 ++--
+ po4a/ro.po | 8 ++++----
+ po4a/uk.po | 8 ++++----
+ 6 files changed, 18 insertions(+), 18 deletions(-)
-commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7
+commit 3670e0616eb9d86e7519d2b76242fd32c6e0c1ae
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-01 19:10:57 +0300
+Date: 2024-05-23 15:15:18 +0300
- CMake/Windows: Fix the import library filename.
+ CMake: Add manual support for 32-bit x86 assembly files
- Both PREFIX and IMPORT_PERFIX have to be set to "" to get
- liblzma.dll and liblzma.dll.a.
+ One has to pass -DENABLE_X86_ASM=ON to cmake to enable the
+ CRC assembly code. Autodetection isn't done. Looking at
+ CMAKE_SYSTEM_PROCESSOR might not work as it comes from uname
+ unless cross-compilation is done using a CMake toolchain file.
+
+ On top of this, if the code is run on modern processors that support
+ the CLMUL instruction, then the C code should be faster (but then
+ one should also be using a x86-64 build if possible).
+
+ (cherry picked from commit 24387c234b4eed1ef9a7eaa107391740b4095568)
- CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
+ CMakeLists.txt | 34 +++++++++++++++++++++++++++++++---
+ 1 file changed, 31 insertions(+), 3 deletions(-)
-commit 007558a358c48a0175cc8d47d11798d7967282ab
+commit c1b001b09e902ecacabb8a2ae1fc991018a4d1f8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-11 19:47:44 +0300
+Date: 2024-05-23 14:26:45 +0300
- CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable.
+ CMake: Rename USE_DOXYGEN to ENABLE_DOXYGEN
- Using set(ENABLE_THREADS "posix") is confusing because it sets
- a new normal variable and leaves the cache entry with the same
- name unchanged. The intent wasn't to change the cache entry so
- this switches to a different variable name.
+ It's more consistent with the other option() uses.
+
+ (cherry picked from commit 0fb3c9c3f684f5a25bd425ed079a20a79f0c969d)
- CMakeLists.txt | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 7d01de67ee3dd76cfc12c23220e2e4cdc59708f1
+commit 7213fe39c717d4623c92af715484a71d9a6ff8d0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-09 21:12:31 +0300
+Date: 2024-05-22 15:21:53 +0300
- CMake: Edit threading related messages.
+ Use more confident language in COPYING
- It's mostly to change from "thread method" to "threading method".
+ (cherry picked from commit 62733592a1cc6f0b41f46ef52e06d1a6fe1ff38a)
- CMakeLists.txt | 19 ++++++++++---------
- 1 file changed, 10 insertions(+), 9 deletions(-)
+ COPYING | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
-commit f8edcf3da689aad4b21e139197725450f2c456a0
+commit 15358be94a4e3f9c20f331b64b3980f3e5283760
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-09 20:59:24 +0300
+Date: 2024-04-29 17:16:38 +0300
- CMake: Use FATAL_ERROR if user-supplied options aren't understood.
+ Add SPDX license identifiers to files under tests/ossfuzz
- This way typos are caught quickly and compounding error messages
- are avoided (a single typo could cause more than one error).
+ (cherry picked from commit 9ae2ebc1e504a1814b0788de95fb5c58c0328dde)
+
+ tests/ossfuzz/Makefile | 2 ++
+ tests/ossfuzz/config/fuzz_decode_alone.options | 2 ++
+ tests/ossfuzz/config/fuzz_decode_stream.options | 2 ++
+ tests/ossfuzz/config/fuzz_encode_stream.options | 2 ++
+ tests/ossfuzz/config/fuzz_lzma.dict | 2 ++
+ tests/ossfuzz/config/fuzz_xz.dict | 2 ++
+ 6 files changed, 12 insertions(+)
+
+commit 1aa92c7ffd0bf8f9738ebf3bd1263bd6f5f096a2
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-29 17:16:06 +0300
+
+ Add SPDX license identifier to .codespellrc
- This keeps using SEND_ERROR when the system is lacking a feature
- (like threading library or sandboxing method). This way the whole
- configuration log will be generated in case someone wishes to
- report a problem upstream.
+ (cherry picked from commit 9000d70eb9815bd7f43ffddc1c3316c507aa0e05)
- CMakeLists.txt | 28 ++++++++++++++--------------
- 1 file changed, 14 insertions(+), 14 deletions(-)
+ .codespellrc | 2 ++
+ 1 file changed, 2 insertions(+)
-commit 1695021e4a233a9388ddd428654c1447f0ea3bfb
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-10-19 16:09:01 +0800
+commit 3c7e400fdcabc0a1b78863948fc17964667a9401
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-22 15:12:09 +0300
- CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL.
+ Move entries po4a/.gitignore to the top level .gitignore
- The option is enabled by default, but will only be visible to a user
- listing cache variables or using a CMake GUI application if the
- immintrin.h header file is found.
+ The po4a directory is in EXTRA_DIST and thus all files there
+ are included in the package. .gitignore doesn't belong in the
+ package so keep that file out of the po4a directory.
- This mirrors our Autotools build --disable-clmul-crc functionality.
+ (cherry picked from commit 903c16fcfa5bfad0cdb2a7383d941243bcb12e76)
- CMakeLists.txt | 40 +++++++++++++++++++++++-----------------
- 1 file changed, 23 insertions(+), 17 deletions(-)
+ .gitignore | 4 ++++
+ po4a/.gitignore | 3 ---
+ 2 files changed, 4 insertions(+), 3 deletions(-)
-commit 5056bc51071d1a07097c5667a0d5bd85242e31b9
+commit 8a99272d4a9358dabdb5bc0b72f4c5240a9dc066
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-14 17:56:59 +0300
+Date: 2024-05-20 16:55:00 +0300
- tuklib_integer: Revise unaligned reads and writes on strict-align archs.
+ CMake: Add comments
- In XZ Utils context this doesn't matter much because
- unaligned reads and writes aren't used in hot code
- when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined.
+ (cherry picked from commit 9d997d6f9d4f042412e45c7b7a23a14ad2e4f9aa)
- src/common/tuklib_integer.h | 256 ++++++++++++++++++++++++++++++++------------
- 1 file changed, 189 insertions(+), 67 deletions(-)
+ tests/tests.cmake | 2 ++
+ 1 file changed, 2 insertions(+)
-commit 9e14743ee5ba79181076bc33952245d5b18fbc58
+commit c35259c9e2400f6f88c269d95ecafdb223ff45d2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-23 02:21:49 +0300
+Date: 2024-05-20 16:55:00 +0300
- tuklib_integer: Add missing write64be and write64le fallback functions.
+ CMake: Remove the note that some tests aren't run
+
+ They are now in the common build configurations.
+
+ (cherry picked from commit d35368b33e54bad2f566df99fac29ffea38e34de)
- src/common/tuklib_integer.h | 34 ++++++++++++++++++++++++++++++++++
- 1 file changed, 34 insertions(+)
+ CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
-commit 4cc91ceb3992ef4f51302b56178c3b2c2aeaaaad
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-10-12 20:12:18 +0800
+commit 30982a215395f19b3837c3da540e1cb3f913569f
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-20 16:55:00 +0300
- Build: Update visibility.m4 from Gnulib.
+ CMake: Add support for test_files.sh
- Updating from version 6 -> 8 from upstream. Declarations for variables
- and function bodies were added to avoid unnecessary failures with
- -Werror.
+ (cherry picked from commit dc232d584619b2819a9c52d6ad5d8b5d56b392ba)
- m4/visibility.m4 | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
+ tests/tests.cmake | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
-commit 1824a6007cb1c8d5d7abcc7bf649148bc06fa72c
+commit 3a8f81e0ad4cd1c102a03ff09e703cf8cb074afc
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-10-06 19:36:35 +0300
+Date: 2024-05-20 16:55:00 +0300
- Update THANKS.
+ Tests: Make test_files.sh more flexible
+
+ Add a new optional argument to specify the directory of the xz and
+ xzdec executables.
+
+ If ../config.h doesn't exist, assume that all encoders and decoders
+ are available.
+
+ (cherry picked from commit a7e9230af9d1f87f474fe38886eb977d4149dc9b)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/test_files.sh | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
-commit 8fdc71a27d07b10a3da52432432e080b6d577642
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-29 20:14:39 +0800
+commit 0644675c829143112c85455f8a6aa91bfc4e1bbb
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-20 16:55:00 +0300
- CMake: Rename xz and man page symlink custom targets.
+ CMake: Add support for test_compress.sh tests
- The Ninja Generator for CMake cannot have a custom target and its
- BYPRODUCTS have the same name. This has prevented Ninja builds on
- Unix-like systems since the xz symlinks were introduced in
- 80a1a8bb838842a2be343bd88ad1462c21c5e2c9.
+ (cherry picked from commit b40e6efbb48d740b9b5b303e59e344801cbb5bd8)
- CMakeLists.txt | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ tests/tests.cmake | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
-commit 38171492ded6426ddf53d0c200fa8c93fcd02a60
+commit dcc02a6ca0e0ac4e330e820683754badbcf9815b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-27 19:54:35 +0300
+Date: 2024-05-20 16:55:00 +0300
- CMake: Fix Windows build with Clang/LLVM 17.
+ Tests: Make test_compress.sh more flexible
- llvm-windres 17.0.0 has more accurate emulation of GNU windres, so
- the hack for GNU windres must now be used with llvm-windres too.
+ Add a new optional second argument: directory of the xz and xzdec
+ executables. This is need with the CMake build where the binaries
+ end up in the top-level build directory.
- LLVM 16.0.6 has the old behavior and there likely won't be more
- 16.x releases. So we can simply check for >= 17.0.0.
+ If ../config.h doesn't exist, assume that all encoders and decoders
+ are available. This will make this script usable from CMake in the
+ most common build configuration.
- The workaround must not be used with Clang that is acting in
- MSVC mode. This checks for the known environments that need
- the workaround instead of using "NOT MSVC".
+ NOTE: Since the existence of ../config.h is checked, the working
+ directory of the test script must be a subdir in the build tree!
+ Otherwise ../config.h would look outside the build tree.
- See also:
- https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47
+ Use the default check type instead of forcing CRC32 or CRC64.
+ Now the script doesn't need to check if CRC64 is available.
+
+ (cherry picked from commit ac3222d2cb1ff3a15eb6d58f9ea9bc78e8bc3bb2)
- CMakeLists.txt | 26 ++++++++++++++------------
- 1 file changed, 14 insertions(+), 12 deletions(-)
+ tests/test_compress.sh | 41 +++++++++++++++++++++++++++++------------
+ 1 file changed, 29 insertions(+), 12 deletions(-)
-commit 1bce6fe48334b5df33d0487a9cbe41950122230e
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-27 00:02:11 +0800
+commit c761b7051fb2ebb6da3cbecafe695fb5af7b2c9c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-20 16:55:00 +0300
- liblzma: Avoid compiler warning without creating extra symbol.
+ CMake: Prepare to support the test_*.sh tests
- When the generic fast crc64 method is used, then we omit
- lzma_crc64_table[][].
+ This is a bit hacky since the scripts grep config.h to know which
+ features were built but the CMake build doesn't create config.h.
+ So instead those test scripts will be run only when all relevant
+ features have been enabled.
- The C standards don't allow an empty translation unit which can be
- avoided by declaring something, without exporting any symbols.
+ (cherry picked from commit 006040b29c83104403621e950ada0c8956c56b3d)
- src/liblzma/check/crc64_table.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
+ tests/tests.cmake | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 49 insertions(+)
-commit dce95a593e6cd9779110aa1e314abd8b35c75f6b
+commit a71bc2d75b95f85fe046f0fd1fb25d36be2b20ba
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-26 17:24:15 +0300
+Date: 2024-05-20 16:55:00 +0300
- Build: Update the comment about -Werror usage in checks.
+ Tests: test_suffix.sh: Add a comment
+
+ (cherry picked from commit 6167607a6ea72fb74eefb943c4566e3cab528cd2)
- configure.ac | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ tests/test_suffix.sh | 3 +++
+ 1 file changed, 3 insertions(+)
-commit f3c32762ae309afa2fe330e7fb397acfdedc4d37
+commit 8fda5ce872632e464a1f9660b3ab8dac939a03c6
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-26 13:51:31 +0300
+Date: 2024-05-18 00:34:07 +0300
- Build: Fix underquoted AC_LANG_SOURCE.
+ Fix typos
- It made no practical difference in this case.
+ Thanks to xx on #tukaani.
+
+ (cherry picked from commit 4e9023857d287f624562156b60dc23d2b64c0f10)
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/common/mythread.h | 2 +-
+ src/common/tuklib_integer.h | 2 +-
+ src/liblzma/api/lzma/base.h | 2 +-
+ src/liblzma/common/filter_buffer_decoder.c | 2 +-
+ src/liblzma/common/filter_common.c | 2 +-
+ src/scripts/xzgrep.in | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
-commit 7dd57f2f2c8fde93fa42b4dbf6d9860717723b41
+commit 2729079bcb8dd1c3ab1a79426690d17f6f8e6f7d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-26 13:14:37 +0300
+Date: 2024-05-18 00:23:52 +0300
- Build: Silence Autoconf warning.
+ liblzma: Fix white space
- There was a use of AC_COMPILE_IFELSE that didn't use
- AC_LANG_SOURCE and Autoconf warned about this. The omission
- had been intentional but it turned out that this didn't do
- what I thought it would.
-
- Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE
- inserts all #defines that have been made with AC_DEFINE so
- far (confdefs.h). The idea was that omitting AC_LANG_SOURCE
- would mean that only the exact code included in the
- AC_COMPILE_IFELSE call would be compiled.
-
- With C programs this is not true: the #defines get added without
- AC_LANG_SOURCE too. There seems to be no neat way to avoid this.
- Thus, with the C language at least, adding AC_LANG_SOURCE makes
- no other difference than silencing a warning from Autoconf. The
- generated "configure" remains identical. (Docs of AC_LANG_CONFTEST
- say that the #defines have been inserted since Autoconf 2.63b and
- that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is
- documented if one also reads the docs of macros that one isn't
- calling directly.)
+ Thanks to xx on #tukaani.
- Any extra code, including #defines, can cause problems for
- these two tests because these tests must use -Werror.
- CC=clang CFLAGS=-Weverything is the most extreme example.
- It enables -Wreserved-macro-identifier which warns about
- It's possible to write a test file that passes -Weverything but
- it becomes impossible when Autoconf inserts confdefs.h.
-
- So this commit adds AC_LANG_SOURCE to silence Autoconf warnings.
- A different solution is needed for -Werror tests.
+ (cherry picked from commit b14d08fbbc254485ace9ccfe7908674f608a62ae)
- configure.ac | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
+ src/liblzma/simple/simple_coder.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
-commit edec253e418562f3164a01ecc8805295fa022efa
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-26 00:47:26 +0800
+commit a289c4dfeb3ded35e129c48b13f46605f0138704
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-13 17:15:04 +0300
- Build: Remove Gnulib dependency from tests.
+ xz: Document the static function get_chains_memusage()
- The tests do not use any Gnulib replacements so they do not need to link
- libgnu.a or have /lib in the include path.
+ (cherry picked from commit 142e670a413a7bce1a2647f1cf1f33f8ee2dbe88)
- tests/Makefile.am | 7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
+ src/xz/coder.c | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
-commit 46cb133ce7360496eecca1255b364c05f0205855
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-26 00:43:43 +0800
+commit 6f0db31713845386ce2419c55b2df89b53b80dd3
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-13 17:07:22 +0300
- CMake: Remove /lib from tests include path.
+ xz: Rename filters_memusage_max() to get_chains_memusage()
- The tests never included anything from /lib, so this was not needed.
+ (cherry picked from commit 78e984399a64bfee5d11e7308e0bdbc1006db2ca)
- CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
+ src/xz/coder.c | 14 ++++++--------
+ 1 file changed, 6 insertions(+), 8 deletions(-)
-commit 4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1
+commit d7e2bf7e2dc9289a7a5dd0311d19d10de6d7ea1b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-24 16:32:32 +0300
+Date: 2024-05-13 17:04:05 +0300
- sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO.
+ xz: Rename filter_memusages to chains_memusages
+
+ (cherry picked from commit 54c3db0a83d3e67d89aba92a0957f2dce9b111a7)
- src/common/sysdefs.h | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
+ src/xz/coder.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 660c8c29e57d30dbd5009ef1f0ec1bbe195ccef6
+commit 58f200b6d1dc4cbc1ab3315a359120ab6eb84878
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-22 02:33:29 +0300
+Date: 2024-05-12 22:26:30 +0300
- xz: Windows: Don't (de)compress to special files like "con" or "nul".
+ xz: Simplify the memory usage scaling code
- Before this commit, the following writes "foo" to the
- console and deletes the input file:
+ This is closer to what it was before the --filtersX support was added,
+ just extended to support for scaling all filter chains. The method
+ before this commit was an extended version of the original too but
+ it was done in a more complex way for no clear reason. In case of
+ an error, the complex version printed fewer informative messages
+ (a good thing) but it's not a sigificant benefit.
- echo foo | xz > con_xz
- xz --suffix=_xz --decompress con_xz
+ In the limit is too low even for single-threaded mode, the required
+ amount of memory is now reported like in 5.4.x instead of like in
+ 5.5.1alpha - 5.6.1 which showed the original non-scaled usage. It
+ had been a FIXME in the old code but it's not clear what message
+ makes the most sense.
- It cannot happen without --suffix because names like con.xz
- are also special and so attempting to decompress con.xz
- (or compress con to con.xz) will already fail when opening
- the input file.
-
- Similar thing is possible when compressing. The following
- writes to "nul" and the input file "n" is deleted.
-
- echo foo | xz > n
- xz --suffix=ul n
-
- Now xz checks if the destination is a special file before
- continuing. DOS/DJGPP version had a check for this but
- Windows (and OS/2) didn't.
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ (cherry picked from commit d9e1ae79ec90d6a7eafeaceaf0ece4f0c83d4417)
- src/xz/file_io.c | 35 ++++++++++++++++++++++++++++-------
- 1 file changed, 28 insertions(+), 7 deletions(-)
+ src/xz/coder.c | 163 ++++++++++++++++++++-------------------------------------
+ 1 file changed, 57 insertions(+), 106 deletions(-)
-commit b7ce6e80786fc0c08ed129e8ee262ea96a5473a1
+commit 41bdc9fa5cc2fc2a70f4331329ac724773cc2f26
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-21 20:42:52 +0300
+Date: 2024-05-13 12:14:00 +0300
- CMake: Wrap two overlong lines that are possible to wrap.
+ xz: Edit comments
+
+ (cherry picked from commit 0ee56983d198b776878432703de664049b1be32e)
- CMakeLists.txt | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ src/xz/coder.h | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
-commit 1595f454d5c8257c668cccd6a86dd68175d5c430
+commit 52e40c1912dfdbf8c7aa85e3a4c3eb138fa73d5d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-21 20:36:31 +0300
+Date: 2024-05-13 12:03:51 +0300
- CMake: Add a comment about threads on Cygwin.
+ xz: Rename chain_idx to chain_num
+
+ (cherry picked from commit ec82a49c3553f7206104582dbfb8b64fa433b491)
- CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/coder.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 5be6275f19784cdd5a954f0188045c8ff4934d54
+commit 8a019633319c694423691f58c55fa23a46e45ded
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-12 21:12:34 +0300
+Date: 2024-05-12 22:29:11 +0300
- CMake: Bump maximum policy version to 3.27.
-
- There are several new policies. CMP0149 may affect the Windows SDK
- version that CMake will choose by default. The new behavior is more
- predictable, always choosing the latest SDK version by default.
+ xz: Edit coding style
- The other new policies shouldn't affect this package.
+ (cherry picked from commit a731a6993c34bbbd55abaf9c166718682b1da24f)
- CMakeLists.txt | 2 +-
+ src/xz/coder.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit e515643d7524851d1eb7dab73453e26d8521324c
+commit e3ad7eda74caea29849e2e9ec01212f5f7d0f574
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-08 19:08:57 +0300
+Date: 2024-05-12 22:16:05 +0300
- Doxygen: Add more C macro names to PREDEFINED.
+ xz: Edit comments
+
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ (cherry picked from commit 32eb176b89243fce3112347fe43a8ad14a9fd2be)
- doxygen/Doxyfile | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ src/xz/coder.c | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
-commit e3478ae4f36cd06522a2fef023860893f068434d
+commit 09cabae2ab47a06f6eee02419a815d4bfd0d9490
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-11 18:47:26 +0300
+Date: 2024-05-12 21:57:49 +0300
- liblzma: Move a few __attribute__ uses in function declarations.
+ xz: Fix grammar in a comment
- The API headers have many attributes but these were left
- as is for now.
+ Fixes: cb3111e3ed84152912b5138d690c8d9f00c6ef02
+ (cherry picked from commit b90339f4daa510d2b1b8c550f855a99667f1d004)
- src/liblzma/common/common.c | 6 ++++--
- src/liblzma/common/common.h | 8 ++++----
- src/liblzma/common/memcmplen.h | 3 ++-
- 3 files changed, 10 insertions(+), 7 deletions(-)
+ src/xz/coder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit b71b8922ef3971e5ccffd1e213888d44abe21d11
+commit c10b66fbf9b2442741a1f052bdb4ce7009af9cda
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-11 19:03:35 +0300
+Date: 2024-05-12 21:46:56 +0300
- xz, xzdec, lzmainfo: Use tuklib_attr_noreturn.
+ xz: Rename filter_memusages to encoder_memusages
- For compatibility with C23's [[noreturn]], tuklib_attr_noreturn
- must be at the beginning of declaration (before "extern" or
- "static", and even before any GNU C's __attribute__).
-
- This commit also moves all other function attributes to
- the beginning of function declarations. "extern" is kept
- at the beginning of a line so the attributes are listed on
- separate lines before "extern" or "static".
+ (cherry picked from commit 4c0bdaf13d651b22ba13bd93f8379724d6ccdc13)
- src/lzmainfo/lzmainfo.c | 6 ++++--
- src/xz/coder.c | 3 ++-
- src/xz/hardware.h | 3 ++-
- src/xz/message.h | 30 +++++++++++++++++-------------
- src/xz/options.c | 3 ++-
- src/xz/util.h | 8 ++++----
- src/xzdec/xzdec.c | 9 ++++++---
- 7 files changed, 37 insertions(+), 25 deletions(-)
+ src/xz/coder.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
-commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b
+commit 9132ce3564b2c003bffd6de6294a3d98dccf314e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-11 18:53:31 +0300
+Date: 2024-05-12 21:42:05 +0300
- Remove incorrect uses of __attribute__((__malloc__)).
+ xz: Edit coding style
- xrealloc() is obviously incorrect, modern GCC docs even
- mention realloc() as an example where this attribute
- cannot be used.
+ (cherry picked from commit b54aa023e0ec291b06e976e5f094ab0549e7b09b)
+
+ src/xz/coder.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit d642e13874e93b03959d1de523f1c8ebe9428838
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 21:31:02 +0300
+
+ xz: Rename filters_index to chain_num
- liblzma's lzma_alloc() and lzma_alloc_zero() would be
- correct uses most of the time but custom allocators
- may use a memory pool or otherwise hold the pointer
- so aliasing issues could happen in theory.
+ The reason is the same as in bd0782c1f13e52cd0fd8415208e30e47004a4c68.
- The xstrdup() case likely was correct but I removed it anyway.
- Now there are no __malloc__ attributes left in the code.
- The allocations aren't in hot paths so this should make
- no practical difference.
+ (cherry picked from commit 49f67d3d3f42b640a7dfc4ca04c8934f658e10ce)
- src/liblzma/common/common.c | 4 ++--
- src/liblzma/common/common.h | 4 ++--
- src/xz/util.h | 4 ++--
- 3 files changed, 6 insertions(+), 6 deletions(-)
+ src/xz/args.c | 8 ++++----
+ src/xz/coder.c | 8 ++++----
+ src/xz/coder.h | 2 +-
+ 3 files changed, 9 insertions(+), 9 deletions(-)
-commit 589b4cba22fccb1dbc919df5d134aefb2b5a6b01
+commit 47599f3b73f0a2bc18e0a8367d723f1eb0f11b63
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-19 14:03:45 +0300
+Date: 2024-05-12 21:22:43 +0300
- Update THANKS.
+ xz: Replace a few uint32_t with "unsigned" to reduce the number of casts
+
+ These hold only tiny values.
+
+ (cherry picked from commit ff9e8b3d069ecfa52ec43dcdb198542d1692a492)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/args.c | 2 +-
+ src/xz/coder.c | 17 ++++++++---------
+ src/xz/coder.h | 2 +-
+ 3 files changed, 10 insertions(+), 11 deletions(-)
-commit 43728ed2267e921fbdfa699ee1e91b105ab0e98b
+commit 8f5ab75c454ea8676ed09c7f6eda8afe87b008ad
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-14 16:35:46 +0300
+Date: 2024-05-12 21:10:45 +0300
- Update THANKS.
+ xz: Rename filters_used_mask to chains_used_mask
+
+ The reason is the same as in bd0782c1f13e52cd0fd8415208e30e47004a4c68.
+
+ (cherry picked from commit b5e6c1113b1ba02c282bd9163eccdb521c937a78)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/coder.c | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
-commit caf00e0988ba47842cfd93dfbb17f7d30120d6e7
+commit 3eb7cf9dd5b90a074f741234225d7de51ad88774
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-09-14 16:34:07 +0300
+Date: 2024-05-12 17:14:43 +0300
- liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)).
+ xz: Move the setting of "check" in coder_set_compression_settings()
- Thanks to Agostino Sarubbo.
- Fixes: https://github.com/tukaani-project/xz/issues/62
+ It's more logical to do it in the beginning instead of in the middle
+ of the filter chain handling.
+
+ Fixes: d6af7f347077b22403133239592e478931307759
+ (cherry picked from commit 32500dfaadae2ea36fda2e17b49ae7d9ac1acf52)
- src/liblzma/check/crc64_fast.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ src/xz/coder.c | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
-commit a70e96d2da761b8b3a77bf14e08002d871e5950b
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-12 22:36:12 +0800
+commit 067961ee0e1adaa66a43fbf8c3be31697554a839
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 17:09:17 +0300
- CMake: Fix time.h checks not running on second CMake run.
+ xz: Rename "filters" to "chains"
- If CMake was configured more than once, HAVE_CLOCK_GETTIME and
- HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check
- for librt being needed to provide HAVE_CLOCK_GETTIME was also
- simplified.
+ The convention is that
+
+ lzma_filter filters[LZMA_FILTERS_MAX + 1];
+
+ contains the filters of a single filter chain.
+ It was so here as well before the commit
+ d6af7f347077b22403133239592e478931307759.
+ It changes "filters" to a ten-element array of filter chains.
+ It's clearer to call this array-of-arrays "chains".
+
+ This also renames "filter_idx" to "chain_idx" which is used
+ as an index as in chains[chain_idx].
+
+ (cherry picked from commit ad146b1f42bbb678175a503a45ce525e779f9b8b)
- CMakeLists.txt | 18 ++++++++++--------
- 1 file changed, 10 insertions(+), 8 deletions(-)
+ src/xz/coder.c | 68 +++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 34 insertions(+), 34 deletions(-)
-commit d5275d83bd2a9701c5feb8666785007c074b1359
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-09-12 22:34:06 +0800
+commit 6822f6f891d43c97ea379a51223ce8ea69439161
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 16:56:15 +0300
- CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC.
+ xz: Clean up a comment
- If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always
- added as a compile definition even if the check for it failed.
+ (cherry picked from commit 5a4ae4e4d0105404184e9a82ee08f94e1b7783e0)
- CMakeLists.txt | 8 +++-----
- 1 file changed, 3 insertions(+), 5 deletions(-)
+ src/xz/coder.c | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
-commit 1f6e7c68fbdeeaa9482fc77de090be63d90912fd
+commit 0e5e3e7bdcfcdc4b4607665ff0f6ad794e5195af
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-31 19:50:05 +0300
+Date: 2024-05-12 16:52:09 +0300
- xz: Refactor thousand separator detection and disable it on MSVC.
+ xz: Add clarifying assertions
- Now the two variations of the format strings are created with
- a macro, and the whole detection code can be easily disabled
- on platforms where thousand separator formatting is known to
- not work (MSVC has no support, and on DJGPP 2.05 it can have
- problems in some cases).
+ (cherry picked from commit 2de80494ed9a4dc7db395a32a5efb770ce769804)
- src/xz/util.c | 89 ++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 45 insertions(+), 44 deletions(-)
+ src/xz/coder.c | 4 ++++
+ 1 file changed, 4 insertions(+)
-commit ef71f83973a20cc28a3221f85681922026ea33f5
+commit 77bcf6b76a26833923e62b2dec717474d5d44700
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-31 18:14:43 +0300
+Date: 2024-05-10 20:23:33 +0300
- xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX.
+ xz: Add a clarifying assertion
- SSIZE_MAX isn't readily available on MSVC. Removing it means
- that there is one thing less to worry when porting to MSVC.
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ (cherry picked from commit 1eaad004bf7748976324672db028e34f42802e61)
- src/xz/file_io.c | 5 ++---
- src/xz/file_io.h | 4 ++--
- 2 files changed, 4 insertions(+), 5 deletions(-)
+ src/xz/coder.c | 1 +
+ 1 file changed, 1 insertion(+)
-commit cf8ba7c3a89e37736b926dfbe85dffeff725db47
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 23:14:45 +0800
+commit df3efc058a256629ea0153b4750d3df308757038
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 16:47:17 +0300
- Tests: Improve invalid unpadded size check in test_lzma_index_append().
+ xz: Clarify a comment
- This check was extended to test the code added to fix a failing assert
- in 68bda971bb8b666a009331455fcedb4e18d837a4.
+ (cherry picked from commit 605094329b986244833c967c04963cacc41a868d)
- tests/test_index.c | 26 +++++++++++++++++++++++---
- 1 file changed, 23 insertions(+), 3 deletions(-)
+ src/xz/coder.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-commit 4a4180ce74788e97e90b9aab579bfd7c6dce3f59
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 21:54:41 +0800
+commit 4ebfe11cd33439675f03e1e3725abf03d6f8251b
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 16:28:25 +0300
- Tests: Improve comments in test_index.c.
+ xz: Use the info collected in parse_block_list()
+
+ This is slightly simpler and it avoids looping through
+ the opt_block_list array.
+
+ (cherry picked from commit 8fac2577f2dbb9491afd8500f60d004c9071df3b)
- tests/test_index.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ src/xz/coder.c | 95 ++++++++++++++++++++++++----------------------------------
+ 1 file changed, 39 insertions(+), 56 deletions(-)
-commit 4b23b84b89e39a5117e16f66c3b01db4f08ed3e7
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 21:52:54 +0800
+commit bfea6913618357a7034a1d79079bccb688262124
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 15:48:45 +0300
- Update THANKS.
+ xz: Remember the filter chains and the largest Block in parse_block_list()
+
+ (cherry picked from commit 81d350dab864b985b740742772f3b132d4c52914)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/args.c | 18 ++++++++++++++++++
+ src/xz/coder.c | 2 ++
+ src/xz/coder.h | 13 +++++++++++++
+ 3 files changed, 33 insertions(+)
-commit 773f1e8622cb1465df528cb16a749517650acd93
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 21:50:16 +0800
+commit d4e33e73922427a0f5277b91b239af538fd41c06
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 15:38:48 +0300
- liblzma: Update assert in vli_ceil4().
+ xz: Update a comment and initialization of filters_used_mask
- The argument to vli_ceil4() should always guarantee the return value
- is also a valid lzma_vli. Thus the highest three valid lzma_vli values
- are invalid arguments. All uses of the function ensure this so the
- assert is updated to match this.
+ (cherry picked from commit 46ab56968f7dfdac187710a1223659d832fa1565)
- src/liblzma/common/index.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/xz/coder.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
-commit 68bda971bb8b666a009331455fcedb4e18d837a4
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 21:31:25 +0800
+commit 3c130737c9bb4a5021bb14eb19e9ceae30ffef3a
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 15:08:10 +0300
- liblzma: Add overflow check for Unpadded size in lzma_index_append().
+ xz: parse_block_list: Edit integer type casting
- This was not a security bug since there was no path to overflow
- UINT64_MAX in lzma_index_append() or when it calls index_file_size().
- The bug was discovered by a failing assert() in vli_ceil4() when called
- from index_file_size() when unpadded_sum (the sum of the compressed size
- of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX.
-
- Previously, the unpadded_size parameter was checked to be not greater
- than UNPADDED_SIZE_MAX, but no check was done once compressed_base was
- added.
-
- This could not have caused an integer overflow in index_file_size() when
- called by lzma_index_append(). The calculation for file_size breaks down
- into the sum of:
-
- - Compressed base from all previous Streams
- - 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and
- footer)
- - stream_padding (can be set by lzma_index_stream_padding())
- - Compressed base from the current Stream
- - Unpadded size (parameter to lzma_index_append())
-
- The sum of everything except for Unpadded size must be less than
- LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions
- that can set these values including lzma_index_stream_padding(),
- lzma_index_append(), and lzma_index_cat(). The maximum value for
- Unpadded size is enforced by lzma_index_append() to be less than or
- equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since
- LZMA_VLI_MAX is half of UINT64_MAX.
-
- Thanks to Joona Kannisto for reporting this.
+ (cherry picked from commit e89293a0baeb8663707c6b4a74fbb310ec698a8f)
- src/liblzma/common/index.c | 6 ++++++
- 1 file changed, 6 insertions(+)
+ src/xz/args.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
-commit b41bb79c602481d7ea93d65f5b3e3f08dc54233b
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-28 22:18:29 +0800
+commit 40c8513b4ee42b8c0fae9b2a229e078ac7e0f87a
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-12 14:51:37 +0300
- Translations: Update the Esperanto translation.
+ xz: Make filter_memusages a local variable
+
+ (cherry picked from commit 87011e40c168255cd2edea129ee68c901770603b)
- po/eo.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ src/xz/coder.c | 35 +++++++++++++++++++++--------------
+ 1 file changed, 21 insertions(+), 14 deletions(-)
-commit 6614e6d4bf8e2b5af6eb73930148e0ffc8d2265a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-09 20:55:36 +0800
+commit cacaf25aa71cd1110cc049d037c11e4075602c35
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-10 20:33:08 +0300
- Docs: Update INSTALL for --enable-threads method win95.
+ xz: Remove unused code and simplify
- The Autotools build allows win95 threads and --enable-small together now
- if the compiler supports __attribute__((__constructor__)).
+ opt_mode == MODE_COMPRESS isn't possible when HAVE_ENCODERS isn't
+ defined. Thus, when *encoding*, the message about *decoder* memory
+ usage is possible to show only when both encoder and decoder have
+ been built.
+
+ Since the message is shown only at V_DEBUG, skip the memusage
+ calculation if verbosity level isn't high enough.
+
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ (cherry picked from commit 347b412a9374e0456bef9da0d7d79174c0b6f1a5)
- INSTALL | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ src/xz/coder.c | 16 ++++------------
+ 1 file changed, 4 insertions(+), 12 deletions(-)
-commit bfb623ad96fa6f1dbc0c560403c4296e3c8e26c9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-09 20:54:15 +0800
+commit 3495a6b291f49079485854bb185a52c29d06cd2f
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-10 20:22:58 +0300
- CMake: Conditionally allow win95 threads and --enable-small.
+ xz: Fix integer type from uint64_t to uint32_t
+
+ lzma_options_lzma.dict_size is uint32_t so use it here too.
+
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ (cherry picked from commit 31358c057c9de9d6aba96bae112b2d17942de7cb)
- CMakeLists.txt | 27 +++++++++++++++++++--------
- 1 file changed, 19 insertions(+), 8 deletions(-)
+ src/xz/coder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit e919ebb29ac9f5270cd7176a39d0d3b4cea875a9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-09 20:35:16 +0800
+commit 2861d856deb557734f067c5c471d670f0b0c6684
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-08 21:40:07 +0300
- Build: Conditionally allow win95 threads and --enable-small.
+ debug/translation.bash: Remove an outdated test command
- When the compiler supports __attribute__((__constructor__))
- mythread_once() is never used, even with --enable-small. A configuration
- with win95 threads and --enable-small will compile and be thread safe so
- it can be allowed.
+ Since 5.3.5beta, "xz --lzma2=mf=bt4,nice=2" works even though bt4 needs
+ at least nice=4. It is rounded up internally by liblzma when needed.
- This isn't a very common configuration since MSVC does not support
- __attribute__((__constructor__)), but MINGW32 and CLANG32 environments
- for MSYS2 can use win95 threads and have
- __attribute__((__constructor__)) support.
+ Fixes: 5cd9f0df78cc4f8a7807bf6104adea13034fbb45
+ (cherry picked from commit 3f71e0f3a118e1012526f94fd640a626d30cb599)
- configure.ac | 21 +++++++++++++--------
- 1 file changed, 13 insertions(+), 8 deletions(-)
+ debug/translation.bash | 1 -
+ 1 file changed, 1 deletion(-)
-commit c0c0cd4a483a672b66a13761583bc4f84d86d501
-Author: Jamaika1 <lukaszcz18@wp.pl>
-Date: 2023-08-08 14:07:59 +0200
+commit 54546babc3feb2786e541b80f9e7216b8f1bd543
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-07 20:41:28 +0300
- mythread.h: Fix typo error in Vista threads mythread_once().
+ Fix the date of NEWS for 5.4.5
- The "once_" variable was accidentally referred to as just "once". This
- prevented building with Vista threads when
- HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined.
+ (cherry picked from commit b05a516830095a0e1937aeb31c937fb0400408b6)
- src/common/mythread.h | 2 +-
+ NEWS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit d93fbefcc48a8737fdf5678ce66d1c1d605752a0
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-03 20:10:21 +0800
+commit a7e58d1fdb493d58854ac599347cf64da0cecca4
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-07 16:21:15 +0300
- Tests: Style fixes to test_lzip_decoder.c.
+ Build: Update visibility.m4 from Gnulib
+
+ This fixes the syntax of the "serial" line and renames
+ a temporary variable.
+
+ (cherry picked from commit 6d336aeb97b69c496ddc626af403f6f21c753658)
- tests/test_lzip_decoder.c | 36 ++++++++++++++++++++++++------------
- 1 file changed, 24 insertions(+), 12 deletions(-)
+ m4/visibility.m4 | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
-commit 65981d8e45741fd1502e007609469e1d60312e69
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-03 15:56:20 +0800
+commit 07a9cda037042b262ba6c8c18fae4a5b3333d508
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-07 15:05:21 +0300
- Translations: Update the Chinese (simplified) translation.
+ po4a/update-po: Delete the *.po.authors files
+
+ These are temporary files that are needed only when running po4a.
+ The top-level Makefile.am puts the whole po4a directory into
+ distribution tarball (it's simpler) so deleting these temporary
+ files is needed to prevent them from getting into tarballs.
+
+ (cherry picked from commit ab51e8ee610e2a893906859848f93d5cb0d5ba83)
- po/zh_CN.po | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ po4a/update-po | 4 ++++
+ 1 file changed, 4 insertions(+)
-commit a108ed589171d683c34238a87e358b87f69e39a0
+commit 1b4e7dca243d8ef297a245b5ee3ce9cd1ca20f56
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-02 17:15:12 +0300
+Date: 2024-05-07 13:12:17 +0300
- xz: Omit an empty paragraph on the man page.
+ xz: Edit comments and coding style
+
+ (cherry picked from commit e4780244a17420cc95d5498cd6e02ad10eac6e5f)
- src/xz/xz.1 | 1 -
- 1 file changed, 1 deletion(-)
+ src/xz/coder.c | 25 ++++++++++++-------------
+ 1 file changed, 12 insertions(+), 13 deletions(-)
-commit 03c51c5c08fe3579d8bbc8eea8251a1128001330
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-02 20:32:20 +0800
+commit 18683525a78e96ec6d7c2b4e841e94ad39be7096
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-06 23:08:22 +0300
- Bump version and soname for 5.4.4.
+ xz: Omit an incorrect comment
+
+ It likely was a leftover from a development version of the code.
+
+ Fixes: 183819bfd9efac8c184d9bf123325719b7eee30f
+ (cherry picked from commit fe4d8b0c80eaeca3381be302eeb89aba871a7e7c)
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ src/xz/coder.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
-commit d7fa3f1b58a77f79b1a4e12452418b5555632e18
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-08-02 20:30:07 +0800
+commit 005f0398645b0342c9c1915d422743c77ec1d435
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-06 23:04:31 +0300
- Add NEWS for 5.4.4.
+ xz: Add braces to a for-statement and to an if-statement
+
+ No functional changes.
+
+ Fixes: 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+ Fixes: 479fd58d60622331fcbe48fddf756927b9f80d9a
+ (cherry picked from commit 9bef5b8d17dd5e009d6a6b2becc2dc535da53937)
- NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 43 insertions(+)
+ src/xz/coder.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 6a1093c0004c42eeaef312456c295671496dd67a
+commit 34be4e6aa62376314fde250ea4f142c18274272f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-02 15:19:43 +0300
+Date: 2024-05-06 23:00:09 +0300
- build-aux/manconv.sh: Fix US-ASCII and UTF-8 output.
+ liblzma: Omit an unneeded array from the x86 filter
- groff defaults to SGR escapes. Using -P-c passes -c to grotty
- which restores the old behavior. Perhaps there is a better way to
- get pure plain text output but this works for now.
+ Fixes: 6aa2a6deeba04808a0fe4461396e7fb70277f3d4
+ (cherry picked from commit de06b9f0c0a3f72569829ecadbc9c0a3ef099f57)
- build-aux/manconv.sh | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/simple/x86.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
-commit f6f9f5651a7e2d89f588981533155ab850e063f7
+commit 79e329b771210c30ea317dd4d99e8968f3e6f9b2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-01 19:10:43 +0300
+Date: 2024-05-06 22:56:31 +0300
- Update THANKS.
+ CMake: Add test_suffix.sh to the tests
+
+ (cherry picked from commit 7da488cb933fdf51cfc14cb5810beb0766224380)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/tests.cmake | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
-commit 0dd83ba8767dad722e0f0f94e0e4146e290a28cb
+commit 86f33bb90c6cfe6950f1d36c9e5dd7fdc9798124
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-08-01 18:22:24 +0300
+Date: 2024-05-06 22:55:54 +0300
- Update THANKS.
+ Test: Add CMake support to test_suffix.sh
+
+ It needs to find the xz executable from a different directory
+ and work without config.h.
+
+ (cherry picked from commit a805594ed0b4cbf7b81aa28ff46a8ab3c83c6876)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/test_suffix.sh | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
-commit 4170a80785cc69edfc5fdfe498bed5f40db6a7ef
-Author: ChanTsune <41658782+ChanTsune@users.noreply.github.com>
-Date: 2023-08-01 18:17:17 +0300
+commit 1e243ab378e8f78ebb3af741fb38354954cf20f9
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-06 20:45:34 +0300
- mythread.h: Disable signal functions in builds targeting Wasm + WASI.
+ Update INSTALL about MINIX 3
- signal.h in WASI SDK doesn't currently provide sigprocmask()
- or sigset_t. liblzma doesn't need them so this change makes
- liblzma and xzdec build against WASI SDK. xz doesn't build yet
- and the tests don't either as tuktest needs setjmp() which
- isn't (yet?) implemented in WASI SDK.
+ The latest stable is 3.3.0 and it's from 2014.
+ Don't mention the older versions in INSTALL.
+ 3.3.0 ships with Clang already.
- Closes: https://github.com/tukaani-project/xz/pull/57
- See also: https://github.com/tukaani-project/xz/pull/56
+ Testing with 3.4.0beta6 shows that tuklib_physmem
+ works too so omit comments about that from INSTALL.
+ Visibility warnigns weren't a problem either.
- (The original commit was edited a little by Lasse Collin.)
+ Thus it's enough to mention the need for --disable-threads
+ as configure doesn't autodetect the lack of pthreads.
+
+ (cherry picked from commit 50e19489387774bab3c4a988397d0d9c7a142a46)
- src/common/mythread.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ INSTALL | 20 +++++++-------------
+ 1 file changed, 7 insertions(+), 13 deletions(-)
-commit 0db6fbe0be1545a4f25fcd6993371155b37bbb26
-Author: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
-Date: 2023-07-31 14:02:21 +0200
+commit 8595b5ab3ba766eb6daed890bfe91a16fe329c2c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-02 23:00:16 +0300
- Docs: Fix typos found by codespell
+ Windows: Remove the "doc/api" line from README-Windows.txt
+
+ Fixes: 252aa1d67bc015eeba462803ab72edeb7744d864
+ (cherry picked from commit 68d18aea1422a2b86b98b71d0b019233d84e01b0)
- CMakeLists.txt | 4 ++--
- NEWS | 2 +-
- configure.ac | 2 +-
- src/liblzma/api/lzma/container.h | 4 ++--
- src/liblzma/api/lzma/filter.h | 2 +-
- src/liblzma/api/lzma/lzma12.h | 4 ++--
- src/liblzma/common/block_buffer_encoder.c | 2 +-
- src/liblzma/common/common.h | 2 +-
- src/liblzma/common/file_info.c | 2 +-
- src/liblzma/common/lzip_decoder.c | 2 +-
- src/liblzma/common/stream_decoder_mt.c | 8 ++++----
- src/liblzma/common/string_conversion.c | 6 +++---
- src/liblzma/lz/lz_encoder.h | 2 +-
- src/liblzma/lzma/lzma_encoder.c | 4 ++--
- src/xz/hardware.c | 4 ++--
- tests/test_filter_flags.c | 4 ++--
- tests/test_index.c | 2 +-
- tests/test_vli.c | 2 +-
- 18 files changed, 29 insertions(+), 29 deletions(-)
+ windows/README-Windows.txt | 2 --
+ 1 file changed, 2 deletions(-)
-commit 84a3a1f4e4f146b3b5fa73fe708cacb0d9f829f3
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-26 20:26:23 +0800
+commit a3f163a4ad97189744107e964e4dea505fbcc252
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-02 22:59:04 +0300
- Update .gitignore.
+ Build: Don't copy doc/api from source tree to distribution tarball
+
+ It was copied if it existed. This was intentional when autogen.sh
+ still built liblzma API docs with Doxygen.
+
+ Fixes: d3a77ebc04bf1db8d52de2d9b0f07877bc4fd139
+ (cherry picked from commit 8ede961374613aa302a13571d662cfaea1cf91f7)
- .gitignore | 4 ++++
- 1 file changed, 4 insertions(+)
+ Makefile.am | 5 -----
+ 1 file changed, 5 deletions(-)
-commit 962b3d41e0c27355ba3052ef7b7d9a887de807e5
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-28 22:03:08 +0800
+commit cb0e847fe07099c1ef6d8076f6a46e17bc431acb
+Author: Sam James <sam@gentoo.org>
+Date: 2024-05-02 13:26:40 +0100
- CMake: Conditionally allow the creation of broken symlinks.
+ ci: add SPDX headers
- The CMake build will try to create broken symlinks on Unix and Unix-like
- platforms. Cygwin and MSYS2 are Unix-like, but may not be able to create
- broken symlinks. The value of the CYGWIN or MSYS environment variables
- determine if broken symlinks are valid.
+ I've checked over each of these and they're straightforward applications
+ of the relevant Github Actions.
- The default for MSYS2 does not allow for broken symlinks, so the CMake
- build has been broken for MSYS2 since commit
- 80a1a8bb838842a2be343bd88ad1462c21c5e2c9.
+ (cherry picked from commit 9a6761aa35ed84d30bd2fda2333a4fdf3f46ecdc)
- CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
- 1 file changed, 75 insertions(+), 7 deletions(-)
+ .github/workflows/freebsd.yml | 2 ++
+ .github/workflows/netbsd.yml | 2 ++
+ .github/workflows/openbsd.yml | 2 ++
+ 3 files changed, 6 insertions(+)
-commit 19899340cf74d98304f9f5b726c72e85c7017d72
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-24 21:43:44 +0800
+commit c3c854dc759fe0c5549aa0a730be9e259243edb6
+Author: Yaroslav Halchenko <debian@onerussian.com>
+Date: 2024-03-29 14:37:24 -0400
- liblzma: Prevent an empty translation unit in Windows builds.
+ codespell: Ignore the THANKS file and debbugs.gnu.org URL
- To workaround Automake lacking Windows resource compiler support, an
- empty source file is compiled to overwrite the resource files for static
- library builds. Translation units without an external declaration are
- not allowed by the C standard and result in a warning when used with
- -Wempty-translation-unit (Clang) or -pedantic (GCC).
+ This way "codespell -i 0" is silent.
+
+ This is the first commit from
+ https://github.com/tukaani-project/xz/pull/93
+ with trivial edits by Lasse Collin.
+
+ (cherry picked from commit 81efe6119f86e3274e512c9eca5ec22b2196c2b3)
- src/liblzma/Makefile.am | 6 +++++-
+ .codespellrc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
-commit ef7fbe83937abd7f55f1637c1d08b559f1d3d6cc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-21 18:05:44 +0800
+commit 3216301aa20fcf9d5a7485e35a295d5c451d9658
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-30 14:37:11 +0300
- Tests: Skip .lz files in test_files.sh if not configured.
+ Add .gitattributes to clean up git-archive output
- Previously if the lzip decoder was not configured then test_files.sh
- would pass the lzip tests instead of skipping them.
+ (cherry picked from commit 905bfc74fe2670fd9c39014803017ab53d325401)
- tests/test_files.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ .gitattributes | 7 +++++++
+ 1 file changed, 7 insertions(+)
-commit e49815ba7aa610b72e8724025eceee23c27e7b23
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 22:11:13 +0800
+commit f99e7c69ada9e0db0ee1ebbc38c8ce9390cd9788
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 12:11:09 +0300
- Tests: Add ARM64 filter test to test_compress.sh.
+ xzdec: Support Landlock ABI version 4
+
+ This was added to xz in 02e3505991233901575b7eabc06b2c6c62a96899
+ but I forgot to do the same in xzdec.
+
+ The Landlock sandbox in xzdec could be stricter as now it's
+ active only for the last file being decompressed. In xz,
+ read-only sandbox is used for multi-file case. On the other hand,
+ xz doesn't go to the strictest mode when processing the last file
+ when more than one file was specified; xzdec does.
+
+ (cherry picked from commit 3334c71d3d4294a4f6569df3ba9bcf2443dfa501)
- tests/test_compress.sh | 1 +
- 1 file changed, 1 insertion(+)
+ src/xzdec/xzdec.c | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
-commit db5b57b827c2b084586c51da1b8a3ab0984bdb40
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-22 18:37:56 +0800
+commit bfe9be7a46cfd3b3069c15f7ba1432192bca1f5b
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-30 22:22:45 +0300
- Translations: Update the Vietnamese translation.
+ liblzma: Fix incorrect function type error from sanitizer
+
+ Clang 17 with -fsanitize=address,undefined:
+
+ src/liblzma/common/filter_common.c:366:8: runtime error:
+ call to function encoder_find through pointer to incorrect
+ function type 'const lzma_filter_coder *(*)(unsigned long)'
+ src/liblzma/common/filter_encoder.c:187: note:
+ encoder_find defined here
+
+ Use a wrapper function to get the correct type neatly.
+ This reduces the number of casts needed too.
+
+ This issue could be a problem with control flow integrity (CFI)
+ methods that check the function type on indirect function calls.
+
+ Fixes: 3b34851de1eaf358cf9268922fa0eeed8278d680
+ (cherry picked from commit 278563ef8f2b8d98d7f2c85e1a64ec1bc21d26d8)
- po/vi.po | 45 ++++++++++++++++++++++++++++-----------------
- 1 file changed, 28 insertions(+), 17 deletions(-)
+ src/liblzma/common/filter_decoder.c | 15 ++++++++++++---
+ src/liblzma/common/filter_encoder.c | 17 +++++++++++++----
+ 2 files changed, 25 insertions(+), 7 deletions(-)
-commit e6ba5014081c98cb068253b3e5f9e372dd157f3c
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:30:05 +0800
+commit 882eadc5b820b6b1495fc91ba3573ac2aa6c1df3
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-30 21:41:11 +0300
- Translations: Update the Croatian translation.
+ xz: Avoid arithmetic on a null pointer
+
+ It's undefined behavior. The result wasn't ever used as it occurred
+ in the last iteration of a loop.
+
+ Clang 17 with -fsanitize=address,undefined:
+
+ $ src/xz/xz --block-list=123
+ src/xz/args.c:164:12: runtime error: applying non-zero offset 1
+ to null pointer
+
+ Fixes: 88ccf47205d7f3aa314d358c72ef214f10f68b43
+ Co-authored-by: Sam James <sam@gentoo.org>
+ (cherry picked from commit 77c8f60547decefca8f2d0c905d9c708c38ee8ff)
- po/hr.po | 49 ++++++++++++++++++++++++++++++-------------------
- 1 file changed, 30 insertions(+), 19 deletions(-)
+ src/xz/args.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
-commit 82657a1f10a25050a3e9c246c41deb785cccba3a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:28:32 +0800
+commit ec5458e1c9b2beb416781e81ad4ff22b0149b99d
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 20:42:00 +0300
- Translations: Update the Korean man page translations.
+ CMake: Support building liblzma API docs using Doxygen
+
+ This is disabled by default to match the default in Autotools.
+ Use -DUSE_DOXYGEN=ON to enable Doxygen usage.
+
+ This uses the update-doxygen script, thus this is under if(UNIX)
+ although Doxygen itself can run on Windows too.
+
+ (cherry picked from commit 64503cc2b76a388ced4ec5f68234a07f0dcddcd5)
- po4a/ko.po | 1255 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 629 insertions(+), 626 deletions(-)
+ CMakeLists.txt | 40 +++++++++++++++++++++++++++++++---------
+ 1 file changed, 31 insertions(+), 9 deletions(-)
-commit fab35907d13efbe7c457e00a310123335d7bae3e
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:25:24 +0800
+commit 8c93ced56bcb23df723dab23b7477d580720f522
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-20 23:36:39 +0300
- Translations: Update the Korean translation.
+ CMake: List API headers in LIBLZMA_API_HEADERS variable
+
+ This way the same list will be usable in more than one location.
+
+ (cherry picked from commit 0a7f5a80d8532a1d8cfa0a902c9d1ad7651eca37)
- po/ko.po | 45 ++++++++++++++++++++++++++++-----------------
- 1 file changed, 28 insertions(+), 17 deletions(-)
+ CMakeLists.txt | 21 ++++++++++++---------
+ 1 file changed, 12 insertions(+), 9 deletions(-)
-commit f530fe1964c34797fa3b775ec5804d68007c1579
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:24:05 +0800
+commit f7c9bab0372db357511e42c9c610a2cfe5fca9b1
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 15:16:42 +0300
- Translations: Update the Polish translation.
+ PACKAGERS: Document the optional Doxygen usage
+
+ Also add a note that packagers should check the licensing
+ of the Doxygen output.
+
+ (cherry picked from commit 541406bee3f09e9813103c6406b10fc6ab2e0d30)
- po/pl.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ PACKAGERS | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
-commit 10b3500cc2617aabdbc802a63164ce0a3683ad2b
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:22:23 +0800
+commit 28e7d130cb843e96d7e6b0358f8dd58bd1b2a275
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 17:47:09 +0300
- Translations: Update the German man page translations.
+ Build: Add --enable-doxygen to generate and install API docs
+
+ It requires Doxygen. This option is disabled by default.
+
+ (cherry picked from commit e21efdf96f39378fe417479f89e97046680406f5)
- po4a/de.po | 1255 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 629 insertions(+), 626 deletions(-)
+ INSTALL | 6 ++++++
+ configure.ac | 10 +++++++++-
+ src/liblzma/api/Makefile.am | 19 +++++++++++++++++++
+ 3 files changed, 34 insertions(+), 1 deletion(-)
-commit 3d14e8a34dba176f975326924ae28a3ab5fee165
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:18:44 +0800
+commit cca7e6c05bc6cc51c0271c36856b7fe29f65c648
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 15:15:17 +0300
- Translations: Update the German translation.
+ Doxygen: update-doxygen: Support out-of-tree builds
+
+ Also, now $0 is used to refer to the script itself.
+
+ (cherry picked from commit 0ece09a575d7e542bda8825808ddd6cf7de8cc4b)
- po/de.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ doxygen/update-doxygen | 110 ++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 68 insertions(+), 42 deletions(-)
-commit bdcc180a2da15039c47455c1cafd1ce9aff442e4
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:17:10 +0800
+commit 8090d3dc7f0eea4a3a61f4f6d46a0d0866e345fe
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-28 21:08:00 +0300
- Translations: Update the Chinese (simplified) translation.
+ Doxygen: Simplify Doxyfile and add SPDX license identifier
+
+ This omits all comments and a few non-default options that weren't
+ needed. Now it contains no copyrighted content from Doxygen itself.
+
+ (cherry picked from commit 2c519f641f266fd897edf680827d9c905f411440)
- po/zh_CN.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ doxygen/Doxyfile | 2698 +-----------------------------------------------------
+ 1 file changed, 25 insertions(+), 2673 deletions(-)
-commit 844240350d33cb46ba8827b74dc8758e2abed9e5
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:15:47 +0800
+commit 0721b8bfe558502669f06c97601fe59ad0d52541
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 15:14:02 +0300
- Translations: Update the Swedish translation.
+ Doxygen: Don't strip JavaScript anymore
+
+ The stripping method worked well with Doxygen 1.8 and 1.9 but
+ it doesn't work with Doxygen 1.10 anymore. Since we won't ship
+ pre-generated liblzma API docs anymore, the extra bloat and
+ extra license info of the JavaScript files won't affect the
+ upstream source package anymore.
+
+ (cherry picked from commit bdba39a57530d11b88440df8024002be3d09e4a1)
- po/sv.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ doxygen/update-doxygen | 21 ---------------------
+ 1 file changed, 21 deletions(-)
-commit bdc7952bcfbc20c134f723ff5cbf84ab690fb4fc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:14:00 +0800
+commit 1ddb40f6fd286c3c6ef510735112db1ac1b60936
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 17:26:41 +0300
- Translations: Update the Ukrainian man page translations.
+ Build: Remove old Doxygen rules from top-level Makefile.am
+
+ (cherry picked from commit d3a77ebc04bf1db8d52de2d9b0f07877bc4fd139)
- po4a/uk.po | 1253 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 628 insertions(+), 625 deletions(-)
+ Makefile.am | 12 ------------
+ 1 file changed, 12 deletions(-)
-commit 143396e070c8d8afb56e3a5f688b214222cf71e0
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:09:15 +0800
+commit 092af76234b1bc79380427456b3215aa0b80f339
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 15:10:06 +0300
- Translations: Update the Ukrainian translation.
+ Update COPYING to match the autogen.sh and mydist changes
+
+ (cherry picked from commit fd7faa4c338a42a6a40e854b837d285ae2e8c609)
- po/uk.po | 45 ++++++++++++++++++++++++++++-----------------
- 1 file changed, 28 insertions(+), 17 deletions(-)
+ COPYING | 11 -----------
+ 1 file changed, 11 deletions(-)
-commit 1b8146d64eaac51b40079f5788b85c1eb79e35de
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:06:57 +0800
+commit 77bce9a0a250cfb20333ee0dca036b3193dd4941
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 17:23:43 +0300
- Translations: Update the Spanish translation.
+ Build: Don't run update-doxygen as part of "make mydist"
+
+ (cherry picked from commit b2bc55d8a0a9f2f59bfd4302067300e650f6baa3)
- po/es.po | 47 +++++++++++++++++++++++++++++------------------
- 1 file changed, 29 insertions(+), 18 deletions(-)
+ Makefile.am | 1 -
+ 1 file changed, 1 deletion(-)
-commit f947ce09d79ef8fa6549d350c4d72e4a8a9fa697
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:05:19 +0800
+commit 3a2fc62f59b2e8cc45f8d8fd9988b4305efe4bff
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 15:09:48 +0300
- Translations: Update the Romanian translation.
+ autogen.sh: Don't generated Doxygen docs anymore
+
+ (cherry picked from commit e9be74f5b129fe8a5388d588e68b1b7f5168a310)
- po/ro.po | 48 ++++++++++++++++++++++++++++++------------------
- 1 file changed, 30 insertions(+), 18 deletions(-)
+ autogen.sh | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
-commit f681301a368def3f597a7c7bea7cb3f7a2f933e7
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-20 20:02:56 +0800
+commit b04c16f9a5a8675a87783305568cadfa3f17d999
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 17:41:36 +0300
- Translations: Update the Romanian man page translations.
+ windows/build.bash: Omit Doxygen docs from the package
+
+ They will be omitted from the source tarball and I don't want
+ to make Doxygen a dependency of build.bash.
+
+ (cherry picked from commit 252aa1d67bc015eeba462803ab72edeb7744d864)
- po4a/ro.po | 1254 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 629 insertions(+), 625 deletions(-)
+ windows/build.bash | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 8bc3146c6be920b56283f4ee846456cb34ae4b6f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-13 21:26:47 +0800
+commit d4dd3c8f6169adf50cad8fe6872e0f5fcb82475c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 14:14:47 +0300
- xz: Update man page Authors and date.
+ README: Don't mention PDF man pages anymore
+
+ (cherry picked from commit 634095364d87444d62d8ec54c134c0cd4705f5d7)
- src/xz/xz.1 | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ README | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit c2905540ef905412b54c76488758712d3e2a0f9d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-18 23:19:09 +0800
+commit be90720d6cd7fbb1b170794445815f579b444a6f
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 14:10:39 +0300
- xz: Slight reword in xz man page for consistency.
+ Build: Omit PDF man pages from the package
- Changed will print => prints in xz --robot --version description to
- match --robot --info-memory description.
+ pdf-local rule was added to create the PDFs still with "make pdf".
+ The install rules are missing but that likely doesn't matter at all.
+
+ (cherry picked from commit dc684bf76ea23574ee9d88382057381e04e6089a)
- src/xz/xz.1 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ Makefile.am | 29 +++++++++++++++++++----------
+ 1 file changed, 19 insertions(+), 10 deletions(-)
-commit 2600d3352449faf57d9cb3fa00cbe40548a1310f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-18 22:49:57 +0800
+commit f724552d0c1ae2e3aa693d80d8d0da962dfac4e8
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 13:54:39 +0300
- liblzma: Improve comment in string_conversion.c.
+ windows/build.bash: Don't copy PDF man pages to the package
- The comment used "flag" when referring to decoder options. Just
- referring to them as options is more clear and consistent.
+ (cherry picked from commit e3531ab4125cbd5c01ebd3200791350960547189)
- src/liblzma/common/string_conversion.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ windows/README-Windows.txt | 2 +-
+ windows/build.bash | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit 98fc14541eec3e1dcf694075c8533f19a3cee552
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-13 21:21:54 +0800
+commit 00e774819c6550a8eac219e9f6f083ab2b155505
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-28 01:34:50 +0300
- liblzma: Reword lzma_str_list_filters() documentation.
+ Tests: test_index: Fix failures when features are disabled
- Reword "options required" to "options read". The previous wording
- may have suggested that the options listed were all required when
- the filters are used for encoding or decoding. Now it should be
- more clear that the options listed are the ones relevant for
- encoding or decoding.
+ Fixes: cd88423e76d54eb72aea037364f3ebb21f122503
+ (cherry picked from commit 710a4573ef2cbd19c66318c3b2d1388e418e26c7)
- src/liblzma/api/lzma/filter.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_index.c | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
-commit 1ac79b4cbaecf3f4930a5d8ce6f7e1f2b63c2a01
+commit 51133ad71eecc19bdb3ab287a0732fd9441753f4
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-07-18 17:37:33 +0300
+Date: 2024-04-20 17:09:11 +0300
- xz: Translate the second "%s: " in message.c since French needs "%s : ".
+ CMake: Keep the build working if the "tests" directory is missing
- This string is used to print a filename when using "xz -v" and
- stderr isn't a terminal.
+ This moves the tests section as is from CMakeLists.txt into
+ tests/tests.cmake. CMakeLists.txt now includes tests/tests.cmake
+ if the latter file exists.
+
+ Now it's possible to delete the whole "tests" directory and
+ building with CMake will still work normally, just without
+ the tests. This way the tests are readily available for those
+ who want them, and those who won't run the tests anyway have
+ a straightforward way to ensure that nothing from the "tests"
+ directory can affect the build process.
+
+ (cherry picked from commit aaff75c3486c4489ce88b0efb36b41cf138af7c3)
- src/xz/message.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 76 ++---------------------------------------------
+ tests/Makefile.am | 1 +
+ tests/tests.cmake | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 92 insertions(+), 73 deletions(-)
-commit 97851be2c6c64494f23c3a735601c13d4387820b
+commit 85b5595b67f0081b2a900104ed7589de4bb75e12
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-07-18 14:35:33 +0300
+Date: 2024-04-20 13:12:50 +0300
- xz: Make "%s: %s" translatable because French needs "%s : %s".
+ Tests: Remove x86 and SPARC BCJ tests
+
+ These are very old but the exact test file isn't easy to reproduce
+ as it was compiled from a short C program (bcj_test.c) long ago.
+ These tests weren't very good anyway, just a little better than nothing.
+
+ (cherry picked from commit a5f2aa5618fe9183706c9c514c3067985f6c338b)
- src/xz/args.c | 5 ++++-
- src/xz/coder.c | 8 ++++----
- src/xz/file_io.c | 8 ++++----
- src/xz/list.c | 11 ++++++-----
- 4 files changed, 18 insertions(+), 14 deletions(-)
+ tests/Makefile.am | 7 ----
+ tests/bcj_test.c | 64 ---------------------------------
+ tests/compress_prepared_bcj_sparc | Bin 1240 -> 0 bytes
+ tests/compress_prepared_bcj_x86 | Bin 1388 -> 0 bytes
+ tests/files/README | 8 -----
+ tests/files/good-1-sparc-lzma2.xz | Bin 612 -> 0 bytes
+ tests/files/good-1-x86-lzma2.xz | Bin 716 -> 0 bytes
+ tests/test_compress_prepared_bcj_sparc | 4 ---
+ tests/test_compress_prepared_bcj_x86 | 4 ---
+ 9 files changed, 87 deletions(-)
-commit b406828a6dfd3caa4f77efe3ff3e3eea263eee62
+commit d8228d1ea08155a17acaadd76ed95805d3b0a929
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-07-18 13:57:54 +0300
+Date: 2024-04-27 18:30:40 +0300
- liblzma: Tweak #if condition in memcmplen.h.
+ Tests: test_index: Edit a misleading test
- Maybe ICC always #defines _MSC_VER on Windows but now
- it's very clear which code will get used.
+ (cherry picked from commit d879686469c9c4bf2a7c0bb6420ebe4530fc8f07)
- src/liblzma/common/memcmplen.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ tests/test_index.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
-commit ef4a07ad9434f81417395f6fe0bb331e027a703b
+commit 2358ef8238f166c49e66f438e7494d4d352eb113
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-07-18 13:49:43 +0300
+Date: 2024-04-27 16:46:01 +0300
- liblzma: Omit unnecessary parenthesis in a preprocessor directive.
+ Tests: test_index: Use minimal values to test integer overflow
+
+ (cherry picked from commit 612005bbdb0dea9dc09e9e2e9cc16a15c1480acd)
- src/liblzma/common/memcmplen.h | 4 ++--
+ tests/test_index.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-commit 64ee0caaea06654b28afaee850fb187a11bf9cb2
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-06-28 20:22:38 +0800
+commit 54f4a4162aae8796580489013583d6148be5a473
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 15:13:39 +0300
- liblzma: Prevent warning for MSYS2 Windows build.
-
- In lzma_memcmplen(), the <intrin.h> header file is only included if
- _MSC_VER and _M_X64 are both defined but _BitScanForward64() was
- previously used if _M_X64 was defined. GCC for MSYS2 defines _M_X64 but
- not _MSC_VER so _BitScanForward64() was used without including
- <intrin.h>.
+ Tests: test_index: Test lzma_index_buffer_decode() more
- Now, lzma_memcmplen() will use __builtin_ctzll() for MSYS2 GCC builds as
- expected.
+ (cherry picked from commit 4ad88b2544c2aaf8de8f38af54587098cbe66c1d)
- src/liblzma/common/memcmplen.h | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ tests/test_index.c | 29 ++++++++++++++++++++++++++---
+ 1 file changed, 26 insertions(+), 3 deletions(-)
-commit ba177057643dae6e9c167ee26471181c199c8a00
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-14 23:20:33 +0800
+commit 85ab59a6b70db33f320a3ea7a854249cb693dea2
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 15:08:29 +0300
- Docs: Add a new section to INSTALL for Tests.
+ Tests: test_index: Test that *i = NULL is done on LZMA_PROG_ERROR
- The new Tests section describes basic information about the tests, how
- to run them, and important details when cross compiling. We have had a
- few questions about how to compile the tests without running them, so
- hopefully this information will help others with the same question in the
- future.
+ On LZMA_DATA_ERROR from lzma_index_buffer_decode(), *i = NULL was
+ already done but this adds a test for that case too.
- Fixes: https://github.com/tukaani-project/xz/issues/54
+ (cherry picked from commit 575b11b0d291e66c5fce31ce7a72f11436d57c83)
- INSTALL | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++--------------
- 1 file changed, 64 insertions(+), 17 deletions(-)
+ tests/test_index.c | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
-commit 0745b900fafa5ac2c31e8ec3cfba3053457c8b1f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-14 21:10:27 +0800
+commit fb42599e44dde417305c7d92fd782147ca923079
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 15:01:25 +0300
- Docs: Update README.
+ Tests: test_index: Test lzma_index_buffer_encode() with empty output buf
- This adds an entry to "Other implementations of the .xz format" for
- XZ for Java.
+ (cherry picked from commit 2c970debdb285823f01f75e875561d893345ac2b)
- README | 4 ++++
- 1 file changed, 4 insertions(+)
+ tests/test_index.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit c972d44103c4edf88e73917ef08bde69db9d06cb
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-18 13:27:46 +0300
+commit 20cac20f63a96a39391f2d613bef0f7bd6553495
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:59:55 +0300
- xz: Fix typo in man page.
+ Tests: test_index: Replace if-statements with tuktest assertions
- The Memory limit information section described three output
- columns when it actually has six. This was reworded to
- "multiple" to make it more future proof.
+ (cherry picked from commit cd88423e76d54eb72aea037364f3ebb21f122503)
- src/xz/xz.1 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_index.c | 22 +++++++++-------------
+ 1 file changed, 9 insertions(+), 13 deletions(-)
-commit 6e21f1b4e2c580b64d258e3b81ac9e44d53b9283
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-14 21:30:25 +0800
+commit 91e3ea8735752db5d0373991e84607196070aeaa
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:56:16 +0300
- Tests: Improve feature testing for skipping.
+ Tests: test_index: Make it clear that my_alloc() has no integer overflows
- Fixed a bug where test_compress_* would all fail if arm64 or armthumb
- filters were enabled for compression but arm was disabled. Since the
- grep tests only checked for "define HAVE_ENCODER_ARM", this would match
- on HAVE_ENCODER_ARM64 or HAVE_ENCODER_ARMTHUMB.
+ liblzma guarantees that the product of the allocation size arguments
+ will fit in size_t.
- Now the config.h feature test requires " 1" at the end to prevent the
- prefix problem. have_feature() was also updated for this even though
- there were known current bugs affecting it. This is just in case future
- features have a similar prefix problem.
-
- tests/test_compress.sh | 4 ++--
- tests/test_files.sh | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-commit 26c37d290c0884a4518a26b949575420a77fb938
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-10 20:56:28 +0800
-
- Translations: Update the Chinese (traditional) translation.
+ Putting the pre-increment in the if-statement was clearly wrong
+ although in practice it didn't matter here as the function is
+ called only a couple of times.
+
+ (cherry picked from commit 7f865577a6224fbbb5f5ca52574b62ea8ac9bf51)
- po/zh_TW.po | 659 ++++++++++++++++++++++++++++++++++--------------------------
- 1 file changed, 377 insertions(+), 282 deletions(-)
+ tests/test_index.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
-commit 2ec65181e28335692a3a4fac4fefc4303111d355
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-07-08 20:03:59 +0800
+commit df1659a6c8367db69e82e2ea59ad5f959cf4e615
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:51:52 +0300
- Translations: Update the Vietnamese translation.
+ Tests: test_index: Verify also iter.block.number_in_stream
+
+ (cherry picked from commit 12313a3b6596cdcf012e180597f84d231f8730d3)
- po/vi.po | 620 +++++++++++++++++++++++++++++++++++----------------------------
- 1 file changed, 349 insertions(+), 271 deletions(-)
+ tests/test_index.c | 2 ++
+ 1 file changed, 2 insertions(+)
-commit c44c7e7590db1b89c97e106f5c516bf69189e233
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-06-28 20:46:31 +0800
+commit e083e95dbfda73900109cca4c82c8713d0a1da21
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:51:06 +0300
- Tests: Fix memory leaks in test_index.
+ Tests: test_index: Check cases that aren't a multiple of 4 bytes
- Several tests were missing calls to lzma_index_end() to clean up the
- lzma_index structs. The memory leaks were discovered by using
- -fsanitize=address with GCC.
+ (cherry picked from commit ad2654010d9d641ce1601beeff00630027e6bcd4)
- tests/test_index.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ tests/test_index.c | 33 +++++++++++++++++++++++++--------
+ 1 file changed, 25 insertions(+), 8 deletions(-)
-commit b9499c94fccc03eba5311b5305f04149a7c5af65
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-06-28 20:43:29 +0800
+commit b0d3b86ecf1881d10e6614b64b0fcc6c16a3b08f
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:40:25 +0300
- Tests: Fix memory leaks in test_block_header.
+ Tests: test_index: Edit comments and white space
- test_block_header was not properly freeing the filter options between
- calls to lzma_block_header_decode(). The memory leaks were discovered by
- using -fsanitize=address with GCC.
+ (cherry picked from commit 2524fcf2b68b662035437cee8edbe80067c0c240)
- tests/test_block_header.c | 38 ++++++++++++++++++++++----------------
- 1 file changed, 22 insertions(+), 16 deletions(-)
+ tests/test_index.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
-commit 1155471651ad456c5f90aee6435931fae65682bf
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-06-28 20:31:11 +0800
+commit bae288ea6ffb976c36e2387c03d75ce84a8a1034
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-27 14:33:38 +0300
- liblzma: Prevent uninitialzed warning in mt stream encoder.
+ liblzma: index_decoder: Fix missing initializations on LZMA_PROG_ERROR
- This change only impacts the compiler warning since it was impossible
- for the wait_abs struct in stream_encode_mt() to be used before it was
- initialized since mythread_condtime_set() will always be called before
- mythread_cond_timedwait().
+ If the arguments to lzma_index_decoder() or lzma_index_buffer_decode()
+ were such that LZMA_PROG_ERROR was returned, the lzma_index **i
+ argument wasn't touched even though the API docs say that *i = NULL
+ is done if an error occurs. This obviously won't be done even now
+ if i == NULL but otherwise it is best to do it due to the wording
+ in the API docs.
- Since the mythread.h code is different between the POSIX and
- Windows versions, this warning was only present on Windows builds.
+ In practice this matters very little: The problem can occur only
+ if the functions are called with invalid arguments, that is,
+ the calling application must already have a bug.
- Thanks to Arthur S for reporting the warning and providing an initial
- patch.
-
- src/liblzma/common/stream_encoder_mt.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-commit 62dd1c9bf0c66679ceeebc8b99bca136ca43bcb9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-06-07 00:10:38 +0800
-
- Update THANKS.
+ (cherry picked from commit 71eed2520e2eecae89bade9dceea16e56cfa2ea0)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/common/index_decoder.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
-commit d04eb78ab3892d3678c180437dd66379efa051fd
-Author: Benjamin Buch <bebuch@users.noreply.github.com>
-Date: 2023-06-06 15:32:45 +0200
+commit f10cb93f335900a29e50f990b751996ef026b3a3
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-26 18:25:18 +0300
- CMake: Protects against double find_package
+ CMake: Bump maximum policy version to 3.29
- Boost iostream uses `find_package` in quiet mode and then again uses
- `find_package` with required. This second call triggers a
- `add_library cannot create imported target "LibLZMA::LibLZMA"
- because another target with the same name already exists.`
-
- This can simply be fixed by skipping the alias part on secondary
- `find_package` runs.
-
- CMakeLists.txt | 16 +++++++++-------
- 1 file changed, 9 insertions(+), 7 deletions(-)
-
-commit 12ea1fb29763dd72376aca73d69621aff01eaa7f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-31 20:26:42 +0800
-
- Translations: Update the Esperanto translation.
+ (cherry picked from commit 0478473953f50716a2bc37b619b1c7dc2682b1ad)
- po/eo.po | 185 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 92 insertions(+), 93 deletions(-)
-
-commit a4d45c07c1e4aa0ea9410b4eed7301c97e960319
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-31 20:25:00 +0800
-
- Translations: Update the Croatian translation.
-
- po/hr.po | 2 +-
+ CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit f51b7bcea6f948db9529b3e6d850e76a30cc0e96
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-31 20:15:53 +0800
+commit 59055d70cdd3df091264ae9da793821bfd65314d
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-13 22:30:44 +0100
- Translations: Update the Chinese (simplified) translation.
+ ci: add NetBSD
+
+ (cherry picked from commit a607e2b40d23f7d998dbaba76692aa30b4c3d9d3)
- po/zh_CN.po | 317 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 157 insertions(+), 160 deletions(-)
+ .github/workflows/netbsd.yml | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
-commit d5b81c19a7594fbb913bb3450360bc2145f29568
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-17 23:12:13 +0800
+commit 812c1f95f37751aaa1e020fc2360949a674842fd
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-13 23:49:26 +0100
- Translations: Update German translation of man pages.
+ ci: add FreeBSD
+
+ (cherry picked from commit 72c210336de26fb87a928160d025fa10a638d23b)
- po4a/de.po | 52 ++++++++++++----------------------------------------
- 1 file changed, 12 insertions(+), 40 deletions(-)
+ .github/workflows/freebsd.yml | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
-commit 36860a3e30d5675b4dba3a343159458d8864bceb
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-17 23:09:18 +0800
+commit d2a4f963c28b864aa179464f7827cc10c6e1365d
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-13 23:16:08 +0100
- Translations: Update the German translation.
+ ci: add OpenBSD
+
+ (cherry picked from commit b526ec2dbfb5889845ea60548c4f5b1f97d84ab2)
- po/de.po | 189 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 94 insertions(+), 95 deletions(-)
+ .github/workflows/openbsd.yml | 31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
-commit f05641ef0d4990c4c58f459039d412475b94b37d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-17 20:30:01 +0800
+commit 493bc57c33385bda5ad32d01ab73dcfe8f5e7ced
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-15 05:53:01 +0100
- Translations: Update the Croatian translation.
+ liblzma: outqueue: add header guard
+
+ Reported by github's codeql.
+
+ (cherry picked from commit c7ef767c49351743d8d011574abb9e200bf6b24f)
- po/hr.po | 187 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 93 insertions(+), 94 deletions(-)
+ src/liblzma/common/outqueue.h | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit b852f6f11d43cafce871cd158c80488f86619a63
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-17 20:26:54 +0800
+commit cede418d4f8e1fb4c8a30839fa5d3b14743e83d4
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-15 05:53:56 +0100
- Translations: Update Korean translation of man pages.
+ liblzma: easy_preset: add header guard
+
+ Reported by github's codeql.
+
+ (cherry picked from commit 55dcae3056d95cb2ddb8b560c12ba7596bc79f2c)
- po4a/ko.po | 3015 ++++++++++++------------------------------------------------
- 1 file changed, 568 insertions(+), 2447 deletions(-)
+ src/liblzma/common/easy_preset.h | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit fdcb78fb6f5313eda363869690685471d7ab9731
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-17 20:13:01 +0800
+commit 6e76a25df28b47407a201bf0381fa6d3c80cb0bb
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-25 14:00:57 +0300
- Translations: Update the Korean translation.
+ tuklib_integer: Rename bswapXX to byteswapXX
+
+ The __builtin_bswapXX from GCC and Clang are preferred when
+ they are available. This can allow compilers to emit the x86 MOVBE
+ instruction instead of doing a load + byteswap as two instructions
+ (which would happen if the byteswapping is done in inline asm).
+
+ bswap16, bswap32, and bswap64 exist in system headers on *BSDs
+ and Darwin. #defining bswap16 on NetBSD results in a warning about
+ macro redefinition. It's safest to avoid this namespace conflict
+ completely.
+
+ No OS supported by tuklib_integer.h uses byteswapXX names and
+ a web search doesn't immediately find any obvious danger of
+ namespace conflicts. So let's try these still-pretty-short names
+ for the macros.
+
+ Thanks to Sam James for pointing out the compiler warning on
+ NetBSD 10.0.
+
+ (cherry picked from commit 4ffc60f32397371769b7d6b5e3ed8626292d58df)
- po/ko.po | 319 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 158 insertions(+), 161 deletions(-)
+ src/common/tuklib_integer.h | 47 ++++++++++++++++++++------------------
+ src/liblzma/check/crc32_fast.c | 4 ++--
+ src/liblzma/check/crc32_tablegen.c | 2 +-
+ src/liblzma/check/crc64_fast.c | 4 ++--
+ src/liblzma/check/crc64_tablegen.c | 2 +-
+ 5 files changed, 31 insertions(+), 28 deletions(-)
-commit 9e39cebe3ccdd4bc320ce6e7eea989bdd167c8b2
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:49:09 +0800
+commit 0ca14871f306b97ce81bfe44c4a39b6b2af31bb3
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-24 01:20:26 +0300
- Translations: Update the Spanish translation.
+ liblzma: API doc cleanups
+
+ (cherry picked from commit 08ab0966a75b501aa7c717622223f0c13a113c75)
- po/es.po | 319 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 158 insertions(+), 161 deletions(-)
+ src/liblzma/api/lzma/container.h | 2 +-
+ src/liblzma/api/lzma/index.h | 6 +++---
+ src/liblzma/api/lzma/vli.h | 5 ++---
+ 3 files changed, 6 insertions(+), 7 deletions(-)
-commit 7a578d1d8293fc1cf7c6f9df76bc6a0e55c51a14
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:47:23 +0800
+commit 94a462850bc8718f5dd5b30116bce2165b2403c2
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-23 16:35:33 +0300
- Translations: Update the Romanian translation.
+ Tests: test_filter_str: Add a few assertions
+
+ (cherry picked from commit 3ac8a9bb4cccbee88350696dc9c645c48d77c989)
- po/ro.po | 195 ++++++++++++++++++++++++++++++++-------------------------------
- 1 file changed, 98 insertions(+), 97 deletions(-)
+ tests/test_filter_str.c | 4 ++++
+ 1 file changed, 4 insertions(+)
-commit 362320fea5383bae179763763625532bad6d10e8
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:45:43 +0800
+commit 72058ca22a7f3c9c67ed58be624f8302c6337cd7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-23 16:35:08 +0300
- Translations: Update Romanian translation of man pages.
+ Tests: test_filter_str: Move one assertion and add a comment
+
+ (cherry picked from commit 26c69be80523b05c84dea86c47c4ddd9a10945d7)
- po4a/ro.po | 19 ++++++++++---------
- 1 file changed, 10 insertions(+), 9 deletions(-)
+ tests/test_filter_str.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 29c5a870be23d0a565b959404b34a8b1babef7df
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:43:51 +0800
+commit c59ebbe1c6dd18b78a046aae3133702dd52c352e
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-23 16:26:06 +0300
- Translations: Update Ukrainian translation of man pages.
+ Tests: test_filter_str: Tweak comments and white space
+
+ (cherry picked from commit 4f6af853bc99904efb8b6c28a0af7b81a8476c1b)
- po4a/uk.po | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ tests/test_filter_str.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit 5ee57572773207371712b1bbcd9b5b8c1baad2cc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:37:54 +0800
+commit ceda860934b0272689d0722ceeb490cf9c559956
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-23 16:25:22 +0300
- Translations: Update the Ukrainian translation.
+ Tests: test_filter_str: Add missing RISC-V case
+
+ Fixes: 89ea1a22f4ed3685b053b7260bc5acf6c75d1664
+ (cherry picked from commit c92663aa1bd576e0615498a4189acf0df12e84b9)
- po/uk.po | 321 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 159 insertions(+), 162 deletions(-)
+ tests/test_filter_str.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit dfc257bdb224780d3c8cdeca5a8e52848b9adc0a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 23:07:35 +0800
+commit 2234b7cc472e62f3401216a71261579342fa2959
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-22 22:23:32 +0300
- Translations: Update the Polish translation.
+ Tests: test_filter_str: Test *error_pos more thoroughly
+
+ (cherry picked from commit b0366df1d7ed26268101f9303a001c91c0806dfc)
- po/pl.po | 316 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 155 insertions(+), 161 deletions(-)
+ tests/test_filter_str.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 76 insertions(+), 1 deletion(-)
-commit f6df4c4ab7378d2971ae1606f4eecc011ea5fc6d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 22:52:14 +0800
+commit 3ba3ef57f929670adb1f9c5e5207a81a29374237
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-22 21:54:39 +0300
- Translations: Update the Swedish translation.
+ liblzma: lzma_str_to_filters: Set *error_pos on all errors
+
+ The API docs clearly say that if error_pos isn't NULL then *error
+ is always set on any error. However, it wasn't touched if str == NULL
+ or filters == NULL or unsupported flags were specified.
+
+ Fixes: cedeeca2ea6ada5b0411b2ae10d7a859e837f203
+ (cherry picked from commit 70d12dd069bb9bb0d6bb1c8fafc4e6f77780263d)
- po/sv.po | 319 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 158 insertions(+), 161 deletions(-)
+ src/liblzma/common/string_conversion.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit 25da22e0521ec698dae4eb5e994b4cd3f4708b60
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-16 21:21:38 +0800
+commit 57ad820e15381344a812c78ce9b67a77a60b9cf3
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-22 20:31:25 +0300
- Translations: Update the Esperanto translation.
+ liblzma: Clean up white space
+
+ (cherry picked from commit ed8e552395701fbf046027cebc8be4a6755b263f)
- po/eo.po | 34 +++++++++++++++++-----------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
+ src/liblzma/lz/lz_encoder.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 4f57a9c9915b7b9267885cf9fca58e5c8208458d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-11 23:49:23 +0800
+commit ba0b5bfe7cb3cdbd9a4e3c268e10c304cb834e8a
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-22 18:35:19 +0300
- liblzma: Adds lzma_nothrow to MicroLZMA API functions.
+ Tests: test_filter_flags: Edit comments and style
- None of the liblzma functions may throw an exception, so this
- attribute should be applied to all liblzma API functions.
+ (cherry picked from commit 2f06920f20b1ad63b7953dc09569e1d424998849)
- src/liblzma/api/lzma/container.h | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ tests/test_filter_flags.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
-commit 238b4e5458b4bd2cadefb768b8ea7c6b70a191ac
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-04 20:38:52 +0800
+commit d2ed6759596185ac6a9c69ea713c27cd4bd1d9ba
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-22 16:39:44 +0300
- Translations: Update the Croatian translation.
+ Tests: Fix C99/C11 compatibility when features are disabled
+
+ The array could become empty and then the initializer would be
+ simply {} which is allowed only in GNU-C and C23.
+
+ (cherry picked from commit b101e1d1dbc81577c0c9aa0cb89cf2e46a15eb82)
- po/hr.po | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ tests/test_filter_flags.c | 18 ++++++++----------
+ 1 file changed, 8 insertions(+), 10 deletions(-)
-commit 0cee63c3c6c4f9084a5e7fa7c15a1863ac8e5ffc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-04 19:50:42 +0800
+commit 9a70e93fef3fd5943484e56f1881a7c6e3296027
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-21 20:32:16 +0300
- Bump version and soname for 5.4.3.
+ DOS: Omit useless defines from config.h
+
+ (cherry picked from commit f8f3a220ac8afcb8cb2812917d3b77e00c2eab0d)
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ dos/config.h | 12 ------------
+ 1 file changed, 12 deletions(-)
-commit 01f937ea9a49005c5091c0165fa0c1e572dd1749
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-05-02 20:39:56 +0800
+commit dc4740f720e08bdd496aa2736db3b7aea6dd3d1e
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-21 20:27:50 +0300
- Add NEWS for 5.4.3.
+ Build: Omit useless checks for fcntl.h, limits.h, and sys/time.h
+
+ (cherry picked from commit fc1921b04b8840caaa777c2bd5340d41b259da20)
- NEWS | 10 ++++++++++
- 1 file changed, 10 insertions(+)
+ configure.ac | 6 ------
+ 1 file changed, 6 deletions(-)
-commit e9b9ea953179502d5245b4e6ca4f5ffe9d5797b1
+commit 6e210d5766b25d36729152a13c5889bb0605a1e3
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-05-03 22:46:42 +0300
+Date: 2024-04-19 22:04:21 +0300
- tuklib_integer.h: Fix a recent copypaste error in Clang detection.
+ liblzma: Silence a warning from Coverity static analysis
- Wrong line was changed in 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7.
- Also, this has >= instead of == since ints larger than 32 bits would
- work too even if not relevant in practice.
+ It is logical why it cannot know for sure that the value has
+ to be at most 4 if it is less than 16.
+
+ The x86 filter is based on a very old LZMA SDK version. Newer
+ ones have quite a different implementation for the same filter.
+
+ Thanks to Sam James.
+
+ (cherry picked from commit 6aa2a6deeba04808a0fe4461396e7fb70277f3d4)
- src/common/tuklib_integer.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/simple/x86.c | 12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
-commit be6e39a8622f0d905072874ec25b1ffd155b12e1
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-04-20 20:15:00 +0800
+commit 4019b012f29008ea6545aba6fe6c141a2d920ae2
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 23:18:19 +0300
- Update THANKS.
+ Update .gitignore
+
+ (cherry picked from commit e89d3e83b4496d0b5410870634970c0aa9721d59)
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ .gitignore | 21 ++++++++-------------
+ 1 file changed, 8 insertions(+), 13 deletions(-)
-commit 9e343a46cf87a345799222c0b0b3a6f3358dde0c
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-04-19 22:22:16 +0800
+commit 09a0311a1e8cdefbcfab9e490cdd41c97a459d24
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 20:53:24 +0300
- Windows: Include <intrin.h> when needed.
+ Tests: test_lzip_decoder: Tweak coding style and comments
- Legacy Windows did not need to #include <intrin.h> to use the MSVC
- intrinsics. Newer versions likely just issue a warning, but the MSVC
- documentation says to include the header file for the intrinsics we use.
-
- GCC and Clang can "pretend" to be MSVC on Windows, so extra checks are
- needed in tuklib_integer.h to only include <intrin.h> when it will is
- actually needed.
+ (cherry picked from commit 86fc4ee859709da0ff9617a1490f13ddac0a109b)
- src/common/tuklib_integer.h | 6 ++++++
- src/liblzma/common/memcmplen.h | 10 ++++++++++
- 2 files changed, 16 insertions(+)
+ tests/test_lzip_decoder.c | 58 +++++++++++++++++++++++------------------------
+ 1 file changed, 28 insertions(+), 30 deletions(-)
-commit 12321a9390acc076b414035a46df9d7545ac379f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-04-19 21:59:03 +0800
+commit 3117336a0291309ddd2a54d2966a589f9f806850
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-19 20:51:36 +0300
- tuklib_integer: Use __builtin_clz() with Clang.
-
- Clang has support for __builtin_clz(), but previously Clang would
- fallback to either the MSVC intrinsic or the regular C code. This was
- discovered due to a bug where a new version of Clang required the
- <intrin.h> header file in order to use the MSVC intrinsics.
+ Tests: test_lzip_decoder: Remove redundant initializations
- Thanks to Anton Kochkov for notifying us about the bug.
+ (cherry picked from commit 38be573a279bd7b608ee7d8509ec10884e6fb0d5)
- src/common/tuklib_integer.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ tests/test_lzip_decoder.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
-commit d1f0e01c395960efd6c29ff144eda4f4c8c1c6d3
+commit f78081eb12c804ec4f5a3dc569b859646b16e9e5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-04-14 18:42:33 +0300
+Date: 2024-04-19 20:47:24 +0300
- liblzma: Update project maintainers in lzma.h.
+ Tests: test_lzip_decoder: Remove unneeded tuktest_malloc() calls
- AUTHORS was updated earlier, lzma.h was simply forgotten.
+ (cherry picked from commit d7e4bc53eacfab9f3de95d8252bdfdc9419079c9)
- src/liblzma/api/lzma.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_lzip_decoder.c | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
-commit 8204c5d1304e1e3b7487801b4acaf8e3179a6c52
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-04-13 20:45:19 +0800
+commit 7413383e4280065b79ca70abe4d8ebc78055b35a
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-15 20:35:07 +0300
- liblzma: Cleans up old commented out code.
+ xz: Fix white space error.
+
+ Thanks to xx on #tukaani.
+
+ (cherry picked from commit eeca8f7c5baf1ad69606bb734d5001763466d58f)
- src/liblzma/common/alone_encoder.c | 11 -----------
- 1 file changed, 11 deletions(-)
+ src/xz/args.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 32980d1562bc031013306be1c787761fa63da87d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-28 22:32:40 +0800
+commit eed2f26c0edb6e31a50d48bab4ff619778690a1e
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-11 23:01:44 +0100
- CMake: Update liblzma-config.cmake generation.
+ xz: add missing noreturn for message_filters_help
- Now that the threading is configurable, the liblzma CMake package only
- needs the threading library when using POSIX threads.
+ Fixes: a165d7df1964121eb9df715e6f836a31c865beef
+ (cherry picked from commit 462ca9409940a19f743daee6b3bcc611277d0007)
- CMakeLists.txt | 33 ++++++++++++++++++++++-----------
- 1 file changed, 22 insertions(+), 11 deletions(-)
+ src/xz/message.h | 1 +
+ 1 file changed, 1 insertion(+)
-commit 023907faa965476fb921a6344253c50e0ba795f9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-28 22:25:33 +0800
+commit 2633d8df616405bd54fd748d7bf887ebc4505b88
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-11 19:34:04 +0100
- CMake: Allows setting thread method.
+ xz: signals: suppress -Wsign-conversion on macOS
- The thread method is now configurable for the CMake build. It matches
- the Autotools build by allowing ON (pick the best threading method),
- OFF (no threading), posix, win95, and vista. If both Windows and
- posix threading are both available, then ON will choose Windows
- threading. Windows threading will also not use:
+ On macOS, we get:
+ ```
+ signals.c: In function 'signals_init':
+ signals.c:76:17: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
+ 76 | sigaddset(&hooked_signals, sigs[i]);
+ | ^~~~~~~~~
+ signals.c:81:17: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
+ 81 | sigaddset(&hooked_signals, message_progress_sigs[i]);
+ | ^~~~~~~~~
+ signals.c:86:9: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
+ 86 | sigaddset(&hooked_signals, SIGTSTP);
+ | ^~~~~~~~~
+ ```
- target_link_libraries(liblzma Threads::Threads)
+ We use `int` for `hooked_signals` but we can't just cast to whatever
+ `sigset_t` is because `sigset_t` is an opaque type. It's an unsigned int
+ on macOS. On macOS, `sigaddset` is implemented as a macro.
- since on systems like MinGW-w64 it would link the posix threads
- without purpose.
+ Just suppress -Wsign-conversion for `signals_init` for macOS given
+ there's no real nice way of fixing this.
+
+ (cherry picked from commit 863f13d2828b99b0539ce73f9cf85bde32358034)
- CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++++++++----------------
- 1 file changed, 104 insertions(+), 40 deletions(-)
+ src/xz/signals.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
-commit ba176d77cbb164b13006516660fc1ff6c59dedb5
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-24 20:05:59 +0800
+commit 50fb269c7a9cf62a9f3fe08859e2aa4348b600a7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-13 22:19:40 +0300
- CMake: Only build xzdec if decoders are enabled.
+ Tests: test_microlzma: Add a "FIXME?" about LZMA_FINISH handling
+
+ (cherry picked from commit fcbd0d199933a69713cb293cbd7409a757d854cd)
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_microlzma.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-commit c99d697df800e9bc47e09facf88bcfdb9e0264a5
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-22 15:42:04 +0800
+commit 3e2ff2d38c54c8fc7ce15aaf91185dc105d9c92c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-13 18:05:31 +0300
- Build: Removes redundant check for LZMA1 filter support.
+ Tests: test_microlzma: Tweak comments, coding style, and minor details
+
+ A few lines were reordered, a few ARRAY_SIZE were changed to sizeof,
+ and a few uint32_t were changed to size_t. No real functional changes
+ were intended.
+
+ (cherry picked from commit 0fe2dfa68355d2b165544b2bc8babf77dcc2039e)
- src/liblzma/lzma/Makefile.inc | 5 +----
- 1 file changed, 1 insertion(+), 4 deletions(-)
+ tests/test_microlzma.c | 149 +++++++++++++++++++++++++++----------------------
+ 1 file changed, 83 insertions(+), 66 deletions(-)
-commit 54a2fd8c850e626343b79c4cc8fcac2f638ec890
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-23 15:14:29 +0200
+commit ebc8b8de19d641c37ab7959a224bcd0ff4c0833f
+Author: Ryan Carsten Schmidt <git@ryandesign.com>
+Date: 2024-04-12 19:31:13 -0500
- CMake: Bump maximum policy version to 3.26.
+ CI: Use only the active CPUs on macOS
- It adds only one new policy related to FOLDERS which we don't use.
- This makes it clear that the code is compatible with the policies
- up to 3.26.
+ hw.ncpu counts all CPUs including inactive ones. hw.activecpu counts
+ only the active CPUs.
+
+ (cherry picked from commit 97f0ee0f1f903f4e7c4ea23e9b89d687025d2992)
- CMakeLists.txt | 2 +-
+ build-aux/ci_build.bash | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 622d0fdc02d5f565c2872d79bc70c669c95c8284
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-21 23:36:00 +0800
+commit 1e63f7d53648beb6dd5acb5771850d7c4bc30477
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 18:33:55 +0100
- CMake: Conditionally build xz list.* files if decoders are enabled.
+ ci: rename ci_build.sh -> ci_build.bash
+
+ We discussed the name and it's less cognitive load to just call it '.bash'
+ so you don't have an immediate question about if bashisms are OK.
+
+ (cherry picked from commit 73f629e321b74f68c9954728fa4f19261afccf46)
- CMakeLists.txt | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
+ .github/workflows/ci.yml | 52 ++++++++++++++++----------------
+ .github/workflows/windows-ci.yml | 20 ++++++------
+ build-aux/{ci_build.sh => ci_build.bash} | 0
+ 3 files changed, 36 insertions(+), 36 deletions(-)
-commit 3e2dc523c596cd770a6a7c58cacc0d0d8761e853
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-25 11:46:50 +0800
+commit aea54a4724414466a20afd7493156d40d0a2741c
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 17:42:23 +0100
- CMake: Allow configuring features as cache variables.
+ ci: build in parallel by default
- This allows users to change the features they build either in
- CMakeCache.txt or by using a CMake GUI. The sources built for
- liblzma are affected by this too, so only the necessary files
- will be compiled.
+ (cherry picked from commit 8709407a9ef8e7e8aec117879400e4dd3e227ada)
- CMakeLists.txt | 528 ++++++++++++++++++++++++++++++++++++++++++---------------
- 1 file changed, 391 insertions(+), 137 deletions(-)
+ build-aux/ci_build.sh | 2 ++
+ 1 file changed, 2 insertions(+)
-commit 0c053f97337fa4ead77acefb577e8e86f8ef388d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-21 14:07:51 +0200
+commit 4381fcf00b2fabb6dcc9fd5cf35d520feb9e775a
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 15:41:08 +0100
- Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.
+ ci: default to -O2
- It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC
- but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler.
+ We need this for when we're passing sanitizer flags or -gdwarf-4 for Clang
+ with Valgrind. Just always start with -O2 if CFLAGS isn't set in the
+ environment and append what was passed on the command line.
+
+ (cherry picked from commit 65bf7e0a1ca6386f17608e8afb84ac470c18d23f)
- configure.ac | 3 +++
- 1 file changed, 3 insertions(+)
+ build-aux/ci_build.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 915d4f6058d52f84d2b58b0a5f3c8272eaa6c1bd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-21 14:04:37 +0200
+commit 752ba5ed99ec754bafbdc4d87a2876cb2566ecc4
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 15:17:47 +0100
- Build: configure.ac: Use AS_IF and AS_CASE where required.
+ ci: make automake's test runner verbose on failures
- This makes no functional difference in the generated configure
- (at least with the Autotools versions I have installed) but this
- change might prevent future bugs like the one that was just
- fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294.
+ This is a lot easier to work with than the save-logs thing the action
+ tries to do...
+
+ (cherry picked from commit bc899f9e0700ad153bd65f4804c4de7515c8a847)
- configure.ac | 30 +++++++++++++++---------------
- 1 file changed, 15 insertions(+), 15 deletions(-)
+ build-aux/ci_build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit b848c039586ed2cddb6fb033680dac107cc5143f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-21 13:12:03 +0200
+commit cc21af171599ffe0419fc32a30edd3ef7d479865
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 12:38:51 +0100
- Update THANKS.
+ ci: make UBSAN abort on errors
+
+ Unfortunately, UBSAN doesn't do this by default. See also the change
+ I made in Meson for this in October [0].
+
+ [0] https://github.com/mesonbuild/meson/commit/7b7d2e060b447de9c2642848847370a58711ac1c
+
+ (cherry picked from commit b5e3470442531717b2457b40ab412740296af1bc)
- THANKS | 1 +
+ .github/workflows/ci.yml | 1 +
1 file changed, 1 insertion(+)
-commit c775ba1602a74f29dbc2088bbe4d02c23fc32ba1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-21 13:11:49 +0200
+commit 2d2d5f14b392cd1aeddab7ce34fd50ba5422e5b5
+Author: Sam James <sam@gentoo.org>
+Date: 2024-04-10 11:43:10 +0100
- Build: Fix --disable-threads breaking the building of shared libs.
+ ci: test Valgrind
- This is broken in the releases 5.2.6 to 5.4.2. A workaround
- for these releases is to pass EGREP='grep -E' as an argument
- to configure in addition to --disable-threads.
+ Using `--trace-children=yes` has a trade-off here, as it makes
+ `test_scripts.sh` pretty slow when calling various non-xz utilities.
- The problem appeared when m4/ax_pthread.m4 was updated in
- the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which
- introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls
- AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP
- but this was only executed if POSIX threads were enabled.
- Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf
- omits it as AC_PROG_EGREP has already been required earlier.
- Thus, if not using POSIX threads, the shell variable EGREP
- would be undefined in the Libtool code in configure.
+ But I also feel like it's not useless to have Valgrind used there and it's
+ not easy to exclude Valgrind just for that one test...
- ax_pthread.m4 is fine. The bug was in configure.ac which called
- AX_PTHREAD conditionally in an incorrect way. Using AS_CASE
- ensures that all AC_REQUIREs get always run.
+ I did consider using AX_VALGRIND_CHECK [0][1] but I couldn't get it working
+ immediately with some conditionally-built tests and I wondered if it was
+ worth spending time on at least while we're debating xz's future build
+ system situation.
- Thanks to Frank Busse for reporting the bug.
- Fixes: https://github.com/tukaani-project/xz/issues/45
+ [0] https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html
+ [1] https://tecnocode.co.uk/2014/12/23/automatically-valgrinding-code-with-ax_valgrind_check/
+
+ (cherry picked from commit 6c095a98fbec70b790253a663173ecdb669108c4)
- configure.ac | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
+ .github/workflows/ci.yml | 11 ++++++++++-
+ build-aux/ci_build.sh | 8 +++++---
+ 2 files changed, 15 insertions(+), 4 deletions(-)
-commit 0673c9ec98b6bae12b33dc295564514aaa26e2fc
+commit 5d20a612051fac3ca6d99abe3cd7e0e3370e5b67
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-19 22:45:59 +0200
+Date: 2024-04-10 23:20:02 +0300
- liblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h.
+ liblzma: CRC: Simplify table omission macros
- Thanks to Christian Hesse for reporting the issue.
- Fixes: https://github.com/tukaani-project/xz/issues/44
+ A macro is useful to prevent a single #if directive from
+ getting too ugly but only one macro is needed for all archs.
+
+ (cherry picked from commit 6286c1900c2d2ca33d9b1b397122c7bcdb9a4d59)
- src/liblzma/common/memcmplen.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ src/liblzma/check/crc32_table.c | 10 ++++------
+ src/liblzma/check/crc64_table.c | 4 ++--
+ src/liblzma/check/crc_common.h | 5 +++--
+ 3 files changed, 9 insertions(+), 10 deletions(-)
-commit 6ca8046ecbc7a1c81ee08f544bfd1414819fb2e8
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-18 23:22:06 +0800
+commit 2a80827e23169c624560ac89714bf5084cbead43
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-10 23:09:40 +0300
- Bump version and soname for 5.4.2.
+ liblzma: ARM64 CRC: Fix omission of CRC32 table
+
+ The macro name had an odd typo so the table wasn't omitted
+ when it should have.
+
+ Fixes: 1940f0ec28f08c0ac72c1413d9706fb82eabe6ad
+ (cherry picked from commit 45da936c879acf4f053a3055665bf1b10ded4462)
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/check/crc32_table.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit ce4f246600db10e77fc93d492ea045b4c9830bc6
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-18 22:10:57 +0800
+commit a54117377151356c1e2494ba1febc245cb71b51c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-10 22:21:51 +0300
- Add NEWS for 5.4.2.
+ Build: If ARM64 feature detection func is found, stop looking for others
+
+ This can speed up configure a tiny bit.
+
+ Fixes: c5f6d79cc9515a7f22d7ea4860c6cc394b295732
+ (cherry picked from commit 308a9af85400b0e2019f0f012c8354e831d06d65)
- NEWS | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 48 insertions(+)
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 3634fe330788fc0df217acdb6581031a851600a3
+commit 9223ad6e78a666cc9f9aba135d1755fec184a24a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-18 16:00:54 +0200
+Date: 2024-04-10 22:04:27 +0300
- Update the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3.
+ liblzma: ARM64 CRC32: Change style of the macOS code to match FreeBSD
+
+ I didn't test this but it shouldn't change any functionality.
+
+ Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
+ (cherry picked from commit fc43cecd32bf9d5f8caa599206b15c9569af1eb6)
- COPYING.GPLv3 | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ src/liblzma/check/crc32_arm64.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
-commit 97679d25ce7cb014328f1455bb338903c003d54f
+commit 32ceb2c36a0e450037bbe906c2a1ea42607b9d21
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-18 15:51:57 +0200
+Date: 2024-04-10 21:59:27 +0300
- Change a few HTTP URLs to HTTPS.
+ liblzma: ARM64 CRC32: Add error checking to FreeBSD-specific code
- The xz man page timestamp was intentionally left unchanged.
+ Also add parenthesis to the return statement.
+
+ I didn't test this.
+
+ Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
+ (cherry picked from commit 1024cd4cd966b998fedec51e385e9ee9a49b3c57)
- INSTALL | 2 +-
- README | 8 ++++----
- configure.ac | 2 +-
- dos/INSTALL.txt | 4 ++--
- src/liblzma/api/lzma.h | 8 ++++----
- src/liblzma/check/sha256.c | 2 +-
- src/xz/xz.1 | 2 +-
- windows/INSTALL-MinGW.txt | 10 +++++-----
- 8 files changed, 19 insertions(+), 19 deletions(-)
+ src/liblzma/check/crc32_arm64.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 01a67e89a56c3ebf5f6681bd06f0edc22a1ae594
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-18 00:40:28 +0800
+commit 42915101e914dba353c236925bc1d5e4826d3f7a
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-10 21:56:33 +0300
- CMake: Fix typo in a comment.
+ liblzma: ARM64 CRC32: Use negation instead of subtracting from 8
+
+ Subtracting from 0 is negation, this just keeps warnings away.
+
+ Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
+ (cherry picked from commit 2337f7021c860b026e3e849e60a9ae8d09ec0ea0)
- CMakeLists.txt | 2 +-
+ src/liblzma/check/crc32_arm64.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 5dca3f5cbab31105196c89cd6df0a9bbc3307c05
+commit 42a9482b48f0171852fbaddbdc729a56f2daa547
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-17 18:36:22 +0200
+Date: 2024-04-10 21:55:10 +0300
- Windows: build.bash: Copy liblzma API docs to the output package.
+ liblzma: ARM64 CRC32: Tweak coding style and comments
+
+ (cherry picked from commit d8fffd01aa1a3c18e437a222abd34699e23ff5e7)
- windows/build.bash | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ src/liblzma/check/crc32_arm64.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
-commit ae252862b30b509ab88b2bbcaa08e8d51b57e928
+commit 38a3ec5a7e2ddeee3686be64b037aa1377f31fd1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-17 08:53:38 +0200
+Date: 2024-04-09 17:47:01 +0300
- Windows: Add microlzma_*.c to the VS project files.
+ CI: Remove ifunc support.
- These should have been included in 5.3.2alpha already.
+ (cherry picked from commit 986865ea2f9d1f8dbef4a130926df106b0f6d41a)
- windows/vs2013/liblzma.vcxproj | 2 ++
- windows/vs2013/liblzma_dll.vcxproj | 2 ++
- windows/vs2017/liblzma.vcxproj | 2 ++
- windows/vs2017/liblzma_dll.vcxproj | 2 ++
- windows/vs2019/liblzma.vcxproj | 2 ++
- windows/vs2019/liblzma_dll.vcxproj | 2 ++
- 6 files changed, 12 insertions(+)
+ .github/workflows/ci.yml | 13 +++----------
+ build-aux/ci_build.sh | 5 +----
+ 2 files changed, 4 insertions(+), 14 deletions(-)
-commit 147d282cc3733e2723df82622b6540ddfb52635e
+commit 34d1252f093944ff350a88a6196539f95902ad41
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-17 08:43:51 +0200
+Date: 2024-04-09 17:43:16 +0300
- CMake: Add microlzma_*.c to the build.
+ liblzma: Remove ifunc support.
- These should have been included in 5.3.2alpha already.
+ This is *NOT* done for security reasons even though the backdoor
+ relied on the ifunc code. Instead, the reason is that in this
+ project ifunc provides little benefits but it's quite a bit of
+ extra code to support it. The only case where ifunc *might* matter
+ for performance is if the CRC functions are used directly by an
+ application. In normal compression use it's completely irrelevant.
+
+ (cherry picked from commit 689ae2427342a2ea1206eb5ca08301baf410e7e0)
- CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
+ CMakeLists.txt | 79 ---------------------------------------
+ INSTALL | 8 ----
+ configure.ac | 79 ---------------------------------------
+ src/liblzma/check/crc32_fast.c | 48 +++---------------------
+ src/liblzma/check/crc64_fast.c | 21 -----------
+ src/liblzma/check/crc_common.h | 9 +----
+ src/liblzma/check/crc_x86_clmul.h | 11 +-----
+ 7 files changed, 8 insertions(+), 247 deletions(-)
-commit 4523a5ee29f45c0256af67a15771bc8bbd25ba53
+commit a594b39685051cd1ec866360bc4dd6c22f301bb4
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-17 08:41:36 +0200
+Date: 2024-04-08 22:04:41 +0300
- Build: Update comments about unaligned access to mention 64-bit.
+ tests/files/README: Update the main heading.
+
+ (cherry picked from commit 6b4c859059a7eb9b0547590c081668e14ecf8af6)
- cmake/tuklib_integer.cmake | 7 +++----
- m4/tuklib_integer.m4 | 4 ++--
- 2 files changed, 5 insertions(+), 6 deletions(-)
+ tests/files/README | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 82aacb40367dc580b09c5a7b270f6c98b63e49b9
+commit fa76e3ef597ee2e9d150461a42d270a386204042
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-17 00:02:30 +0200
+Date: 2024-04-08 22:02:45 +0300
- Tests: Update .gitignore.
+ tests/files/README: Explain how to recreate the ARM64 test files.
+
+ (cherry picked from commit 2a851e06b891ce894f918faff32a6cca6fdecee6)
- .gitignore | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ tests/files/README | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
-commit 5d022c24921eec938604a8cb10d70aa08dbd8575
+commit 112fa0aba6be30968811c9131f1b995cf9e92e75
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-14 20:04:03 +0200
+Date: 2024-04-08 21:51:55 +0300
- po4a/update-po: Display the script name consistently in error messages.
+ debug: Add generator for the ARM64 test file data.
+
+ (cherry picked from commit 3d09b721b94e18fe1f853a04799697f5de10b291)
- po4a/update-po | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ debug/Makefile.am | 3 +-
+ debug/testfilegen-arm64.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 118 insertions(+), 1 deletion(-)
-commit 896295117324f323c0b8db6a31ad6ebfaa88793d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-17 01:30:36 +0800
+commit 1a1f3d0323d5991a3238566e8f517d5116358b5c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 21:19:38 +0300
- Doc: Rename Doxygen HTML doc directory name liblzma => api.
+ xz man page: Use .ft CR instead of CW to silence warnings from groff.
- When the docs are installed, calling the directory "liblzma" is
- confusing since multiple other files in the doc directory are for
- liblzma. This should also make it more natural for distros when they
- package the documentation.
+ (cherry picked from commit 31ef676567c9d6fcc4ec9fc833c312f7a7c21c48)
- .gitignore | 2 +-
- Makefile.am | 18 +++++++++---------
- PACKAGERS | 4 ++--
- doxygen/Doxyfile | 2 +-
- doxygen/update-doxygen | 18 +++++++++---------
- 5 files changed, 22 insertions(+), 22 deletions(-)
+ src/xz/xz.1 | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
-commit 94097157fae308b2c1a5edb4e8597c68b45eeaea
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 22:07:15 +0800
+commit 9f9203f574f895c40a86a83c45c6bb79c25bb5d2
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 19:28:35 +0300
- liblzma: Remove note from lzma_options_bcj about the ARM64 exception.
+ Fix NEWS for 5.6.0 and 5.6.1.
- This was left in by mistake since an early version of the ARM64 filter
- used a different struct for its options.
+ (cherry picked from commit 780cbf29d5a88db2b546e9b7b019c4c33ca72685)
- src/liblzma/api/lzma/bcj.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ NEWS | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit da16d0b73b79d7785ece6f78a577fadd1fb59d0e
+commit 12876b33c79e36d7e51e8ba6ab7162bd2129cb5b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-15 19:19:13 +0200
+Date: 2024-04-08 19:22:26 +0300
- COPYING: Add a note about the included Doxygen-generated HTML.
+ Remove the XZ logo.
+
+ (cherry picked from commit bfd0c7c478e93a1911b845459549ff94587b6ea2)
- COPYING | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ COPYING | 5 -
+ COPYING.CC-BY-SA-4.0 | 427 ---------------------------------------------------
+ Makefile.am | 2 -
+ README | 2 -
+ doc/xz-logo.png | Bin 6771 -> 0 bytes
+ doxygen/Doxyfile | 6 +-
+ doxygen/footer.html | 13 --
+ 7 files changed, 3 insertions(+), 452 deletions(-)
-commit e57c74f9ef19201f72c106f2c347596f40229936
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 21:41:09 +0800
+commit 879295d91f06c241fd8a8fc1ca95776dbeb45f93
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 18:27:39 +0300
- Doc: Update PACKAGERS with details about liblzma API docs install.
+ Update maintainer and author info.
+
+ The other maintainer suddenly disappeared.
+
+ (cherry picked from commit 77a294d98a9d2d48f7e4ac273711518bf689f5c4)
- PACKAGERS | 22 ++++++++++++++++------
- 1 file changed, 16 insertions(+), 6 deletions(-)
+ AUTHORS | 9 +++++++--
+ README | 10 +++-------
+ THANKS | 1 -
+ src/liblzma/api/lzma.h | 2 +-
+ 4 files changed, 11 insertions(+), 11 deletions(-)
-commit 7e2fa48bb73edb25457232e2e62a4f81c6b95281
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 21:38:32 +0800
+commit 859617d30d81317236e004b323fed0883f932dcf
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 18:05:32 +0300
- liblzma: Add set lzma.h as the main page for Doxygen documentation.
+ Docs: Update .xz file format specification to 1.2.1.
- The \mainpage command is used in the first block of comments in lzma.h.
- This changes the previously nearly empty index.html to use the first
- comment block in lzma.h for its contents.
+ This only reverts the XZ URL changes.
- lzma.h is no longer documented separately, but this is for the better
- since lzma.h only defined a few macros that users do not need to use.
- The individual API header files all have a disclaimer that they should
- not be #included directly, so there should be no confusion on the fact
- that lzma.h should be the only header used by applications.
-
- Additionally, the note "See ../lzma.h for information about liblzma as
- a whole." was removed since lzma.h is now the main page of the
- generated HTML and does not have its own page anymore. So it would be
- confusing in the HTML version and was only a "nice to have" when
- browsing the source files.
+ (cherry picked from commit 8dd03d4484ccf80022722a16d0ed9b37f2b58072)
- src/liblzma/api/lzma.h | 1 +
- src/liblzma/api/lzma/base.h | 2 --
- src/liblzma/api/lzma/bcj.h | 2 --
- src/liblzma/api/lzma/block.h | 2 --
- src/liblzma/api/lzma/check.h | 2 --
- src/liblzma/api/lzma/container.h | 2 --
- src/liblzma/api/lzma/delta.h | 2 --
- src/liblzma/api/lzma/filter.h | 2 --
- src/liblzma/api/lzma/hardware.h | 2 --
- src/liblzma/api/lzma/index.h | 2 --
- src/liblzma/api/lzma/index_hash.h | 4 +---
- src/liblzma/api/lzma/lzma12.h | 2 --
- src/liblzma/api/lzma/stream_flags.h | 2 --
- src/liblzma/api/lzma/version.h | 2 --
- src/liblzma/api/lzma/vli.h | 2 --
- 15 files changed, 2 insertions(+), 29 deletions(-)
+ doc/xz-file-format.txt | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
-commit d42977c7acfdf7fd9acc8803cf411eca7dc10478
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 21:37:32 +0800
+commit eeb74fba1f6ea334a519015938b4a26c6ba5d4eb
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 17:33:56 +0300
- Build: Generate doxygen documentation in autogen.sh.
+ Update website URLs back to tukaani.org.
- Another command line option (--no-doxygen) was added to disable
- creating the doxygen documenation in cases where it not wanted or
- if the doxygen tool is not installed.
+ The XZ projects were moved back to their original URLs.
+
+ (cherry picked from commit 17aa2e1a796d3f758802df29afc89dcf335db567)
- autogen.sh | 35 +++++++++++++++++++++++++++++------
- 1 file changed, 29 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 2 +-
+ COPYING | 3 +--
+ README | 4 ++--
+ configure.ac | 2 +-
+ doc/faq.txt | 2 +-
+ doc/lzma-file-format.txt | 12 ++++++------
+ dos/config.h | 2 +-
+ src/liblzma/api/lzma.h | 2 +-
+ src/xz/xz.1 | 6 +++---
+ src/xzdec/xzdec.1 | 4 ++--
+ windows/README-Windows.txt | 2 +-
+ 11 files changed, 20 insertions(+), 21 deletions(-)
-commit 8fc712fcf41d821069c670f22b8bf628e7a4a877
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 21:35:55 +0800
+commit a7b9cd70004bfc1abadc7e865dfce765f7b8b59d
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 17:07:08 +0300
- Build: Create doxygen/update-doxygen script.
-
- This is a helper script to generate the Doxygen documentation. It can be
- run in 'liblzma' or 'internal' mode by setting the first argument. It
- will default to 'liblzma' mode and only generate documentation for the
- liblzma API header files.
+ xzdec: Tweak coding style and comments.
- The helper script will be run during the custom mydist hook when we
- create releases. This hook already alters the source directory, so its
- fine to do it here too. This way, we can include the Doxygen generated
- files in the distrubtion and when installing.
-
- In 'liblzma' mode, the JavaScript is stripped from the .html files and
- the .js files are removed. This avoids license hassle from jQuery and
- other libraries that Doxygen 1.9.6 puts into jquery.js in minified form.
+ (cherry picked from commit 2739db981023373a2ddabc7b456c7e658bb4f582)
- Makefile.am | 1 +
- doxygen/update-doxygen | 111 +++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 112 insertions(+)
+ src/xzdec/xzdec.c | 32 +++++++++++++++++++++-----------
+ 1 file changed, 21 insertions(+), 11 deletions(-)
-commit 77d2c025d19fbac7277c63239cfb1338f02c66c0
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-03-16 21:34:36 +0800
+commit ebe9d6d8cb27168706078009b3f64da8fde63833
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-04-08 15:53:46 +0300
- Build: Install Doxygen docs and include in distribution if generated.
-
- Added a install-data-local target to install the Doxygen documentation
- only when it has been generated. In order to correctly remove the docs,
- a corresponding uninstall-local target was added.
+ tests/ossfuzz: Tiny fix to a comment.
- If the doxygen docs exist in the source tree, they will also be included
- in the distribution now too.
+ (cherry picked from commit 408b6adb2a07d07c6535f859571cca38837caaf3)
- Makefile.am | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
+ tests/ossfuzz/fuzz_decode_stream.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 9af8f6f947a43974a4ff025f4c896f2fb4c91b4f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-03 20:37:30 +0800
+commit 78ab47d65d916207233abbcdb0ccfd6efb946c05
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-30 14:36:28 +0200
- Doxygen: Refactor Doxyfile.in to doxygen/Doxyfile.
+ CMake: Fix sabotaged Landlock sandbox check.
- Instead of having Doxyfile.in configured by Autoconf, the Doxyfile
- can have the tags that need to be configured piped into the doxygen
- command through stdin with the overrides after Doxyfile's contents.
-
- Going forward, the documentation should be generated in two different
- modes: liblzma or internal.
-
- liblzma is useful for most users. It is the documentation for just
- the liblzma API header files. This is the default.
+ It never enabled it.
- internal is for people who want to understand how xz and liblzma work.
- It might be useful for people who want to contribute to the project.
+ (cherry picked from commit f9cf4c05edd14dedfe63833f8ccbe41b55823b00)
- .gitignore | 3 +-
- Doxyfile.in | 1234 -------------------------
- Makefile.am | 1 -
- configure.ac | 1 -
- doxygen/Doxyfile | 2684 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 5 files changed, 2686 insertions(+), 1237 deletions(-)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 1c558a26928b753fcf1c0d4bce9c0643285edd86
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-28 23:22:36 +0800
+commit 5f178c364c3b5c6fe87099b7624d5c76995ff8e6
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-05-22 14:08:33 +0300
- Tests: Remove unused macros and functions.
+ Delete SECURITY.md from v5.6
+
+ It's too easily out of date in the stable branches.
+ It's not included in the release packages anyway.
- tests/tests.h | 75 -----------------------------------------------------------
- 1 file changed, 75 deletions(-)
+ .github/SECURITY.md | 29 -----------------------------
+ 1 file changed, 29 deletions(-)
-commit 7479a69a45a1b8fdb9a209e11f247dce11ac1ba0
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-12 22:29:07 +0800
+commit b3a756188004a16de5956c368e3b0efd1a9bccb0
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-22 17:46:30 +0200
- Tests: Refactors existing lzma_index tests.
+ liblzma: memcmplen.h: Add a comment why subtraction is used.
- Converts the existing lzma_index tests into tuktests and covers every
- API function from index.h except for lzma_file_info_decoder, which can
- be tested in the future.
+ (cherry picked from commit 0b99783d63f27606936bb79a16c52d0d70c0b56f)
- tests/test_index.c | 2036 ++++++++++++++++++++++++++++++++++++++--------------
- 1 file changed, 1492 insertions(+), 544 deletions(-)
+ src/liblzma/common/memcmplen.h | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
-commit fd56d5353360279c10e8e5e05f5bc6ea03f64584
+commit 94939a145f362ff8b09fb37fc72901743f7f5cb2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-07 19:59:23 +0200
+Date: 2024-03-15 17:43:39 +0200
- xz: Make Capsicum sandbox more strict with stdin and stdout.
+ INSTALL: Document arguments of --enable-symbol-versions.
+
+ (cherry picked from commit 8a25ba024d55610c448c6e4f1400a00bae51b493)
- src/xz/file_io.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ INSTALL | 43 +++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 39 insertions(+), 4 deletions(-)
-commit d1bdaaebc68cae7f0ba457fa990b520df2186fd1
+commit fa14c8aaf0d0266b7e0c3b7c766159299c1a0f18
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-03-11 19:31:40 +0200
+Date: 2024-03-15 17:15:50 +0200
- xz: Don't fail if Capsicum is enabled but kernel doesn't support it.
+ Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.
- (This commit combines related commits from the master branch.)
+ This does the previous commit with CMake.
- If Capsicum support is missing from the kernel or xz is being run
- in an emulator that lacks Capsicum suport, the syscalls will fail
- and set errno to ENOSYS. Previously xz would display and error and
- exit, making xz unusable. Now it will check for ENOSYS and run
- without sandbox support. Other tools like ssh behave similarly.
+ AC_EGREP_CPP uses AC_REQUIRE so the outermost if-commands must
+ be changed to AS_IF to ensure that things wont break some day.
+ See 5a5bd7f871818029d5ccbe189f087f591258c294.
- Displaying a warning for missing Capsicum support was considered
- but such extra output would quickly become annoying. It would also
- break test_scripts.sh in "make check".
-
- Also move cap_enter() to be the first step instead of the last one.
- This matches the example in the cap_rights_limit(2) man page. With
- the current code it shouldn't make any practical difference though.
-
- Thanks to Xin Li for the bug report, suggesting a fix, and testing:
- https://github.com/tukaani-project/xz/pull/43
-
- Thanks to Jia Tan for most of the original commits.
+ (cherry picked from commit 49324b711f9d42b3543bf2f3ae598eaa03360bd5)
- src/xz/file_io.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
+ configure.ac | 18 +++++++++++++-----
+ 1 file changed, 13 insertions(+), 5 deletions(-)
-commit 5d351c69c19d212ddd2cf1f3bdb24900820c6776
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-04 21:06:35 +0800
+commit 73baa8d99b51c7623ed95afe6411302d9ff56864
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-15 16:36:35 +0200
- Build: Adjust CMake version search regex.
+ CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.
- Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH
- macros do not need to be on consecutive lines in version.h. They can be
- separated by more whitespace, comments, or even other content, as long
- as they appear in the proper order (major, minor, patch).
-
- CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
-
-commit b82d4831e3f2339c4cdbc47776c99462088c11b7
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-26 09:50:21 +0800
-
- liblzma: Improve documentation for version.h.
+ It doesn't support the __symver__ attribute or __asm__(".symver ...").
+ The generic symbol versioning can still be used since it only needs
+ linker support.
- Specified parameter and return values for API functions and documented
- a few more of the macros.
+ (cherry picked from commit c273123ed0ebaebf49994057a7fe98aae7f42c40)
- src/liblzma/api/lzma/version.h | 29 ++++++++++++++++++++++-------
- 1 file changed, 22 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
-commit 2caba3efe3e0c2d7c6dca00e22c56812326a34e6
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-24 23:46:23 +0800
+commit 886633f42376f4648d931917733c8a59fb2e1f6c
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-13 21:38:24 +0200
- liblzma: Clarify lzma_lzma_preset() documentation in lzma12.h.
-
- lzma_lzma_preset() does not guarentee that the lzma_options_lzma are
- usable in an encoder even if it returns false (success). If liblzma
- is built with default configurations, then the options will always be
- usable. However if the match finders hc3, hc4, or bt4 are disabled, then
- the options may not be usable depending on the preset level requested.
+ Update THANKS.
- The documentation was updated to reflect this complexity, since this
- behavior was unclear before.
+ (cherry picked from commit df7f487648d18a3992386a59b8a061edca862d17)
- src/liblzma/api/lzma/lzma12.h | 5 +++++
- 1 file changed, 5 insertions(+)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 594f904673ba55a833adfa60bbab6b60d4902d08
+commit 760f622f0d73632df2347aaca7ac7ff5761e98b6
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-27 18:38:35 +0200
+Date: 2024-03-13 21:30:18 +0200
- CMake: Require that the C compiler supports C99 or a newer standard.
+ liblzma: Minor comment edits.
- Thanks to autoantwort for reporting the issue and suggesting
- a different patch:
- https://github.com/tukaani-project/xz/pull/42
+ (cherry picked from commit 3217b82b3ec023bf8338249134a076bea0ea30ec)
- CMakeLists.txt | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ src/liblzma/common/string_conversion.c | 4 ++--
+ src/liblzma/delta/delta_decoder.c | 2 ++
+ 2 files changed, 4 insertions(+), 2 deletions(-)
-commit 88101143cb774bca6b7006c8335b09dc3f334140
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-24 18:10:37 +0800
+commit 403b4c78b81f67bc3787542f55f555407253316c
+Author: Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>
+Date: 2024-03-13 13:07:13 +0100
- Tests: Small tweak to test-vli.c.
+ liblzma: Fix building with NVHPC (NVIDIA HPC SDK).
- The static global variables can be disabled if encoders and decoders
- are not built. If they are not disabled and -Werror is used, it will
- cause an usused warning as an error.
+ NVHPC compiler has several issues that make it impossible to
+ build liblzma:
+ - the compiler cannot handle unions that contain pointers that
+ are not the first members;
+ - the compiler cannot handle the assembler code in range_decoder.h
+ (LZMA_RANGE_DECODER_CONFIG has to be set to zero);
+ - the compiler fails to produce valid code for delta_decode if the
+ vectorization is enabled, which results in failed tests.
+
+ This introduces NVHPC-specific workarounds that address the issues.
+
+ (cherry picked from commit 096bc0e3f8fb4bfc4d2f3f64a7f219401ffb4c31)
- tests/test_vli.c | 2 ++
- 1 file changed, 2 insertions(+)
+ src/liblzma/common/string_conversion.c | 6 ++++--
+ src/liblzma/delta/delta_decoder.c | 3 +++
+ src/liblzma/rangecoder/range_decoder.h | 1 +
+ 3 files changed, 8 insertions(+), 2 deletions(-)
-commit 4042dbf03a06e019ccdd1e9d1b94cf613d62d5a9
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-06 21:46:43 +0800
+commit 1888fb49f629340758e98e69d5aa328f6f73c5e1
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-13 21:17:10 +0200
- liblzma: Replace '\n' -> newline in filter.h documentation.
+ CMake: Disable symbol versioning on non-glibc Linux.
- The '\n' renders as a newline when the comments are converted to html
- by Doxygen.
+ This better matches what configure.ac does. For example, musl has
+ only basic symbol versioning support:
+
+ https://wiki.musl-libc.org/functional-differences-from-glibc.html#Symbol_versioning
+
+ configure.ac tries to enable symbol versioning only with glibc
+ so now CMake does the same.
+
+ (cherry picked from commit 2ad7fad67080e88fa7fc191f9d613d8b7add9c62)
- src/liblzma/api/lzma/filter.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 22 ++++++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
-commit 3971f5c5024750ce8286891c6f79ae1661047483
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-06 21:45:37 +0800
+commit 4b3c84e8eebbcf712fc2396dbb8117cce2d72464
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-13 20:32:46 +0200
- liblzma: Shorten return description for two functions in filter.h.
+ CMake: Make symbol versioning configurable.
- Shorten the description for lzma_raw_encoder_memusage() and
- lzma_raw_decoder_memusage().
+ (cherry picked from commit 82f0c0d39eb2c026b1d96ee706f70ace868d4ed4)
- src/liblzma/api/lzma/filter.h | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 62 +++++++++++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 42 insertions(+), 20 deletions(-)
-commit 5e61b39432752b6cd1a7b518f0f9e4f0c3f0f242
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-06 21:44:45 +0800
+commit 69d1e20208eb9bd1f4f1c8ee4e49cc82d681a877
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-13 19:47:36 +0200
- liblzma: Reword a few lines in filter.h
+ Build: Style tweaks to configure.ac.
+
+ The AC_MSG_ERROR line is overlong anyway as are a few other
+ AC_MSG_ERROR lines already.
+
+ (cherry picked from commit 45d33bfc45e4295b8ad743bc2ae61cc724f98076)
- src/liblzma/api/lzma/filter.h | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ configure.ac | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
-commit 8a53533869defa1191b41f176a0312cb53a139e2
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-06 21:35:06 +0800
+commit 051d6b5c85a874c78249693865fd751088f403a2
+Author: Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>
+Date: 2024-03-12 20:03:49 +0100
- liblzma: Improve documentation in filter.h.
+ Build: Let the users override the symbol versioning variant.
- All functions now explicitly specify parameter and return values.
- The notes and code annotations were moved before the parameter and
- return value descriptions for consistency.
+ There are cases when the users want to decide themselves whether
+ they want to have the generic (even on GNU/Linux) or the linux
+ (even if we do not recommend that) symbol versioning variant.
+ The former might be needed to circumvent compiler issues (i.e.
+ the compiler does not support all features that are required
+ for the linux versioning), the latter might help in overriding
+ the assumptions made in the configure script.
- Also, the description above lzma_filter_encoder_is_supported() about
- not being able to list available filters was removed since
- lzma_str_list_filters() will do this.
+ (cherry picked from commit f56ed6fac6619b56b005878d3b5210e2f0d721c0)
- src/liblzma/api/lzma/filter.h | 226 ++++++++++++++++++++++++++----------------
- 1 file changed, 143 insertions(+), 83 deletions(-)
+ configure.ac | 91 +++++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 50 insertions(+), 41 deletions(-)
-commit 6d05b08b17ac8cb93165ee8f310fdd925b0b258f
+commit 95dcea4b5df0b180af461e4584d2bcf7725e3aef
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-23 20:46:16 +0200
+Date: 2024-04-09 18:22:16 +0300
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit dfc9a54082e0fc7b3b796ea15336b5075acc79d5
+commit 1107712e372f7593ad729764c0c2644d0e4aa675
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-21 22:57:10 +0200
+Date: 2024-04-08 15:32:58 +0300
- liblzma: Avoid null pointer + 0 (undefined behavior in C).
+ Remove the backdoor found in 5.6.0 and 5.6.1 (CVE-2024-3094).
- In the C99 and C17 standards, section 6.5.6 paragraph 8 means that
- adding 0 to a null pointer is undefined behavior. As of writing,
- "clang -fsanitize=undefined" (Clang 15) diagnoses this. However,
- I'm not aware of any compiler that would take advantage of this
- when optimizing (Clang 15 included). It's good to avoid this anyway
- since compilers might some day infer that pointer arithmetic implies
- that the pointer is not NULL. That is, the following foo() would then
- unconditionally return 0, even for foo(NULL, 0):
+ While the backdoor was inactive (and thus harmless) without inserting
+ a small trigger code into the build system when the source package was
+ created, it's good to remove this anyway:
- void bar(char *a, char *b);
+ - The executable payloads were embedded as binary blobs in
+ the test files. This was a blatant violation of the
+ Debian Free Software Guidelines.
- int foo(char *a, size_t n)
- {
- bar(a, a + n);
- return a == NULL;
- }
+ - On machines that see lots bots poking at the SSH port, the backdoor
+ noticeably increased CPU load, resulting in degraded user experience
+ and thus overwhelmingly negative user feedback.
- In contrast to C, C++ explicitly allows null pointer + 0. So if
- the above is compiled as C++ then there is no undefined behavior
- in the foo(NULL, 0) call.
+ - The maintainer who added the backdoor has disappeared.
- To me it seems that changing the C standard would be the sane
- thing to do (just add one sentence) as it would ensure that a huge
- amount of old code won't break in the future. Based on web searches
- it seems that a large number of codebases (where null pointer + 0
- occurs) are being fixed instead to be future-proof in case compilers
- will some day optimize based on it (like making the above foo(NULL, 0)
- return 0) which in the worst case will cause security bugs.
+ - Backdoors are bad for security.
- Some projects don't plan to change it. For example, gnulib and thus
- many GNU tools currently require that null pointer + 0 is defined:
+ This reverts the following without making any other changes:
- https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00000.html
+ 6e636819 Tests: Update two test files.
+ a3a29bbd Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz.
+ 0b4ccc91 Tests: Update RISC-V test files.
+ 8c9b8b20 liblzma: Fix typos in crc32_fast.c and crc64_fast.c.
+ 82ecc538 liblzma: Fix false Valgrind error report with GCC.
+ cf44e4b7 Tests: Add a few test files.
+ 3060e107 Tests: Use smaller dictionary size in RISC-V test files.
+ e2870db5 Tests: Add two RISC-V Filter test files.
- https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html
+ The RISC-V test files also have real content that tests the filter
+ but the real content would fit into much smaller files. A generator
+ program would need to be available as well.
- In XZ Utils null pointer + 0 issue should be fixed after this
- commit. This adds a few if-statements and thus branches to avoid
- null pointer + 0. These check for size > 0 instead of ptr != NULL
- because this way bugs where size > 0 && ptr == NULL will likely
- get caught quickly. None of them are in hot spots so it shouldn't
- matter for performance.
-
- A little less readable version would be replacing
-
- ptr + offset
-
- with
-
- offset != 0 ? ptr + offset : ptr
-
- or creating a macro for it:
-
- #define my_ptr_add(ptr, offset) \
- ((offset) != 0 ? ((ptr) + (offset)) : (ptr))
-
- Checking for offset != 0 instead of ptr != NULL allows GCC >= 8.1,
- Clang >= 7, and Clang-based ICX to optimize it to the very same code
- as ptr + offset. That is, it won't create a branch. So for hot code
- this could be a good solution to avoid null pointer + 0. Unfortunately
- other compilers like ICC 2021 or MSVC 19.33 (VS2022) will create a
- branch from my_ptr_add().
-
- Thanks to Marcin Kowalczyk for reporting the problem:
- https://github.com/tukaani-project/xz/issues/36
+ Thanks to Andres Freund for finding and reporting it and making
+ it public quickly so others could act without a delay.
+ See: https://www.openwall.com/lists/oss-security/2024/03/29/4
- src/liblzma/common/block_decoder.c | 5 ++++-
- src/liblzma/common/block_encoder.c | 7 +++++--
- src/liblzma/common/common.c | 20 ++++++++++++++------
- src/liblzma/common/index_decoder.c | 13 ++++++++++---
- src/liblzma/common/index_encoder.c | 11 +++++++++--
- src/liblzma/common/index_hash.c | 13 ++++++++++---
- src/liblzma/common/lzip_decoder.c | 6 +++++-
- src/liblzma/delta/delta_decoder.c | 7 ++++++-
- src/liblzma/delta/delta_encoder.c | 12 ++++++++++--
- src/liblzma/simple/simple_coder.c | 6 ++++--
- 10 files changed, 77 insertions(+), 23 deletions(-)
+ src/liblzma/check/crc32_fast.c | 7 +++++--
+ src/liblzma/check/crc64_fast.c | 4 +++-
+ src/liblzma/check/crc_common.h | 25 -------------------------
+ tests/files/README | 27 ---------------------------
+ tests/files/bad-3-corrupt_lzma2.xz | Bin 512 -> 0 bytes
+ tests/files/bad-dict_size.lzma | Bin 41 -> 0 bytes
+ tests/files/good-1-riscv-lzma2-1.xz | Bin 7424 -> 0 bytes
+ tests/files/good-1-riscv-lzma2-2.xz | Bin 7432 -> 0 bytes
+ tests/files/good-2cat.xz | Bin 136 -> 0 bytes
+ tests/files/good-large_compressed.lzma | Bin 35421 -> 0 bytes
+ tests/files/good-small_compressed.lzma | Bin 258 -> 0 bytes
+ tests/test_files.sh | 11 -----------
+ 12 files changed, 8 insertions(+), 66 deletions(-)
-commit f6dce49cb656b358e2fb2a3032e35e20af34dc84
+commit fd1b975b7851e081ed6e5cf63df946cd5cbdbb94
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-07 00:00:44 +0800
+Date: 2024-03-09 11:42:50 +0800
- liblzma: Adjust container.h for consistency with filter.h.
+ Bump version and soname for 5.6.1.
- src/liblzma/api/lzma/container.h | 20 +++++++++-----------
- 1 file changed, 9 insertions(+), 11 deletions(-)
+ src/liblzma/Makefile.am | 2 +-
+ src/liblzma/api/lzma/version.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit 173d240bb4763aedc8c01df4d9c83e311d954c33
+commit a2cda572498e96163fe4e2bde096d5dd7b814668
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-07 00:00:09 +0800
+Date: 2024-03-09 11:27:27 +0800
- liblzma: Fix small typos and reword a few things in filter.h.
+ Add NEWS for 5.6.1
- src/liblzma/api/lzma/container.h | 13 ++++++-------
- 1 file changed, 6 insertions(+), 7 deletions(-)
+ NEWS | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
-commit 17797bacde3f7264048ef0976c137a600148d6cf
+commit 8583c6021124e388bce044a09f00ebabfd6165a7
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-06 23:42:08 +0800
+Date: 2024-03-09 10:43:20 +0800
- liblzma: Convert list of flags in lzma_mt to bulleted list.
+ Translations: Add missing --riscv option to man page translations.
- src/liblzma/api/lzma/container.h | 9 ++++++---
- 1 file changed, 6 insertions(+), 3 deletions(-)
+ po4a/de.po | 702 +++++++++++++++++++++++++++++-----------------------------
+ po4a/fr.po | 549 ++++++++++++++++++++++-----------------------
+ po4a/ko.po | 702 +++++++++++++++++++++++++++++-----------------------------
+ po4a/pt_BR.po | 641 +++++++++++++++++++++++++++--------------------------
+ po4a/ro.po | 702 +++++++++++++++++++++++++++++-----------------------------
+ po4a/uk.po | 702 +++++++++++++++++++++++++++++-----------------------------
+ 6 files changed, 2024 insertions(+), 1974 deletions(-)
-commit 37da0e727161b401b8bfd8dccf163a4b2fc0460b
+commit 74b138d2a6529f2c07729d7c77b1725a8e8b16f1
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-26 23:17:41 +0800
+Date: 2024-03-09 10:18:29 +0800
- liblzma: Fix typo in documentation in container.h
+ Tests: Update two test files.
- lzma_microlzma_decoder -> lzma_microlzma_encoder
+ The original files were generated with random local to my machine.
+ To better reproduce these files in the future, a constant seed was used
+ to recreate these files.
- src/liblzma/api/lzma/container.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/files/bad-3-corrupt_lzma2.xz | Bin 484 -> 512 bytes
+ tests/files/good-large_compressed.lzma | Bin 35430 -> 35421 bytes
+ 2 files changed, 0 insertions(+), 0 deletions(-)
-commit b8331077c626e6bf14f4671d09b561146eaf816a
+commit 3ec6dfd656bdd40ede2a5f11e6be338988e38be4
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-26 23:16:34 +0800
+Date: 2024-03-09 10:08:32 +0800
- liblzma: Improve documentation for container.h
+ Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz.
- Standardizing each function to always specify parameters and return
- values. Also moved the parameters and return values to the end of each
- function description.
+ The first stream in this file is valid, so this tests that xz properly
+ stops after decompressing it.
- src/liblzma/api/lzma/container.h | 146 +++++++++++++++++++++++++--------------
- 1 file changed, 93 insertions(+), 53 deletions(-)
+ tests/test_files.sh | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
-commit b9a3511bb61d3b6ce49abd33dce6155a573f5272
+commit a67dcce6109c2f932a0a86abb0d7a95d3c31fb3e
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-22 20:59:41 +0800
-
- CMake: Add LZIP decoder test to list of tests.
-
- CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
-
-commit cd82ef2fb48b174c57cd03b84a9a0f978772cb89
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-17 20:56:49 +0200
-
- Update THANKS.
-
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
-
-commit 076e911ba25cadf2cbdfbd0f65991a002e210c0b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-17 20:48:28 +0200
+Date: 2024-03-09 10:05:32 +0800
- Build: Use only the generic symbol versioning on MicroBlaze.
-
- On MicroBlaze, GCC 12 is broken in sense that
- __has_attribute(__symver__) returns true but it still doesn't
- support the __symver__ attribute even though the platform is ELF
- and symbol versioning is supported if using the traditional
- __asm__(".symver ...") method. Avoiding the traditional method is
- good because it breaks LTO (-flto) builds with GCC.
+ Tests: Update RISC-V test files.
- See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
-
- For now the only extra symbols in liblzma_linux.map are the
- compatibility symbols with the patch that spread from RHEL/CentOS 7.
- These require the use of __symver__ attribute or __asm__(".symver ...")
- in the C code. Compatibility with the patch from CentOS 7 doesn't
- seem valuable on MicroBlaze so use liblzma_generic.map on MicroBlaze
- instead. It doesn't require anything special in the C code and thus
- no LTO issues either.
-
- An alternative would be to detect support for __symver__
- attribute in configure.ac and CMakeLists.txt and fall back
- to __asm__(".symver ...") but then LTO would be silently broken
- on MicroBlaze. It sounds likely that MicroBlaze is a special
- case so let's treat it as a such because that is simpler. If
- a similar issue exists on some other platform too then hopefully
- someone will report it and this can be reconsidered.
-
- (This doesn't do the same fix in CMakeLists.txt. Perhaps it should
- but perhaps CMake build of liblzma doesn't matter much on MicroBlaze.
- The problem breaks the build so it's easy to notice and can be fixed
- later.)
-
- Thanks to Vincent Fazio for reporting the problem and proposing
- a patch (in the end that solution wasn't used):
- https://github.com/tukaani-project/xz/pull/32
-
- configure.ac | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-commit bc34e5ac9996667d2c1ec9a7895ec5931ac4caea
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-16 21:09:00 +0200
+ This increases code coverage and tests for possible shifting bugs.
- liblzma: Very minor API doc tweaks.
-
- Use "member" to refer to struct members as that's the term used
- by the C standard.
-
- Use lzma_options_delta.dist and such in docs so that in Doxygen's
- HTML output they will link to the doc of the struct member.
-
- Clean up a few trailing white spaces too.
-
- src/liblzma/api/lzma/block.h | 6 +++---
- src/liblzma/api/lzma/delta.h | 6 +++---
- src/liblzma/api/lzma/index.h | 10 +++++-----
- src/liblzma/api/lzma/stream_flags.h | 6 +++---
- 4 files changed, 14 insertions(+), 14 deletions(-)
+ tests/files/good-1-riscv-lzma2-1.xz | Bin 7512 -> 7424 bytes
+ tests/files/good-1-riscv-lzma2-2.xz | Bin 7512 -> 7432 bytes
+ 2 files changed, 0 insertions(+), 0 deletions(-)
-commit d31fbd28be5b79eb682db50004b0fb7aad5299ec
+commit 058337b0f1da9f166049ecc972fa5c499c1af08c
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-17 00:54:33 +0800
+Date: 2024-03-09 09:52:32 +0800
- liblzma: Adjust spacing in doc headers in bcj.h.
+ liblzma: Fix typos in crc32_fast.c and crc64_fast.c.
- src/liblzma/api/lzma/bcj.h | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
+ src/liblzma/check/crc32_fast.c | 4 ++--
+ src/liblzma/check/crc64_fast.c | 3 +--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
-commit 701e9be6bede19771895f756082db0c017f86f07
+commit cd5de9c1bbab3dd41b34b37a89c193fb6ff51ca5
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-17 00:44:44 +0800
+Date: 2024-03-09 09:49:55 +0800
- liblzma: Adjust documentation in bcj.h for consistent style.
+ Tests: Replace HAVE_MICROLZMA usage in CMake and Autotools builds.
+
+ This reverts commit adaacafde6661496ca2814b1e94a3ba5186428cb.
- src/liblzma/api/lzma/bcj.h | 43 ++++++++++++++++++++++---------------------
- 1 file changed, 22 insertions(+), 21 deletions(-)
+ CMakeLists.txt | 15 ++++++++++-----
+ configure.ac | 9 ++-------
+ tests/Makefile.am | 9 ++++++---
+ tests/test_microlzma.c | 12 ++++--------
+ 4 files changed, 22 insertions(+), 23 deletions(-)
-commit 762c4d0b62d2694cf3a01e030fdfe68e09e7b503
+commit 651a1545c8b6150051a0b44857136efd419afc6f
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-17 00:36:05 +0800
+Date: 2024-03-09 09:20:57 +0800
- liblzma: Rename field => member in documentation.
+ liblzma: Fix false Valgrind error report with GCC.
- Also adjusted preset value => preset level.
+ With GCC and a certain combination of flags, Valgrind will falsely
+ trigger an invalid write. This appears to be due to the omission of
+ instructions to properly save, set up, and restore the frame pointer.
+
+ The IFUNC resolver is a leaf function since it only calls a function
+ that is inlined. So sometimes GCC omits the frame pointer instructions
+ in the resolver unless this optimization is explictly disabled.
+
+ This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2267598.
- src/liblzma/api/lzma/base.h | 18 +++++++--------
- src/liblzma/api/lzma/block.h | 44 ++++++++++++++++++-------------------
- src/liblzma/api/lzma/container.h | 26 +++++++++++-----------
- src/liblzma/api/lzma/delta.h | 12 +++++-----
- src/liblzma/api/lzma/index.h | 30 ++++++++++++-------------
- src/liblzma/api/lzma/lzma12.h | 28 +++++++++++------------
- src/liblzma/api/lzma/stream_flags.h | 32 +++++++++++++--------------
- 7 files changed, 95 insertions(+), 95 deletions(-)
+ src/liblzma/check/crc32_fast.c | 9 +++------
+ src/liblzma/check/crc64_fast.c | 7 +++----
+ src/liblzma/check/crc_common.h | 25 +++++++++++++++++++++++++
+ 3 files changed, 31 insertions(+), 10 deletions(-)
-commit 0ce1db0223854d94b4a0d17737ac0486a75d9e6a
+commit 6e97b299f1b22e366ec42ba5dc5b9d0746e87b84
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-02-16 17:59:50 +0200
+Date: 2024-03-05 23:21:26 +0200
- liblzma: Silence a warning from MSVC.
-
- It gives C4146 here since unary minus with unsigned integer
- is still unsigned (which is the intention here). Doing it
- with substraction makes it clearer and avoids the warning.
-
- Thanks to Nathan Moinvaziri for reporting this.
+ liblzma: Fix a typo in a comment in the RISC-V filter.
- src/liblzma/check/crc64_fast.c | 2 +-
+ src/liblzma/simple/riscv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit d83da006b3e8dbad9112e6cde6b27049d193c9ec
+commit 4e1c97052b5f14f4d6dda99d12cbbd01e66e3712
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-16 21:04:54 +0800
+Date: 2024-03-05 00:34:46 +0800
- liblzma: Improve documentation for stream_flags.h
+ liblzma: Use attribute no_profile_instrument_function with ifunc.
- Standardizing each function to always specify parameters and return
- values. Also moved the parameters and return values to the end of each
- function description.
-
- A few small things were reworded and long sentences broken up.
+ Thanks to Sam James for determining this was the attribute needed to
+ workaround the GCC bug and for his version of the patch in Gentoo.
- src/liblzma/api/lzma/stream_flags.h | 76 ++++++++++++++++++++++---------------
- 1 file changed, 46 insertions(+), 30 deletions(-)
+ src/liblzma/check/crc32_fast.c | 5 +++++
+ src/liblzma/check/crc64_fast.c | 3 +++
+ 2 files changed, 8 insertions(+)
-commit 2796bb4736f645d34939b5d62d5958f534e41e69
+commit ed957d39426695e948b06de0ed952a2fbbe84bd1
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-14 21:50:16 +0800
+Date: 2024-03-05 00:27:31 +0800
- liblzma: Improve documentation in lzma12.h.
+ Build: Require attribute no_profile_instrument_function for ifunc usage.
- All functions now explicitly specify parameter and return values.
-
- src/liblzma/api/lzma/lzma12.h | 32 +++++++++++++++++++++++---------
- 1 file changed, 23 insertions(+), 9 deletions(-)
-
-commit ebebaa8d9381afea440eb1b01917117551adf68f
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-27 22:44:06 +0800
-
- liblzma: Improve documentation in check.h.
+ Using __attribute__((__no_profile_instrument_function__)) on the ifunc
+ resolver works around a bug in GCC -fprofile-generate:
+ it adds profiling code even to ifunc resolvers which can make
+ the ifunc resolver crash at program startup. This attribute
+ was not introduced until GCC 7 and Clang 13, so ifunc won't
+ be used with prior versions of these compilers.
- All functions now explicitly specify parameter and return values.
- Also moved the note about SHA-256 functions not being exported to the
- top of the file.
-
- src/liblzma/api/lzma/check.h | 41 ++++++++++++++++++++++++++++-------------
- 1 file changed, 28 insertions(+), 13 deletions(-)
-
-commit 765fa2865aab97ea713c1715922e322b3cf599a7
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-08 21:33:52 +0800
-
- liblzma: Improve documentation in index.h
+ This bug was brought to our attention by:
- All functions now explicitly specify parameter and return values.
+ https://bugs.gentoo.org/925415
+
+ And was reported to upstream GCC by:
+
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11411
- src/liblzma/api/lzma/index.h | 177 ++++++++++++++++++++++++++++++-------------
- 1 file changed, 126 insertions(+), 51 deletions(-)
+ CMakeLists.txt | 7 +++++++
+ configure.ac | 7 +++++++
+ 2 files changed, 14 insertions(+)
-commit 918e208af5960728b6def01e692b395f7d8e3701
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-08 20:35:32 +0800
+commit e98ddaf85a1a8fb3cc863637f83356cc9db31e13
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-03-04 19:23:18 +0200
- liblzma: Reword a comment in index.h.
+ liblzma: Fix a comment in the RISC-V filter.
- src/liblzma/api/lzma/index.h | 4 ++--
+ src/liblzma/simple/riscv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-commit 1f157d214bc09338876d2467b549935679abc0bf
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-08 20:30:23 +0800
+commit 319cec142f67fe294e0486402f1569f223d9a83d
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-29 16:35:52 +0200
- liblzma: Omit lzma_index_iter's internal field from Doxygen docs.
-
- Add \private above this field and its sub-fields since it is not meant
- to be modified by users.
+ CMake: Warn if translated man pages are missing.
- src/liblzma/api/lzma/index.h | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 9 +++++++++
+ 1 file changed, 9 insertions(+)
-commit 28757fa46d8e0f0a9c17628b2b6af9bcb3cd96fc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-21 21:32:03 +0800
+commit 46c3e113d8eeb1a731a60829fa7f5d1b519f7f26
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-29 16:35:52 +0200
- liblzma: Fix documentation for LZMA_MEMLIMIT_ERROR.
+ CMake: Warn if gettext tools and pre-created .gmo files are missing.
- LZMA_MEMLIMIT_ERROR was missing the "<" character needed to put
- documentation after a member.
-
- src/liblzma/api/lzma/base.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-commit 135d5a1a65a9e199b9a5550c1f788cf43cd81018
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-21 00:29:38 +0800
-
- liblzma: Improve documentation for base.h.
+ It's only done with CMake >= 3.20 and if library support
+ for translation was already found.
- Standardizing each function to always specify params and return values.
- Also fixed a small grammar mistake.
+ Sort of fixes: https://github.com/tukaani-project/xz/issues/82
- src/liblzma/api/lzma/base.h | 30 +++++++++++++++++++++++++-----
- 1 file changed, 25 insertions(+), 5 deletions(-)
+ CMakeLists.txt | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
-commit 2287d5668384e289d51e72724997dc920483768e
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-14 00:08:33 +0800
+commit 86bec8334bb1dcb6d9293a11cdccd895b17f364b
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-28 18:26:25 +0200
- liblzma: Minor improvements to vli.h.
-
- Added [out] annotations to parameters that are pointers and can have
- their value changed. Also added a clarification to lzma_vli_is_valid.
+ xz: Add comments.
- src/liblzma/api/lzma/vli.h | 15 ++++++++-------
- 1 file changed, 8 insertions(+), 7 deletions(-)
+ src/xz/coder.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit 7124b8a16ae60cb2e93218ff531868eebd673bde
+commit 5c91b454c24e043ca8f2cc7d2b09bd091dafe655
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-10 21:38:02 +0800
+Date: 2024-02-27 23:42:41 +0800
- liblzma: Add comments for macros in delta.h.
+ xz: Change logging level for thread reduction to highest verbosity only.
- Document LZMA_DELTA_DIST_MIN and LZMA_DELTA_DIST_MAX for completeness
- and to avoid Doxygen warnings.
-
- src/liblzma/api/lzma/delta.h | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-commit 59c7bb8931159fdb1a31bbbeaed0e6984e2d3c81
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-10 21:35:23 +0800
-
- liblzma: Improve documentation in index_hash.h.
+ Now that multi threaded encoding is the default, users do not need to
+ see a warning message everytime the number of threads is reduced. On
+ some machines, this could happen very often. It is not unreasonable for
+ users to need to set double verbose mode to see this kind of
+ information.
- All functions now explicitly specify parameter and return values.
- Also reworded the description of lzma_index_hash_init() for readability.
+ To see these warning messages -vv or --verbose --verbose must be passed
+ to set xz into the highest possible verbosity mode.
+
+ These warnings had caused automated testing frameworks to fail when they
+ expected no output to stderr.
+
+ Thanks to Sebastian Andrzej Siewior for reporting this and for the
+ initial version of the patch.
- src/liblzma/api/lzma/index_hash.h | 36 +++++++++++++++++++++++++++---------
- 1 file changed, 27 insertions(+), 9 deletions(-)
+ src/xz/coder.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit e970c28ac3cb2e8051925f81db2fe953664c2645
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:33:32 +0800
+commit d0e57b2f159f8fd03a9a89f2f593a768d0487898
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-26 23:06:13 +0200
- liblzma: Fix bug in lzma_str_from_filters() not checking filters[] length.
-
- The bug is only a problem in applications that do not properly terminate
- the filters[] array with LZMA_VLI_UNKNOWN or have more than
- LZMA_FILTERS_MAX filters. This bug does not affect xz.
+ Fix sorting in THANKS.
- src/liblzma/common/string_conversion.c | 7 +++++++
- 1 file changed, 7 insertions(+)
+ THANKS | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 85e01266a96689448abb249da6c6abc3afcd4a4e
+commit d416be55ac02af1144fed455fb18b710147bb490
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:32:47 +0800
+Date: 2024-02-26 23:39:29 +0800
- Tests: Create test_filter_str.c.
-
- Tests lzma_str_to_filters(), lzma_str_from_filters(), and
- lzma_str_list_filters() API functions.
+ Update THANKS.
- CMakeLists.txt | 1 +
- tests/Makefile.am | 2 +
- tests/test_filter_str.c | 593 ++++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 596 insertions(+)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 3fa0f3ba12dd3383f62dbfa18a864f9b4217fa0a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-22 08:49:00 +0800
+commit f06b33edd2aeabdb11836a2bf0b681768dad29d3
+Author: Chien Wong <m@xv97.com>
+Date: 2024-02-25 21:38:13 +0800
- liblzma: Fix typos in comments in string_conversion.c.
+ xz: Add missing RISC-V on the filter list in the man page
+
+ Signed-off-by: Chien Wong <m@xv97.com>
- src/liblzma/common/string_conversion.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/xz/xz.1 | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-commit 32dbe045d74e94f75c53236fa2a6c0454d7b6d9e
+commit a100f9111c8cc7f5b5f0e4a5e8af3de7161c7975
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:20:20 +0800
+Date: 2024-02-26 23:02:06 +0800
- liblzma: Clarify block encoder and decoder documentation.
+ Build: Fix Linux Landlock feature test in Autotools and CMake builds.
- Added a few sentences to the description for lzma_block_encoder() and
- lzma_block_decoder() to highlight that the Block Header must be coded
- before calling these functions.
+ The previous Linux Landlock feature test assumed that having the
+ linux/landlock.h header file was enough. The new feature tests also
+ requires that prctl() and the required Landlock system calls are
+ supported.
- src/liblzma/api/lzma/block.h | 15 +++++++++++----
- 1 file changed, 11 insertions(+), 4 deletions(-)
+ CMakeLists.txt | 25 ++++++++++++++++++++++---
+ configure.ac | 27 ++++++++++++++++++++++++++-
+ src/xz/sandbox.c | 2 +-
+ src/xz/sandbox.h | 2 +-
+ src/xzdec/xzdec.c | 8 ++++----
+ 5 files changed, 54 insertions(+), 10 deletions(-)
-commit ccf12acbfa7331b1bbb99ec55879186eb35f879f
+commit d85efdc8911e6e8964ec920af44c8a6fe0a4c3c2
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:12:24 +0800
+Date: 2024-02-26 20:06:10 +0800
- Update lzma_block documentation for lzma_block_uncomp_encode().
+ Tests: Add test_microlzma to .gitignore and CMakeLists.txt.
- src/liblzma/api/lzma/block.h | 3 +++
- 1 file changed, 3 insertions(+)
+ .gitignore | 1 +
+ CMakeLists.txt | 1 +
+ 2 files changed, 2 insertions(+)
-commit 6a0b168dd9dc1ef437255c4bfdc6eff8b96fdb24
+commit 42ee4256739779005a7f921946c8a8e483d1f2ed
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:11:37 +0800
+Date: 2024-02-26 19:56:25 +0800
- liblzma: Minor edits to lzma_block header_size documentation.
+ Tests: Correct license header in test_microlzma.c.
- src/liblzma/api/lzma/block.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ tests/test_microlzma.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
-commit 84ce36f90e68471fec1f0e61cd93ac7ed9ab4883
+commit c83349dfd9cf9c495005b6d30e2fd34a9cafc18a
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:11:07 +0800
+Date: 2024-02-25 21:41:55 +0800
- liblzma: Enumerate functions that read version in lzma_block.
+ Fix typos in NEWS and CMakeLists.
- src/liblzma/api/lzma/block.h | 13 +++++++++++--
- 1 file changed, 11 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 2 +-
+ NEWS | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit d6620774682830d606f57109861b6763805b3492
+commit 2d7d862e3ffa8cec4fd3fdffcd84e984a17aa429
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:10:34 +0800
+Date: 2024-02-24 15:55:08 +0800
- liblzma: Clarify comment in block.h.
+ Bump version and soname for 5.6.0.
- src/liblzma/api/lzma/block.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ src/liblzma/Makefile.am | 2 +-
+ src/liblzma/api/lzma/version.h | 6 +++---
+ src/liblzma/liblzma_generic.map | 2 +-
+ src/liblzma/liblzma_linux.map | 2 +-
+ 4 files changed, 6 insertions(+), 6 deletions(-)
-commit 880adb5aa25f66a53d81c2f3acc716f7a4d373d1
+commit a18fb1edef0d0aac12a09eed05e9c448c777af7b
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-03 00:07:23 +0800
+Date: 2024-02-24 15:50:36 +0800
- liblzma: Improve documentation for block.h.
-
- Standardizing each function to always specify params and return values.
- Output pointer parameters are also marked with doxygen style [out] to
- make it clear. Any note sections were also moved above the parameter and
- return sections for consistency.
+ Add NEWS for 5.6.0.
- src/liblzma/api/lzma/block.h | 96 ++++++++++++++++++++++++++++++++++----------
- 1 file changed, 75 insertions(+), 21 deletions(-)
+ NEWS | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 143 insertions(+)
-commit b5b1b1f061c342271e4977ce5cba604a19c0ca52
+commit 24355c5280bc95e3d594432d60bb8432aa6af173
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-02-01 23:38:30 +0800
+Date: 2024-02-22 22:27:01 +0800
- liblzma: Clarify a comment about LZMA_STR_NO_VALIDATION.
+ Translations: Remove obsolete and fuzzy matches from some translations.
- The flag description for LZMA_STR_NO_VALIDATION was previously confusing
- about the treatment for filters than cannot be used with .xz format
- (lzma1) without using LZMA_STR_ALL_FILTERS. Now, it is clear that
- LZMA_STR_NO_VALIDATION is not a super set of LZMA_STR_ALL_FILTERS.
+ The French and Brazilian Portuguese man page translations have not been
+ updated since the switch from public domain to 0BSD. The old GPLv2
+ strings have now been removed from these files.
- src/liblzma/api/lzma/filter.h | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ po4a/fr.po | 4702 +++++++++++++++++++++++++++++++++++++----------------
+ po4a/pt_BR.po | 4987 ++++++++++++++++++++++++++++++++++++++++-----------------
+ 2 files changed, 6832 insertions(+), 2857 deletions(-)
-commit e904e778b82b14f2779aab80d6c8f3c01a3fc54b
+commit 02ca4a7d7b703e2ec63e00b70feec825e919dbc1
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-27 20:14:51 +0800
+Date: 2024-02-21 00:31:54 +0800
- Translations: Add Brazilian Portuguese translation of man pages.
+ Translations: Patch man pages to avoid fuzzy matches.
- Thanks to Rafael Fontenelle.
+ This will be fixed in the next round of translations, but this avoids
+ having a fuzzy match or not fixing the English version.
- po4a/po4a.conf | 2 +-
- po4a/pt_BR.po | 3677 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 3678 insertions(+), 1 deletion(-)
+ po4a/de.po | 2 +-
+ po4a/ko.po | 2 +-
+ po4a/ro.po | 2 +-
+ po4a/uk.po | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
-commit e9c47e79c9584ba1126f5fa0dbe6c96e67411aa6
+commit 898aad9fc711e03452d24d9e2c5b7f77a6f9ce64
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-24 20:48:50 +0800
+Date: 2024-02-21 00:30:43 +0800
- liblzma: Fix documentation in filter.h for lzma_str_to_filters()
+ xzmore: Fix typo in xzmore.1.
- The previous documentation for lzma_str_to_filters() was technically
- correct, but misleading. lzma_str_to_filters() returns NULL on success,
- which is in practice always defined to 0. This is the same value as
- LZMA_OK, but lzma_str_to_filters() does not return lzma_ret so we should
- be more clear.
+ Thanks to Yuri Chornoivan.
- src/liblzma/api/lzma/filter.h | 2 +-
+ src/scripts/xzmore.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 99575947a58a60416c570eb78038d18a1ea4cef4
+commit 5631aa206c8d16b4eeab85a46b8b698f4fc4cdba
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-07 21:55:06 +0800
+Date: 2024-02-24 12:12:16 +0800
- xz: Refactor duplicated check for custom suffix when using --format=raw
+ Translations: Update the Vietnamese translation.
- src/xz/args.c | 8 ++++++++
- src/xz/suffix.c | 26 ++++++++------------------
- src/xz/suffix.h | 8 ++++++++
- 3 files changed, 24 insertions(+), 18 deletions(-)
+ po/vi.po | 505 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 309 insertions(+), 196 deletions(-)
-commit 76dec92fcca4a9ccd2063ed6d5d9e3474665baad
+commit a65fd7ce9d6228e87faf61dc56a35984d0088248
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-20 21:53:14 +0800
+Date: 2024-02-24 12:06:40 +0800
- liblzma: Set documentation on all reserved fields to private.
-
- This prevents the reserved fields from being part of the generated
- Doxygen documentation.
+ Translations: Update the Esperanto translation.
- src/liblzma/api/lzma/base.h | 17 +++++++++++++++
- src/liblzma/api/lzma/block.h | 43 +++++++++++++++++++++++++++++++++++++
- src/liblzma/api/lzma/container.h | 24 +++++++++++++++++++++
- src/liblzma/api/lzma/delta.h | 12 +++++++++++
- src/liblzma/api/lzma/index.h | 27 +++++++++++++++++++++++
- src/liblzma/api/lzma/lzma12.h | 22 +++++++++++++++++++
- src/liblzma/api/lzma/stream_flags.h | 28 ++++++++++++++++++++++++
- 7 files changed, 173 insertions(+)
+ po/eo.po | 502 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 306 insertions(+), 196 deletions(-)
-commit bd213d06ebf92cf42eeb97e7c578bddc857f8ea8
+commit cf44e4b7f5dfdbf8c78aef377c10f71e274f63c0
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-21 23:59:43 +0800
+Date: 2024-02-23 23:09:59 +0800
- liblzma: Highlight liblzma API headers should not be included directly.
-
- This improves the generated Doxygen HTML files to better highlight
- how to properly use the liblzma API header files.
+ Tests: Add a few test files.
- src/liblzma/api/lzma/base.h | 5 +++--
- src/liblzma/api/lzma/bcj.h | 5 +++--
- src/liblzma/api/lzma/block.h | 5 +++--
- src/liblzma/api/lzma/check.h | 5 +++--
- src/liblzma/api/lzma/container.h | 5 +++--
- src/liblzma/api/lzma/delta.h | 5 +++--
- src/liblzma/api/lzma/filter.h | 5 +++--
- src/liblzma/api/lzma/hardware.h | 5 +++--
- src/liblzma/api/lzma/index.h | 5 +++--
- src/liblzma/api/lzma/index_hash.h | 5 +++--
- src/liblzma/api/lzma/lzma12.h | 5 +++--
- src/liblzma/api/lzma/stream_flags.h | 5 +++--
- src/liblzma/api/lzma/version.h | 5 +++--
- src/liblzma/api/lzma/vli.h | 5 +++--
- 14 files changed, 42 insertions(+), 28 deletions(-)
+ tests/files/README | 19 +++++++++++++++++++
+ tests/files/bad-3-corrupt_lzma2.xz | Bin 0 -> 484 bytes
+ tests/files/bad-dict_size.lzma | Bin 0 -> 41 bytes
+ tests/files/good-2cat.xz | Bin 0 -> 136 bytes
+ tests/files/good-large_compressed.lzma | Bin 0 -> 35430 bytes
+ tests/files/good-small_compressed.lzma | Bin 0 -> 258 bytes
+ 6 files changed, 19 insertions(+)
-commit 257dbff0ba1a7bc45a74d203ece015c9f70c88cd
+commit 39f4a1a86ad80b2d064b812cee42668e6c8b8c73
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-19 20:35:09 +0800
+Date: 2024-02-23 20:58:36 +0800
- tuklib_physmem: Silence warning from -Wcast-function-type on MinGW-w64.
-
- tuklib_physmem depends on GetProcAddress() for both MSVC and MinGW-w64
- to retrieve a function address. The proper way to do this is to cast the
- return value to the type of function pointer retrieved. Unfortunately,
- this causes a cast-function-type warning, so the best solution is to
- simply ignore the warning.
+ Tests: Add MicroLZMA test.
- src/common/tuklib_physmem.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
+ tests/Makefile.am | 4 +-
+ tests/test_microlzma.c | 548 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 551 insertions(+), 1 deletion(-)
-commit 720ad4a44282a7ee59aa9920eaf495d85d245d97
+commit adaacafde6661496ca2814b1e94a3ba5186428cb
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-16 21:35:45 +0800
+Date: 2024-02-23 20:57:59 +0800
- xz: Add missing comment for coder_set_compression_settings()
+ Build: Define HAVE_MICROLZMA when it is configured.
- src/xz/coder.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 4 ++++
+ configure.ac | 9 +++++++--
+ 2 files changed, 11 insertions(+), 2 deletions(-)
-commit 88dc19163421282369c0989e997c05f9a447edc6
+commit eea78216d27182ca917bf00e02feaab058a4d21e
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-16 20:55:10 +0800
+Date: 2024-02-23 20:27:15 +0800
- xz: Do not set compression settings with raw format in list mode.
+ xz: Fix Capsicum sandbox compile error.
- Calling coder_set_compression_settings() in list mode with verbose mode
- on caused the filter chain and memory requirements to print. This was
- unnecessary since the command results in an error and not consistent
- with other formats like lzma and alone.
+ user_abort_pipe[] was still being used instead of the parameters.
- src/xz/args.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ src/xz/sandbox.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 039e0ab13efb144642f9d99eeeb9c668e76bb430
+commit 32b0a3ce19224f9074d01a4ffbc1655b05fcb82d
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-13 20:37:06 +0800
+Date: 2024-02-23 16:12:32 +0800
- Translations: Update the Brazilian Portuguese translation.
-
- po/pt_BR.po | 603 ++++++++++++++++++++++++++++++++++--------------------------
- 1 file changed, 344 insertions(+), 259 deletions(-)
-
-commit 718f7a60e740b26b8353965edaaddc7d4deb4d85
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 13:04:05 +0200
-
- Build: Omit -Wmissing-noreturn from the default warnings.
+ Build: Fix ARM64 CRC32 instruction feature test.
- It's not that important. It can be annoying in builds that
- disable many features since in those cases the tests programs
- will correctly trigger this warning with Clang.
-
- configure.ac | 1 -
- 1 file changed, 1 deletion(-)
-
-commit 3ccedb09724c998c39d708c945f6da5852c39e13
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 06:05:58 +0200
-
- xz: Use ssize_t for the to-be-ignored return value from write(fd, ptr, 1).
+ Old versions of Clang reported the unsupported function attribute and
+ __crc32d() function as warnings instead of errors, so the feature test
+ passed when it shouldn't have, causing a compile error at build time.
+ -Werror was added to this feature test to fix this. The change is not
+ needed for CMake because check_c_source_compiles() also performs
+ linking and the error is caught then.
- It makes no difference here as the return value fits into an int
- too and it then gets ignored but this looks better.
+ Thanks to Sebastian Andrzej Siewior for reporting this.
- src/xz/file_io.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-commit 09fbd2f0527def89e839c8907de4fe7ef6bc5019
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 06:01:12 +0200
-
- xz: Silence warnings from -Wsign-conversion in a 32-bit build.
-
- src/common/tuklib_mbstr_fw.c | 2 +-
- src/xz/list.c | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
+ configure.ac | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit 683d3f178ef1487b5418be49f331b0131a101b40
+commit 4c81c9611f8b2e1ad65eb7fa166afc570c58607e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 05:38:48 +0200
+Date: 2024-02-22 19:16:35 +0200
- liblzma: Silence another warning from -Wsign-conversion in a 32-bit build.
+ CMake: Add LOCALEDIR to the windres workaround.
- It doesn't warn on a 64-bit system because truncating
- a ptrdiff_t (signed long) to uint32_t is diagnosed under
- -Wconversion by GCC and -Wshorten-64-to-32 by Clang.
-
- src/liblzma/lz/lz_encoder_mf.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
-
-commit 2b8062ef94a38d0f9ad0d1b309e8748db52f5c15
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 04:46:45 +0200
+ LOCALEDIR may contain spaces like in "C:\Program Files".
- liblzma: Silence a warning from -Wsign-conversion in a 32-bit build.
-
- src/common/mythread.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
-commit b16b9c0d22227012518595c2222facc73bd833a8
+commit de4337fd89ca7db5feb97b5c40143404f6e22986
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 04:17:24 +0200
+Date: 2024-02-22 15:18:25 +0200
- Build: Make configure add more warning flags for GCC and Clang.
+ xz: Landlock: Fix error message if input file is a directory.
- -Wstrict-aliasing was removed from the list since it is enabled
- by -Wall already.
+ If xz is given a directory, it should look like this:
- A normal build is clean with these on GNU/Linux x86-64 with
- GCC 12.2.0 and Clang 14.0.6.
-
- configure.ac | 36 +++++++++++++++++++++++++++++++-----
- 1 file changed, 31 insertions(+), 5 deletions(-)
-
-commit c47ecd6d3909d0d3ff48dfd6e2ee41e7c7130b94
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 04:14:18 +0200
-
- Tests: Fix warnings from clang --Wassign-enum.
+ $ xz /usr/bin
+ xz: /usr/bin: Is a directory, skipping
- Explicitly casting the integer to lzma_check silences the warning.
- Since such an invalid value is needed in multiple tests, a constant
- INVALID_LZMA_CHECK_ID was added to tests.h.
+ The Landlock rules didn't allow opening directories for reading:
- The use of 0x1000 for lzma_block.check wasn't optimal as if
- the underlying type is a char then 0x1000 will be truncated to 0.
- However, in these test cases the value is ignored, thus even with
- such truncation the test would have passed.
-
- tests/test_block_header.c | 6 +++---
- tests/test_check.c | 2 +-
- tests/test_stream_flags.c | 8 ++++----
- tests/tests.h | 9 +++++++++
- 4 files changed, 17 insertions(+), 8 deletions(-)
-
-commit 34e13ce015232968731de2a9ec3440a08b0084b1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 03:51:07 +0200
-
- Tests: Silence warnings from -Wsign-conversion.
+ $ xz /usr/bin
+ xz: /usr/bin: Permission denied
- Note that assigning an unsigned int to lzma_check doesn't warn
- on GNU/Linux x86-64 since the enum type is unsigned on that
- platform. The enum can be signed on some other platform though
- so it's best to use enumeration type lzma_check in these situations.
+ The simplest fix was to allow opening directories for reading.
+ While it's a bit silly to allow it solely for the error message,
+ it shouldn't make the sandbox significantly weaker.
+
+ The single-file use case (like when called from GNU tar) is
+ still as strict as possible: all Landlock restrictions are
+ enabled before (de)compression starts.
- tests/test_check.c | 6 +++---
- tests/test_stream_flags.c | 10 +++++-----
- 2 files changed, 8 insertions(+), 8 deletions(-)
+ src/xz/sandbox.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
-commit 6671d0fe46b77f0fafce860836b7a12dc3cda14a
+commit 120da10ae139ea52ca4275452adf8eda02d07cc8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 03:19:59 +0200
+Date: 2024-02-22 14:41:29 +0200
- liblzma: Silence warnings from clang -Wconditional-uninitialized.
+ liblzma: Disable branchless C version in range decoder.
- This is similar to 2ce4f36f179a81d0c6e182a409f363df759d1ad0.
- The actual initialization of the variables is done inside
- mythread_sync() macro. Clang doesn't seem to see that
- the initialization code inside the macro is always executed.
+ Thanks to Sebastian Andrzej Siewior and Sam James for
+ benchmarking on various systems.
- src/liblzma/common/stream_decoder_mt.c | 8 +++++---
- src/liblzma/common/stream_encoder_mt.c | 2 +-
- 2 files changed, 6 insertions(+), 4 deletions(-)
+ src/liblzma/rangecoder/range_decoder.h | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
-commit d3e833ca1d2abda54648494c33aca73a40a47efe
+commit 00440f52be9ac2c7438c7b0cb1082f12399632c6
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 03:11:40 +0200
+Date: 2024-02-21 17:41:32 +0200
- Fix warnings from clang -Wdocumentation.
+ INSTALL: Clarify that --disable-assembler affects only 32-bit x86.
- src/liblzma/check/check.h | 4 ----
- src/liblzma/lz/lz_encoder_mf.c | 4 ++--
- src/xz/options.c | 4 ++--
- 3 files changed, 4 insertions(+), 8 deletions(-)
+ INSTALL | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
-commit 977dd2e26bc50efec8d30fb90380394042d24558
+commit 11405be84ea294497e12d03d7219f607063f4a00
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 03:04:28 +0200
+Date: 2024-02-19 18:41:37 +0200
- Tests: test_lzip_decoder: Remove trailing white-space.
+ Windows: build.bash: Include COPYING.0BSD in the package.
- tests/test_lzip_decoder.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ windows/build.bash | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit c55157ed7437ab14f2afb7fecf331e321f2edf9a
+commit c27cf64e3e27f4968431d65be7098a12a3a80d30
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-12 03:03:55 +0200
+Date: 2024-02-18 17:59:46 +0200
- Tests: test_lzip_decoder: Silence warnings from -Wsign-conversion.
+ Windows: build.bash: include liblzma-crt-mixing.txt in the package.
- tests/test_lzip_decoder.c | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
+ windows/build.bash | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 18b845e69752c975dfeda418ec00eda22605c2ee
+commit 8d38941baed05de4ff7cc775de14833108f62184
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-11 18:52:54 +0200
-
- Bump version and soname for 5.4.1.
-
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+Date: 2024-02-18 17:17:43 +0200
-commit 4080bbb844fb36701ffb978f0c41ea2c2c9f8960
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 23:58:16 +0800
+ Windows: Major update to Windows build instructions.
- Add NEWS for 5.4.1.
+ INSTALL | 68 ++++-----
+ windows/INSTALL-MSVC.txt | 23 +--
+ windows/INSTALL-MinGW-w64_with_Autotools.txt | 49 +++++++
+ windows/INSTALL-MinGW-w64_with_CMake.txt | 203 +++++++++++++++++++++++++++
+ windows/INSTALL-MinGW.txt | 138 ------------------
+ windows/README-Windows.txt | 2 +
+ windows/build-with-cmake.bat | 35 +++++
+ windows/liblzma-crt-mixing.txt | 70 +++++++++
+ 8 files changed, 404 insertions(+), 184 deletions(-)
- NEWS | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 70 insertions(+)
-
-commit 674c89fdb8c457ebc3a0652e235d8b6cd7b7dee2
+commit 4b5b0d352348ff510ffb50a3b5b71788857d37a1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 11:56:11 +0200
+Date: 2024-02-18 15:15:04 +0200
- sysdefs.h: Don't include strings.h anymore.
-
- On some platforms src/xz/suffix.c may need <strings.h> for
- strcasecmp() but suffix.c includes the header when it needs it.
+ Windows: Update windows/README-Windows.txt.
- Unless there is an old system that otherwise supports enough C99
- to build XZ Utils but doesn't have C89/C90-compatible <string.h>,
- there should be no need to include <strings.h> in sysdefs.h.
+ It's for binary packages built with windows/build.bash.
- src/common/sysdefs.h | 6 ------
- 1 file changed, 6 deletions(-)
+ windows/README-Windows.txt | 104 ++++++++++++++++++---------------------------
+ 1 file changed, 41 insertions(+), 63 deletions(-)
-commit 2a6b938084fac9ddb39cd69c9beeed15c3b6f6f6
+commit 1ee716f74085223c8fbcae1d5a384e6bf53c0f6a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 11:23:41 +0200
+Date: 2024-02-18 15:15:04 +0200
- xz: Include <strings.h> in suffix.c if needed for strcasecmp().
+ Windows: Update windows/build.bash.
- SUSv2 and POSIX.1‐2017 declare only a few functions in <strings.h>.
- Of these, strcasecmp() is used on some platforms in suffix.c.
- Nothing else in the project needs <strings.h> (at least if
- building on a modern system).
+ Support for the old MinGW was dropped. Only MinGW-w64 with GCC
+ is supported now.
- sysdefs.h currently includes <strings.h> if HAVE_STRINGS_H is
- defined and suffix.c relied on this.
+ The script now supports also cross-compilation from GNU/Linux
+ (tests are not run). MSYS2 and also the old MSYS 1.0.11 work
+ for building on Windows. The i686 and x86_64 toolchains must
+ be in PATH to build both 32-bit and 64-bit versions.
- Note that dos/config.h doesn't #define HAVE_STRINGS_H even though
- DJGPP does have strings.h. It isn't needed with DJGPP as strcasecmp()
- is also in <string.h> in DJGPP.
+ Parallel builds are done if "nproc" from GNU coreutils is available.
+
+ MinGW-w64 runtime copyright information file was renamed from
+ COPYING-Windows.txt to COPYING.MinGW-w64-runtime.txt which
+ is the filename used by MinGW-w64 itself. Its existence
+ is now mandatory, it's checked at the beginning of the script.
+
+ The file TODO is no longer copied to the package.
- src/xz/suffix.c | 3 +++
- 1 file changed, 3 insertions(+)
+ windows/build.bash | 191 +++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 112 insertions(+), 79 deletions(-)
-commit aea639e81beb548e3114c74b6d9a894d6e036189
+commit 60462e42609a1d961868a1d1ebecc713c6d27e2e
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 22:46:48 +0800
+Date: 2024-02-20 23:32:22 +0800
- xz: Fix warning -Wformat-nonliteral on clang in message.c.
-
- clang and gcc differ in how they handle -Wformat-nonliteral. gcc will
- allow a non-literal format string as long as the function takes its
- format arguments as a va_list.
+ Translations: Update the Romanian man page translations.
- src/xz/message.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
+ po4a/ro.po | 1715 +++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 875 insertions(+), 840 deletions(-)
-commit e3b42bfcb0f67988beee7c7022fed0361282be45
+commit 10d733e5b8929c642e00891cfa9ead9c2cdd2e05
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 20:58:31 +0800
+Date: 2024-02-20 23:30:25 +0800
- Tests: Fix test_filter_flags copy/paste error.
+ Translations: Update the Korean man page translations.
- tests/test_filter_flags.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ po4a/ko.po | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 21625b7e11d004788e40eb5eb88d9d89f65fe347
+commit 797a34b72ac6baff237d7a546fa941d8f78f2f62
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 20:42:29 +0800
+Date: 2024-02-20 21:03:53 +0800
- Tests: Fix type-limits warning in test_filter_flags.
-
- This only occurs in test_filter_flags when the BCJ filters are not
- configured and built. In this case, ARRAY_SIZE() returns 0 and causes a
- type-limits warning with the loop variable since an unsigned number will
- always be >= 0.
+ Translations: Update the Spanish translation.
- tests/test_filter_flags.c | 13 ++++++++++---
- 1 file changed, 10 insertions(+), 3 deletions(-)
+ po/es.po | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit c337983e928682d56ce3470b286a8d5b8646e0ad
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 22:14:03 +0200
+commit 5c3751d019f023e091df9a653e2bb1f6ea8b0d49
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-20 20:18:07 +0800
- liblzma: CLMUL CRC64: Work around a bug in MSVC, second attempt.
-
- This affects only 32-bit x86 builds. x86-64 is OK as is.
-
- I still cannot easily test this myself. The reporter has tested
- this and it passes the tests included in the CMake build and
- performance is good: raw CRC64 is 2-3 times faster than the
- C version of the slice-by-four method. (Note that liblzma doesn't
- include a MSVC-compatible version of the 32-bit x86 assembly code
- for the slice-by-four method.)
-
- Thanks to Iouri Kharon for figuring out a fix, testing, and
- benchmarking.
+ Translations: Update the Romanian translation.
- src/liblzma/check/crc64_fast.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
+ po/ro.po | 470 ++++++++++++++++++++++++++++++---------------------------------
+ 1 file changed, 227 insertions(+), 243 deletions(-)
-commit b7fb438ea0e3ee02e3a164f3b72fae456cbe34d7
+commit e2d31154ecc750935436e8b62c6b073b2cfa84e3
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 01:18:50 +0800
+Date: 2024-02-20 20:15:50 +0800
- Tests: Fix unused function warning in test_block_header.
-
- One of the global arrays of filters was only used in a test that
- required both encoders and decoders to be configured in the build.
+ Translations: Update the Croatian translation.
- tests/test_block_header.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ po/hr.po | 648 ++++++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 355 insertions(+), 293 deletions(-)
-commit 68e9ef036d18d7c3952bff0b391d5989b86934da
+commit 704500f994d5ac271bfcfd592275c5a7da4dc8d2
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-11 01:08:03 +0800
+Date: 2024-02-20 20:05:44 +0800
- Tests: Fix unused function warning in test_index_hash.
-
- test_index_hash does not use fill_index_hash() unless both encoders
- and decoders are configured in the build.
+ Translations: Update the German man page translations.
- tests/test_index_hash.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
+ po4a/de.po | 1696 +++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 873 insertions(+), 823 deletions(-)
-commit a387707cd8cdefbffb5b7429bda4b7fcc192954a
+commit 1cfd3dca3fef321b06db73c3c9e13f347c2e2f5f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-20 19:58:25 +0800
+
+ Translations: Update the German translation.
+
+ po/de.po | 427 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 225 insertions(+), 202 deletions(-)
+
+commit 28b9b3f16cc7c6e5b42e691994569c17f4561c9a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-20 19:56:52 +0800
+
+ Translations: Update the Hungarian translation.
+
+ po/hu.po | 556 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 338 insertions(+), 218 deletions(-)
+
+commit 00b06cd0af6ad2ee93d3006bf80417db060c2b04
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 00:33:14 +0200
+Date: 2024-02-19 16:48:05 +0200
- Windows: Update INSTALL-MSVC.txt to recommend CMake over project files.
+ CMake: Fix building of lzmainfo when translations are enabled.
- windows/INSTALL-MSVC.txt | 19 ++++++++++++-------
- 1 file changed, 12 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
-commit 52902ad69518255a14b0144f0a2379e06fde5b6e
+commit b0d1422b6037bfea6f6723683bd82a8e6d77026c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 12:47:16 +0200
+Date: 2024-02-19 13:38:42 +0200
- Revert "liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022)."
+ CMake: Don't assume that -fvisibility=hidden is supported outside Windows.
- This reverts commit 36edc65ab4cf10a131f239acbd423b4510ba52d5.
+ The original code was good enough for supporting GNU/Linux
+ and a few others but it wasn't very portable.
- It was reported that it wasn't a good enough fix and MSVC
- still produced (different kind of) bad code when building
- for 32-bit x86 if optimizations are enabled.
-
- Thanks to Iouri Kharon.
+ CMake doesn't support Solaris Studio's -xldscope=hidden.
+ If it ever does, things should still work with this commit
+ as Solaris Studio supports not only its own __global but also
+ the GNU C __attribute__((visibility("default"))). Support for the
+ attribute was added in 2007 to Sun Studio 12 compiler version 5.9.
- src/liblzma/check/crc64_fast.c | 6 ------
- 1 file changed, 6 deletions(-)
+ CMakeLists.txt | 26 ++++++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 4 deletions(-)
-commit e81b9fc48ca70f9228308d3f1871cd81f9a5a496
+commit 2ced9d34bef4dce52ecbbf84d0903ab0aae1442c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 10:05:13 +0200
+Date: 2024-02-19 12:20:59 +0200
- sysdefs.h: Fix a comment.
+ CMake: Revise the component splitting.
- src/common/sysdefs.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 57 +++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 31 insertions(+), 26 deletions(-)
-commit 6e89ab58b031aa046308a0b3504ff0a5be042571
+commit 426bdc709c169d39b31dec410016779de117ef69
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 10:04:06 +0200
+Date: 2024-02-17 21:45:07 +0200
- sysdefs.h: Don't include memory.h anymore even if it were available.
-
- It quite probably was never needed, that is, any system where memory.h
- was required likely couldn't compile XZ Utils for other reasons anyway.
-
- XZ Utils 5.2.6 and later source packages were generated using
- Autoconf 2.71 which no longer defines HAVE_MEMORY_H. So the code
- being removed is no longer used anyway.
+ CMake: Update the main comment and document CMAKE_BUILD_TYPE=Release.
- src/common/sysdefs.h | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 79 ++++++++++++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 63 insertions(+), 16 deletions(-)
-commit 65c59ad429aa59f9df0326d9fc82931ba4a9d123
+commit 4430e075f7ccfc47972d6ca0aa1c3779fc265e10
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-10 08:50:26 +0200
+Date: 2024-02-17 21:27:48 +0200
- CMake/Windows: Add a workaround for windres from GNU binutils.
+ CMake: Use -O2 instead of -O3 in CMAKE_BUILD_TYPE=Release.
- This is combined from the following commits in the master branch:
- 443dfebced041adc88f10d824188eeef5b5821a9
- 6b117d3b1fe91eb26d533ab16a2e552f84148d47
- 5e34774c31d1b7509b5cb77a3be9973adec59ea0
+ -O3 doesn't seem useful for speed but it makes the code bigger.
+ CMake makes is difficult for users to simply override the
+ optimization level: CFLAGS / CMAKE_C_FLAGS aren't helpful because
+ they go before CMAKE_C_FLAGS_RELEASE. Of course, users can override
+ CMAKE_C_FLAGS_RELEASE directly but then they have to remember to
+ add also -DNDEBUG to disable assertions.
- Thanks to Iouri Kharon for the bug report, the original patch,
- and testing.
+ This commit changes -O3 to -O2 in CMAKE_C_FLAGS_RELEASE if and only if
+ CMAKE_C_FLAGS_RELEASE cache variable doesn't already exist. So if
+ a custom value is passed on the command line (or reconfiguring an
+ already-configured build), the cache variable won't be modified.
- CMakeLists.txt | 32 +++++++++++++++++++++++++++++++-
- 1 file changed, 31 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
-commit 43521e77acc907863fa4f94aae276366172cb9ee
+commit 025eb6d7879e4c4e8cb29716b371e0f4c1aea660
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-06 22:53:38 +0200
+Date: 2024-02-18 14:59:52 +0200
- Tests: test_filter_flags: Clean up minor issues.
+ CMake: Handle symbol versioning on MicroBlaze specially.
- Here are the list of the most significant issues addressed:
- - Avoid using internal common.h header. It's not good to copy the
- constants like this but common.h cannot be included for use outside
- of liblzma. This is the quickest thing to do that could be fixed later.
-
- - Omit the INIT_FILTER macro. Initialization should be done with just
- regular designated initializers.
-
- - Use start_offset = 257 for BCJ tests. It demonstrates that Filter
- Flags encoder and decoder don't validate the options thoroughly.
- 257 is valid only for the x86 filter. This is a bit silly but
- not a significant problem in practice because the encoder and
- decoder initialization functions will catch bad alignment still.
- Perhaps this should be fixed but it's not urgent and doesn't need
- to be in 5.4.x.
-
- - Various tweaks to comments such as filter id -> Filter ID
+ This is to match configure.ac.
- tests/test_filter_flags.c | 153 +++++++++++++++++++++++-----------------------
- 1 file changed, 78 insertions(+), 75 deletions(-)
+ CMakeLists.txt | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
-commit 6b44cead95d767414272dc3a67898a36bfdf95b3
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-29 23:33:33 +0800
+commit 2edd1a35b2507d1ce68b52dbaebe23c4850a74ce
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 22:18:12 +0200
- Tests: Refactors existing filter flags tests.
-
- Converts the existing filter flags tests into tuktests.
+ CMake: Keep build working even if lib/*.[ch] are removed.
- tests/test_filter_flags.c | 655 ++++++++++++++++++++++++++++++++--------------
- 1 file changed, 457 insertions(+), 198 deletions(-)
+ CMakeLists.txt | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
-commit 1bbefa9659b202ba31bd244a9d0e4f0d37ff3ed7
+commit d753e2ce4715552884afadc4ed6fbf8ccca6efac
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-08 00:32:29 +0200
+Date: 2024-02-17 18:10:40 +0200
- Tests: tuktest.h: Support tuktest_malloc(0).
-
- It's not needed in XZ Utils at least for now. It's good to support
- it still because if such use is needed later, it wouldn't be
- caught on GNU/Linux since malloc(0) from glibc returns non-NULL.
+ CMake: Install documentation.
- tests/tuktest.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
-commit ce3a3fbc7c2c399aeed644d54f3bd56ac914dfee
+commit 7a0405bea9cb0df9318b70f779f82b2c473e98ac
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-07 21:57:11 +0200
+Date: 2024-02-17 15:35:35 +0200
- CMake: Update cmake_minimum_required from 3.13...3.16 to 3.13...3.25.
+ CMake: Bump maximum policy version to 3.28.
- The changes listed on cmake-policies(7) for versions 3.17 to 3.25
- shouldn't affect this project.
+ CMP0154 doesn't affect us since we don't use FILE_SET.
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 99fcd57f2ea35eaa94e09f674d5364329c880fa2
+commit c2264ffbe3892d28930b89b0123efc369cabc143
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-08 00:24:23 +0200
+Date: 2024-02-17 15:35:35 +0200
- Update THANKS.
+ CMake: Build lzmainfo.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 54 insertions(+)
-commit c0c13d9d82eb8a4302c8bbb8b4c5178d285fe9ab
+commit 998d0b29536094a89cf385a3b894e157db1ccefe
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-07 19:50:35 +0200
+Date: 2024-02-17 15:35:35 +0200
- Update THANKS.
+ CMake: Build lzmadec.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ CMakeLists.txt | 76 ++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 42 insertions(+), 34 deletions(-)
-commit 3d45987451b1c3bb42697b29341824c0e5484cba
+commit 74e8bc7417a0f37ca7ed5ee0127d33c69b3100b9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-09 11:27:24 +0200
+Date: 2024-02-17 15:35:35 +0200
- CMake: Fix a copypaste error in xzdec Windows resource file handling.
+ CMake: Add test_scripts.sh to the tests.
- It was my mistake. Thanks to Iouri Kharon for the bug report.
+ In contrast to Automake, skipping of this test when decoders
+ are disabled is handled at CMake side instead of test_scripts.sh
+ because CMake-build doesn't create config.h.
- CMakeLists.txt | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 14 ++++++++++++++
+ tests/test_scripts.sh | 13 ++++++++-----
+ 2 files changed, 22 insertions(+), 5 deletions(-)
-commit 706bce5018d7cf83094e13454a0731169ec119b5
+commit 4808f238a731befcd46c2117c62a1caaf4403989
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-07 19:50:03 +0200
+Date: 2024-02-17 15:35:35 +0200
- CMake/Windows: Add resource files to xz.exe and xzdec.exe.
+ CMake: Install scripts.
- The command line tools cannot be built with MSVC for now but
- they can be built with MinGW-w64.
-
- Thanks to Iouri Kharon for the bug report and the original patch.
+ Compared to the Autotools-based build, this has simpler handling
+ for the shell (@POSIX_SHELL@) and extra PATH entry for the scripts
+ (configure has --enable-path-for-scripts=PREFIX). The simpler
+ metho should be enough for non-ancient systems and Solaris.
- CMakeLists.txt | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
+ CMakeLists.txt | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 82 insertions(+), 1 deletion(-)
-commit e96dee55df04113c33b387ccdb6cb70935422d91
+commit 3462362ebd94d835c664e94ad8f414cfe7590ca7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-09 12:22:05 +0200
+Date: 2024-02-17 15:35:35 +0200
- liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022).
-
- I haven't tested with MSVC myself and there doesn't seem to be
- information about the problem online, so I'm relying on the bug report.
+ Scripts: Use @PACKAGE_VERSION@ instead of @VERSION@.
- Thanks to Iouri Kharon for the bug report and the patch.
+ PACKAGE_VERSION was already used in liblzma.pc.in.
+ This way only one version @foo@ is used.
- src/liblzma/check/crc64_fast.c | 6 ++++++
- 1 file changed, 6 insertions(+)
+ src/scripts/xzdiff.in | 2 +-
+ src/scripts/xzgrep.in | 2 +-
+ src/scripts/xzless.in | 2 +-
+ src/scripts/xzmore.in | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
-commit 52bc1ee34dda9bb6fb40175e5952863066681b77
+commit 67610c245ba6c68cf65991693bab9312b7dc987b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-07 19:31:15 +0200
+Date: 2024-02-17 15:35:35 +0200
- Build: Require that _mm_set_epi64x() is usable to enable CLMUL support.
+ CMake: Simplify symlink creation and install translated man pages.
- VS2013 doesn't have _mm_set_epi64x() so this way CLMUL gets
- disabled with VS2013.
+ It helps that cmake_install.cmake doesn't parallelize installation
+ so symlinks can be created so that the target is always known to
+ exist (a requirement on Windows in some cases).
- Thanks to Iouri Kharon for the bug report.
+ This bumps the minimum CMake version from 3.13 to 3.14 to use
+ file(CREATE_LINK ...). It could be made to work on 3.13 by
+ calling "cmake -E create_symlink" but it's uglier code and
+ slower in "make install". 3.14 should be a reasonable version
+ to require nowadays, especially since the Autotools build
+ is still the primary build system for most OSes.
- CMakeLists.txt | 3 ++-
- configure.ac | 8 ++++++--
- 2 files changed, 8 insertions(+), 3 deletions(-)
+ CMakeLists.txt | 195 +++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 98 insertions(+), 97 deletions(-)
-commit bad44cfe19e8be8ae76755369be2a34abcd2b4fa
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-29 00:25:18 +0800
+commit 50cc1d8a5a8154428bf240c7e4972e32b17d99bf
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 15:35:35 +0200
- Tests: Creates test_index_hash.c
+ CMake: Add support for building and installing xz with translations.
- Tests all API functions exported from index_hash.h. Does not have a
- dedicated test for lzma_index_hash_end.
+ If gettext tools are available, the .po files listed in po/LINGUAS
+ are converted using msgfmt. This allows building with translations
+ directly from xz.git without Autotools.
+
+ If gettext tools aren't available, the Autotools-created .gmo files
+ in the "po" directory will be used. This allows CMake-based build
+ to use translations from Autotools-generated tarball.
- [Minor edits were made by Lasse Collin.]
+ If translation support is found (Intl_FOUND) but both the
+ gettext tools and the pre-generated .gmo files are missing,
+ then "make" will fail.
- .gitignore | 1 +
- CMakeLists.txt | 2 +
- tests/Makefile.am | 3 +
- tests/test_index_hash.c | 388 ++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 394 insertions(+)
+ CMakeLists.txt | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 66 insertions(+), 2 deletions(-)
-commit 692ccdf5516dfe55fb6e9c5cdfb31f4c02c1ecd1
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-05 20:57:25 +0800
+commit 746c471643009947f94a3494a1148f74c7381b56
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-19 11:58:33 +0200
- liblzma: Remove common.h include from common/index.h.
-
- common/index.h is needed by liblzma internally and tests. common.h will
- include and define many things that are not needed by the tests.
-
- Also, this prevents include order problems because both common.h and
- lzma.h define LZMA_API. On most platforms it results only in a warning
- but on Windows it would break the build as the definition in common.h
- must be used only for building liblzma itself.
+ liblzma: Remove commented-out code.
- src/liblzma/common/index.c | 1 +
- src/liblzma/common/index.h | 9 +++++++--
- src/liblzma/common/index_decoder.h | 1 +
- src/liblzma/common/stream_buffer_encoder.c | 1 +
- 4 files changed, 10 insertions(+), 2 deletions(-)
+ src/liblzma/rangecoder/range_decoder.h | 3 ---
+ 1 file changed, 3 deletions(-)
-commit 2ac7bafc8f07c1edefe96a4a7a040ddfff0eb5bb
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-08-17 20:20:16 +0800
+commit 4ce300ce0884c6e552de2af9ae8050b47b01f0e7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 23:07:35 +0200
- liblzma: Add NULL check to lzma_index_hash_append.
-
- This is for consistency with lzma_index_append.
+ xz: Delete old commented-out code.
- src/liblzma/common/index_hash.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/xz/message.c | 19 -------------------
+ 1 file changed, 19 deletions(-)
-commit db714d30e0c74d1dd4af1a23ed62b44e0e8e4efc
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-08-17 17:59:51 +0800
+commit cae9a5e0bf422e6c5e64180805904f7ed02dc3aa
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 23:07:35 +0200
- liblzma: Replaced hardcoded 0x0 index indicator byte with macro
+ xz: Use stricter pledge(2) and Landlock sandbox.
+
+ This makes these sandboxing methods stricter when no files are
+ created or deleted. That is, it's a middle ground between the
+ initial sandbox and the strictest single-file-to-stdout sandbox:
+ this allows opening files for reading but output has to go to stdout.
- src/liblzma/common/index.h | 3 +++
- src/liblzma/common/index_decoder.c | 2 +-
- src/liblzma/common/index_encoder.c | 2 +-
- src/liblzma/common/index_hash.c | 2 +-
- src/liblzma/common/stream_decoder.c | 3 ++-
- src/liblzma/common/stream_decoder_mt.c | 2 +-
- 6 files changed, 9 insertions(+), 5 deletions(-)
+ src/xz/main.c | 46 +++++++++++++++++++++++++++++++++-------------
+ src/xz/sandbox.c | 32 ++++++++++++++++++++++++++++++++
+ src/xz/sandbox.h | 4 ++++
+ 3 files changed, 69 insertions(+), 13 deletions(-)
-commit 39d2585dcd3e827cfc3c46025ab6708c4aeb36c6
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-06 20:43:31 +0800
+commit 02e3505991233901575b7eabc06b2c6c62a96899
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 23:07:35 +0200
- Style: Change #if !defined() to #ifndef in mythread.h.
+ xz: Support Landlock ABI version 4.
+
+ Linux 6.7 added support for ABI version 4 which restricts
+ TCP connections which xz won't need and thus those can be
+ forbidden now. Since the ABI version is handled at runtime,
+ supporting version 4 won't cause any compatibility issues.
+
+ Note that new enough kernel headers are required to get
+ version 4 support enabled at build time.
- src/common/mythread.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/xz/sandbox.c | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
-commit 3f0130aa288e4ed57ace609517db9700a41223af
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-06 20:35:55 +0800
+commit 374868d81d473ab56556a1cfd6b1b36a1fab348b
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 23:07:35 +0200
- Build: Add missing stream_decoder_mt.c to .vcxproj files.
+ xz: Move sandboxing code to sandbox.c and improve Landlock sandbox.
- The line in the .vcxproj files for building with was missing in 5.4.0.
- Thank to Hajin Jang for reporting the issue.
+ Landlock is now always used just like pledge(2) is: first in more
+ permissive mode and later (under certain common conditions) in
+ a strict mode that doesn't allow opening more files.
+
+ I put pledge(2) first in sandbox.c because it's the simplest API
+ to use and still somewhat fine-grained for basic applications.
+ So it's the simplest thing to understand for anyone reading sandbox.c.
- windows/vs2013/liblzma.vcxproj | 1 +
- windows/vs2013/liblzma_dll.vcxproj | 1 +
- windows/vs2017/liblzma.vcxproj | 1 +
- windows/vs2017/liblzma_dll.vcxproj | 1 +
- windows/vs2019/liblzma.vcxproj | 1 +
- windows/vs2019/liblzma_dll.vcxproj | 1 +
- 6 files changed, 6 insertions(+)
+ CMakeLists.txt | 2 +
+ src/xz/Makefile.am | 2 +
+ src/xz/file_io.c | 170 +-----------------------------
+ src/xz/file_io.h | 6 --
+ src/xz/main.c | 50 +++------
+ src/xz/private.h | 6 +-
+ src/xz/sandbox.c | 295 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/xz/sandbox.h | 39 +++++++
+ 8 files changed, 357 insertions(+), 213 deletions(-)
-commit f204d1050a515d17851eed9049862ce5a9c729c1
+commit 7312dfbb02197c7f990c7a3cefd027a9387d1473
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-04 22:40:54 +0200
+Date: 2024-02-17 23:07:35 +0200
- Update THANKS.
+ xz: Tweak comments.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/main.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-commit 34a9c2d650d6c30bd88e1b21910dd863209aa884
+commit c701a5909ad9882469fbab4fab5d2d5556d3ba78
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-04 18:40:28 +0200
+Date: 2024-02-17 23:07:35 +0200
- Tests: Adjust style in test_compress.sh.
+ xz: Fix message_init() description.
+
+ Also explicitly initialize progress_automatic to make it clear
+ that it can be read before message_init() sets it. Static variable
+ was initialized to false by default already so this is only for
+ clarity.
- tests/test_compress.sh | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
+ src/xz/main.c | 3 ++-
+ src/xz/message.c | 2 +-
+ src/xz/message.h | 5 ++++-
+ 3 files changed, 7 insertions(+), 3 deletions(-)
-commit 761c208d58e0c3daa0f46e68b406adfc318d2a46
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-04 23:58:58 +0800
+commit 9466306719f3b76e92fac4e55fbfd89ec92295fa
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 19:35:47 +0200
- Tests: Replace non portable shell parameter expansion
+ Build: Makefile.am: Sort EXTRA_DIST.
- The shell parameter expansion using # and ## is not supported in
- Solaris 10 Bourne shell (/bin/sh). Even though this is POSIX, it is not fully
- portable, so we should avoid it.
+ Dirs first, then files in case-sensitive ASCII order.
- tests/create_compress_files.c | 2 +-
- tests/test_compress.sh | 20 +++++++++++++-------
- tests/test_compress_prepared_bcj_sparc | 2 +-
- tests/test_compress_prepared_bcj_x86 | 2 +-
- 4 files changed, 16 insertions(+), 10 deletions(-)
+ Makefile.am | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
-commit 8a7cbc074547e55e57f4f3696f69bedeb05e14c4
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-03 21:02:38 +0800
+commit f3440e78c9517db75bfa52e1a378fad60b073bbe
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 19:25:05 +0200
- Translations: Add Korean translation of man pages.
-
- Thanks to Seong-ho Cho
+ Build: Don't install TODO.
- po4a/ko.po | 5552 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po4a/po4a.conf | 2 +-
- 2 files changed, 5553 insertions(+), 1 deletion(-)
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit ca2af49bb8be5995eb0e6a3abf457622626d49a7
+commit a7a3b62e2ab03c82b2bd5c78da1d1fb8b8490381
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-03 20:47:27 +0800
+Date: 2024-02-18 01:09:11 +0800
- Translations: Update the Esperanto translation.
+ Translations: Update the Korean man page translations.
- po/eo.po | 620 ++++++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 332 insertions(+), 288 deletions(-)
+ po4a/ko.po | 1707 +++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 871 insertions(+), 836 deletions(-)
-commit bfba3394aed03311fe9a746d3141b2e16d8b9325
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2023-01-02 17:05:07 +0200
+commit 9b315db2d5e74700f3dc0755eb86c27947c0b393
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-18 01:08:32 +0800
- Build: Fix config.h comments.
+ Translations: Update the Korean translation.
- configure.ac | 2 +-
- m4/tuklib_progname.m4 | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ po/ko.po | 423 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 223 insertions(+), 200 deletions(-)
-commit 507648ad114c2ae0cd6d181063e1ac07e8106718
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2023-01-02 22:33:48 +0800
+commit 56246607dff177b0410d140fcca4a42c865723dc
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-17 16:23:14 +0200
- Build: Only define HAVE_PROGRAM_INVOCATION_NAME if it is set to 1.
+ Build: Install translated lzmainfo man pages.
- HAVE_DECL_PROGRAM_INVOCATION_NAME is renamed to
- HAVE_PROGRAM_INVOCATION_NAME. Previously,
- HAVE_DECL_PROGRAM_INVOCATION_NAME was always set when
- building with autotools. CMake would only set this when it was 1, and the
- dos/config.h did not define it. The new macro definition is consistent
- across build systems.
+ All other translated man pages were being installed but
+ lzmainfo had been forgotten.
- cmake/tuklib_progname.cmake | 5 ++---
- m4/tuklib_progname.m4 | 5 ++++-
- src/common/tuklib_progname.c | 2 +-
- src/common/tuklib_progname.h | 2 +-
- 4 files changed, 8 insertions(+), 6 deletions(-)
+ src/lzmainfo/Makefile.am | 26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
-commit ab5229d32adfec1f3fbc95228d9dd6f560732ab5
+commit f1d6b88aefcced538403c5c2606ba57065b16e70
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-30 20:10:08 +0200
+Date: 2024-02-17 16:01:32 +0200
- Tests: test_check: Test corner cases of CLMUL CRC64.
+ liblzma: Avoid implementation-defined behavior in the RISC-V filter.
+
+ GCC docs promise that it works and a few other compilers do
+ too. Clang/LLVM is documented source code only but unsurprisingly
+ it behaves the same as others on x86-64 at least. But the
+ certainly-portable way is good enough here so use that.
- tests/test_check.c | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
+ src/liblzma/simple/riscv.c | 30 ++++++++++++++++++++++--------
+ 1 file changed, 22 insertions(+), 8 deletions(-)
-commit 8791826f31733fda0a13b411c2ed930faaeb25aa
+commit 843ddc5f617b91ae132d6bab0f2f2d9c9fcd214a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-30 19:36:49 +0200
+Date: 2024-02-17 15:48:28 +0200
- Tests: Clarify a comment in test_lzip_decoder.c.
+ liblzma: Wrap a line exceeding 80 chars.
- tests/test_lzip_decoder.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ src/liblzma/rangecoder/range_decoder.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit c410d812ea12bfc74f6b727c1a799478c79f19ca
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-29 01:55:19 +0800
+commit e9053c907250c70d98b319d95fa54cb94fc76869
+Author: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
+Date: 2024-02-16 21:50:15 +0100
- xz: Includes <time.h> and <sys/time.h> conditionally in mytime.c.
+ liblzma/rangecoder: Exclude x32 from the x86-64 optimisation.
- Previously, mytime.c depended on mythread.h for <time.h> to be included.
+ The x32 port has a x86-64 ABI in term of all registers but uses only
+ 32bit pointer like x86-32. The assembly optimisation fails to compile on
+ x32. Given the state of x32 I suggest to exclude it from the
+ optimisation rather than trying to fix it.
+
+ Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
- src/xz/mytime.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ src/liblzma/rangecoder/range_decoder.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 501c6013d4a59fae5d4368e9657c4885493db809
+commit 3d198fb13b87f8803442e5799d465f7434a70555
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-29 01:15:27 +0800
+Date: 2024-02-17 21:05:07 +0800
- liblzma: Includes sys/time.h conditionally in mythread
-
- Previously, <sys/time.h> was always included, even if mythread only used
- clock_gettime. <time.h> is still needed even if clock_gettime is not used
- though because struct timespec is needed for mythread_condtime.
+ Translations: Update the Spanish translation.
- src/common/mythread.h | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
+ po/es.po | 427 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 226 insertions(+), 201 deletions(-)
-commit 9e3cb514b5b95bd235dcdff3db4436f57444ee4f
+commit cf278bfe60a25b54b3786f06503bc61272970820
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-29 01:10:53 +0800
+Date: 2024-02-17 20:43:29 +0800
- Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set.
-
- Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always
- be set to 0 or 1. However, this macro was needed in xz so if xz was not
- built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but
- HAVE_CLOCK_GETTIME was, it caused a warning during build. Now,
- HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and
- will only be set if it is 1.
+ Translations: Update the Swedish translation.
- CMakeLists.txt | 8 +++-----
- configure.ac | 5 ++++-
- src/common/mythread.h | 4 ++--
- src/xz/mytime.c | 5 ++---
- 4 files changed, 11 insertions(+), 11 deletions(-)
+ po/sv.po | 434 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 230 insertions(+), 204 deletions(-)
-commit 6fc3e5467911572fa9af4021ea46396261aae796
+commit b0f1a41be50560cc6cb528e8e96b02b2067c52c2
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-28 01:14:07 +0800
+Date: 2024-02-17 20:41:38 +0800
- Translations: Add Ukrainian translations of man pages.
-
- Thanks to Yuri Chornoivan
+ Translations: Update the Polish translation.
- po4a/po4a.conf | 2 +-
- po4a/uk.po | 3676 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 3677 insertions(+), 1 deletion(-)
+ po/pl.po | 424 +++++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 224 insertions(+), 200 deletions(-)
-commit e84f2ab7f8bc38cd8f8befa0bb398656c3c11f8e
+commit d74ed48b30c631b6a4c7e7858b06828293bf8520
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-22 23:14:53 +0800
+Date: 2024-02-17 20:41:02 +0800
- liblzma: Update documentation for lzma_filter_encoder.
+ Translations: Update the Ukrainian translation.
- src/liblzma/common/filter_encoder.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ po/uk.po | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 711e22d5c5f3bac39ac904efb3ede874a66e2045
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-16 17:53:34 +0200
+
+ Translations: Use the same sentence in xz.pot-header that the TP uses.
-commit b14b8dbba9a3b232787ae218b46430b9246383dd
+ po/xz.pot-header | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit fb5f6aaf18584672d0fee5dbe41fd30fc6bf5422
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-21 21:12:03 +0800
+Date: 2024-02-16 22:53:46 +0800
- Tests: Adds lzip decoder tests
+ Fix typos discovered by codespell.
- .gitignore | 1 +
- tests/Makefile.am | 2 +
- tests/test_lzip_decoder.c | 471 ++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 474 insertions(+)
+ AUTHORS | 2 +-
+ NEWS | 2 +-
+ src/liblzma/rangecoder/range_decoder.h | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
-commit 09a114805e1d4f9a02a06cee7dbf2f5014d1f710
-Author: Jia Cheong Tan <jiat0218@gmail.com>
-Date: 2022-12-20 22:05:21 +0800
+commit c64723bbb094e29b4edd98f6fcce866e1b569b42
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-16 22:52:41 +0800
- Doxygen: Update .gitignore for generating docs for in source build.
-
- In source builds are not recommended, but we should still ignore
- the generated artifacts.
+ Translations: Update the Ukrainian man page translations.
- .gitignore | 2 ++
- 1 file changed, 2 insertions(+)
+ po4a/uk.po | 1710 +++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 873 insertions(+), 837 deletions(-)
-commit d3e6fe44196bf9478ad193522e2b48febf2eca6b
+commit 2895195ed0f68b245c7bd568c126ba6e685fa1d6
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-20 20:46:44 +0800
+Date: 2024-02-16 22:51:04 +0800
- liblzma: Fix lzma_microlzma_encoder() return value.
-
- Using return_if_error on lzma_lzma_lclppb_encode was improper because
- return_if_error is expecting an lzma_ret value, but
- lzma_lzma_lclppb_encode returns a boolean. This could result in
- lzma_microlzma_encoder, which would be misleading for applications.
+ Translations: Update the Ukrainian translation.
- src/liblzma/common/microlzma_encoder.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ po/uk.po | 466 ++++++++++++++++++++++++++++++---------------------------------
+ 1 file changed, 225 insertions(+), 241 deletions(-)
-commit b55a27b46f52524a4a8d9cdef03e6689cefc1375
+commit 4c20781f4c8f04879b64d631a4f44b4909147bde
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-16 18:30:02 +0200
+Date: 2024-02-15 22:32:52 +0200
- liblzma: Update authors list in arm64.c.
+ Translations: Omit the generic copyright line from man page headers.
- src/liblzma/simple/arm64.c | 1 +
+ po4a/update-po | 1 +
1 file changed, 1 insertion(+)
-commit 2fd28d2b7cec3468324a6f15eff7e73c285b1d7d
+commit 4323bc3e0c1e1d2037d5e670a3bf6633e8a3031e
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-16 20:58:55 +0800
+Date: 2024-02-15 22:26:43 +0800
- CMake: Update .gitignore for CMake artifacts from in source build.
-
- In source builds are not recommended, but we can make it easier
- by ignoring the generated artifacts from CMake.
+ Update m4/.gitignore.
- .gitignore | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
+ m4/.gitignore | 1 +
+ 1 file changed, 1 insertion(+)
-commit b69da6d4bb6bb11fc0cf066920791990d2b22a06
+commit 5394a1665b7a108a54cb8b4ef3ebe59d3dbcca3a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 20:37:17 +0200
+Date: 2024-02-14 21:11:49 +0200
- Bump version to 5.4.0 and soname to 5.4.0.
+ Tests: tuktest.h: Treat Clang separately from GCC.
+
+ Don't assume that Clang defines __GNUC__ as the extensions
+ are available in clang-cl as well (and possibly in some other
+ Clang variants?).
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 6 +++---
- src/liblzma/liblzma_generic.map | 2 +-
- src/liblzma/liblzma_linux.map | 2 +-
- 4 files changed, 6 insertions(+), 6 deletions(-)
+ tests/tuktest.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 20869eb3fb280ff4f271ef527b12b6bf68b05e19
+commit cce7330b9f23485a0879422e0c3395a7065439ac
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 20:29:39 +0200
+Date: 2024-02-14 21:11:03 +0200
- Update INSTALL: CMake on Windows isn't experimental anymore.
-
- Using CMake to build liblzma should work on a few other OSes
- but building the command line tools is still subtly broken.
-
- It is known that shared library versioning may differ between
- CMake and Libtool builds on some OSes, most notably Darwin.
+ Tests: tuktest.h: Add a missing word to a comment.
- INSTALL | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
+ tests/tuktest.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit cbbd84451944e3e8c63acfaa3c923f6d8aff7852
+commit 5dd8fc9452a3373cedc27379067ce638f992c741
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 19:47:53 +0200
+Date: 2024-02-14 21:10:10 +0200
- Add NEWS for 5.4.0.
+ Tests: tuktest.h: Fix the comment about STest.
- NEWS | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 202 insertions(+)
+ tests/tuktest.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit c3e94d37e8d10a3e96019864b6f5d7b578db2c14
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 17:41:20 +0200
+commit 6f1790254a03c5edf0f2976f773220f070450acd
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-15 01:53:40 +0800
- Fix a typo in NEWS.
+ Bump version for 5.5.2beta.
- NEWS | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/liblzma/api/lzma/version.h | 4 ++--
+ src/liblzma/liblzma_generic.map | 2 +-
+ src/liblzma/liblzma_linux.map | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
-commit 0d2a2e0a545c3da2b3e9500f1e531eb903087245
+commit 924fdeedf48113fb1e0646d86bd89a356d21a055
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 17:41:03 +0200
+Date: 2024-02-14 19:46:11 +0200
- Add NEWS for 5.2.10.
+ liblzma: Fix validate_map.sh.
+
+ Adding the SPDX license identifier changed the line numbers.
- NEWS | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
+ src/liblzma/validate_map.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 177ece1c8eb007188fb1b04eff09ca2193fbdea6
+commit 22140a2df6161b0110e6b4afa5ea0a07c5b60b01
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 12:30:45 +0200
+Date: 2024-02-14 19:38:34 +0200
- Tests: Fix a typo in tests/files/README.
+ Build: Start the generated ChangeLog from around 5.4.0 instead of 5.2.0.
- tests/files/README | 2 +-
+ Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 60f45bdbaa6b07558b3f4baac285739b0c6342f5
+commit 0b8cefa136c21d403a01b78517f4decb50172bdb
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-13 12:30:09 +0200
+Date: 2024-02-14 19:27:46 +0200
- Tests: Add two ARM64 test files.
+ Fixed NEWS for 5.5.2beta.
- tests/files/README | 7 +++++++
- tests/files/good-1-arm64-lzma2-1.xz | Bin 0 -> 512 bytes
- tests/files/good-1-arm64-lzma2-2.xz | Bin 0 -> 488 bytes
- tests/test_files.sh | 5 +++++
- 4 files changed, 12 insertions(+)
+ NEWS | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit f5e419550619c548c7c35d7e367cf00580a56521
+commit a4557bad96361d93ea171ed859ac5a696fca824f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-12 22:44:21 +0200
+Date: 2024-02-14 19:21:45 +0200
- Translations: Update the Catalan translation.
+ liblzma: Silence warnings in --enable-small build.
- po/ca.po | 657 +++++++++++++++++++++++++++++----------------------------------
- 1 file changed, 306 insertions(+), 351 deletions(-)
+ src/liblzma/lzma/lzma_decoder.c | 2 ++
+ src/liblzma/rangecoder/range_decoder.h | 1 +
+ 2 files changed, 3 insertions(+)
-commit 0fb9d355da3789b1757040af475b4e6bbc8b8af8
+commit 38edf473236d00b3e100dc4c4f0bf43a4993fed2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-12 19:18:12 +0200
+Date: 2024-02-14 19:15:58 +0200
- Update THANKS.
+ Build: Install COPYING.0BSD as part of docs.
- THANKS | 1 +
+ Makefile.am | 1 +
1 file changed, 1 insertion(+)
-commit e5b6c161c61a37c54dcb76a99bbb83ac4abe02dc
+commit b74e10bd839bcdc239afb5300ffaee195f34c217
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-12 19:07:58 +0200
+Date: 2024-02-14 19:14:05 +0200
- Update AUTHORS.
+ Docs: List COPYING.0BSD in README.
- AUTHORS | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
+ README | 1 +
+ 1 file changed, 1 insertion(+)
-commit f2d98e691099d82054d5f3071ef6f5e809932e44
+commit dfdb60ffe933a1f1497d300dbb4513ed17ec6f0e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-12 15:31:14 +0200
+Date: 2024-02-14 19:11:48 +0200
- Docs: Omit multi-threaded decompress from TODO.
+ Docs: Include doc/examples/11_file_info.c in tarballs.
- The TODO file outdated still.
-
- TODO | 2 --
- 1 file changed, 2 deletions(-)
-
-commit b42908c42a4cc091db45a7e5ba0e0ecceaa3f6da
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-11 21:16:09 +0200
+ It was added in 2017 in c2e29f06a7d1e3ba242ac2fafc69f5d6e92f62cd
+ but it never got into any release tarballs because it was
+ forgotten to be added to Makefile.am.
- Docs: Update xz-file-format.txt to 1.1.0 for ARM64 filter.
-
- doc/xz-file-format.txt | 29 ++++++++++++++++++++++-------
- 1 file changed, 22 insertions(+), 7 deletions(-)
+ Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
-commit 854f2f5946b353cb0963fd6dfd54d363adc89b9f
+commit 160b6862646d95dfdbd73ab7f1031ede0f54992d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-11 21:13:57 +0200
+Date: 2024-02-14 19:05:58 +0200
- xz: Rename --experimental-arm64 to --arm64.
+ liblzma: Silence a warning.
- src/xz/args.c | 2 +-
+ src/liblzma/rangecoder/range_decoder.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 31dbd1e5fb65831915a7bbb531c3f19aea8d57a5
+commit eeedd4d0925ea417add04ceb42a6c0829244b50c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-11 21:13:06 +0200
+Date: 2024-02-14 18:32:27 +0200
- liblzma: Change LZMA_FILTER_ARM64 to the official Filter ID 0x0A.
+ Add NEWS for 5.5.2beta.
- src/liblzma/api/lzma/bcj.h | 6 +-----
- 1 file changed, 1 insertion(+), 5 deletions(-)
+ NEWS | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 60 insertions(+)
-commit 01b3549e523edac899ec4925b282ceddd20da116
+commit 8af7db854f903068d72a9a0d21103cb0c5027fa8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-08 19:24:22 +0200
+Date: 2024-02-13 14:32:47 +0200
- xz: Make args_info.files_name a const pointer.
+ xz: Mention lzmainfo if trying to use 'lzma --list'.
+
+ This kind of fixes the problem reported here:
+ https://bugs.launchpad.net/ubuntu/+source/xz-utils/+bug/1291020
- src/xz/args.c | 2 +-
- src/xz/args.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ src/xz/list.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
-commit bc665b84ea6bf7946394a08122177efe41b26a5f
+commit 0668907ff736e4cd16738c10d39a2bc9e851aefb
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-08 19:18:16 +0200
+Date: 2024-02-14 14:58:36 +0200
- xz: Don't modify argv[].
-
- The code that parses --memlimit options and --block-list modified
- the argv[] when parsing the option string from optarg. This was
- visible in "ps auxf" and such and could be confusing. I didn't
- understand it back in the day when I wrote that code. Now a copy
- is allocated when modifiable strings are needed.
+ liblzma: Add comments.
- src/xz/args.c | 23 +++++++++++++++++++----
- 1 file changed, 19 insertions(+), 4 deletions(-)
+ src/liblzma/lzma/lzma_decoder.c | 9 +++++++++
+ src/liblzma/rangecoder/range_decoder.h | 11 +++++++++--
+ 2 files changed, 18 insertions(+), 2 deletions(-)
-commit a13064e1c290de7933db72b6dffbd65cfce59c9f
+commit 109f1913d4824c8214d5bbd38ebebf62c37572da
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-08 18:18:57 +0200
+Date: 2024-02-13 17:00:17 +0200
- Translations: Update the German man page translations.
+ Scripts: Add lz4 support to xzgrep and xzdiff.
- po4a/de.po | 4570 ++++++++++++++++++------------------------------------------
- 1 file changed, 1374 insertions(+), 3196 deletions(-)
+ src/scripts/xzdiff.1 | 8 +++++---
+ src/scripts/xzdiff.in | 14 +++++++++-----
+ src/scripts/xzgrep.1 | 6 ++++--
+ src/scripts/xzgrep.in | 1 +
+ 4 files changed, 19 insertions(+), 10 deletions(-)
-commit 8bdbe42a8d0d75dff70206b923fc4bce5c69a40a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-06 23:05:56 +0800
+commit de55485cb23af56c5adbe3239b935c957ff8ac4f
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-13 14:05:13 +0200
- Translations: Update the German translation.
+ liblzma: Choose the range decoder variants using a bitmask macro.
- po/de.po | 586 ++++++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 315 insertions(+), 271 deletions(-)
+ src/liblzma/rangecoder/range_decoder.h | 64 ++++++++++++++++++++++++++++------
+ 1 file changed, 53 insertions(+), 11 deletions(-)
-commit 5c304b57c24ef40ff57f864301065f0244c05bde
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-06 23:04:25 +0800
+commit 0709c2b2d7c1d8f437b003f691880fd7810e5be5
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-13 11:38:10 +0200
- Translations: Update the Turkish translation.
+ xz: Fix outdated threading related info on the man page.
- po/tr.po | 221 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 108 insertions(+), 113 deletions(-)
+ src/xz/xz.1 | 22 ++++++++++++++--------
+ 1 file changed, 14 insertions(+), 8 deletions(-)
-commit 6d86781fdb937970486500447ebb49b98244235b
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-06 23:02:11 +0800
+commit 3182a330c1512cc1f5c87b5c5a272578e60a5158
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
- Translations: Update the Croatian translation.
+ liblzma: Range decoder: Add x86-64 inline assembly.
+
+ It's compatible with GCC and Clang.
- po/hr.po | 228 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 113 insertions(+), 115 deletions(-)
+ src/liblzma/rangecoder/range_decoder.h | 491 +++++++++++++++++++++++++++++++++
+ 1 file changed, 491 insertions(+)
-commit 7a5b4b8075eb36026b1796f04ffed5830c42396a
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-06 22:56:30 +0800
+commit cba2edc991dffba7cd4891dbc1bd26cb950cf053
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
- Translations: Add Romanian translation of man pages.
+ liblzma: Range decoder: Add branchless C code.
- Thanks to Remus-Gabriel Chelu.
+ It's used only for basic bittrees and fixed-size reverse bittree
+ because those showed a clear benefit on x86-64 with GCC and Clang.
+ The other methods were more mixed and thus are commented out but
+ they should be tested on other archs.
- po4a/po4a.conf | 2 +-
- po4a/ro.po | 3692 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 3693 insertions(+), 1 deletion(-)
+ src/liblzma/rangecoder/range_decoder.h | 76 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 76 insertions(+)
-commit c6977e7400088177556e8771bcb839eb7d90caa3
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-12-06 22:52:13 +0800
+commit e290a72d6dee71faf3a90c9678b2f730083666a7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
- Translations: Update the Romanian translation.
+ liblzma: Clarify a comment.
- po/ro.po | 294 +++++++++++++++++++++++++++++++--------------------------------
- 1 file changed, 147 insertions(+), 147 deletions(-)
+ src/liblzma/lzma/lzma_decoder.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
-commit ac2a747e939c2cbccff7a49c399769af5e02d2ab
+commit 5e04706b91ca90d6befd4da24a588a55e631d4a9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-08 17:30:09 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Check for unexpected NULL pointers in block_header_decode().
+ liblzma: LZMA decoder: Optimize loop comparison.
- The API docs gave an impression that such checks are done
- but they actually weren't done. In practice it made little
- difference since the calling code has a bug if these are NULL.
-
- Thanks to Jia Tan for the original patch that checked for
- block->filters == NULL.
+ But now it needs one more local variable.
- src/liblzma/common/block_header_decoder.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ src/liblzma/lzma/lzma_decoder.c | 5 ++---
+ src/liblzma/rangecoder/range_decoder.h | 10 +++++++++-
+ 2 files changed, 11 insertions(+), 4 deletions(-)
-commit 24790f49ae66938c1c7574315e1c0aba1ed5ed25
+commit 88276f9f2cb4871c7eb86952d93d07c1cf6caa66
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 20:59:32 +0200
+Date: 2024-02-12 17:09:10 +0200
- Bump version number for 5.3.5beta.
-
- This also sorts the symbol names alphabetically in liblzma_*.map.
+ liblzma: Optimize literal_subcoder() macro slightly.
- src/liblzma/api/lzma/version.h | 4 ++--
- src/liblzma/liblzma_generic.map | 10 +++++-----
- src/liblzma/liblzma_linux.map | 10 +++++-----
- 3 files changed, 12 insertions(+), 12 deletions(-)
+ src/liblzma/lzma/lzma_common.h | 22 ++++++++++++----------
+ src/liblzma/lzma/lzma_decoder.c | 12 ++++++------
+ src/liblzma/lzma/lzma_encoder.c | 6 +++---
+ src/liblzma/lzma/lzma_encoder_optimum_normal.c | 2 +-
+ src/liblzma/lzma/lzma_encoder_private.h | 4 ++--
+ 5 files changed, 24 insertions(+), 22 deletions(-)
-commit 7e53c5bcb3c2c17f47c096c06ff6b1481e6ecafa
+commit 5938f6de4d8ec9656776cd69e78ddfd6c3ad84e5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 20:57:26 +0200
+Date: 2024-02-12 17:09:10 +0200
- Add NEWS for 5.3.5beta.
+ liblzma: LZ decoder: Add unlikely().
- NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 43 insertions(+)
+ src/liblzma/lz/lz_decoder.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 5865f2aaac326fcbd9f8a7d62defa230e4cb644e
+commit 9c252e3ed086c6b72590b2531586c42596d4a9d9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 20:57:09 +0200
+Date: 2024-02-12 17:09:10 +0200
- Update THANKS.
+ liblzma: LZ decoder: Remove a useless unlikely().
- THANKS | 3 +++
- 1 file changed, 3 insertions(+)
+ src/liblzma/lz/lz_decoder.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 62b270988ec67314d69976df484d2974c6eacfda
+commit f3872a59475456c5d365cad9f1c5be514cfa54b5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 20:04:17 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Use __has_attribute(__symver__) to fix Clang detection.
+ liblzma: Optimize LZ decoder slightly.
- If someone sets up Clang to define __GNUC__ to 10 or greater
- then symvers broke. __has_attribute is supported by such GCC
- and Clang versions that don't support __symver__ so this should
- be much better and simpler way to detect if __symver__ is
- actually supported.
+ Now extra buffer space is reserved so that repeating bytes for
+ any single match will never need to copy from two places (both
+ the beginning and the end of the buffer). This simplifies
+ dict_repeat() and helps a little with speed.
- Thanks to Tomasz Gajc for the bug report.
+ This seems to reduce .lzma decompression time about 2 %, so
+ with .xz and CRC it could be slightly less. The small things
+ add up still.
- src/liblzma/common/common.h | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
+ src/liblzma/lz/lz_decoder.c | 43 ++++++++++++-----
+ src/liblzma/lz/lz_decoder.h | 101 +++++++++++++++++++++-------------------
+ src/liblzma/lzma/lzma_decoder.c | 4 +-
+ 3 files changed, 88 insertions(+), 60 deletions(-)
-commit f9ca7d45162664ddd9fb70e19335c2426e5d75bb
+commit eb518446e578acf079abae5f1ce28db7b6e59bc1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 18:51:52 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Omit zero-skipping from ARM64 filter.
+ liblzma: LZMA decoder: Get rid of next_state[].
- It has some complicated downsides and its usefulness is more limited
- than I originally thought. So this change is bad for certain very
- specific situations but a generic solution that works for other
- filters (and is otherwise better too) is planned anyway. And this
- way 7-Zip can use the same compatible filter for the .7z format.
+ It's not completely obvious if this is better in the decoder.
+ It should be good if compiler can avoid creating a branch
+ (like using CMOV on x86).
- This is still marked as experimental with a new temporary Filter ID.
+ This also makes lzma_encoder.c use the new macros.
- src/liblzma/api/lzma/bcj.h | 2 +-
- src/liblzma/simple/arm64.c | 81 +++++++++++++---------------------------------
- 2 files changed, 24 insertions(+), 59 deletions(-)
+ src/liblzma/lzma/lzma_common.h | 14 ++++++++++++++
+ src/liblzma/lzma/lzma_decoder.c | 30 ++++++++----------------------
+ src/liblzma/lzma/lzma_encoder.c | 4 ++--
+ 3 files changed, 24 insertions(+), 24 deletions(-)
-commit 5baec3f0a9c85e6abf45c0f652f699b074129a8b
+commit e0c0ee475c0800c08291ae45e0d66aa00d5ce604
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 18:13:27 +0200
+Date: 2024-02-12 17:09:10 +0200
- xz: Omit the special notes about ARM64 filter on the man page.
+ liblzma: LZMA decoder improvements.
+
+ This adds macros for bittree decoding which prepares the code
+ for alternative C versions and inline assembly.
- src/xz/xz.1 | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
+ src/liblzma/lzma/lzma_decoder.c | 264 ++++++++++-----------------------
+ src/liblzma/rangecoder/range_common.h | 4 +
+ src/liblzma/rangecoder/range_decoder.h | 142 ++++++++++++++++--
+ 3 files changed, 210 insertions(+), 200 deletions(-)
-commit 0c3627b51862eb0dcdd4fc283d046250571991c6
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 18:12:03 +0200
+commit de5c5e417645ad8906ef914bc059d08c1462fc29
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Don't be over-specific in lzma_str_to_filters API doc.
+ liblzma: Creates Non-resumable and Resumable modes for lzma_decoder.
+
+ The new decoder resumes the first decoder loop in the Resumable mode.
+ Then, the code executes in Non-resumable mode until it detects that it
+ cannot guarantee to have enough input/output to decode another symbol.
+
+ The Resumable mode is how the decoder has always worked. Before decoding
+ every input bit, it checks if there is enough space and will save its
+ location to be resumed later. When the decoder has more input/output,
+ it jumps back to the correct sequence in the Resumable mode code.
+
+ When the input/output buffers are large, the Resumable mode is much
+ slower than the Non-resumable because it has more branches and is harder
+ for the compiler to optimize since it is in a large switch block.
+
+ Early benchmarking shows significant time improvement (8-10% on gcc and
+ clang x86) by using the Non-resumable code as much as possible.
- src/liblzma/api/lzma/filter.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
+ src/liblzma/lz/lz_decoder.h | 14 +-
+ src/liblzma/lzma/lzma_decoder.c | 720 ++++++++++++++++++++++++++++------------
+ 2 files changed, 521 insertions(+), 213 deletions(-)
-commit 94adf057f27b1970f493dc99cd166407d7255639
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 17:54:23 +0200
+commit e446ab7a18abfde18f8d1cf02a914df72b1370e3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Silence unused variable warning when BCJ filters are disabled.
+ liblzma: Creates separate "safe" range decoder mode.
- Thanks to Jia Tan for the original patch.
+ The new "safe" range decoder mode is the same as old range decoder, but
+ now the default behavior of the range decoder will not check if there is
+ enough input or output to complete the operation. When the buffers are
+ close to fully consumed, the "safe" operations must be used instead. This
+ will improve speed because it will reduce the number of branches needed
+ for most of the range decoder operations.
- src/liblzma/common/string_conversion.c | 15 +++++++++++++++
- 1 file changed, 15 insertions(+)
+ src/liblzma/lzma/lzma_decoder.c | 108 ++++++++-------------------------
+ src/liblzma/rangecoder/range_decoder.h | 77 +++++++++++++++++------
+ 2 files changed, 82 insertions(+), 103 deletions(-)
-commit c68af4441744e5ffc41a472e1be9c9d53a1d9780
+commit 7f6d9ca329ff3e01d4b0be7366eb4f5c93da41b9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-12-01 17:38:03 +0200
+Date: 2024-02-12 17:09:10 +0200
- Translations: Update the Chinese (simplified) translation.
+ doxygen/footer.html: Add missing closing tags and don't open a new tab.
+
+ The footer template from Doxygen has the closing </body> </html>
+ as Doxygen doesn't add them otherwise.
+
+ target="_blank" was omitted as it's not useful here but
+ it can be slightly annoying as one cannot just go back
+ in the browser history.
+
+ Since the footer links to the license file in the same
+ directory and not to CC website, the rel attributes
+ can be omitted.
- po/zh_CN.po | 608 ++++++++++++++++++++++++++++++++++--------------------------
- 1 file changed, 348 insertions(+), 260 deletions(-)
+ doxygen/footer.html | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 3be6942e5c27d29995d41da52fbe274e4ce4a537
+commit 26d1527d34d52b0f5d632d4fb636fb33d0867e92
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-30 18:55:03 +0200
+Date: 2024-02-13 13:19:10 +0200
- Add NEWS for 5.2.9.
+ Tweak the expressions in AUTHORS.
- NEWS | 34 ++++++++++++++++++++++++++++++++++
- 1 file changed, 34 insertions(+)
+ AUTHORS | 31 +++++++++++++++++++++++--------
+ 1 file changed, 23 insertions(+), 8 deletions(-)
-commit 7c16e312cb2f40b81154c0e5be13a3c6b8da485d
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-11-30 23:33:08 +0800
+commit d231d56580175fa040fdd3c6207a58243ce6217b
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-13 13:07:33 +0200
- xz: Remove message_filters_to_str function prototype from message.h.
+ Translations: Add the man page translators into man page header comment.
- This was forgotten from 7484744af6cbabe81e92af7d9e061dfd597fff7b.
+ It looked odd to only have the original English authors listed
+ in the header comments of the translated files.
- src/xz/message.h | 16 ----------------
- 1 file changed, 16 deletions(-)
+ po4a/.gitignore | 1 +
+ po4a/po4a.conf | 14 +++++++-------
+ po4a/update-po | 18 ++++++++++++++++++
+ 3 files changed, 26 insertions(+), 7 deletions(-)
-commit 764955e2d4f2a5e8d6d6fec63af694f799e050e7
+commit 6d35fcb936474fca1acaebfd9502c097b6fde88e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-30 18:08:34 +0200
+Date: 2024-02-12 17:09:10 +0200
- Change the bug report address.
+ Translations: Translate also messages of lzmainfo.
- It forwards to me and Jia Tan.
+ lzmainfo has had translation support since 2009 at least but
+ it was never added to po/POTFILES.in so the messages weren't
+ translated. It's a very rarely needed tool so it's not too bad.
- Also update the IRC reference in README as #tukaani was moved
- to Libera Chat long ago.
+ This also adds src/xz/mytime.c to po/POTFILES.in although there
+ are no translatable strings. It's simpler this way so that it
+ won't be forgotten if strings were ever added to that file.
- CMakeLists.txt | 2 +-
- README | 11 +++++------
- configure.ac | 2 +-
- dos/config.h | 2 +-
- windows/README-Windows.txt | 2 +-
- 5 files changed, 9 insertions(+), 10 deletions(-)
+ po/POTFILES.in | 2 ++
+ 1 file changed, 2 insertions(+)
-commit c21983c76031e01da01ad3c6cc716fe4b8a75070
+commit a9f369dd54b05f9ac4e00ead9d765d04fc259868
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-30 17:50:17 +0200
+Date: 2024-02-12 17:09:10 +0200
- Build: Add string_conversion.c to CMake, DOS, and VS files.
+ Translations: Add custom .pot header with SPDX license identifier.
+
+ The same is used for both po/xz.pot and po4a/xz-man.pot.
- CMakeLists.txt | 1 +
- dos/Makefile | 1 +
- windows/vs2013/liblzma.vcxproj | 1 +
- windows/vs2013/liblzma_dll.vcxproj | 1 +
- windows/vs2017/liblzma.vcxproj | 1 +
- windows/vs2017/liblzma_dll.vcxproj | 1 +
- windows/vs2019/liblzma.vcxproj | 1 +
- windows/vs2019/liblzma_dll.vcxproj | 1 +
- 8 files changed, 8 insertions(+)
+ Makefile.am | 1 +
+ po/xz.pot-header | 7 +++++++
+ po4a/update-po | 8 ++++++++
+ 3 files changed, 16 insertions(+)
-commit 30be0c35d24eb5175459d69dbf7d92e2b087ef82
+commit 469cd6653bb96e83c5cf1031c204d34566b15f44
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-30 17:38:32 +0200
-
- Update to HTTPS URLs in AUTHORS.
+Date: 2024-02-12 17:09:10 +0200
- AUTHORS | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-commit 0a72b9ca2fe20082da9b7128fe0d908af947a851
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-11-30 00:52:06 +0800
-
- liblzma: Improve documentation for string to filter functions.
+ Translations: po4a/update-po: Add copyright notice to xz-man.pot.
+
+ All man pages are under 0BSD now so this is simple now.
- src/liblzma/api/lzma/filter.h | 17 +++++++++--------
- 1 file changed, 9 insertions(+), 8 deletions(-)
+ po4a/update-po | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit a6e21fcede3b196160a52dd294d965c508a4bb33
+commit 28ce45e38fbed4b5f54f2013e38dab47d22bf699
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-29 22:27:42 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Two fixes to lzma_str_list_filters() API docs.
-
- Thanks to Jia Tan.
+ Update COPYING about the man pages of the scripts.
- src/liblzma/api/lzma/filter.h | 6 +++---
+ COPYING | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
-commit 7484744af6cbabe81e92af7d9e061dfd597fff7b
+commit e48287bf51afd5184ea74de1dcade9e153f873f7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 21:57:47 +0200
+Date: 2024-02-12 17:09:10 +0200
- xz: Use lzma_str_from_filters().
+ xzdiff, xzgrep, and xzmore: Rewrite the man pages.
+
+ The main reason is a kind of silly one:
+
+ xz-man.pot contains strings from all man pages in XZ Utils.
+ The man pages of xzdiff, xzgrep, and xzmore were under GPLv2
+ and the rest under 0BSD. Thus xz-man.pot contained strings
+ under two licences. po4a creates the translated man pages
+ from the combined 0BSD+GPLv2 xz-man.pot.
+
+ I haven't liked this mixing in xz-man.pot but the
+ Translation Project requires that all man pages must be
+ in the same .pot file. So a separate xz-man-gpl.pot
+ wasn't an option.
- Two uses: Displaying encoder filter chain when compressing with -vv,
- and displaying the decoder filter chain in --list -vv.
+ Since these man pages are short, rewriting them was quick enough.
+ Now xz-man.pot is entirely under 0BSD and marking the per-file
+ licenses is simpler.
+
+ As a bonus, some wording hopefully is now slightly better
+ although it's perhaps a matter of taste.
+
+ NOTE: In xzgrep.1, the EXIT STATUS section was written by me
+ in the commit d796b6d7fdb8b7238b277056cf9146cce25db604 so that's
+ why that section could be taken as is from the old xzgrep.1.
- src/xz/list.c | 28 ++++++---
- src/xz/message.c | 175 +++----------------------------------------------------
- 2 files changed, 28 insertions(+), 175 deletions(-)
+ src/scripts/xzdiff.1 | 94 ++++++++++++++++++++++++-----------------
+ src/scripts/xzgrep.1 | 116 ++++++++++++++++++++++++++++++++-------------------
+ src/scripts/xzmore.1 | 79 ++++++++++++++++++++---------------
+ 3 files changed, 173 insertions(+), 116 deletions(-)
-commit cedeeca2ea6ada5b0411b2ae10d7a859e837f203
+commit 3e551b111b8ae8150f1a1040364dbafc034f22be
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 21:37:48 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Add lzma_str_to_filters, _from_filters, and _list_filters.
+ xzless: Update man page slightly.
- lzma_str_to_filters() uses static error messages which makes
- them not very precise. It tells the position in the string
- where an error occurred though which helps quite a bit if
- applications take advantage of it. Dynamic error messages can
- be added later with a new flag if it seems important enough.
+ The xz tool can decompress three file formats and xzless
+ has always supported uncompressed files too.
- src/liblzma/api/lzma/filter.h | 258 +++++++
- src/liblzma/common/Makefile.inc | 1 +
- src/liblzma/common/string_conversion.c | 1302 ++++++++++++++++++++++++++++++++
- src/liblzma/liblzma_generic.map | 3 +
- src/liblzma/liblzma_linux.map | 3 +
- 5 files changed, 1567 insertions(+)
+ src/scripts/xzless.1 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
-commit 072ebf7b1335421193ffa9d4a70d5533786b8995
+commit 40f36da2262d13d6e1ba8449caa855512ae626d7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 21:02:19 +0200
+Date: 2024-02-12 17:09:10 +0200
- liblzma: Make lzma_validate_chain() available outside filter_common.c.
+ Translations: Change po/Makevars to add a copyright notice to po/xz.pot.
- src/liblzma/common/filter_common.c | 8 ++++----
- src/liblzma/common/filter_common.h | 3 +++
- 2 files changed, 7 insertions(+), 4 deletions(-)
+ po/Makevars | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 5f22bd2d37e3bd01a5d701b51750eb51f09c11bf
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 10:51:03 +0200
+commit 24192854e2ea5c06997431a98bda3c36c5da1497
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ Translations: Update po/Makevars to use the template from gettext 0.22.4.
+
+ Also add SPDX license identifier now that there is a known license.
+
+ po/Makevars | 51 ++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 46 insertions(+), 5 deletions(-)
+
+commit b94154957370116480b43bcabca25fc52deb9853
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ liblzma: Include the SPDX license identifier 0BSD to generated files.
+
+ Perhaps the generated files aren't even copyrightable but
+ using the same license for them as for the rest of the liblzma
+ keeps things more consistent for tools that look for license info.
+
+ src/liblzma/check/crc32_table_be.h | 4 +++-
+ src/liblzma/check/crc32_table_le.h | 4 +++-
+ src/liblzma/check/crc32_tablegen.c | 16 ++++++++++------
+ src/liblzma/check/crc64_table_be.h | 4 +++-
+ src/liblzma/check/crc64_table_le.h | 4 +++-
+ src/liblzma/check/crc64_tablegen.c | 8 +++++---
+ src/liblzma/lz/lz_encoder_hash_table.h | 4 +++-
+ src/liblzma/lzma/fastpos_table.c | 4 +++-
+ src/liblzma/lzma/fastpos_tablegen.c | 12 +++++++-----
+ src/liblzma/rangecoder/price_table.c | 4 +++-
+ src/liblzma/rangecoder/price_tablegen.c | 12 +++++++-----
+ 11 files changed, 50 insertions(+), 26 deletions(-)
+
+commit 8e4ec794836bc1701d8c9bd5e347b8ce8cc5bbb4
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ liblzma: Fix compilation of price_tablegen.c.
+
+ It is built and run only manually so this didn't matter
+ unless one wanted to regenerate the price_table.c.
+
+ src/liblzma/rangecoder/price_tablegen.c | 5 +++++
+ src/liblzma/rangecoder/range_common.h | 5 ++++-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+commit e99bff3ffbcdf2634fd5bd13887627ec7dbfecaf
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ Add SPDX license identifiers to GPL, LGPL, and FSFULLR files.
+
+ extra/scanlzma/scanlzma.c | 2 ++
+ lib/Makefile.am | 2 ++
+ lib/getopt-cdefs.h | 2 ++
+ lib/getopt-core.h | 2 ++
+ lib/getopt-ext.h | 2 ++
+ lib/getopt-pfx-core.h | 2 ++
+ lib/getopt-pfx-ext.h | 2 ++
+ lib/getopt.c | 2 ++
+ lib/getopt.in.h | 2 ++
+ lib/getopt1.c | 2 ++
+ lib/getopt_int.h | 2 ++
+ m4/ax_pthread.m4 | 2 ++
+ m4/getopt.m4 | 2 ++
+ m4/posix-shell.m4 | 2 ++
+ m4/visibility.m4 | 2 ++
+ src/scripts/xzdiff.1 | 3 +--
+ src/scripts/xzdiff.in | 1 +
+ src/scripts/xzgrep.1 | 3 +--
+ src/scripts/xzgrep.in | 1 +
+ src/scripts/xzless.in | 1 +
+ src/scripts/xzmore.1 | 3 +--
+ src/scripts/xzmore.in | 1 +
+ 22 files changed, 37 insertions(+), 6 deletions(-)
+
+commit 22af94128b89a131f5e58ae69bee5e50227c15da
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ Add SPDX license identifier into 0BSD source code files.
+
+ .github/workflows/ci.yml | 2 ++
+ .github/workflows/windows-ci.yml | 2 ++
+ CMakeLists.txt | 2 ++
+ Makefile.am | 3 +--
+ autogen.sh | 1 +
+ build-aux/ci_build.sh | 3 ++-
+ build-aux/manconv.sh | 3 ++-
+ build-aux/version.sh | 3 ++-
+ cmake/remove-ordinals.cmake | 2 ++
+ cmake/tuklib_common.cmake | 4 ++++
+ cmake/tuklib_cpucores.cmake | 4 ++++
+ cmake/tuklib_integer.cmake | 4 ++++
+ cmake/tuklib_large_file_support.cmake | 4 ++++
+ cmake/tuklib_mbstr.cmake | 4 ++++
+ cmake/tuklib_physmem.cmake | 4 ++++
+ cmake/tuklib_progname.cmake | 4 ++++
+ configure.ac | 4 +++-
+ debug/Makefile.am | 3 +--
+ debug/crc32.c | 2 ++
+ debug/full_flush.c | 2 ++
+ debug/hex2bin.c | 2 ++
+ debug/known_sizes.c | 2 ++
+ debug/memusage.c | 2 ++
+ debug/repeat.c | 2 ++
+ debug/sync_flush.c | 2 ++
+ debug/translation.bash | 1 +
+ doc/examples/01_compress_easy.c | 2 ++
+ doc/examples/02_decompress.c | 2 ++
+ doc/examples/03_compress_custom.c | 2 ++
+ doc/examples/04_compress_easy_mt.c | 2 ++
+ doc/examples/11_file_info.c | 2 ++
+ doc/examples/Makefile | 3 +--
+ dos/Makefile | 2 ++
+ dos/config.h | 2 ++
+ doxygen/update-doxygen | 3 ++-
+ extra/7z2lzma/7z2lzma.bash | 3 ++-
+ m4/tuklib_common.m4 | 8 ++++++--
+ m4/tuklib_cpucores.m4 | 8 ++++++--
+ m4/tuklib_integer.m4 | 8 ++++++--
+ m4/tuklib_mbstr.m4 | 8 ++++++--
+ m4/tuklib_physmem.m4 | 8 ++++++--
+ m4/tuklib_progname.m4 | 8 ++++++--
+ po/POTFILES.in | 2 ++
+ po4a/po4a.conf | 2 ++
+ po4a/update-po | 3 ++-
+ src/Makefile.am | 3 +--
+ src/common/common_w32res.rc | 2 ++
+ src/common/mythread.h | 2 ++
+ src/common/sysdefs.h | 2 ++
+ src/common/tuklib_common.h | 2 ++
+ src/common/tuklib_config.h | 2 ++
+ src/common/tuklib_cpucores.c | 2 ++
+ src/common/tuklib_cpucores.h | 2 ++
+ src/common/tuklib_exit.c | 2 ++
+ src/common/tuklib_exit.h | 2 ++
+ src/common/tuklib_gettext.h | 2 ++
+ src/common/tuklib_integer.h | 2 ++
+ src/common/tuklib_mbstr.h | 2 ++
+ src/common/tuklib_mbstr_fw.c | 2 ++
+ src/common/tuklib_mbstr_width.c | 2 ++
+ src/common/tuklib_open_stdxxx.c | 2 ++
+ src/common/tuklib_open_stdxxx.h | 2 ++
+ src/common/tuklib_physmem.c | 2 ++
+ src/common/tuklib_physmem.h | 2 ++
+ src/common/tuklib_progname.c | 2 ++
+ src/common/tuklib_progname.h | 2 ++
+ src/liblzma/Makefile.am | 3 +--
+ src/liblzma/api/Makefile.am | 3 +--
+ src/liblzma/api/lzma.h | 2 ++
+ src/liblzma/api/lzma/base.h | 2 ++
+ src/liblzma/api/lzma/bcj.h | 2 ++
+ src/liblzma/api/lzma/block.h | 2 ++
+ src/liblzma/api/lzma/check.h | 2 ++
+ src/liblzma/api/lzma/container.h | 2 ++
+ src/liblzma/api/lzma/delta.h | 2 ++
+ src/liblzma/api/lzma/filter.h | 2 ++
+ src/liblzma/api/lzma/hardware.h | 2 ++
+ src/liblzma/api/lzma/index.h | 2 ++
+ src/liblzma/api/lzma/index_hash.h | 2 ++
+ src/liblzma/api/lzma/lzma12.h | 2 ++
+ src/liblzma/api/lzma/stream_flags.h | 2 ++
+ src/liblzma/api/lzma/version.h | 2 ++
+ src/liblzma/api/lzma/vli.h | 2 ++
+ src/liblzma/check/Makefile.inc | 4 ++--
+ src/liblzma/check/check.c | 2 ++
+ src/liblzma/check/check.h | 2 ++
+ src/liblzma/check/crc32_arm64.h | 2 ++
+ src/liblzma/check/crc32_fast.c | 2 ++
+ src/liblzma/check/crc32_small.c | 2 ++
+ src/liblzma/check/crc32_table.c | 2 ++
+ src/liblzma/check/crc32_tablegen.c | 2 ++
+ src/liblzma/check/crc32_x86.S | 2 ++
+ src/liblzma/check/crc64_fast.c | 2 ++
+ src/liblzma/check/crc64_small.c | 2 ++
+ src/liblzma/check/crc64_table.c | 2 ++
+ src/liblzma/check/crc64_tablegen.c | 2 ++
+ src/liblzma/check/crc64_x86.S | 2 ++
+ src/liblzma/check/crc_common.h | 2 ++
+ src/liblzma/check/crc_x86_clmul.h | 2 ++
+ src/liblzma/check/sha256.c | 2 ++
+ src/liblzma/common/Makefile.inc | 3 +--
+ src/liblzma/common/alone_decoder.c | 2 ++
+ src/liblzma/common/alone_decoder.h | 2 ++
+ src/liblzma/common/alone_encoder.c | 2 ++
+ src/liblzma/common/auto_decoder.c | 2 ++
+ src/liblzma/common/block_buffer_decoder.c | 2 ++
+ src/liblzma/common/block_buffer_encoder.c | 2 ++
+ src/liblzma/common/block_buffer_encoder.h | 2 ++
+ src/liblzma/common/block_decoder.c | 2 ++
+ src/liblzma/common/block_decoder.h | 2 ++
+ src/liblzma/common/block_encoder.c | 2 ++
+ src/liblzma/common/block_encoder.h | 2 ++
+ src/liblzma/common/block_header_decoder.c | 2 ++
+ src/liblzma/common/block_header_encoder.c | 2 ++
+ src/liblzma/common/block_util.c | 2 ++
+ src/liblzma/common/common.c | 2 ++
+ src/liblzma/common/common.h | 2 ++
+ src/liblzma/common/easy_buffer_encoder.c | 2 ++
+ src/liblzma/common/easy_decoder_memusage.c | 2 ++
+ src/liblzma/common/easy_encoder.c | 2 ++
+ src/liblzma/common/easy_encoder_memusage.c | 2 ++
+ src/liblzma/common/easy_preset.c | 2 ++
+ src/liblzma/common/easy_preset.h | 2 ++
+ src/liblzma/common/file_info.c | 2 ++
+ src/liblzma/common/filter_buffer_decoder.c | 2 ++
+ src/liblzma/common/filter_buffer_encoder.c | 2 ++
+ src/liblzma/common/filter_common.c | 2 ++
+ src/liblzma/common/filter_common.h | 2 ++
+ src/liblzma/common/filter_decoder.c | 2 ++
+ src/liblzma/common/filter_decoder.h | 2 ++
+ src/liblzma/common/filter_encoder.c | 2 ++
+ src/liblzma/common/filter_encoder.h | 2 ++
+ src/liblzma/common/filter_flags_decoder.c | 2 ++
+ src/liblzma/common/filter_flags_encoder.c | 2 ++
+ src/liblzma/common/hardware_cputhreads.c | 2 ++
+ src/liblzma/common/hardware_physmem.c | 2 ++
+ src/liblzma/common/index.c | 2 ++
+ src/liblzma/common/index.h | 2 ++
+ src/liblzma/common/index_decoder.c | 2 ++
+ src/liblzma/common/index_decoder.h | 2 ++
+ src/liblzma/common/index_encoder.c | 2 ++
+ src/liblzma/common/index_encoder.h | 2 ++
+ src/liblzma/common/index_hash.c | 2 ++
+ src/liblzma/common/lzip_decoder.c | 2 ++
+ src/liblzma/common/lzip_decoder.h | 2 ++
+ src/liblzma/common/memcmplen.h | 2 ++
+ src/liblzma/common/microlzma_decoder.c | 2 ++
+ src/liblzma/common/microlzma_encoder.c | 2 ++
+ src/liblzma/common/outqueue.c | 2 ++
+ src/liblzma/common/outqueue.h | 2 ++
+ src/liblzma/common/stream_buffer_decoder.c | 2 ++
+ src/liblzma/common/stream_buffer_encoder.c | 2 ++
+ src/liblzma/common/stream_decoder.c | 2 ++
+ src/liblzma/common/stream_decoder.h | 2 ++
+ src/liblzma/common/stream_decoder_mt.c | 2 ++
+ src/liblzma/common/stream_encoder.c | 2 ++
+ src/liblzma/common/stream_encoder_mt.c | 2 ++
+ src/liblzma/common/stream_flags_common.c | 2 ++
+ src/liblzma/common/stream_flags_common.h | 2 ++
+ src/liblzma/common/stream_flags_decoder.c | 2 ++
+ src/liblzma/common/stream_flags_encoder.c | 2 ++
+ src/liblzma/common/string_conversion.c | 2 ++
+ src/liblzma/common/vli_decoder.c | 2 ++
+ src/liblzma/common/vli_encoder.c | 2 ++
+ src/liblzma/common/vli_size.c | 2 ++
+ src/liblzma/delta/Makefile.inc | 3 +--
+ src/liblzma/delta/delta_common.c | 2 ++
+ src/liblzma/delta/delta_common.h | 2 ++
+ src/liblzma/delta/delta_decoder.c | 2 ++
+ src/liblzma/delta/delta_decoder.h | 2 ++
+ src/liblzma/delta/delta_encoder.c | 2 ++
+ src/liblzma/delta/delta_encoder.h | 2 ++
+ src/liblzma/delta/delta_private.h | 2 ++
+ src/liblzma/liblzma.pc.in | 3 +--
+ src/liblzma/liblzma_generic.map | 2 ++
+ src/liblzma/liblzma_linux.map | 2 ++
+ src/liblzma/liblzma_w32res.rc | 2 ++
+ src/liblzma/lz/Makefile.inc | 3 +--
+ src/liblzma/lz/lz_decoder.c | 2 ++
+ src/liblzma/lz/lz_decoder.h | 2 ++
+ src/liblzma/lz/lz_encoder.c | 2 ++
+ src/liblzma/lz/lz_encoder.h | 2 ++
+ src/liblzma/lz/lz_encoder_hash.h | 2 ++
+ src/liblzma/lz/lz_encoder_mf.c | 2 ++
+ src/liblzma/lzma/Makefile.inc | 3 +--
+ src/liblzma/lzma/fastpos.h | 2 ++
+ src/liblzma/lzma/fastpos_tablegen.c | 2 ++
+ src/liblzma/lzma/lzma2_decoder.c | 2 ++
+ src/liblzma/lzma/lzma2_decoder.h | 2 ++
+ src/liblzma/lzma/lzma2_encoder.c | 2 ++
+ src/liblzma/lzma/lzma2_encoder.h | 2 ++
+ src/liblzma/lzma/lzma_common.h | 2 ++
+ src/liblzma/lzma/lzma_decoder.c | 2 ++
+ src/liblzma/lzma/lzma_decoder.h | 2 ++
+ src/liblzma/lzma/lzma_encoder.c | 2 ++
+ src/liblzma/lzma/lzma_encoder.h | 2 ++
+ src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 ++
+ src/liblzma/lzma/lzma_encoder_optimum_normal.c | 2 ++
+ src/liblzma/lzma/lzma_encoder_presets.c | 2 ++
+ src/liblzma/lzma/lzma_encoder_private.h | 2 ++
+ src/liblzma/rangecoder/Makefile.inc | 3 +--
+ src/liblzma/rangecoder/price.h | 2 ++
+ src/liblzma/rangecoder/price_tablegen.c | 2 ++
+ src/liblzma/rangecoder/range_common.h | 2 ++
+ src/liblzma/rangecoder/range_decoder.h | 2 ++
+ src/liblzma/rangecoder/range_encoder.h | 2 ++
+ src/liblzma/simple/Makefile.inc | 3 +--
+ src/liblzma/simple/arm.c | 2 ++
+ src/liblzma/simple/arm64.c | 2 ++
+ src/liblzma/simple/armthumb.c | 2 ++
+ src/liblzma/simple/ia64.c | 2 ++
+ src/liblzma/simple/powerpc.c | 2 ++
+ src/liblzma/simple/riscv.c | 2 ++
+ src/liblzma/simple/simple_coder.c | 2 ++
+ src/liblzma/simple/simple_coder.h | 2 ++
+ src/liblzma/simple/simple_decoder.c | 2 ++
+ src/liblzma/simple/simple_decoder.h | 2 ++
+ src/liblzma/simple/simple_encoder.c | 2 ++
+ src/liblzma/simple/simple_encoder.h | 2 ++
+ src/liblzma/simple/simple_private.h | 2 ++
+ src/liblzma/simple/sparc.c | 2 ++
+ src/liblzma/simple/x86.c | 2 ++
+ src/liblzma/validate_map.sh | 1 +
+ src/lzmainfo/Makefile.am | 3 +--
+ src/lzmainfo/lzmainfo.c | 2 ++
+ src/lzmainfo/lzmainfo_w32res.rc | 2 ++
+ src/scripts/Makefile.am | 3 +--
+ src/xz/Makefile.am | 3 +--
+ src/xz/args.c | 2 ++
+ src/xz/args.h | 2 ++
+ src/xz/coder.c | 2 ++
+ src/xz/coder.h | 2 ++
+ src/xz/file_io.c | 2 ++
+ src/xz/file_io.h | 2 ++
+ src/xz/hardware.c | 2 ++
+ src/xz/hardware.h | 2 ++
+ src/xz/list.c | 2 ++
+ src/xz/list.h | 2 ++
+ src/xz/main.c | 2 ++
+ src/xz/main.h | 2 ++
+ src/xz/message.c | 2 ++
+ src/xz/message.h | 2 ++
+ src/xz/mytime.c | 2 ++
+ src/xz/mytime.h | 2 ++
+ src/xz/options.c | 2 ++
+ src/xz/options.h | 2 ++
+ src/xz/private.h | 2 ++
+ src/xz/signals.c | 2 ++
+ src/xz/signals.h | 2 ++
+ src/xz/suffix.c | 2 ++
+ src/xz/suffix.h | 2 ++
+ src/xz/util.c | 2 ++
+ src/xz/util.h | 2 ++
+ src/xz/xz_w32res.rc | 2 ++
+ src/xzdec/Makefile.am | 3 +--
+ src/xzdec/lzmadec_w32res.rc | 2 ++
+ src/xzdec/xzdec.c | 2 ++
+ src/xzdec/xzdec_w32res.rc | 2 ++
+ tests/Makefile.am | 3 +--
+ tests/bcj_test.c | 2 ++
+ tests/code_coverage.sh | 1 +
+ tests/create_compress_files.c | 2 ++
+ tests/ossfuzz/fuzz_common.h | 2 ++
+ tests/ossfuzz/fuzz_decode_alone.c | 2 ++
+ tests/ossfuzz/fuzz_decode_stream.c | 2 ++
+ tests/ossfuzz/fuzz_encode_stream.c | 2 ++
+ tests/test_bcj_exact_size.c | 2 ++
+ tests/test_block_header.c | 2 ++
+ tests/test_check.c | 2 ++
+ tests/test_compress.sh | 1 +
+ tests/test_compress_generated_abc | 1 +
+ tests/test_compress_generated_random | 1 +
+ tests/test_compress_generated_text | 1 +
+ tests/test_compress_prepared_bcj_sparc | 1 +
+ tests/test_compress_prepared_bcj_x86 | 1 +
+ tests/test_files.sh | 1 +
+ tests/test_filter_flags.c | 2 ++
+ tests/test_filter_str.c | 2 ++
+ tests/test_hardware.c | 2 ++
+ tests/test_index.c | 2 ++
+ tests/test_index_hash.c | 2 ++
+ tests/test_lzip_decoder.c | 2 ++
+ tests/test_memlimit.c | 2 ++
+ tests/test_scripts.sh | 1 +
+ tests/test_stream_flags.c | 2 ++
+ tests/test_suffix.sh | 1 +
+ tests/test_vli.c | 2 ++
+ tests/tests.h | 2 ++
+ tests/tuktest.h | 2 ++
+ windows/build.bash | 3 ++-
+ 290 files changed, 588 insertions(+), 58 deletions(-)
+
+commit 23de53421ea258cde6a3c33a038b1e9d08f771d1
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 23:25:54 +0200
+
+ liblzma: Sync the AUTHORS fix about SHA-256 to lzma.h.
+
+ src/liblzma/api/lzma.h | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
- liblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused.
+commit 689e0228baeb95232430e90d628379db89583d71
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-12 17:09:10 +0200
+
+ Change most public domain parts to 0BSD.
+
+ Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt
+ were not touched.
+
+ COPYING.0BSD was added.
+
+ .github/workflows/ci.yml | 3 -
+ .github/workflows/windows-ci.yml | 3 -
+ CMakeLists.txt | 3 -
+ COPYING | 112 ++++++++++++++-----------
+ COPYING.0BSD | 11 +++
+ Makefile.am | 3 -
+ PACKAGERS | 11 +--
+ autogen.sh | 3 -
+ build-aux/ci_build.sh | 3 -
+ build-aux/manconv.sh | 3 -
+ build-aux/version.sh | 3 -
+ cmake/remove-ordinals.cmake | 3 -
+ cmake/tuklib_common.cmake | 3 -
+ cmake/tuklib_cpucores.cmake | 3 -
+ cmake/tuklib_integer.cmake | 3 -
+ cmake/tuklib_large_file_support.cmake | 3 -
+ cmake/tuklib_mbstr.cmake | 3 -
+ cmake/tuklib_physmem.cmake | 3 -
+ cmake/tuklib_progname.cmake | 3 -
+ configure.ac | 3 -
+ debug/Makefile.am | 3 -
+ debug/crc32.c | 3 -
+ debug/full_flush.c | 3 -
+ debug/hex2bin.c | 3 -
+ debug/known_sizes.c | 3 -
+ debug/memusage.c | 3 -
+ debug/repeat.c | 3 -
+ debug/sync_flush.c | 3 -
+ debug/translation.bash | 3 -
+ doc/examples/01_compress_easy.c | 3 -
+ doc/examples/02_decompress.c | 3 -
+ doc/examples/03_compress_custom.c | 3 -
+ doc/examples/04_compress_easy_mt.c | 3 -
+ doc/examples/11_file_info.c | 3 -
+ doc/examples/Makefile | 3 -
+ dos/Makefile | 3 -
+ doxygen/update-doxygen | 3 -
+ extra/7z2lzma/7z2lzma.bash | 3 -
+ m4/tuklib_common.m4 | 3 -
+ m4/tuklib_cpucores.m4 | 3 -
+ m4/tuklib_integer.m4 | 3 -
+ m4/tuklib_mbstr.m4 | 3 -
+ m4/tuklib_physmem.m4 | 3 -
+ m4/tuklib_progname.m4 | 3 -
+ po4a/update-po | 3 -
+ src/Makefile.am | 3 -
+ src/common/common_w32res.rc | 3 -
+ src/common/mythread.h | 3 -
+ src/common/sysdefs.h | 3 -
+ src/common/tuklib_common.h | 3 -
+ src/common/tuklib_cpucores.c | 3 -
+ src/common/tuklib_cpucores.h | 3 -
+ src/common/tuklib_exit.c | 3 -
+ src/common/tuklib_exit.h | 3 -
+ src/common/tuklib_gettext.h | 3 -
+ src/common/tuklib_integer.h | 3 -
+ src/common/tuklib_mbstr.h | 3 -
+ src/common/tuklib_mbstr_fw.c | 3 -
+ src/common/tuklib_mbstr_width.c | 3 -
+ src/common/tuklib_open_stdxxx.c | 3 -
+ src/common/tuklib_open_stdxxx.h | 3 -
+ src/common/tuklib_physmem.c | 3 -
+ src/common/tuklib_physmem.h | 3 -
+ src/common/tuklib_progname.c | 3 -
+ src/common/tuklib_progname.h | 3 -
+ src/liblzma/Makefile.am | 3 -
+ src/liblzma/api/Makefile.am | 3 -
+ src/liblzma/api/lzma.h | 13 ++-
+ src/liblzma/api/lzma/base.h | 3 -
+ src/liblzma/api/lzma/bcj.h | 3 -
+ src/liblzma/api/lzma/block.h | 3 -
+ src/liblzma/api/lzma/check.h | 3 -
+ src/liblzma/api/lzma/container.h | 3 -
+ src/liblzma/api/lzma/delta.h | 3 -
+ src/liblzma/api/lzma/filter.h | 3 -
+ src/liblzma/api/lzma/hardware.h | 3 -
+ src/liblzma/api/lzma/index.h | 3 -
+ src/liblzma/api/lzma/index_hash.h | 3 -
+ src/liblzma/api/lzma/lzma12.h | 3 -
+ src/liblzma/api/lzma/stream_flags.h | 3 -
+ src/liblzma/api/lzma/version.h | 3 -
+ src/liblzma/api/lzma/vli.h | 3 -
+ src/liblzma/check/Makefile.inc | 3 -
+ src/liblzma/check/check.c | 3 -
+ src/liblzma/check/check.h | 3 -
+ src/liblzma/check/crc32_arm64.h | 3 -
+ src/liblzma/check/crc32_fast.c | 3 -
+ src/liblzma/check/crc32_small.c | 3 -
+ src/liblzma/check/crc32_table.c | 3 -
+ src/liblzma/check/crc32_tablegen.c | 3 -
+ src/liblzma/check/crc32_x86.S | 3 -
+ src/liblzma/check/crc64_fast.c | 3 -
+ src/liblzma/check/crc64_small.c | 3 -
+ src/liblzma/check/crc64_table.c | 3 -
+ src/liblzma/check/crc64_tablegen.c | 3 -
+ src/liblzma/check/crc64_x86.S | 3 -
+ src/liblzma/check/crc_common.h | 3 -
+ src/liblzma/check/crc_x86_clmul.h | 3 -
+ src/liblzma/check/sha256.c | 3 -
+ src/liblzma/common/Makefile.inc | 3 -
+ src/liblzma/common/alone_decoder.c | 3 -
+ src/liblzma/common/alone_decoder.h | 3 -
+ src/liblzma/common/alone_encoder.c | 3 -
+ src/liblzma/common/auto_decoder.c | 3 -
+ src/liblzma/common/block_buffer_decoder.c | 3 -
+ src/liblzma/common/block_buffer_encoder.c | 3 -
+ src/liblzma/common/block_buffer_encoder.h | 3 -
+ src/liblzma/common/block_decoder.c | 3 -
+ src/liblzma/common/block_decoder.h | 3 -
+ src/liblzma/common/block_encoder.c | 3 -
+ src/liblzma/common/block_encoder.h | 3 -
+ src/liblzma/common/block_header_decoder.c | 3 -
+ src/liblzma/common/block_header_encoder.c | 3 -
+ src/liblzma/common/block_util.c | 3 -
+ src/liblzma/common/common.c | 3 -
+ src/liblzma/common/common.h | 3 -
+ src/liblzma/common/easy_buffer_encoder.c | 3 -
+ src/liblzma/common/easy_decoder_memusage.c | 3 -
+ src/liblzma/common/easy_encoder.c | 3 -
+ src/liblzma/common/easy_encoder_memusage.c | 3 -
+ src/liblzma/common/easy_preset.c | 3 -
+ src/liblzma/common/easy_preset.h | 3 -
+ src/liblzma/common/file_info.c | 3 -
+ src/liblzma/common/filter_buffer_decoder.c | 3 -
+ src/liblzma/common/filter_buffer_encoder.c | 3 -
+ src/liblzma/common/filter_common.c | 3 -
+ src/liblzma/common/filter_common.h | 3 -
+ src/liblzma/common/filter_decoder.c | 3 -
+ src/liblzma/common/filter_decoder.h | 3 -
+ src/liblzma/common/filter_encoder.c | 3 -
+ src/liblzma/common/filter_encoder.h | 3 -
+ src/liblzma/common/filter_flags_decoder.c | 3 -
+ src/liblzma/common/filter_flags_encoder.c | 3 -
+ src/liblzma/common/hardware_cputhreads.c | 3 -
+ src/liblzma/common/hardware_physmem.c | 3 -
+ src/liblzma/common/index.c | 3 -
+ src/liblzma/common/index.h | 3 -
+ src/liblzma/common/index_decoder.c | 3 -
+ src/liblzma/common/index_decoder.h | 3 -
+ src/liblzma/common/index_encoder.c | 3 -
+ src/liblzma/common/index_encoder.h | 3 -
+ src/liblzma/common/index_hash.c | 3 -
+ src/liblzma/common/lzip_decoder.c | 3 -
+ src/liblzma/common/lzip_decoder.h | 3 -
+ src/liblzma/common/memcmplen.h | 3 -
+ src/liblzma/common/microlzma_decoder.c | 3 -
+ src/liblzma/common/microlzma_encoder.c | 3 -
+ src/liblzma/common/outqueue.c | 3 -
+ src/liblzma/common/outqueue.h | 3 -
+ src/liblzma/common/stream_buffer_decoder.c | 3 -
+ src/liblzma/common/stream_buffer_encoder.c | 3 -
+ src/liblzma/common/stream_decoder.c | 3 -
+ src/liblzma/common/stream_decoder.h | 3 -
+ src/liblzma/common/stream_decoder_mt.c | 3 -
+ src/liblzma/common/stream_encoder.c | 3 -
+ src/liblzma/common/stream_encoder_mt.c | 3 -
+ src/liblzma/common/stream_flags_common.c | 3 -
+ src/liblzma/common/stream_flags_common.h | 3 -
+ src/liblzma/common/stream_flags_decoder.c | 3 -
+ src/liblzma/common/stream_flags_encoder.c | 3 -
+ src/liblzma/common/string_conversion.c | 3 -
+ src/liblzma/common/vli_decoder.c | 3 -
+ src/liblzma/common/vli_encoder.c | 3 -
+ src/liblzma/common/vli_size.c | 3 -
+ src/liblzma/delta/Makefile.inc | 3 -
+ src/liblzma/delta/delta_common.c | 3 -
+ src/liblzma/delta/delta_common.h | 3 -
+ src/liblzma/delta/delta_decoder.c | 3 -
+ src/liblzma/delta/delta_decoder.h | 3 -
+ src/liblzma/delta/delta_encoder.c | 3 -
+ src/liblzma/delta/delta_encoder.h | 3 -
+ src/liblzma/delta/delta_private.h | 3 -
+ src/liblzma/liblzma.pc.in | 3 -
+ src/liblzma/liblzma_w32res.rc | 3 -
+ src/liblzma/lz/Makefile.inc | 3 -
+ src/liblzma/lz/lz_decoder.c | 3 -
+ src/liblzma/lz/lz_decoder.h | 3 -
+ src/liblzma/lz/lz_encoder.c | 3 -
+ src/liblzma/lz/lz_encoder.h | 3 -
+ src/liblzma/lz/lz_encoder_hash.h | 3 -
+ src/liblzma/lz/lz_encoder_mf.c | 3 -
+ src/liblzma/lzma/Makefile.inc | 3 -
+ src/liblzma/lzma/fastpos.h | 3 -
+ src/liblzma/lzma/fastpos_tablegen.c | 3 -
+ src/liblzma/lzma/lzma2_decoder.c | 3 -
+ src/liblzma/lzma/lzma2_decoder.h | 3 -
+ src/liblzma/lzma/lzma2_encoder.c | 3 -
+ src/liblzma/lzma/lzma2_encoder.h | 3 -
+ src/liblzma/lzma/lzma_common.h | 3 -
+ src/liblzma/lzma/lzma_decoder.c | 3 -
+ src/liblzma/lzma/lzma_decoder.h | 3 -
+ src/liblzma/lzma/lzma_encoder.c | 3 -
+ src/liblzma/lzma/lzma_encoder.h | 3 -
+ src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 -
+ src/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 -
+ src/liblzma/lzma/lzma_encoder_presets.c | 3 -
+ src/liblzma/lzma/lzma_encoder_private.h | 3 -
+ src/liblzma/rangecoder/Makefile.inc | 3 -
+ src/liblzma/rangecoder/price.h | 3 -
+ src/liblzma/rangecoder/price_tablegen.c | 3 -
+ src/liblzma/rangecoder/range_common.h | 3 -
+ src/liblzma/rangecoder/range_decoder.h | 3 -
+ src/liblzma/rangecoder/range_encoder.h | 3 -
+ src/liblzma/simple/Makefile.inc | 3 -
+ src/liblzma/simple/arm.c | 3 -
+ src/liblzma/simple/arm64.c | 3 -
+ src/liblzma/simple/armthumb.c | 3 -
+ src/liblzma/simple/ia64.c | 3 -
+ src/liblzma/simple/powerpc.c | 3 -
+ src/liblzma/simple/riscv.c | 3 -
+ src/liblzma/simple/simple_coder.c | 3 -
+ src/liblzma/simple/simple_coder.h | 3 -
+ src/liblzma/simple/simple_decoder.c | 3 -
+ src/liblzma/simple/simple_decoder.h | 3 -
+ src/liblzma/simple/simple_encoder.c | 3 -
+ src/liblzma/simple/simple_encoder.h | 3 -
+ src/liblzma/simple/simple_private.h | 3 -
+ src/liblzma/simple/sparc.c | 3 -
+ src/liblzma/simple/x86.c | 3 -
+ src/liblzma/validate_map.sh | 3 -
+ src/lzmainfo/Makefile.am | 3 -
+ src/lzmainfo/lzmainfo.1 | 4 +-
+ src/lzmainfo/lzmainfo.c | 3 -
+ src/lzmainfo/lzmainfo_w32res.rc | 3 -
+ src/scripts/Makefile.am | 3 -
+ src/scripts/xzless.1 | 4 +-
+ src/xz/Makefile.am | 3 -
+ src/xz/args.c | 3 -
+ src/xz/args.h | 3 -
+ src/xz/coder.c | 3 -
+ src/xz/coder.h | 3 -
+ src/xz/file_io.c | 3 -
+ src/xz/file_io.h | 3 -
+ src/xz/hardware.c | 3 -
+ src/xz/hardware.h | 3 -
+ src/xz/list.c | 3 -
+ src/xz/list.h | 3 -
+ src/xz/main.c | 3 -
+ src/xz/main.h | 3 -
+ src/xz/message.c | 3 -
+ src/xz/message.h | 3 -
+ src/xz/mytime.c | 3 -
+ src/xz/mytime.h | 3 -
+ src/xz/options.c | 3 -
+ src/xz/options.h | 3 -
+ src/xz/private.h | 3 -
+ src/xz/signals.c | 3 -
+ src/xz/signals.h | 3 -
+ src/xz/suffix.c | 3 -
+ src/xz/suffix.h | 3 -
+ src/xz/util.c | 3 -
+ src/xz/util.h | 3 -
+ src/xz/xz.1 | 4 +-
+ src/xz/xz_w32res.rc | 3 -
+ src/xzdec/Makefile.am | 3 -
+ src/xzdec/lzmadec_w32res.rc | 3 -
+ src/xzdec/xzdec.1 | 4 +-
+ src/xzdec/xzdec.c | 3 -
+ src/xzdec/xzdec_w32res.rc | 3 -
+ tests/Makefile.am | 3 -
+ tests/bcj_test.c | 3 -
+ tests/code_coverage.sh | 3 -
+ tests/create_compress_files.c | 3 -
+ tests/files/README | 3 +-
+ tests/ossfuzz/fuzz_common.h | 3 -
+ tests/ossfuzz/fuzz_decode_alone.c | 3 -
+ tests/ossfuzz/fuzz_decode_stream.c | 3 -
+ tests/ossfuzz/fuzz_encode_stream.c | 3 -
+ tests/test_bcj_exact_size.c | 3 -
+ tests/test_block_header.c | 3 -
+ tests/test_check.c | 3 -
+ tests/test_compress.sh | 3 -
+ tests/test_files.sh | 3 -
+ tests/test_filter_flags.c | 3 -
+ tests/test_filter_str.c | 3 -
+ tests/test_hardware.c | 3 -
+ tests/test_index.c | 3 -
+ tests/test_index_hash.c | 3 -
+ tests/test_lzip_decoder.c | 3 -
+ tests/test_memlimit.c | 3 -
+ tests/test_scripts.sh | 3 -
+ tests/test_stream_flags.c | 3 -
+ tests/test_suffix.sh | 3 -
+ tests/test_vli.c | 3 -
+ tests/tests.h | 3 -
+ tests/tuktest.h | 3 -
+ windows/README-Windows.txt | 11 +--
+ windows/build.bash | 3 -
+ 288 files changed, 100 insertions(+), 911 deletions(-)
+
+commit 76946dc4336c831fe2cc26696a035d807dd3cf13
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-09 17:20:31 +0200
+
+ Fix SHA-256 authors.
+
+ The initial commit 5d018dc03549c1ee4958364712fb0c94e1bf2741
+ in 2007 had a comment in sha256.c that the code is based on
+ Crypto++ Library 5.5.1. In 2009 the Authors list in sha256.c
+ and the AUTHORS file was updated with information that the
+ code had come from Crypto++ but via 7-Zip. I know I had viewed
+ 7-Zip's SHA-256 code but back then the C code has been identical
+ enough with Crypto++, so I don't why I thought the author info
+ would need that extra step via 7-Zip for this single file.
+
+ Another error is that I had mixed sha.* and shacal2.* files
+ when checking for author info in Crypto++. The shacal2.* files
+ aren't related to liblzma's sha256.c and thus Kevin Springle's
+ code in Crypto++ isn't either.
+
+ AUTHORS | 6 ++----
+ src/liblzma/check/sha256.c | 14 ++++----------
+ 2 files changed, 6 insertions(+), 14 deletions(-)
+
+commit 21d9cbae9eecca28ce373d3d9464defd2cf5d851
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-09 17:20:31 +0200
+
+ Remove macosx/build.sh.
+
+ It was last updated in 2013.
+
+ Makefile.am | 1 -
+ macosx/build.sh | 113 --------------------------------------------------------
+ 2 files changed, 114 deletions(-)
+
+commit eac2c3c67f9113a225fb6667df862edd30366931
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2024-02-09 17:20:31 +0200
+
+ Doc: Remove doc/examples_old.
+
+ It was good to keep these around in parallel with the newer examples
+ but I think it's OK to remove the old ones at this point.
+
+ Makefile.am | 5 --
+ doc/examples_old/xz_pipe_comp.c | 127 --------------------------------------
+ doc/examples_old/xz_pipe_decomp.c | 123 ------------------------------------
+ 3 files changed, 255 deletions(-)
+
+commit 89ea1a22f4ed3685b053b7260bc5acf6c75d1664
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-13 22:38:58 +0800
+
+ Tests: Add RISC-V filter support in a few places.
+
+ tests/test_filter_flags.c | 6 ++++++
+ tests/test_filter_str.c | 6 ++++++
+ 2 files changed, 12 insertions(+)
+
+commit 45663443eb2b377e6171529380fee312f1adcdf4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-13 22:37:07 +0800
+
+ liblzma: Fix build error if only RISC-V BCJ filter is enabled.
+
+ If any other BCJ filter was enabled for encoding or decoding, then this
+ was not a problem.
- src/liblzma/lz/lz_decoder.c | 14 --------------
- src/liblzma/lz/lz_decoder.h | 3 ---
- 2 files changed, 17 deletions(-)
+ src/liblzma/common/string_conversion.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-commit cee83206465b95729ab649aa2f57fdbde8dcaf89
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 10:48:53 +0200
+commit 2f15597d677bc35743c777d4cf3bfa698b478681
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-13 22:56:24 +0800
- liblzma: Use LZMA1EXT feature in lzma_microlzma_decoder().
-
- Here too this avoids the slightly ugly method to set
- the uncompressed size.
-
- Also moved the setting of dict_size to the struct initializer.
+ Translations: Update the Korean translation.
- src/liblzma/common/microlzma_decoder.c | 15 ++++++++-------
- 1 file changed, 8 insertions(+), 7 deletions(-)
+ po/ko.po | 526 ++++++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 284 insertions(+), 242 deletions(-)
-commit e310e8b6a490dfb468f4ed68feff246d776b323c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-28 10:28:20 +0200
+commit df873143ad1615c6d6aaa1bf8808b1676091dfe3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-13 01:55:53 +0800
- liblzma: Use LZMA1EXT feature in lzma_alone_decoder().
-
- This avoids the need to use the slightly ugly method to
- set the uncompressed size.
+ Translations: Update the Korean man page translations.
- src/liblzma/common/alone_decoder.c | 18 +++++++++++++-----
- 1 file changed, 13 insertions(+), 5 deletions(-)
+ po4a/ko.po | 1375 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 770 insertions(+), 605 deletions(-)
-commit 33b8a24b6646a9dbfd8358405aec466b13078559
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-27 23:16:21 +0200
+commit b3f415eddb150341865a1af47959c3baba076b33
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-13 01:53:33 +0800
- liblzma: Add LZMA_FILTER_LZMA1EXT to support LZMA1 without end marker.
-
- Some file formats need support for LZMA1 streams that don't use
- the end of payload marker (EOPM) alias end of stream (EOS) marker.
- So far liblzma API has supported decompressing such streams via
- lzma_alone_decoder() when .lzma header specifies a known
- uncompressed size. Encoding support hasn't been available in the API.
-
- Instead of adding a new LZMA1-only API for this purpose, this commit
- adds a new filter ID for use with raw encoder and decoder. The main
- benefit of this approach is that then also filter chains are possible,
- for example, if someone wants to implement support for .7z files that
- use the x86 BCJ filter with LZMA1 (not BCJ2 as that isn't supported
- in liblzma).
+ Translations: Update the Chinese (simplified) translation.
- src/liblzma/api/lzma/lzma12.h | 123 ++++++++++++++++++++++++++++++--
- src/liblzma/common/filter_common.c | 7 ++
- src/liblzma/common/filter_decoder.c | 6 ++
- src/liblzma/common/filter_encoder.c | 9 +++
- src/liblzma/lzma/lzma2_encoder.c | 2 +-
- src/liblzma/lzma/lzma_decoder.c | 26 ++++++-
- src/liblzma/lzma/lzma_encoder.c | 40 +++++++++--
- src/liblzma/lzma/lzma_encoder.h | 3 +-
- src/liblzma/lzma/lzma_encoder_private.h | 3 +
- 9 files changed, 204 insertions(+), 15 deletions(-)
+ po/zh_CN.po | 424 ++++++++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 268 insertions(+), 156 deletions(-)
-commit 9a304bf1e45b3ddf61aaeaa7c764915b34618ede
+commit 9860d418d296eb3c721e5384fb367c0499b579c8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-27 18:43:07 +0200
+Date: 2024-02-09 23:21:01 +0200
- liblzma: Avoid unneeded use of void pointer in LZMA decoder.
+ xzless: Use ||- in LESSOPEN with with "less" 451 and newer.
- src/liblzma/lzma/lzma_decoder.c | 3 +--
- src/liblzma/lzma/lzma_decoder.h | 2 +-
- 2 files changed, 2 insertions(+), 3 deletions(-)
+ src/scripts/xzless.in | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
-commit 218394958c7683f892275bb40eae880620feebcc
+commit fd0692b0525e6c26b496492be9e2c865cab734f8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-27 18:20:33 +0200
+Date: 2024-02-09 23:00:05 +0200
- liblzma: Pass the Filter ID to LZ encoder and decoder.
+ xzless: Use --show-preproc-errors with "less" 632 and newer.
- This allows using two Filter IDs with the same
- initialization function and data structures.
+ This makes "less" show a warning if a decompression error occurred.
- src/liblzma/common/alone_decoder.c | 1 +
- src/liblzma/common/alone_encoder.c | 1 +
- src/liblzma/common/common.h | 7 +++++--
- src/liblzma/common/lzip_decoder.c | 1 +
- src/liblzma/common/microlzma_decoder.c | 1 +
- src/liblzma/common/microlzma_encoder.c | 1 +
- src/liblzma/lz/lz_decoder.c | 5 +++--
- src/liblzma/lz/lz_decoder.h | 3 ++-
- src/liblzma/lz/lz_encoder.c | 5 +++--
- src/liblzma/lz/lz_encoder.h | 3 ++-
- src/liblzma/lzma/lzma2_decoder.c | 3 ++-
- src/liblzma/lzma/lzma2_encoder.c | 3 ++-
- src/liblzma/lzma/lzma_decoder.c | 2 +-
- src/liblzma/lzma/lzma_encoder.c | 2 +-
- 14 files changed, 26 insertions(+), 12 deletions(-)
+ src/scripts/xzless.in | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
-commit 1663c7676b76f4c514031797f3db1896e8100f7f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-27 01:03:16 +0200
+commit adb073da76a920b5a81e6b32254f4ddb054dc57a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-09 23:59:54 +0800
- liblzma: Remove two FIXME comments.
+ liblzma: Fix typo discovered by codespell.
- src/liblzma/common/filter_encoder.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/check/crc32_arm64.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 11fe708db783ac36ebeeb85da164e29e8c300910
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-26 22:25:30 +0200
+commit 55d9fc883d221cbace951a370f1fb144698f8c2e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-09 20:01:06 +0800
- xz: Use lzma_filters_free().
+ Translations: Update the Swedish translation.
- src/xz/list.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ po/sv.po | 420 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 254 insertions(+), 166 deletions(-)
-commit e782af9110d8499c7ac2929bc871540eefea5ea1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-26 22:21:13 +0200
+commit 55ba4a1ea321499c805eedfa811ffde690bae311
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-08 20:09:04 +0800
- liblzma: Use lzma_filters_free() in more places.
+ Translations: Update the Spanish translation.
- src/liblzma/common/block_header_decoder.c | 20 ++------------------
- src/liblzma/common/stream_decoder.c | 4 +---
- src/liblzma/common/stream_decoder_mt.c | 22 +++++-----------------
- 3 files changed, 8 insertions(+), 38 deletions(-)
+ po/es.po | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
-commit 90caaded2dc6db1d6a55b01160d7e87f4a423628
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-25 18:04:37 +0200
+commit 7f2293cd804a89d3c3b2d3ed573560ca9e1520ae
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-07 21:34:35 +0800
- liblzma: Omit simple coder init functions if they are disabled.
+ Translations: Update the Spanish translation.
- src/liblzma/simple/arm.c | 4 ++++
- src/liblzma/simple/armthumb.c | 4 ++++
- src/liblzma/simple/ia64.c | 4 ++++
- src/liblzma/simple/powerpc.c | 4 ++++
- src/liblzma/simple/sparc.c | 4 ++++
- src/liblzma/simple/x86.c | 4 ++++
- 6 files changed, 24 insertions(+)
+ po/es.po | 419 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 253 insertions(+), 166 deletions(-)
-commit 5cd9f0df78cc4f8a7807bf6104adea13034fbb45
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 23:24:59 +0200
+commit f4af2036bc625739d6d33d9e1fede583a25c3828
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-07 21:28:32 +0800
- xz: Allow nice_len 2 and 3 even if match finder requires 3 or 4.
-
- Now that liblzma accepts these, we avoid the extra check and
- there's one message less for translators too.
+ Translations: Update the Polish translation.
- src/xz/options.c | 5 -----
- 1 file changed, 5 deletions(-)
+ po/pl.po | 411 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 249 insertions(+), 162 deletions(-)
-commit 3be88ae071371caa279b44e13f4836fb178fe4ae
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 23:23:55 +0200
+commit e5e93bb816043c559cddf03a3b7ba13bec353ee4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-07 19:40:12 +0800
- liblzma: Allow nice_len 2 and 3 even if match finder requires 3 or 4.
-
- That is, if the specified nice_len is smaller than the minimum
- of the match finder, silently use the match finder's minimum value
- instead of reporting an error. The old behavior is annoying to users
- and it complicates xz options handling too.
+ Translations: Update the German translation.
- src/liblzma/lz/lz_encoder.c | 14 +++++++++-----
- src/liblzma/lz/lz_encoder.h | 9 +++++++++
- src/liblzma/lzma/lzma_encoder.c | 11 ++++++++---
- 3 files changed, 26 insertions(+), 8 deletions(-)
+ po/de.po | 396 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 242 insertions(+), 154 deletions(-)
-commit 93439cfafe1768b3b18d67d2356ef7e7559bba59
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 16:25:10 +0200
+commit 28f18ff8e26902762fb007c13be235b4ac1ac071
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-07 19:27:25 +0800
- liblzma: Add lzma_filters_update() support to the multi-threaded encoder.
-
- A tiny downside of this is that now a 1-4 tiny allocations are made
- for every Block because each worker thread needs its own copy of
- the filter chain.
+ Translations: Update the German man page translations.
- src/liblzma/api/lzma/filter.h | 36 +++++++------
- src/liblzma/common/stream_encoder_mt.c | 96 +++++++++++++++++++++++++++++++---
- 2 files changed, 109 insertions(+), 23 deletions(-)
+ po4a/de.po | 1353 +++++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 752 insertions(+), 601 deletions(-)
-commit 17ac51e689794eb41cab3e80946fec689caea2d2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 14:53:22 +0200
+commit cabfbc7947da05aa5dfe39bec9759e076f940e3c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-06 23:44:06 +0800
- Update THANKS.
+ Translations: Update the Romanian translation.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ po/ro.po | 416 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 252 insertions(+), 164 deletions(-)
-commit 06824396b2b6c84f3a235cb7c19c2a9701167797
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 14:52:44 +0200
+commit bf20c94f5d748cea2147779f4fa7e2fd2eb8555e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-06 23:45:02 +0800
- Build: Don't put GNU/Linux-specific symbol versions into static liblzma.
-
- It not only makes no sense to put symbol versions into a static library
- but it can also cause breakage.
-
- By default Libtool #defines PIC if building a shared library and
- doesn't define it for static libraries. This is documented in the
- Libtool manual. It can be overriden using --with-pic or --without-pic.
- configure.ac detects if --with-pic or --without-pic is used and then
- gives an error if neither --disable-shared nor --disable-static was
- used at the same time. Thus, in normal situations it works to build
- both shared and static library at the same time on GNU/Linux,
- only --with-pic or --without-pic requires that only one type of
- library is built.
-
- Thanks to John Paul Adrian Glaubitz from Debian for reporting
- the problem that occurred on ia64:
- https://www.mail-archive.com/xz-devel@tukaani.org/msg00610.html
+ Translations: Update the Romanian man page translations.
- CMakeLists.txt | 5 +-
- configure.ac | 143 +++++++++++++++++++++++++++++---------------
- src/liblzma/common/common.h | 12 ++++
- 3 files changed, 111 insertions(+), 49 deletions(-)
+ po4a/ro.po | 1759 +++++++++++++++++++++++++++++++++---------------------------
+ 1 file changed, 966 insertions(+), 793 deletions(-)
-commit e1acf7107291f8b3d6d609a7133331ff36d35d14
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 01:32:16 +0200
+commit 7c25ec9feb0241e4affb7432681cc4f5696f3a96
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-07 20:56:57 +0800
- liblzma: Refactor to use lzma_filters_free().
-
- lzma_filters_free() sets the options to NULL and ids to
- LZMA_VLI_UNKNOWN so there is no need to do it by caller;
- the filter arrays will always be left in a safe state.
-
- Also use memcpy() instead of a loop to copy a filter chain
- when it is known to be safe to copy LZMA_FILTERS_MAX + 1
- (even if the elements past the terminator might be uninitialized).
+ Translations: Update the Ukrainian translation.
- src/liblzma/common/stream_encoder.c | 16 ++++------------
- src/liblzma/common/stream_encoder_mt.c | 11 ++---------
- 2 files changed, 6 insertions(+), 21 deletions(-)
+ po/uk.po | 397 ++++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 242 insertions(+), 155 deletions(-)
-commit cb05dbcf8b868441ec805016222f3fd77f1c5caa
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 01:26:37 +0200
+commit b3523250e9eef10b017473754c1e1c9e31f10374
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-06 23:30:03 +0800
- liblzma: Fix another invalid free() after memory allocation failure.
-
- This time it can happen when lzma_stream_encoder_mt() is used
- to reinitialize an existing multi-threaded Stream encoder
- and one of 1-4 tiny allocations in lzma_filters_copy() fail.
-
- It's very similar to the previous bug
- 10430fbf3820dafd4eafd38ec8be161a6978ed2b, happening with
- an array of lzma_filter structures whose old options are freed
- but the replacement never arrives due to a memory allocation
- failure in lzma_filters_copy().
+ Translations: Update the Ukrainian man page translations.
- src/liblzma/common/stream_encoder_mt.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ po4a/uk.po | 1363 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 764 insertions(+), 599 deletions(-)
-commit 75f1a6c26df4ce329da0882786403e3ccf5cd898
+commit a5c177f514f4c90e0d2f6045636fca6c2e80a20d
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-05-05 20:53:42 +0800
+Date: 2024-02-02 01:39:28 +0800
- liblzma: Add support for LZMA_SYNC_FLUSH in the Block encoder.
-
- The documentation mentions that lzma_block_encoder() supports
- LZMA_SYNC_FLUSH but it was never added to supported_actions[]
- in the internal structure. Because of this, LZMA_SYNC_FLUSH could
- not be used with the Block encoder unless it was the next coder
- after something like stream_encoder() or stream_encoder_mt().
+ Update AUTHORS.
- src/liblzma/common/block_encoder.c | 1 +
- 1 file changed, 1 insertion(+)
+ AUTHORS | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit d0901645170b638c517f5c50866b6ef48f491c65
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 01:02:50 +0200
+commit 7f68a68c19d0ae57bd0e802be0ea8f974e41299f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-02 01:38:51 +0800
- liblzma: Add new API function lzma_filters_free().
-
- This is small but convenient and should have been added
- a long time ago.
+ liblzma: Update Authors list in crc32_arm64.h.
- src/liblzma/api/lzma/filter.h | 21 +++++++++++++++++++++
- src/liblzma/common/filter_common.c | 26 ++++++++++++++++++++++++++
- src/liblzma/liblzma_generic.map | 1 +
- src/liblzma/liblzma_linux.map | 1 +
- 4 files changed, 49 insertions(+)
+ src/liblzma/check/crc32_arm64.h | 1 +
+ 1 file changed, 1 insertion(+)
-commit ae1f8a723dcde2f2c5cf444bcbb5fc5026b3c3c5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-24 00:02:31 +0200
+commit 97f9ba50b84e67b3dcb5b17dd5d3e1d14f9ad1d0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-01 16:07:03 +0800
- CMake: Don't use symbol versioning with static library.
+ liblzma: Check HAVE_USABLE_CLMUL before omitting CRC32 table.
+
+ This was split from the prior commit so it could be easily applied to
+ the 5.4 branch.
+
+ Closes: https://github.com/tukaani-project/xz/pull/77
- CMakeLists.txt | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
+ src/liblzma/check/crc32_table.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 48c1b99dc537a27e1ca929d8837e778e5ba32191
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-23 21:55:22 +0200
+commit ca9015f4dead2c97b48f5a6933631b0a448b65b9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-02-01 16:06:29 +0800
- liblzma: Add lzma_attr_warn_unused_result to lzma_filters_copy().
+ liblzma: Check HAVE_USABLE_CLMUL before omitting CRC64 table.
+
+ If liblzma is configured with --disable-clmul-crc
+ CFLAGS="-msse4.1 -mpclmul", then it will fail to compile because the
+ generic version must be used but the CRC tables were not included.
- src/liblzma/api/lzma/filter.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ src/liblzma/check/crc64_table.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 10430fbf3820dafd4eafd38ec8be161a6978ed2b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-23 21:26:21 +0200
+commit 2f1552a91c825e87013925e1a67a0930e7aef592
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-23 18:02:13 +0800
- liblzma: Fix invalid free() after memory allocation failure.
-
- The bug was in the single-threaded .xz Stream encoder
- in the code that is used for both re-initialization and for
- lzma_filters_update(). To trigger it, an application had
- to either re-initialize an existing encoder instance with
- lzma_stream_encoder() or use lzma_filters_update(), and
- then one of the 1-4 tiny allocations in lzma_filters_copy()
- (called from stream_encoder_update()) must fail. An error
- was correctly reported but the encoder state was corrupted.
+ liblzma: Only use ifunc in crcXX_fast.c if its needed.
- This is related to the recent fix in
- f8ee61e74eb40600445fdb601c374d582e1e9c8a which is good but
- it wasn't enough to fix the main problem in stream_encoder.c.
+ The code was using HAVE_FUNC_ATTRIBUTE_IFUNC instead of CRC_USE_IFUNC.
+ With ARM64, ifunc is incompatible because it requires non-inline
+ function calls for runtime detection.
- src/liblzma/common/stream_encoder.c | 39 +++++++++++++++++++++++++++++--------
- 1 file changed, 31 insertions(+), 8 deletions(-)
+ src/liblzma/check/crc32_fast.c | 6 +++---
+ src/liblzma/check/crc64_fast.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
-commit cafd6dc397ca8b5b5f7775e8d6876b8fe70f8e70
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-22 16:37:15 +0200
+commit 30a25f3742287697bc57a1bef86c19ecf5129322
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 22:08:45 +0800
- liblzma: Fix language in a comment.
+ Docs: Add --disable-arm64-crc32 description to INSTALL.
- src/liblzma/common/stream_encoder.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ INSTALL | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
-commit c392bf8ccba857baaf50399c4b460119befacd54
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-22 11:20:17 +0200
+commit 1940f0ec28f08c0ac72c1413d9706fb82eabe6ad
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 21:36:09 +0800
- liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB.
+ liblzma: Omit CRC tables when not needed with ARM64 optimizations.
- The encoder doesn't support dictionary sizes larger than 1536 MiB.
- This is validated, for example, when calculating the memory usage
- via lzma_raw_encoder_memusage(). It is also enforced by the LZ
- part of the encoder initialization. However, LZMA encoder with
- LZMA_MODE_NORMAL did an unsafe calculation with dict_size before
- such validation and that results in an infinite loop if dict_size
- was 2 << 30 or greater.
+ This is similar to the existing x86-64 CLMUL conditions to omit the
+ tables. They were slightly refactored to improve readability.
- src/liblzma/lzma/lzma_encoder.c | 19 +++++++++++++++----
- 1 file changed, 15 insertions(+), 4 deletions(-)
+ src/liblzma/check/crc32_table.c | 18 +++++++++++++++---
+ src/liblzma/check/crc64_table.c | 7 ++++++-
+ src/liblzma/check/crc_common.h | 5 ++++-
+ 3 files changed, 25 insertions(+), 5 deletions(-)
-commit f50534c973a591ccf65485adfc827a8a7126ca6c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-21 13:02:33 +0200
+commit 761f5b69a4c778c8bcb09279b845b07c28790575
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 20:54:56 +0800
- liblzma: Fix two Doxygen commands in the API headers.
+ liblzma: Rename crc32_aarch64.h to crc32_arm64.h.
- These were caught by clang -Wdocumentation.
-
- src/liblzma/api/lzma/hardware.h | 2 +-
- src/liblzma/api/lzma/index_hash.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-commit 649d4872ed2f55196114a061d45b416fc4353569
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-19 19:09:55 +0200
-
- xz: Refactor duplicate code from hardware_memlimit_mtenc_get().
+ Even though the proper name for the architecture is aarch64, this
+ project uses ARM64 throughout. So the rename is for consistency.
+
+ Additionally, crc32_arm64.h was slightly refactored for the following
+ changes:
+
+ * Added MSVC, FreeBSD, and macOS support in
+ is_arch_extension_supported().
+
+ * crc32_arch_optimized() now checks the size when aligning the
+ buffer.
+
+ * crc32_arch_optimized() loop conditions were slightly modified to
+ avoid both decrementing the size and incrementing the buffer
+ pointer.
+
+ * Use the intrinsic wrappers defined in <arm_acle.h> because GCC and
+ Clang name them differently.
+
+ * Minor spacing and comment changes.
- src/xz/hardware.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 2 +-
+ src/liblzma/check/Makefile.inc | 2 +-
+ src/liblzma/check/crc32_aarch64.h | 109 ----------------------------------
+ src/liblzma/check/crc32_arm64.h | 119 ++++++++++++++++++++++++++++++++++++++
+ src/liblzma/check/crc32_fast.c | 3 +-
+ src/liblzma/check/crc64_fast.c | 3 -
+ 6 files changed, 122 insertions(+), 116 deletions(-)
-commit d327743bb547a53364e5951a16e5f1663fe4b9ff
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-19 19:06:13 +0200
+commit 455a08609caa3223066a717fb01bfa42c5dba47d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 20:49:30 +0800
- xz: Add support --threads=+N so that -T+1 gives threaded mode.
+ liblzma: Refactor crc_common.h.
+
+ The CRC_GENERIC is now split into CRC32_GENERIC and CRC64_GENERIC, since
+ the ARM64 optimizations will be different between CRC32 and CRC64.
+
+ For the same reason, CRC_ARCH_OPTIMIZED is split into
+ CRC32_ARCH_OPTIMIZED and CRC64_ARCH_OPTIMIZED.
+
+ ifunc will only be used with x86-64 CLMUL because the runtime detection
+ methods needed with ARM64 are not compatible with ifunc.
- src/xz/args.c | 18 +++++++++++++++---
- src/xz/hardware.c | 17 +++++++++++++++--
- src/xz/hardware.h | 1 +
- src/xz/xz.1 | 21 ++++++++++++++++++++-
- 4 files changed, 51 insertions(+), 6 deletions(-)
+ src/liblzma/check/crc32_fast.c | 8 +--
+ src/liblzma/check/crc64_fast.c | 8 +--
+ src/liblzma/check/crc_common.h | 108 ++++++++++++++++++++++++++++-------------
+ 3 files changed, 82 insertions(+), 42 deletions(-)
-commit a11a2b8b5e830ba682c1d81aaa7078842b296995
+commit 61908e816049af7a9f43ea804a57ee8570e2e644
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-11-19 23:18:04 +0800
+Date: 2024-01-22 00:42:28 +0800
- CMake: Adds test_memlimit to CMake tests
+ CMake: Add support for ARM64 CRC32 instruction detection.
- CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
+ CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
-commit 2af8d9e9b3f44f62d19e7c39297ec63af2e8c64f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-15 19:10:21 +0200
+commit c5f6d79cc9515a7f22d7ea4860c6cc394b295732
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 00:36:47 +0800
- Translations: Update the Korean translation.
+ Build: Add support for ARM64 CRC32 instruction detection.
+
+ This adds --enable-arm64-crc32/--disable-arm64-crc32 (enabled by
+ default) for using the ARM64 CRC32 instruction. This can be disabled if
+ one knows the binary will never need to run on an ARM64 machine
+ with this instruction extension.
- po/ko.po | 652 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 371 insertions(+), 281 deletions(-)
+ configure.ac | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 52 insertions(+)
-commit 16ac05677292f7e21a4feaddcfb2ab062ea5f385
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-15 19:09:28 +0200
+commit 849d0f282a6a890c5cf5a0e0f02980b12d9ebb0f
+Author: Chenxi Mao <chenxi.mao2013@gmail.com>
+Date: 2024-01-09 17:23:11 +0800
- Translations: Update the Turkish translation.
+ Speed up CRC32 calculation on ARM64
+
+ The CRC32 instructions in ARM64 can calculate the CRC32 result
+ for 8 bytes in a single operation, making the use of ARM64
+ instructions much faster compared to the general CRC32 algorithm.
+
+ Optimized CRC32 will be enabled if ARM64 has CRC extension
+ running on Linux.
+
+ Signed-off-by: Chenxi Mao <chenxi.mao2013@gmail.com>
- po/tr.po | 568 ++++++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 310 insertions(+), 258 deletions(-)
+ CMakeLists.txt | 1 +
+ src/liblzma/check/Makefile.inc | 3 +-
+ src/liblzma/check/crc32_aarch64.h | 109 ++++++++++++++++++++++++++++++++++++++
+ src/liblzma/check/crc32_fast.c | 5 +-
+ src/liblzma/check/crc64_fast.c | 5 +-
+ src/liblzma/check/crc_common.h | 16 +++---
+ 6 files changed, 130 insertions(+), 9 deletions(-)
-commit b9a67d9a5fa207062d4aa8a01639234609315d31
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-15 10:58:39 +0200
+commit b43c3e48bf6097095eef36d44cdbec811074940a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-26 19:05:51 +0800
- Bump version number for 5.3.4alpha.
+ Bump version number for 5.5.1alpha.
src/liblzma/api/lzma/version.h | 2 +-
src/liblzma/liblzma_generic.map | 2 +-
src/liblzma/liblzma_linux.map | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
-commit 5b999ba289b3280457b7386b9ac65dbbdf1575a5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-15 10:54:40 +0200
+commit c7a7ae1500ea90bd3c2d54533e4f433933eb598f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-26 19:00:52 +0800
- Add NEWS for 5.3.4alpha.
+ Add NEWS for 5.5.1alpha
- NEWS | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 96 insertions(+)
+ NEWS | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 80 insertions(+)
-commit ce8db9e37da4f6c87691c5066f51f91f2411c44a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-15 10:54:08 +0200
+commit 0ef8192e8d5af4e6200d5d4aee22d1f177f7a2df
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-26 18:54:24 +0800
- Add NEWS for 5.2.8.
+ Add NEWS for 5.4.6.
- NEWS | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 79 insertions(+)
+ NEWS | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
-commit b56bc8251d2736224af6bdaaae734ceb8926a879
+commit 93de7e751d17731315a899264f2a7239d7d2d316
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 23:19:57 +0200
+Date: 2024-01-24 20:00:57 +0200
- Revert "liblzma: Simple/BCJ filters: Allow disabling generic BCJ options."
-
- This reverts commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8
- and also does equivalent change to arm64.c.
+ Move doc/logo/xz-logo.png to "doc" and Doxygen footer to "doxygen".
- Now that ARM64 filter will use lzma_options_bcj, this change
- is not needed anymore.
+ The footer isn't a complete HTML file so having it in the doxygen
+ directory is a tiny bit clearer.
- src/liblzma/simple/arm.c | 2 +-
- src/liblzma/simple/arm64.c | 2 +-
- src/liblzma/simple/armthumb.c | 2 +-
- src/liblzma/simple/ia64.c | 2 +-
- src/liblzma/simple/powerpc.c | 2 +-
- src/liblzma/simple/simple_coder.c | 4 ++--
- src/liblzma/simple/simple_private.h | 2 +-
- src/liblzma/simple/sparc.c | 2 +-
- src/liblzma/simple/x86.c | 3 +--
- 9 files changed, 10 insertions(+), 11 deletions(-)
+ Makefile.am | 2 +-
+ doc/{logo => }/xz-logo.png | Bin
+ doxygen/Doxyfile | 4 ++--
+ doc/logo/copyright.html => doxygen/footer.html | 0
+ 4 files changed, 3 insertions(+), 3 deletions(-)
-commit 8370ec8edf9ddf8d1d9fef03d8d1027503ec4c35
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 23:14:41 +0200
+commit 00fa01698df51c58ae2acf8c7fa4e1fb159f75a9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-09 17:05:01 +0800
- Replace the experimental ARM64 filter with a new experimental version.
+ README: Add COPYING.CC-BY-SA-4.0 entry to section 1.1.
- This is incompatible with the previous version.
+ The Overall documentation section (1.1) table spacing had to be adjusted
+ since the filename was very long.
+
+ README | 38 ++++++++++++++++++++------------------
+ 1 file changed, 20 insertions(+), 18 deletions(-)
+
+commit e280470040b27c5e58d78b25b9e2bb71fc6c3882
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-09 16:56:16 +0800
+
+ Build: Add the logo and license to the release.
+
+ Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit b1ee6cf259bb49ce91abe9f622294524e37edf4c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-09 16:44:42 +0800
+
+ COPYING: Add the license for the XZ logo.
+
+ COPYING | 5 +
+ COPYING.CC-BY-SA-4.0 | 427 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 432 insertions(+)
+
+commit 31293ae7074802cc7286089a89c7b552d930c97f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-09 16:40:56 +0800
+
+ Doxygen: Added the XZ logo and copyright information.
- This has space/tab fixes in filter_*.c and bcj.h too.
+ The PROJECT_LOGO field is now used to include the XZ logo. The footer
+ of each page now lists the copyright information instead of the default
+ footer. The license is also copied to statisfy the copyright and so the
+ link in the documentation can be local.
- src/liblzma/api/lzma/bcj.h | 41 +-----
- src/liblzma/common/filter_common.c | 14 +-
- src/liblzma/common/filter_decoder.c | 12 +-
- src/liblzma/common/filter_encoder.c | 17 +--
- src/liblzma/simple/arm64.c | 283 ++++++++++++++----------------------
- src/liblzma/simple/simple_decoder.h | 4 -
- src/liblzma/simple/simple_encoder.h | 2 -
- src/xz/args.c | 2 +-
- src/xz/message.c | 13 +-
- src/xz/options.c | 39 -----
- src/xz/options.h | 7 -
- 11 files changed, 147 insertions(+), 287 deletions(-)
+ doc/logo/copyright.html | 11 +++++++++++
+ doc/logo/xz-logo.png | Bin 0 -> 6771 bytes
+ doxygen/Doxyfile | 6 +++---
+ 3 files changed, 14 insertions(+), 3 deletions(-)
-commit f644473a211394447824ea00518d0a214ff3f7f2
+commit 6daa4d0ea46a8441f21f609149f3633158bf4704
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 21:34:57 +0200
+Date: 2024-01-23 18:29:28 +0200
- liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL.
+ xz: Use threaded mode by defaut (as if --threads=0 was used).
- It also works on E2K as it supports these intrinsics.
+ This hopefully does more good than bad:
- On x86-64 runtime detection is used so the code keeps working on
- older processors too. A CLMUL-only build can be done by using
- -msse4.1 -mpclmul in CFLAGS and this will reduce the library
- size since the generic implementation and its 8 KiB lookup table
- will be omitted.
+ + It's faster by default.
- On 32-bit x86 this isn't used by default for now because by default
- on 32-bit x86 the separate assembly file crc64_x86.S is used.
- If --disable-assembler is used then this new CLMUL code is used
- the same way as on 64-bit x86. However, a CLMUL-only build
- (-msse4.1 -mpclmul) won't omit the 8 KiB lookup table on
- 32-bit x86 due to a currently-missing check for disabled
- assembler usage.
+ + Only the threaded compressor creates files that
+ can be decompressed in threaded mode.
- The configure.ac check should be such that the code won't be
- built if something in the toolchain doesn't support it but
- --disable-clmul-crc option can be used to unconditionally
- disable this feature.
+ - Compression ratio is worse, usually not too much though.
+ When it matters, -T1 must be used.
- CLMUL speeds up decompression of files that have compressed very
- well (assuming CRC64 is used as a check type). It is know that
- the CLMUL code is significantly slower than the generic code for
- tiny inputs (especially 1-8 bytes but up to 16 bytes). If that
- is a real-world problem then there is already a commented-out
- variant that uses the generic version for small inputs.
+ - Memory usage increases.
- Thanks to Ilya Kurdyukov for the original patch which was
- derived from a white paper from Intel [1] (published in 2009)
- and public domain code from [2] (released in 2016).
+ - Scripts that assume single-threaded mode but don't use -T1 will
+ possibly use too much resources, for example, if they run
+ multiple xz processes in parallel to compress multiple files.
- [1] https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
- [2] https://github.com/rawrunprotected/crc
+ - Output from single-threaded and multi-threaded compressors
+ differ but such changes could happen for other reasons too
+ (they just haven't happened since 5.0.0).
- CMakeLists.txt | 26 ++-
- INSTALL | 12 ++
- configure.ac | 59 +++++-
- src/liblzma/check/crc64_fast.c | 449 +++++++++++++++++++++++++++++++++++++++-
- src/liblzma/check/crc64_table.c | 21 +-
- 5 files changed, 554 insertions(+), 13 deletions(-)
+ src/xz/hardware.c | 6 +++++-
+ src/xz/message.c | 4 ++--
+ src/xz/xz.1 | 9 +++++++++
+ 3 files changed, 16 insertions(+), 3 deletions(-)
-commit 3b466bc79672bb2b06d1245a500588e6026e0ba0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 20:14:34 +0200
+commit a2dd2dc8e5307a7280bb99868bc478560facba2c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-23 23:52:49 +0800
- Translations: Update the Swedish translation one more time.
+ CI: Use RISC-V filter when building with BCJ support.
- po/sv.po | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ build-aux/ci_build.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit e963379a8622ebdff6ce78e76b803bcd1e1d16d6
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 19:34:15 +0200
+commit 3060e1070b2421b26c0e17794c1307ec5622f11d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-23 23:52:14 +0800
- Translations: Update the Swedish translation again.
+ Tests: Use smaller dictionary size in RISC-V test files.
- po/sv.po | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
+ tests/files/good-1-riscv-lzma2-1.xz | Bin 7512 -> 7512 bytes
+ tests/files/good-1-riscv-lzma2-2.xz | Bin 7516 -> 7512 bytes
+ 2 files changed, 0 insertions(+), 0 deletions(-)
-commit a4bc689a823a2254f29ac9d233170add5121b307
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 19:07:45 +0200
+commit 44ff2fa5c94dc345c4dd69195a19fc5238df60b3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-23 23:50:57 +0800
- Translations: Update the Swedish translation.
+ Tests: Skip RISC-V test files if decoder was not built.
- po/sv.po | 671 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 382 insertions(+), 289 deletions(-)
+ tests/test_files.sh | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit bbf2073d824ab4ba33bed4b77f467435abd333a5
+commit 6133a3f30049d3beaf7d22535b1e5d38e109be4e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 18:58:09 +0200
+Date: 2024-01-23 16:11:54 +0200
- Translations: Update the Ukrainian translation.
+ xz: Man page: Add more examples of LZMA2 options with BCJ filters.
- po/uk.po | 618 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 354 insertions(+), 264 deletions(-)
+ src/xz/xz.1 | 38 +++++++++++++++++++++++++++++++-------
+ 1 file changed, 31 insertions(+), 7 deletions(-)
-commit ac10b1b3622e70881595586edfb8a3ebdcd76bb6
+commit 50255feeaabcc7e7db22b858a6bd64a9b5b4f16d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 17:58:07 +0200
+Date: 2024-01-23 00:09:48 +0200
- Build: Omit x86_64 from --enable-assembler.
+ liblzma: RISC-V filter: Use byte-by-byte access.
- It didn't do anything. There are only 32-bit x86 assembly files
- and it feels likely that new files won't be added as intrinsics
- in C are more portable across toolchains and OSes.
-
- configure.ac | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-commit eb0f1450ad9f23dac03050d9c8375980240aee21
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-14 16:00:52 +0200
-
- liblzma: Use __attribute__((__constructor__)) if available.
+ Not all RISC-V processors support fast unaligned access so
+ it's better to read only one byte in the main loop. This can
+ be faster even on x86-64 when compared to reading 32 bits at
+ a time as half the time the address is only 16-bit aligned.
- This uses it for CRC table initializations when using --disable-small.
- It avoids mythread_once() overhead. It also means that then
- --disable-small --disable-threads is thread-safe if this attribute
- is supported.
+ The downside is larger code size on archs that do support
+ fast unaligned access.
- CMakeLists.txt | 15 +++++++++++++++
- INSTALL | 4 +++-
- configure.ac | 31 ++++++++++++++++++++++++++++---
- src/liblzma/check/crc32_small.c | 7 +++++++
- src/liblzma/check/crc64_small.c | 5 +++++
- src/liblzma/lz/lz_encoder.c | 2 +-
- 6 files changed, 59 insertions(+), 5 deletions(-)
+ src/liblzma/simple/riscv.c | 114 +++++++++++++++++++++++++++++++++------------
+ 1 file changed, 84 insertions(+), 30 deletions(-)
-commit 6553f49b11dafad35c73b05f12e14865ea1fd8a1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-12 21:19:52 +0200
+commit db5eb5f563e8baa8d912ecf576f53391ff861596
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Romanian translation.
+ xz: Update xz -lvv for RISC-V filter.
+
+ Version 5.6.0 will be shown, even though upcoming alphas and betas
+ will be able to support this filter. 5.6.0 looks nicer in the output and
+ people shouldn't be encouraged to use an unstable version in production
+ in any way.
- po/ro.po | 651 +++++++++++++++++++++++++++++++++++++--------------------------
- 1 file changed, 380 insertions(+), 271 deletions(-)
+ src/xz/list.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit db97e69e12393becc29f8febd53133d0d36989bd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-12 21:17:45 +0200
+commit e2870db5be1503e6a489fc3d47daf950d6f62723
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Hungarian translation.
+ Tests: Add two RISC-V Filter test files.
+
+ These test files achieve 100% code coverage in
+ src/liblzma/simple/riscv.c. They contain all of the instructions that
+ should be filtered and a few cases that should not.
- po/hu.po | 625 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 357 insertions(+), 268 deletions(-)
+ tests/files/README | 8 ++++++++
+ tests/files/good-1-riscv-lzma2-1.xz | Bin 0 -> 7512 bytes
+ tests/files/good-1-riscv-lzma2-2.xz | Bin 0 -> 7516 bytes
+ 3 files changed, 8 insertions(+)
-commit 2bbb9c0f3829a8b121b36998d273a6c6f92000f4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:58:57 +0200
+commit b26a89869315ece2f6d9d10d32d45f672550f245
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Finnish translation.
+ xz: Update message in --long-help for RISC-V Filter.
- po/fi.po | 610 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 348 insertions(+), 262 deletions(-)
+ src/xz/message.c | 1 +
+ 1 file changed, 1 insertion(+)
-commit 3c8cbb8137b6f8ed9416c1209d73cdbcb015251f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:58:18 +0200
+commit 283f778908873eca61388029fc418fa800c9d7d7
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Croatian translation.
+ xz: Update the man page for the RISC-V Filter.
+
+ A special note was added to suggest using four-byte alignment when the
+ compressed instruction extension is not present in a RISC-V binary.
- po/hr.po | 680 +++++++++++++++++++++++++++++++++++----------------------------
- 1 file changed, 381 insertions(+), 299 deletions(-)
+ src/xz/xz.1 | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 26c3359eac0988d6f3986735cd1363bec1678e8e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:57:18 +0200
+commit ac3691ccca051d67f60b4a3b05b88e511d0b1b28
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Polish translation.
+ Tests: Add RISC-V Filter test in test_compress.sh.
- po/pl.po | 569 ++++++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 309 insertions(+), 260 deletions(-)
+ tests/test_compress.sh | 1 +
+ 1 file changed, 1 insertion(+)
-commit 577e467b137c735afb8de6ae71ac7a73c2960cc4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:56:44 +0200
+commit 2959dbc7358efcf421ce51bc9cd7eae8fdd8fec4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Translations: Update the Spanish translation.
+ liblzma: Update string_conversion.c to support RISC-V Filter.
- po/es.po | 598 ++++++++++++++++++++++++++++++++++++---------------------------
- 1 file changed, 344 insertions(+), 254 deletions(-)
+ src/liblzma/common/string_conversion.c | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit f9b4ff6e9a0f1678650775582d3e4fe782abce97
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:16:03 +0200
+commit 34372a5adbe5a7f6bf29498410ba3a463a720966
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- Update THANKS.
+ CMake: Support RISC-V BCJ Filter for encoding and decoding.
- THANKS | 1 +
+ CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
-commit a39961ef211e1bf030b17edeea3cff29fe263b67
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 17:15:25 +0200
+commit 440a2eccb082dc13400c09e22308a58fef85146c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-22 23:33:39 +0800
- liblzma: Fix building with Intel ICC (the classic compiler).
+ liblzma: Add RISC-V BCJ filter.
+
+ The new Filter ID is 0x0B.
- It claims __GNUC__ >= 10 but doesn't support __symver__ attribute.
+ Thanks to Chien Wong <m@xv97.com> for the initial version of the Filter,
+ the xz CLI updates, and the Autotools build system modifications.
- Thanks to Stephen Sachs.
+ Thanks to Igor Pavlov for his many contributions to the design of
+ the filter.
- src/liblzma/common/common.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ configure.ac | 4 +-
+ src/liblzma/api/lzma/bcj.h | 5 +
+ src/liblzma/common/filter_common.c | 9 +
+ src/liblzma/common/filter_decoder.c | 8 +
+ src/liblzma/common/filter_encoder.c | 10 +
+ src/liblzma/simple/Makefile.inc | 4 +
+ src/liblzma/simple/riscv.c | 688 ++++++++++++++++++++++++++++++++++++
+ src/liblzma/simple/simple_coder.h | 9 +
+ src/xz/args.c | 7 +
+ 9 files changed, 742 insertions(+), 2 deletions(-)
-commit c715f683dcb1a817d565da292cddfbceda643e12
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 14:35:58 +0200
+commit 5540f4329bbdb4deb4850d4af48b18ad074bba19
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-19 23:08:14 +0800
- liblzma: Fix incorrect #ifdef for x86 SSE2 support.
+ Docs: Update .xz file format specification to 1.2.0.
- __SSE2__ is the correct macro for SSE2 support with GCC, Clang,
- and ICC. __SSE2_MATH__ means doing floating point math with SSE2
- instead of 387. Often the latter macro is defined if the first
- one is but it was still a bug.
+ The new RISC-V filter was added to the specification, in addition to
+ updating the specification URL.
- src/liblzma/common/memcmplen.h | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
+ doc/xz-file-format.txt | 29 +++++++++++++++++------------
+ 1 file changed, 17 insertions(+), 12 deletions(-)
-commit bd334ae56afe7f642ad4d0f1ac19e74e82daa1ce
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 13:27:06 +0200
+commit 22d86192f8cf00902a1f90ee2a83ca600794459b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-19 23:08:14 +0800
- Add NEWS for 5.2.7 (forgotten cherry-pick from v5.2).
+ xz: Update website URLs in the man pages.
- NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 74 insertions(+)
+ src/xz/xz.1 | 6 +++---
+ src/xzdec/xzdec.1 | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
-commit 3c7860cf49de6f81046b3a4034a89f3a4803a576
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 13:16:21 +0200
+commit 6b63c4c6139fa1bb21b570521d3d2b4a608bc34d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-19 23:08:14 +0800
- xzdiff: Add support for .lz files.
-
- The other scripts don't need changes for .lz support because
- in those scripts it is enough that xz supports .lz.
+ liblzma: Update website URL.
- src/scripts/xzdiff.in | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ dos/config.h | 2 +-
+ src/liblzma/api/lzma.h | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
-commit d76c752a6d77052e5ad57ade555082585f7ac5d8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-11 12:23:58 +0200
+commit fce4758018f3a3589236f3fe7999fd9dd08c77e9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-19 23:08:14 +0800
- Scripts: Ignore warnings from xz.
-
- In practice this means making the scripts work when
- the input files have an unsupported check type which
- isn't a problem in practice unless support for
- some check types has been disabled at build time.
+ Docs: Update website URLs.
- src/scripts/xzdiff.in | 5 +++--
- src/scripts/xzgrep.in | 2 +-
- src/scripts/xzless.in | 4 ++--
- src/scripts/xzmore.in | 4 ++--
- 4 files changed, 8 insertions(+), 7 deletions(-)
+ .github/SECURITY.md | 2 +-
+ COPYING | 3 ++-
+ README | 4 ++--
+ doc/faq.txt | 2 +-
+ doc/lzma-file-format.txt | 18 +++++++++---------
+ windows/README-Windows.txt | 3 ++-
+ 6 files changed, 17 insertions(+), 15 deletions(-)
-commit 6552535afd1fe29d726ab6e68cf14ce3624fd48c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-10 12:34:43 +0200
+commit c26812c5b2c8a2a47f43214afe6b0b840c73e4f5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2024-01-19 23:08:14 +0800
- Translations: Rename poa4/fr_FR.po to po4a/fr.po.
-
- That's how it is preferred at the Translation Project.
- On my system /usr/share/man/fr_FR doesn't contain any
- other man pages than XZ Utils while /usr/share/man/fr
- has quite a few, so this will fix that too.
-
- Thanks to Benno Schulenberg from the Translation Project.
+ Build: Update website URL.
- po4a/{fr_FR.po => fr.po} | 0
- po4a/po4a.conf | 2 +-
- 2 files changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit 0918159ce4c75bfb60aff0193b559f8a9f41d25a
+commit fbb3ce541ef79cad1710e88a27a5babb5f6f8e5b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 18:48:50 +0200
+Date: 2024-01-11 15:01:50 +0200
- xz: Update the man page about BCJ filters, including upcoming --arm64.
-
- The --arm64 isn't actually implemented yet in the form
- described in this commit.
-
- Thanks to Jia Tan.
+ liblzma: CRC: Add a comment to crc_x86_clmul.h about BUILDING_ macros.
- src/xz/xz.1 | 66 +++++++++++++++++++++++++++----------------------------------
- 1 file changed, 29 insertions(+), 37 deletions(-)
+ src/liblzma/check/crc_x86_clmul.h | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit ba2ae3596f6be1587495f33b367488f6e00e56f1
+commit 4f518c1b6b7b7ce5dcefea81acd44d7a086a8882
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 18:14:14 +0200
+Date: 2024-01-11 15:22:36 +0200
- xz: Add --arm64 to --long-help and omit endianness from ARM(-Thumb).
-
- Modern 32-bit ARM in big endian mode use little endian for
- instruction encoding still, so the filters work on such
- executables too. It's likely less confusing for users this way.
-
- The --arm64 option hasn't been implemented yet (there is
- --experimental-arm64 but it's different). The --arm64 option
- is added now anyway because this is the likely result and the
- strings need to be ready for translators.
+ liblzma: CRC: Remove crc_always_inline, use lzma_always_inline instead.
- Thanks to Jia Tan.
+ Now crc_simd_body() in crc_x86_clmul.h is only called once
+ in a translation unit, we no longer need to be so cautious
+ about ensuring the always-inline behavior.
- src/xz/message.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ src/liblzma/check/crc_common.h | 20 --------------------
+ src/liblzma/check/crc_x86_clmul.h | 2 +-
+ 2 files changed, 1 insertion(+), 21 deletions(-)
-commit 802d57d9215d9c81dbee86edb43c9e93a7f7ec55
+commit 35c03ec6bf66f1b159964c9721a2dce0e2859b20
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 15:12:13 +0200
+Date: 2024-01-11 14:39:46 +0200
- Windows: Update the VS project files for ARM64 and .lz support.
+ liblzma: CRC: Update CLMUL comments to more generic wording.
- windows/vs2013/config.h | 9 +++++++++
- windows/vs2013/liblzma.vcxproj | 5 ++++-
- windows/vs2013/liblzma_dll.vcxproj | 5 ++++-
- windows/vs2017/config.h | 9 +++++++++
- windows/vs2017/liblzma.vcxproj | 3 +++
- windows/vs2017/liblzma_dll.vcxproj | 3 +++
- windows/vs2019/config.h | 9 +++++++++
- windows/vs2019/liblzma.vcxproj | 5 ++++-
- windows/vs2019/liblzma_dll.vcxproj | 5 ++++-
- 9 files changed, 49 insertions(+), 4 deletions(-)
+ src/liblzma/check/crc32_fast.c | 16 ++++++++--------
+ src/liblzma/check/crc64_fast.c | 10 +++++-----
+ 2 files changed, 13 insertions(+), 13 deletions(-)
-commit 5846aeda05972bc803c6094821ae836229ebe691
+commit 66f080e8016129576536482ac377e2ecac7a2b90
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 14:57:48 +0200
+Date: 2024-01-10 18:23:31 +0200
- DOS: Update Makefile and config.h to include ARM64 and .lz support.
+ liblzma: Rename arch-specific CRC functions and macros.
+
+ CRC_CLMUL was split to CRC_ARCH_OPTIMIZED and CRC_X86_CLMUL.
+ CRC_ARCH_OPTIMIZED is defined when an arch-optimized version is used.
+ Currently the x86 CLMUL implementations are the only arch-optimized
+ versions, and these also use the CRC_x86_CLMUL macro to tell when
+ crc_x86_clmul.h needs to be included.
+
+ is_clmul_supported() was renamed to is_arch_extension_supported().
+ crc32_clmul() and crc64_clmul() were renamed to
+ crc32_arch_optimized() and crc64_arch_optimized().
+ This way the names make sense with arch-specific non-CLMUL
+ implementations as well.
- dos/Makefile | 2 ++
- dos/config.h | 9 +++++++++
- 2 files changed, 11 insertions(+)
+ src/liblzma/check/crc32_fast.c | 13 +++++++------
+ src/liblzma/check/crc64_fast.c | 13 +++++++------
+ src/liblzma/check/crc_common.h | 9 ++++++---
+ src/liblzma/check/crc_x86_clmul.h | 21 +++++++++++----------
+ 4 files changed, 31 insertions(+), 25 deletions(-)
-commit 781da8d6c44de6aa278c916375250668a0b107f2
+commit 3dbed75b0b9c7087c76fe687acb5cf582cd57b99
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 14:45:05 +0200
+Date: 2024-01-10 18:19:21 +0200
- CMake: Add lzip decoder files and #define to the build.
+ liblzma: Fix a comment in crc_common.h.
- CMakeLists.txt | 3 +++
- 1 file changed, 3 insertions(+)
+ src/liblzma/check/crc_common.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit df8ad4af65a9c4846b108550d0083770a69dee64
+commit 419f55f9dfc2df8792902b8953d50690121afeea
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 14:41:56 +0200
+Date: 2023-10-20 23:35:10 +0300
- Docs: Update INSTALL and also add new prohibited options to PACKAGERS.
+ liblzma: Avoid extern lzma_crc32_clmul() and lzma_crc64_clmul().
+
+ A CLMUL-only build will have the crcxx_clmul() inlined into
+ lzma_crcxx(). Previously a jump to the extern lzma_crcxx_clmul()
+ was needed. Notes about shared liblzma on ELF platforms:
+
+ - On platforms that support ifunc and -fvisibility=hidden, this
+ was silly because CLMUL-only build would have that single extra
+ jump instruction of extra overhead.
+
+ - On platforms that support neither -fvisibility=hidden nor linker
+ version script (liblzma*.map), jumping to lzma_crcxx_clmul()
+ would go via PLT so a few more instructions of overhead (still
+ not a big issue but silly nevertheless).
+
+ There was a downside with static liblzma too: if an application only
+ needs lzma_crc64(), static linking would make the linker include the
+ CLMUL code for both CRC32 and CRC64 from crc_x86_clmul.o even though
+ the CRC32 code wouldn't be needed, thus increasing code size of the
+ executable (assuming that -ffunction-sections isn't used).
+
+ Also, now compilers are likely to inline crc_simd_body()
+ even if they don't support the always_inline attribute
+ (or MSVC's __forceinline). Quite possibly all compilers
+ that build the code do support such an attribute. But now
+ it likely isn't a problem even if the attribute wasn't supported.
+
+ Now all x86-specific stuff is in crc_x86_clmul.h. If other archs
+ The other archs can then have their own headers with their own
+ is_clmul_supported() and crcxx_clmul().
+
+ Another bonus is that the build system doesn't need to care if
+ crc_clmul.c is needed.
+
+ is_clmul_supported() stays as inline function as it's not needed
+ when doing a CLMUL-only build (avoids a warning about unused function).
- INSTALL | 49 +++++++++++++++++++++++++++++++++++++++++--------
- PACKAGERS | 2 ++
- 2 files changed, 43 insertions(+), 8 deletions(-)
+ CMakeLists.txt | 7 +-
+ configure.ac | 1 -
+ src/liblzma/check/Makefile.inc | 6 +-
+ src/liblzma/check/crc32_fast.c | 9 ++-
+ src/liblzma/check/crc64_fast.c | 9 ++-
+ src/liblzma/check/crc_common.h | 64 ----------------
+ src/liblzma/check/{crc_clmul.c => crc_x86_clmul.h} | 86 ++++++++++++++++++----
+ 7 files changed, 91 insertions(+), 91 deletions(-)
-commit c8ef089c149afaab413c3a51be827dd1d11afe0e
+commit e3833e297dfb5021a197bda34ba2a795e30aaf8a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-20 17:39:06 +0300
+Date: 2023-10-21 00:06:52 +0300
- Tests: Test the .lz files in test_files.sh.
+ liblzma: crc_clmul.c: Add crc_attr_target macro.
+
+ This reduces the number of the complex #if directives.
- tests/test_files.sh | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
+ src/liblzma/check/crc_clmul.c | 30 ++++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 14 deletions(-)
-commit c8f70ebb4628ceb6cb29cc9195d9deadf69d2bd7
+commit d164ac0e62904126f7920c25f9a2875c8cd28b97
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-20 15:35:59 +0300
+Date: 2023-10-20 22:49:48 +0300
- Tests: Add .lz (lzip) test files.
+ liblzma: Simplify existing cases with lzma_attr_no_sanitize_address.
- tests/files/README | 109 +++++++++++++++++++++++++++++----
- tests/files/bad-1-v0-uncomp-size.lz | Bin 0 -> 42 bytes
- tests/files/bad-1-v1-crc32.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-dict-1.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-dict-2.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-magic-1.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-magic-2.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-member-size.lz | Bin 0 -> 50 bytes
- tests/files/bad-1-v1-trailing-magic.lz | Bin 0 -> 54 bytes
- tests/files/bad-1-v1-uncomp-size.lz | Bin 0 -> 50 bytes
- tests/files/good-1-v0-trailing-1.lz | Bin 0 -> 59 bytes
- tests/files/good-1-v0.lz | Bin 0 -> 42 bytes
- tests/files/good-1-v1-trailing-1.lz | Bin 0 -> 67 bytes
- tests/files/good-1-v1-trailing-2.lz | Bin 0 -> 70 bytes
- tests/files/good-1-v1.lz | Bin 0 -> 50 bytes
- tests/files/good-2-v0-v1.lz | Bin 0 -> 78 bytes
- tests/files/good-2-v1-v0.lz | Bin 0 -> 78 bytes
- tests/files/good-2-v1-v1.lz | Bin 0 -> 86 bytes
- tests/files/unsupported-1-v234.lz | Bin 0 -> 50 bytes
- 19 files changed, 98 insertions(+), 11 deletions(-)
+ src/liblzma/check/crc_clmul.c | 12 +++---------
+ 1 file changed, 3 insertions(+), 9 deletions(-)
-commit 731db13e6fa3ad3e3fc786c0ccf6eac4cce6865f
+commit 9523c1300d22fa715765c181cf991d14d6112fb1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-19 22:32:51 +0300
+Date: 2023-10-20 21:53:35 +0300
- xz: Remove the commented-out FORMAT_GZIP, gzip, .gz, and .tgz.
+ liblzma: #define crc_attr_no_sanitize_address in crc_common.h.
- src/xz/args.c | 2 --
- src/xz/coder.h | 1 -
- src/xz/suffix.c | 9 ---------
- 3 files changed, 12 deletions(-)
+ src/liblzma/check/crc_common.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit 3176f992c55b8d788c4633809aaf9447376a5a12
+commit 93d144f0930821590524247bd174afd38003d7f0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-08 21:28:15 +0300
+Date: 2023-10-20 23:25:14 +0300
- xz: Add .lz (lzip) decompression support.
+ liblzma: CRC: Add empty lines.
- If configured with --disable-lzip-decoder then --long-help will
- still list `lzip' in --format but I left it like that since
- due to translations it would be messy to have two help strings.
- Features are disabled only in special situations so wrong help
- in such a situation shouldn't matter much.
-
- Thanks to Michał Górny for the original patch.
+ And remove one too.
- src/xz/args.c | 9 ++++++++
- src/xz/coder.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
- src/xz/coder.h | 3 +++
- src/xz/message.c | 2 +-
- src/xz/suffix.c | 26 ++++++++++++++++++----
- src/xz/xz.1 | 46 +++++++++++++++++++++++++++++++++-----
- 6 files changed, 141 insertions(+), 13 deletions(-)
+ src/liblzma/check/crc32_fast.c | 2 ++
+ src/liblzma/check/crc64_fast.c | 3 +++
+ src/liblzma/check/crc_clmul.c | 1 -
+ 3 files changed, 5 insertions(+), 1 deletion(-)
-commit 034086e1ae1459210837a24e04878435c86dc41b
+commit 0c7e854ffd27f1cec2e9b0e61601d6f90bfa10ae
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-08 00:29:20 +0300
+Date: 2023-10-20 23:19:33 +0300
- liblzma: Add .lz support to lzma_auto_decoder().
+ liblzma: crc_clmul.c: Tidy up the location of MSVC pragma.
- Thanks to Michał Górny for the original patch.
+ It makes no difference in practice.
- src/liblzma/api/lzma/container.h | 10 ++++++----
- src/liblzma/common/Makefile.inc | 3 ++-
- src/liblzma/common/auto_decoder.c | 23 +++++++++++++++++------
- src/liblzma/common/lzip_decoder.h | 22 ++++++++++++++++++++++
- 4 files changed, 47 insertions(+), 11 deletions(-)
+ src/liblzma/check/crc_clmul.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 0538db038f3cdc352007dacb42454aa1806b8e40
+commit 15cf3f04f270d707a5c91cc0208b23b6db42b774
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-06 15:50:20 +0300
+Date: 2023-12-20 21:16:24 +0200
- liblzma: Add .lz (lzip) decompression support (format versions 0 and 1).
-
- Support for format version 0 was removed from lzip 1.18 for some
- reason. .lz format version 0 files are rare (and old) but some
- source packages were released in this format, and some people might
- have personal files in this format too. It's very little extra code
- to support it along side format version 1 so this commits adds
- support for both.
-
- The Sync Flush marker extentension to the original .lz format
- version 1 isn't supported. It would require changes to the
- LZMA decoder itself. Such files are very rare anyway.
-
- See the API doc for lzma_lzip_decoder() for more details about
- the .lz format support.
-
- Thanks to Michał Górny for the original patch.
+ Update THANKS.
- configure.ac | 21 ++
- src/liblzma/api/lzma/container.h | 62 +++++-
- src/liblzma/common/Makefile.inc | 5 +
- src/liblzma/common/lzip_decoder.c | 413 ++++++++++++++++++++++++++++++++++++++
- src/liblzma/liblzma_generic.map | 1 +
- src/liblzma/liblzma_linux.map | 1 +
- 6 files changed, 501 insertions(+), 2 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 633d48a075b9ce4b9c08a7a56a7eb4cabc18100c
+commit cd64dd70d5665b6048829c45772d08606f44672e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 14:17:23 +0200
+Date: 2023-12-20 21:15:16 +0200
- liblzma: Add the missing Makefile.inc change for --disable-microlzma.
+ liblzma: Use 8-byte method in memcmplen.h on ARM64.
- This was forgotten from commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8.
-
- src/liblzma/common/Makefile.inc | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-commit 724285dadbdc88765c8fb83eab9816575a260966
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 14:10:52 +0200
-
- xz: Add comments about stdin and src_st.st_size.
+ It requires fast unaligned access to 64-bit integers
+ and a fast instruction to count leading zeros in
+ a 64-bit integer (__builtin_ctzll()). This perhaps
+ should be enabled on some other archs too.
- "xz -v < regular_file > out.xz" doesn't display the percentage
- and estimated remaining time because it doesn't even try to
- check the input file size when input is read from stdin.
- This could be improved but for now there's just a comment
- to remind about it.
-
- src/xz/coder.c | 9 +++++++++
- src/xz/file_io.c | 4 ++++
- 2 files changed, 13 insertions(+)
-
-commit f723eec68b0e44234910f669a29119de33018967
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 12:48:22 +0200
-
- xz: Fix displaying of file sizes in progress indicator in passthru mode.
+ Thanks to Chenxi Mao for the original patch:
+ https://github.com/tukaani-project/xz/pull/75 (the first commit)
+ According to the numbers there, this may improve encoding
+ speed by about 3-5 %.
- It worked for one input file since the counters are zero when
- xz starts but they weren't reset when starting a new file in
- passthru mode. For example, if files A, B, and C are one byte each,
- then "xz -dcvf A B C" would show file sizes as 1, 2, and 3 bytes
- instead of 1, 1, and 1 byte.
+ This enables the 8-byte method on MSVC ARM64 too which
+ should work but wasn't tested.
- src/xz/coder.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
+ src/liblzma/common/memcmplen.h | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
-commit 69265d0f223ddf1d66f799b8b047df22923e376f
+commit 12c90c00f05e19da3c0c91d8cd8e0d0d45965606
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-09 11:27:20 +0200
+Date: 2023-12-20 21:01:06 +0200
- xz: Add a comment why --to-stdout is not in --help.
+ liblzma: Check also for __clang__ in memcmplen.h.
- It is on the man page still.
+ This change hopefully makes no practical difference as Clang
+ likely was detected via __GNUC__ or _MSC_VER already.
- src/xz/message.c | 3 +++
- 1 file changed, 3 insertions(+)
+ src/liblzma/common/memcmplen.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit fe6b8852a3c6a0eb5a3c33512e0a69af257d3bc7
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 23:05:37 +0200
+commit 133c5851eb917c6d99d0b623c1689c8518e65f38
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-21 21:39:08 +0800
- xz: Make xz -lvv show that the upcoming --arm64 needs 5.4.0 to decompress.
+ Translations: Update the French translation.
- src/xz/list.c | 20 +++++++++++++++-----
- 1 file changed, 15 insertions(+), 5 deletions(-)
+ po/fr.po | 632 +++++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 370 insertions(+), 262 deletions(-)
-commit fb3f05ac9f2b4b0e3643401960fbeab31997ac7a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 22:26:54 +0200
+commit 710cbc186cad0ac601c38bd6bf31167648a5581e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-21 16:39:53 +0800
- Docs: Update faq.txt a little.
+ xz: Add a comment to Capsicum sandbox setup.
+
+ This comment is repeated in xzdec.c to help remind us why all the
+ capabilities are removed from stdin in certain situations.
- doc/faq.txt | 66 ++++++++++++++++++++++++++++++++++++++++---------------------
- 1 file changed, 43 insertions(+), 23 deletions(-)
+ src/xz/file_io.c | 1 +
+ 1 file changed, 1 insertion(+)
-commit 05331f091ec3b68eccbfb2a9a7a576072768fb4b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 16:57:17 +0200
+commit 4e1c695676bafbaecc9fb307f6ee94138ae72c12
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-20 22:19:19 +0800
- Translations: Update Turkish translation.
+ Docs: Update --enable-sandbox option in INSTALL.
+
+ xzdec now also uses the sandbox when its configured.
- po/tr.po | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ INSTALL | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
-commit ed3a4822963b4940d84e6f44d47277c394fc046d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 14:55:32 +0200
+commit ebddf20214143a8e002ab897e95e880bb4c5ac44
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-20 22:39:13 +0800
- Translations: Update Croatian translation.
+ CMake: Move sandbox detection outside of xz section.
+
+ The sandbox is now enabled for xzdec as well, so it no longer belongs
+ in just the xz section. xz and xzdec are always built, except for older
+ MSVC versions, so there isn't a need to conditionally show the sandbox
+ configuration. CMake will do a little unecessary work on older MSVC
+ versions that can't build xz or xzdec, but this is a very small
+ downside.
- po/hr.po | 190 ++++++++++++++++++++++++++++++++-------------------------------
- 1 file changed, 96 insertions(+), 94 deletions(-)
+ CMakeLists.txt | 178 +++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 98 insertions(+), 80 deletions(-)
-commit 4746f5ec721316bc4c6fec9905b2902e0360e0af
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 14:13:03 +0200
+commit 5feb09266fd2928ec0a4dcb98c1dc7f053111316
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-20 22:43:44 +0800
- liblzma: Update API docs about decoder flags.
+ Build: Allow sandbox to be configured for just xzdec.
+
+ If xz is disabled, then xzdec can still use the sandbox.
- src/liblzma/api/lzma/container.h | 21 +++++++++++++++++----
- 1 file changed, 17 insertions(+), 4 deletions(-)
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
-commit 8779a9db5d0cec00c9dc9e9965dd2dda04f9d80d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 14:01:50 +0200
+commit d74fb5f060b76db709b50f5fd37490394e52f975
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-19 21:18:28 +0800
- liblzma: Use the return_if_error() macro in alone_decoder.c.
+ xzdec: Add sandbox support for Pledge, Capsicum, and Landlock.
+
+ A very strict sandbox is used when the last file is decompressed. The
+ likely most common use case of xzdec is to decompress a single file.
+ The Pledge sandbox is applied to the entire process with slightly more
+ relaxed promises, until the last file is processed.
+
+ Thanks to Christian Weisgerber for the initial patch adding Pledge
+ sandboxing.
- src/liblzma/common/alone_decoder.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
+ src/xzdec/xzdec.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 139 insertions(+), 7 deletions(-)
-commit 3f4990b6822961e75cd9b4e2e82b1df63f6f8fcc
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 14:00:58 +0200
+commit b34b6a9912d6165e34ba0db151b7f9941d2e06d5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-20 21:31:34 +0800
- liblzma: Fix a comment in auto_decoder.c.
+ liblzma: Initialize lzma_lz_encoder pointers with NULL.
+
+ This fixes the recent change to lzma_lz_encoder that used memzero
+ instead of the NULL constant. On some compilers the NULL constant
+ (always 0) may not equal the NULL pointer (this only needs to guarentee
+ to not point to valid memory address).
+
+ Later code compares the pointers to the NULL pointer so we must
+ initialize them with the NULL pointer instead of 0 to guarentee
+ code correctness.
- src/liblzma/common/auto_decoder.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/lz/lz_encoder.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
-commit 026a5897c72a2041ae08ceec54ce8b1cdeb51334
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-08 13:43:19 +0200
+commit 183a62f0b540ff4d23cc19b2b6bc2525f0bd64df
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-16 20:51:38 +0800
- xz: Initialize the pledge(2) sandbox at the very beginning of main().
+ liblzma: Set all values in lzma_lz_encoder to NULL after allocation.
+
+ The first member of lzma_lz_encoder doesn't necessarily need to be set
+ to NULL since it will always be set before anything tries to use it.
+ However the function pointer members must be set to NULL since other
+ functions rely on this NULL value to determine if this behavior is
+ supported or not.
+
+ This fixes a somewhat serious bug, where the options_update() and
+ set_out_limit() function pointers are not set to NULL. This seems to
+ have been forgotten since these function pointers were added many years
+ after the original two (code() and end()).
+
+ The problem is that by not setting this to NULL we are relying on the
+ memory allocation to zero things out if lzma_filters_update() is called
+ on a LZMA1 encoder. The function pointer for set_out_limit() is less
+ serious because there is not an API function that could call this in an
+ incorrect way. set_out_limit() is only called by the MicroLZMA encoder,
+ which must use LZMA1 where set_out_limit() is always set. Its currently
+ not possible to call set_out_limit() on an LZMA2 encoder at this time.
- It feels better that the initializations are sandboxed too.
- They don't do anything that the pledge() call wouldn't allow.
+ So calling lzma_filters_update() on an LZMA1 encoder had undefined
+ behavior since its possible that memory could be manipulated so the
+ options_update member pointed to a different instruction sequence.
+
+ This is unlikely to be a bug in an existing application since it relies
+ on calling lzma_filters_update() on an LZMA1 encoder in the first place.
+ For instance, it does not affect xz because lzma_filters_update() can
+ only be used when encoding to the .xz format.
+
+ This is fixed by using memzero() to set all members of lzma_lz_encoder
+ to NULL after it is allocated. This ensures this mistake will not occur
+ here in the future if any additional function pointers are added.
- src/xz/main.c | 27 ++++++++++++++-------------
- 1 file changed, 14 insertions(+), 13 deletions(-)
+ src/liblzma/lz/lz_encoder.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
-commit 49a59f6ca001c3ce9affa2c162b437aad021b4d5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-07 22:51:16 +0200
+commit 1a1bb381db7a20cf86cb45a350e5cca35224d017
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-16 20:30:55 +0800
- xz: Extend --robot --info-memory output.
-
- Now it includes everything that the human-readable --info-memory shows.
+ liblzma: Tweak a comment.
- src/xz/hardware.c | 24 +++++++++++++++---------
- src/xz/xz.1 | 47 +++++++++++++++++++++++++++++++++++++++++------
- 2 files changed, 56 insertions(+), 15 deletions(-)
+ src/liblzma/lz/lz_encoder.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 5e2450c75cbac966c62cf2231c824f2cc91ddba8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-11-07 17:22:04 +0200
+commit 55810780e04f759747b02683fb8020b8cd022a85
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-16 20:28:21 +0800
- liblzma: Include cached memory in reported memusage in threaded decoder.
-
- This affects lzma_memusage() and lzma_memlimit_set() when used
- with the threaded decompressor. Now all allocations are reported
- by lzma_memusage() (so it's not misleading) and lzma_memlimit_set()
- cannot lower the limit below that value.
+ liblzma: Make parameter names in function definition match declaration.
- The alternative would have been to allow lowering the limit if
- doing so is possible by freeing the cached memory but since
- the primary use case of lzma_memlimit_set() is to increase
- memlimit after LZMA_MEMLIMIT_ERROR this simple approach
- was selected.
-
- The cached memory was always included when enforcing
- the memory usage limit while decoding.
-
- Thanks to Jia Tan.
+ lzma_raw_encoder() and lzma_raw_encoder_init() used "options" as the
+ parameter name instead of "filters" (used by the declaration). "filters"
+ is more clear since the parameter represents the list of filters passed
+ to the raw encoder, each of which contains filter options.
- src/liblzma/common/stream_decoder_mt.c | 22 +++++++++++++++++++---
- 1 file changed, 19 insertions(+), 3 deletions(-)
+ src/liblzma/common/filter_encoder.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
-commit 1fc6e7dd1fabdb60124d449b99273330ccab3ff1
+commit 5dad6f628af742bab826819760deb677597445f7
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-11-07 16:24:14 +0200
+Date: 2023-12-16 20:18:47 +0800
- xz: Avoid a compiler warning in progress_speed() in message.c.
+ liblzma: Improve lzma encoder init function consistency.
- This should be smaller too since it avoids the string constants.
+ lzma_encoder_init() did not check for NULL options, but
+ lzma2_encoder_init() did. This is more of a code style improvement than
+ anything else to help make lzma_encoder_init() and lzma2_encoder_init()
+ more similar.
- src/xz/message.c | 9 +++------
- 1 file changed, 3 insertions(+), 6 deletions(-)
+ src/liblzma/lzma/lzma_encoder.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit cf118c014683069b5dbe91898acdc40f2f0a1f5d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-31 16:26:05 +0200
+commit e1b1a9d6370b788bd6078952c6c201e12bc27cbf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-16 11:20:20 +0800
- Build: Clarify comment in configure.ac about SSE2.
+ Docs: Update repository URL in Changelog.
- configure.ac | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ ChangeLog | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit aad3c609ffb72f581a7a2b67be3ad70b2b327840
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-31 16:16:37 +0200
+commit f9b82bc64a9405e486575c65c1729229eb0a8198
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-15 16:56:31 +0800
- Build: Remove obsolete commented-out lines from configure.ac.
+ CI: Update Upload Artifact Action.
- configure.ac | 4 ----
- 1 file changed, 4 deletions(-)
+ .github/workflows/ci.yml | 2 +-
+ .github/workflows/windows-ci.yml | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit e53e0e2186c6b8ce866bd19aec52f1c318ed31ba
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-31 13:31:58 +0200
+commit d0b24efe6cdc47db5b0fdf6306f70a2e0e63e49e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-07 21:48:07 +0800
- Windows: Fix mythread_once() macro with Vista threads.
+ Tests: Silence -Wsign-conversion warning on GCC version < 10.
+
+ Since GCC version 10, GCC no longer complains about simple implicit
+ integer conversions with Arithmetic operators.
+
+ For instance:
+
+ uint8_t a = 5;
+ uint32_t b = a + 5;
- Don't call InitOnceComplete() if initialization was already done.
+ Give a warning on GCC 9 and earlier but this:
- So far mythread_once() has been needed only when building
- with --enable-small. windows/build.bash does this together
- with --disable-threads so the Vista-specific mythread_once()
- is never needed by those builds. VS project files or
- CMake-builds don't support HAVE_SMALL builds at all.
+ uint8_t a = 5;
+ uint32_t b = (a + 5) * 2;
+
+ Gives a warning with GCC 10+.
- src/common/mythread.h | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
+ tests/test_block_header.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 48dde3bab9dc04081acb5aa7cf7c5044b8a49f58
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-31 11:54:44 +0200
+commit 4a972a8ee3ed88ac14067c1d2f15b78988e5dae8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-06 18:39:03 +0800
- liblzma: Silence -Wconversion warning from crc64_fast.c.
+ Update THANKS.
- src/liblzma/check/crc64_fast.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit a243c617ff249d915ac123de4f536b80322c1fdb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-31 11:49:47 +0200
+commit ee2f48350099201694a7586e41d7aa2f09fc74da
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-12-06 18:30:25 +0800
- CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4.
+ Tests: Minor cleanups to OSS-Fuzz files.
+
+ Most of these fixes are small typos and tweaks. A few were caused by bad
+ advice from me. Here is the summary of what is changed:
+
+ - Author line edits
- This was forgotten from commit 2611c4d90535652d3eb7ef4a026a6691276fab43.
+ - Small comment changes/additions
+
+ - Using the return value in the error messages in the fuzz targets'
+ coder initialization code
+
+ - Removed fuzz_encode_stream.options. This set a max length, which may
+ prevent some worthwhile code paths from being properly exercised.
+
+ - Removed the max_len option from fuzz_decode_stream.options for the
+ same reason as fuzz_encode_stream. The alone decoder fuzz target still
+ has this restriction.
+
+ - Altered the dictionary contents for fuzz_lzma.dict. Instead of keeping
+ the properties static and varying the dictionary size, the properties
+ are varied and the dictionary size is kept small. The dictionary size
+ doesn't have much impact on the code paths but the properties do.
+
+ Closes: https://github.com/tukaani-project/xz/pull/73
- cmake/tuklib_cpucores.cmake | 5 +++++
- 1 file changed, 5 insertions(+)
+ tests/ossfuzz/Makefile | 3 ++
+ tests/ossfuzz/config/fuzz_decode_stream.options | 1 -
+ tests/ossfuzz/config/fuzz_lzma.dict | 34 +++++++++++-----------
+ tests/ossfuzz/fuzz_common.h | 16 +++++------
+ tests/ossfuzz/fuzz_decode_alone.c | 15 +++++-----
+ tests/ossfuzz/fuzz_decode_stream.c | 15 +++++-----
+ tests/ossfuzz/fuzz_encode_stream.c | 38 +++++++++++++++----------
+ 7 files changed, 66 insertions(+), 56 deletions(-)
-commit 05c72de06fcaaedc78f8abba7d5ec568ddcf1e75
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-27 15:49:18 +0300
+commit 483bb90eec7c83e1c2bcd06287714afd62d8c17d
+Author: Maksym Vatsyk <maksym.vatsyk@leviathansecurity.com>
+Date: 2023-12-05 16:31:09 +0100
- Tests: test_files.sh: Make it not fail if features were disabled at build.
+ Tests: Add fuzz_encode_stream ossfuzz target.
- It now tries to test as many files as easily possible.
- The exit status indicates skipping if any of the files were
- skipped. This way it is easy to notice if something is being
- skipped when it isn't expected.
+ This fuzz target handles .xz stream encoding. The first byte of input
+ is used to dynamically set the preset level in order to increase the
+ fuzz coverage of complex critical code paths.
- tests/test_files.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 46 insertions(+), 4 deletions(-)
+ tests/ossfuzz/config/fuzz_encode_stream.options | 2 +
+ tests/ossfuzz/fuzz_encode_stream.c | 79 +++++++++++++++++++++++++
+ 2 files changed, 81 insertions(+)
-commit b3459327a51f4b8239d19e6c34b4e0c6bc2d81de
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-27 15:30:13 +0300
+commit 7ca8c9869df82756c3128c4fcf1058da4d18aa48
+Author: Maksym Vatsyk <maksym.vatsyk@leviathansecurity.com>
+Date: 2023-12-04 17:23:24 +0100
- Tests: test_files.sh: Suppress an expected warning from the log.
+ Tests: Add fuzz_decode_alone OSS-Fuzz target
- xz (but not xzdec) will normally warn about unsupported check
- but since we are testing specifically such a file, it's better
- to silence that warning so that it doesn't look suspicious in
- test_files.sh.log.
+ This fuzz target that handles LZMA alone decoding. A new fuzz
+ dictionary .dict was also created with common LZMA header values to
+ help speed up the discovery of valid headers.
+
+ tests/ossfuzz/config/fuzz_decode_alone.options | 3 ++
+ tests/ossfuzz/config/fuzz_lzma.dict | 22 ++++++++++++++
+ tests/ossfuzz/fuzz_decode_alone.c | 41 ++++++++++++++++++++++++++
+ 3 files changed, 66 insertions(+)
+
+commit 37581a77ad5a49615325b1d1925fdc402b1e1d5a
+Author: Maksym Vatsyk <maksym.vatsyk@leviathansecurity.com>
+Date: 2023-12-04 17:21:29 +0100
+
+ Tests: Update OSS-Fuzz Makefile.
- The use of -q and -Q in xzdec is just for consistency and
- doesn't affect the result at least for now.
+ All .c files can be built as separate fuzz targets. This simplifies
+ the Makefile by allowing us to use wildcards instead of having a
+ Makefile target for each fuzz target.
- tests/test_files.sh | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ tests/ossfuzz/Makefile | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
-commit 798c86e4231e0835ab76ccd0810c8ea30833b2ce
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-27 15:27:50 +0300
+commit 28ce6a1c2a74866c51f7996a6869679c236d3c94
+Author: Maksym Vatsyk <maksym.vatsyk@leviathansecurity.com>
+Date: 2023-12-04 17:20:08 +0100
- Tests: test_files.sh: Print the reason for skipping if xz & xzdec missing.
+ Tests: Move common OSS-Fuzz target code to .h file.
- tests/test_files.sh | 1 +
- 1 file changed, 1 insertion(+)
+ tests/ossfuzz/fuzz_common.h | 56 ++++++++++++++++++++++++++++++++++++
+ tests/ossfuzz/fuzz_decode_stream.c | 59 ++++++++++----------------------------
+ 2 files changed, 71 insertions(+), 44 deletions(-)
-commit c1dd8524e1af07f16b790463899de06a6a5fcc08
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-27 01:12:40 +0300
+commit bf0521ea1591c25b9d510c1b8be86073e9d847c6
+Author: Maksym Vatsyk <maksym.vatsyk@leviathansecurity.com>
+Date: 2023-12-04 17:18:20 +0100
- Tests: Keep test_compress_* working when some filters are unavailable.
+ Tests: Rename OSS-Fuzz files.
- tests/test_compress.sh | 34 ++++++++++++++++++++--------------
- 1 file changed, 20 insertions(+), 14 deletions(-)
+ tests/ossfuzz/config/fuzz.options | 2 --
+ tests/ossfuzz/config/fuzz_decode_stream.options | 3 +++
+ tests/ossfuzz/config/{fuzz.dict => fuzz_xz.dict} | 0
+ tests/ossfuzz/{fuzz.c => fuzz_decode_stream.c} | 0
+ 4 files changed, 3 insertions(+), 2 deletions(-)
-commit ce30ada91951d0746879ae438da11f1ee8a90aa0
+commit 685094b8e1c1aa1bf934de0366ca42ef599d25f7
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-23 21:01:08 +0800
+Date: 2023-11-30 23:10:43 +0800
- Tests: test_bcj_exact_size skips properly now if PowerPC filter disabled.
+ Update THANKS.
- tests/test_bcj_exact_size.c | 3 +++
- 1 file changed, 3 insertions(+)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 89c5cfcacaca7130509fac836e2f30c46b824502
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-26 00:05:57 +0300
+commit 3b3023e00b0071e10f589bbc3674e0ec432b8add
+Author: Kian-Meng Ang <kianmeng@cpan.org>
+Date: 2023-11-30 23:01:19 +0800
- Tests: Test also unsupported-*.xz.
+ Tests: Fix typos
- tests/test_files.sh | 37 +++++++++++++++++++++++++++++++++++++
- 1 file changed, 37 insertions(+)
+ tests/test_index.c | 2 +-
+ tests/test_lzip_decoder.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
-commit a4b214b93ac741edef9c41e55865b0b867ca2587
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 23:45:03 +0300
+commit 424d46ead8cbc0da57f406b76926ec4ed47437f5
+Author: Kian-Meng Ang <kianmeng@cpan.org>
+Date: 2023-11-30 22:59:47 +0800
- Build: Use AC_CONFIG_HEADERS instead of the ancient AC_CONFIG_HEADER.
-
- We require Autoconf >= 2.69 and that has AC_CONFIG_HEADERS.
-
- There is a warning about AC_PROG_CC_C99 being obsolete but
- it cannot be removed because it is needed with Autoconf 2.69.
+ xz: Fix typo
- configure.ac | 2 +-
+ src/xz/file_io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 04f299b64e73f50afc188c2590ebebc6b73ed744
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 23:31:44 +0300
+commit 35558adf9c45e5597f2c8dbd969885dd484038d2
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-30 20:41:00 +0800
- Build: Update m4/ax_pthread.m4 from Autoconf Archive.
+ Update THANKS.
- m4/ax_pthread.m4 | 29 ++++++++++++++++++++++-------
- 1 file changed, 22 insertions(+), 7 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 59c4d6e1390f6f4176f43ac1dad1f7ac03c449b8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 23:28:34 +0300
+commit fd170e8557727bed6bec0518c16415064d972e4e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-22 21:20:12 +0800
- Build: Add configure option --disable-microlzma.
-
- MicroLZMA was made for EROFS and used by erofs-utils.
- It might be used by something else in the future but
- those wanting a smaller build for specific situations
- can now disable this rarely-needed feature.
+ CI: Test musl libc builds on Ubuntu runner.
- configure.ac | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
+ .github/workflows/ci.yml | 19 +++++++++++++++++--
+ 1 file changed, 17 insertions(+), 2 deletions(-)
-commit 054ccd6d14b2cc6eddc56897af280d3221414150
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 23:09:11 +0300
+commit db2b4aa068a492c0013279a4ed43803e8ff9bb3e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-22 21:12:15 +0800
- xz: Fix --single-stream with an empty .xz Stream.
-
- Example:
-
- $ xz -dc --single-stream good-0-empty.xz
- xz: good-0-empty.xz: Internal error (bug)
-
- The code, that is tries to catch some input file issues early,
- didn't anticipate LZMA_STREAM_END which is possible in that
- code only when --single-stream is used.
+ CI: Allow ci_build.sh to set a different C compiler.
- src/xz/coder.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
+ build-aux/ci_build.sh | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
-commit 563288ea705e83ff5cb292adf794650c263bca1d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 21:11:58 +0300
+commit ff7badef53c2cd698d4b72b945f34dfd0835e13c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-24 21:19:12 +0800
- xz: Add support for OpenBSD's pledge() sandbox.
+ CMake: Use consistent indentation with check_c_source_compiles().
- configure.ac | 12 +++++++++---
- src/xz/file_io.c | 11 +++++++++++
- src/xz/main.c | 13 +++++++++++++
- src/xz/private.h | 2 +-
- 4 files changed, 34 insertions(+), 4 deletions(-)
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit f9913e8ee2ba0b1e4ff4d0aa4c001aae305ed944
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 19:07:17 +0300
+commit d4af167570f2c14b002ee18a39d5b1e7e5a892b1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-22 20:33:36 +0800
- xz: Fix decompressor behavior if input uses an unsupported check type.
-
- Now files with unsupported check will make xz display
- a warning, set the exit status to 2 (unless --no-warn is used),
- and then decompress the file normally. This is how it was
- supposed to work since the beginning but this was broken by
- the commit 231c3c7098f1099a56abb8afece76fc9b8699f05, that is,
- a little before 5.0.0 was released. The buggy behavior displayed
- a message, set exit status 1 (error), and xz didn't attempt to
- to decompress the file.
+ CMake: Change __attribute__((__ifunc__())) detection.
- This doesn't matter today except for special builds that disable
- CRC64 or SHA-256 at build time (but such builds should be used
- in special situations only). The bug matters if new check type
- is added in the future and an old xz version is used to decompress
- such a file; however, it's likely that such files would use a new
- filter too and an old xz wouldn't be able to decompress the file
- anyway.
+ This renames ALLOW_ATTR_IFUNC to USE_ATTR_IFUNC and applies the ifunc
+ detection changes that were made to the Autotools build.
- The first hunk in the commit is the actual fix. The second hunk
- is a cleanup since LZMA_TELL_ANY_CHECK isn't used in xz.
-
- There is a test file for unsupported check type but it wasn't
- used by test_files.sh, perhaps due to different behavior between
- xz and the simpler xzdec.
+ Fixes: https://github.com/tukaani-project/xz/issues/70
- src/xz/coder.c | 19 +++++++++++++++----
- 1 file changed, 15 insertions(+), 4 deletions(-)
+ CMakeLists.txt | 53 +++++++++++++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 45 insertions(+), 8 deletions(-)
-commit aa4fe145b9486adc454f44fd3e09be9add808a0f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 18:36:19 +0300
+commit 20ecee40a0053fd16371ef0628046bf45e548d72
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-24 20:19:11 +0800
- xz: Clarify the man page: input file isn't removed if an error occurs.
+ Docs: Update INSTALL for --enable_ifunc change.
- src/xz/xz.1 | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ INSTALL | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
-commit 8b46ae8cdeddfd7dc01fec92971b8696e9a96c5d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 18:30:55 +0300
+commit ffb456593d695d70052a2f71c7a2e6269217d194
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-21 20:56:55 +0800
- xz: Refactor to remove is_empty_filename().
+ Build: Change --enable-ifunc handling.
+
+ Some compilers support __attribute__((__ifunc__())) even though the
+ dynamic linker does not. The compiler is able to create the binary
+ but it will fail on startup. So it is not enough to just test if
+ the attribute is supported.
- Long ago it was used in list.c too but nowadays it's needed
- only in io_open_src() so it's nicer to avoid a separate function.
+ The default value for enable_ifunc is now auto, which will attempt
+ to compile a program using __attribute__((__ifunc__())). There are
+ additional checks in this program if glibc is being used or if it
+ is running on FreeBSD.
+
+ Setting --enable-ifunc will skip this test and always enable
+ __attribute__((__ifunc__())), even if is not supported.
- src/xz/file_io.c | 4 +++-
- src/xz/util.c | 12 ------------
- src/xz/util.h | 4 ----
- 3 files changed, 3 insertions(+), 17 deletions(-)
+ configure.ac | 61 +++++++++++++++++++++++++++++++++++++++++++-----------------
+ 1 file changed, 44 insertions(+), 17 deletions(-)
-commit 85624015978b0de294cff3df79006df987c552b1
+commit 12b89bcc9915090eb42ae638e565af44b6832a23
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-25 18:23:54 +0300
+Date: 2023-11-23 17:39:10 +0200
- xz: If input file cannot be removed, treat it as a warning, not error.
-
- Treating it as a warning (message + exit status 2) matches gzip
- and it seems more logical as at that point the output file has
- already been successfully closed. When it's a warning it is
- possible to suppress it with --no-warn.
+ xz: Tweak a comment.
- src/xz/file_io.c | 4 ++--
+ src/xz/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-commit fda9f85f52c546f7ca0313cf89481da4707fecb3
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-24 16:25:09 +0300
+commit 2ab2e4b5a542eab93902985ce4e642719a8b7a4e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-23 22:13:39 +0800
- liblzma: Threaded decoder: Stop the worker threads on errors.
-
- It's waste of CPU time and electricity to leave the unfinished
- worker threads running when it is known that their output will
- get ignored.
+ xz: Use is_tty() in message.c.
- src/liblzma/common/stream_decoder_mt.c | 33 ++++++++++++++++++++++++++-------
- 1 file changed, 26 insertions(+), 7 deletions(-)
+ src/xz/message.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
-commit 2611c4d90535652d3eb7ef4a026a6691276fab43
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-20 20:22:50 +0300
+commit 584e3a258f32d579b1d07f99b4dc6e856c10ac7e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-23 22:04:35 +0800
- tuklib_cpucores: Use HW_NCPUONLINE on OpenBSD.
+ xz: Create separate is_tty() function.
- On OpenBSD the number of cores online is often less
- than what HW_NCPU would return because OpenBSD disables
- simultaneous multi-threading (SMT) by default.
+ The new is_tty() will report if a file descriptor is a terminal or not.
+ On POSIX systems, it is a wrapper around isatty(). However, the native
+ Windows implementation of isatty() will return true for all character
+ devices, not just terminals. So is_tty() has a special case for Windows
+ so it can use alternative Windows API functions to determine if a file
+ descriptor is a terminal.
- Thanks to Christian Weisgerber.
-
- m4/tuklib_cpucores.m4 | 5 +++++
- src/common/tuklib_cpucores.c | 9 +++++++++
- 2 files changed, 14 insertions(+)
-
-commit 424ac91c7e0419393ff2bde4f62e21fa611c776d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-19 19:39:35 +0300
-
- Tests: Skip tests in test_*.sh if encoders and/or decoders are disabled.
-
- This isn't perfect as the scripts can still fail if only
- certain filters are disabled. This is still an improvement
- as now "make check" has better behavior when all encoders
- or decoders are disabled.
+ This fixes a bug with MSVC and MinGW-w64 builds that refused to read from
+ or write to non-terminal character devices because xz thought it was a
+ terminal. For instance:
- Grepping ../config.h is simple and fairly clean but it only
- works if config.h was created. CMake builds don't create
- config.h but they don't use these test scripts either.
+ xz foo -c > /dev/null
- Thanks to Sebastian Andrzej Siewior for reporting the problem.
- Thanks to Jia Tan for the original patch which grepped xz
- error messages instead of config.h.
+ would fail because /dev/null was assumed to be a terminal.
- tests/test_compress.sh | 12 ++++++++++++
- tests/test_files.sh | 11 +++++++++++
- tests/test_scripts.sh | 11 +++++++++++
- 3 files changed, 34 insertions(+)
+ src/xz/util.c | 30 +++++++++++++++++++++++-------
+ src/xz/util.h | 14 ++++++++++++++
+ 2 files changed, 37 insertions(+), 7 deletions(-)
-commit ca8bf9d7c5a30be8ba1eeb106fd892f19e83ed09
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-19 18:54:34 +0300
+commit 6b05f827f50e686537e9a23c49c5aa4c0aa6b23d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-22 20:39:41 +0800
- Test: Remove the (exit 1) lines.
+ tuklib_integer: Fix typo discovered by codespell.
- I suspect that I used these in the original version because
- Autoconf's manual describes that such a trick is needed in
- some specific situations for portability reasons. None of those
- situations listed on Autoconf 2.71 manual apply to these test
- scripts though so this cleans them up.
-
- tests/test_compress.sh | 10 ----------
- tests/test_files.sh | 9 ---------
- tests/test_scripts.sh | 6 ------
- 3 files changed, 25 deletions(-)
+ Based on internet dictionary searches, 'choise' is an outdated spelling
+ of 'choice'.
-commit 82fcb7cfc17ce62f79ebc7ca2374e1daca5e4d5e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-19 17:14:57 +0300
-
- Tests: Fix a warning in test_memlimit.c when decoders are disabled.
-
- tests/test_memlimit.c | 3 +++
- 1 file changed, 3 insertions(+)
+ src/common/tuklib_integer.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit b5f8271b45b9b0e59485ffba3640ca3418835ec4
+commit 659aca0d695807c0762d4101765189e4e33d1e2c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-19 17:11:46 +0300
+Date: 2023-11-17 19:35:19 +0200
- Tests: Add test_memlimit to .gitignore.
+ xz: Move the check for --suffix with --format=raw a few lines earlier.
- Thanks to Jia Tan.
+ Now it reads from argv[] instead of args->arg_names.
- .gitignore | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/args.c | 44 ++++++++++++++++++++++----------------------
+ 1 file changed, 22 insertions(+), 22 deletions(-)
-commit 6a86e81cab202d0a812a7b2e9efacaf70c58ba38
+commit ca278eb2b7f5a4940f5ab18955297b398d423824
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-06 21:53:09 +0300
+Date: 2023-11-17 20:35:11 +0800
- Tests: Refactor test_stream_flags.c.
+ Tests: Create test_suffix.sh.
- Converts test_stream_flags to tuktest. Also the test will now
- compile and skip properly if encoders or decoders are disabled.
+ This tests some complicated interactions with the --suffix= option.
+ The suffix option must be used with --format=raw, but can optionally
+ be used to override the default .xz suffix.
- Thanks to Sebastian Andrzej Siewior.
+ This test also verifies some recent bugs have been correctly solved
+ and to hopefully avoid further regressions in the future.
- tests/test_stream_flags.c | 533 ++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 416 insertions(+), 117 deletions(-)
+ tests/Makefile.am | 2 +
+ tests/test_suffix.sh | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 191 insertions(+)
-commit 827ac5b4821491fd3afe0d0e1ddac326253aeb66
+commit 2a732aba22da1b0d4a1241cb32280ed010ba03ce
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-06 17:00:38 +0800
+Date: 2023-11-17 20:19:26 +0800
- Tests: Refactor test_block_header.c.
-
- test_block_header now achieves higher test coverage. Also the
- test will now compile and skip properly if encoders or decoders
- are disabled.
+ xz: Fix a bug with --files and --files0 in raw mode without a suffix.
- Thanks to Sebastian Andrzej Siewior.
-
- tests/test_block_header.c | 486 +++++++++++++++++++++++++++++++++++-----------
- 1 file changed, 370 insertions(+), 116 deletions(-)
-
-commit 84963318952064a93bfc52edd6b0ef70593384ee
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-05 23:54:12 +0800
-
- Tests: Fix compilation issues.
+ The following command caused a segmentation fault:
- test_bcj_exact_size, test_check, test_hardware, and test_index will
- all now compile and skip properly if encoders or decoders are disabled.
+ xz -Fraw --lzma1 --files=foo
- Also fixed a small typo (disabed -> disabled).
+ when foo was a valid file. The usage of --files or --files0 was not
+ being checked when compressing or decompressing in raw mode without a
+ suffix. The suffix checking code was meant to validate that all files
+ to be processed are "-" (if not writing to standard out), meaning the
+ data is only coming from standard in. In this case, there were no file
+ names to check since --files and --files0 store their file name in a
+ different place.
- Thanks to Sebastian Andrzej Siewior.
+ Later code assumed the suffix was set and caused a segmentation fault.
+ Now, the above command results in an error.
- tests/test_bcj_exact_size.c | 20 ++++++++++++++------
- tests/test_check.c | 8 +++++++-
- tests/test_hardware.c | 2 +-
- tests/test_index.c | 6 ++++++
- tests/test_memlimit.c | 16 +++++++++++++++-
- tests/test_vli.c | 13 +++++++++++++
- 6 files changed, 56 insertions(+), 9 deletions(-)
-
-commit 7dcabeec63d46b436fa5f043c3d1f09d0e15be16
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-05 16:20:47 +0300
-
- Tests: Include mythread.h in the tests that use MYTHREAD_ENABLED.
-
- tests/test_check.c | 1 +
- tests/test_hardware.c | 1 +
- tests/test_memlimit.c | 1 +
- 3 files changed, 3 insertions(+)
+ src/xz/args.c | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit 14af758a770c7781af18fb66d6d21ee5b1c27f04
+commit 299920bab9ae258a247366339264e8aefca9e3ce
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-05 20:57:16 +0800
+Date: 2023-11-17 20:04:58 +0800
- liblzma: Fix a compilation issue when encoders are disabled.
-
- When encoders were disabled and threading enabled, outqueue.c and
- outqueue.h were not compiled. The multi threaded decoder required
- these files, so compilation failed.
+ Tests: Fix typo in a comment.
- src/liblzma/common/Makefile.inc | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
+ tests/test_files.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 6ca5c354bd4620aa7f81da68870eef1b1f26288f
+commit f481523baac946fa3bc13d79186ffaf0c0b818a7
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-10-05 16:41:38 +0800
+Date: 2023-11-15 23:40:13 +0800
- Tests: Fix compilation error when threading support has been disabled.
+ xz: Refactor suffix test with raw format.
+
+ The previous version set opt_stdout, but this caused an issue with
+ copying an input file to standard out when decompressing an unknown file
+ type. The following needs to result in an error:
- Now tests that require threading are skipped when threading
- support has been disabled.
+ echo foo | xz -df
- Thanks to Sebastian Andrzej Siewior.
+ since -c, --stdout is not used. This fixes the previous error by not
+ setting opt_stdout.
- tests/test_check.c | 4 ++++
- tests/test_hardware.c | 4 ++++
- tests/test_memlimit.c | 4 ++++
- 3 files changed, 12 insertions(+)
+ src/xz/args.c | 38 +++++++++++++-------------------------
+ 1 file changed, 13 insertions(+), 25 deletions(-)
-commit fae37ad2affd8fe8871f4ff93d5cab5ec14d5e58
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-10-05 14:26:00 +0300
+commit 837ea40b1c9d4998cac4500b55171bf33e0c31a6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-14 20:27:46 +0800
- tuklib_integer: Add 64-bit endianness-converting reads and writes.
+ xz: Move suffix check after stdout mode is detected.
+
+ This fixes a bug introduced in cc5aa9ab138beeecaee5a1e81197591893ee9ca0
+ when the suffix check was initially moved. This caused a situation that
+ previously worked:
- Also update the comment in liblzma's memcmplen.h.
+ echo foo | xz -Fraw --lzma1 | wc -c
- Thanks to Michał Górny for the original patch for the reads.
+ to fail because the old code knew that this would write to standard out
+ so a suffix was not needed.
- m4/tuklib_integer.m4 | 8 ++++----
- src/common/tuklib_integer.h | 46 ++++++++++++++++++++++++++++++++++++++++--
- src/liblzma/common/memcmplen.h | 9 +++------
- 3 files changed, 51 insertions(+), 12 deletions(-)
+ src/xz/args.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
-commit 508a44372c5b0dede8863fd0d358d4a9d8645c95
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-30 12:06:13 +0300
+commit d4f4a4d040ef47a5e82dffd0f067e92716606ddf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-11-14 20:27:04 +0800
- liblzma: Add API doc note about the .xz decoder LZMA_MEMLIMIT_ERROR bug.
+ xz: Detect when all data will be written to standard out earlier.
- The bug was fixed in 660739f99ab211edec4071de98889fb32ed04e98.
+ If the -c, --stdout argument is not used, then we can still detect when
+ the data will be written to standard out if all of the provided
+ filenames are "-" (denoting standard in) or if no filenames are
+ provided.
- src/liblzma/api/lzma/base.h | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ src/xz/args.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
-commit 8cc9874a7974cd575aee44f218836f7acdbeb0ed
+commit 2ade7246e7ba729a91460d2fab0f4c7b89d3998b
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-09-21 16:15:50 +0800
+Date: 2023-11-09 01:21:53 +0800
- liblzma: Add dest and src NULL checks to lzma_index_cat.
-
- The documentation states LZMA_PROG_ERROR can be returned from
- lzma_index_cat. Previously, lzma_index_cat could not return
- LZMA_PROG_ERROR. Now, the validation is similar to
- lzma_index_append, which does a NULL check on the index
- parameter.
+ liblzma: Add missing comments to lz_encoder.h.
- src/liblzma/common/index.c | 3 +++
- 1 file changed, 3 insertions(+)
+ src/liblzma/lz/lz_encoder.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
-commit afd5a8bf5374eba82804a999e1ea7af680784086
+commit 5fe1450603dc625340b8b7866fb4a83ff748ad06
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-09-21 20:29:28 +0800
+Date: 2023-11-01 20:18:30 +0800
- Tests: Create a test for the lzma_index_cat bug.
+ Add NEWS for 5.4.5.
- tests/test_index.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 42 insertions(+), 1 deletion(-)
+ NEWS | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 74 insertions(+)
-commit 3d5a99ca373a4e86faf671226ca6487febb9eeac
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-09-21 19:28:53 +0800
+commit 46007049cd42e606543dbe650feb17bdf4469c29
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-10-31 21:41:09 +0200
- liblzma: Fix copying of check type statistics in lzma_index_cat().
+ liblzma: Fix compilation of fastpos_tablegen.c.
- The check type of the last Stream in dest was never copied to
- dest->checks (the code tried to copy it but it was done too late).
- This meant that the value returned by lzma_index_checks() would
- only include the check type of the last Stream when multiple
- lzma_indexes had been concatenated.
+ The macro lzma_attr_visibility_hidden has to be defined to make
+ fastpos.h usable. The visibility attribute is irrelevant to
+ fastpos_tablegen.c so simply #define the macro to an empty value.
- In xz --list this meant that the summary would only list the
- check type of the last Stream, so in this sense this was only
- a visual bug. However, it's possible that some applications
- use this information for purposes other than merely showing
- it to the users in an informational message. I'm not aware of
- such applications though and it's quite possible that such
- applications don't exist.
+ fastpos_tablegen.c is never built by the included build systems
+ and so the problem wasn't noticed earlier. It's just a standalone
+ program for generating fastpos_table.c.
- Regular streamed decompression in xz or any other application
- doesn't use lzma_index_cat() and so this bug cannot affect them.
+ Fixes: https://github.com/tukaani-project/xz/pull/69
+ Thanks to GitHub user Jamaika1.
- src/liblzma/common/index.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
+ src/liblzma/lzma/fastpos_tablegen.c | 2 ++
+ 1 file changed, 2 insertions(+)
-commit a61d32172789735350a941e23baf6b587c49e5d9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-28 12:20:41 +0300
+commit 148e20607e95781558bdfc823ecba07b7af4b590
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-31 21:51:40 +0800
- tuklib_physmem: Fix Unicode builds on Windows.
-
- Thanks to ArSaCiA Game.
+ Build: Fix text wrapping in an output message.
- src/common/tuklib_physmem.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ configure.ac | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
-commit 5a4d3548ab214fdca364d5c734baf1d1fab47308
+commit 8c36ab79cbf23104ce7a3d533d5ac98cd492e57c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-28 11:12:07 +0300
+Date: 2023-10-30 18:09:53 +0200
- Tests: Add test_memlimit.c to test restarting after LZMA_MEMLIMIT_ERROR.
+ liblzma: Add a note why crc_always_inline exists for now.
+
+ Solaris Studio is a possible example (not tested) which
+ supports the always_inline attribute but might not get
+ detected by the common.h #ifdefs.
- tests/Makefile.am | 2 +
- tests/test_memlimit.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 153 insertions(+)
+ src/liblzma/check/crc_common.h | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit 660739f99ab211edec4071de98889fb32ed04e98
+commit e7a86b94cd247435ac96bc79ba528b690b9ca388
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-28 11:05:15 +0300
+Date: 2023-10-22 17:59:11 +0300
- liblzma: Stream decoder: Fix restarting after LZMA_MEMLIMIT_ERROR.
-
- If lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible
- to use lzma_memlimit_set() to increase the limit and continue
- decoding. This was supposed to work from the beginning but
- there was a bug. With other decoders (.lzma or threaded .xz)
- this already worked correctly.
+ liblzma: Use lzma_always_inline in memcmplen.h.
- src/liblzma/common/stream_decoder.c | 16 +++++++++++++---
- 1 file changed, 13 insertions(+), 3 deletions(-)
+ src/liblzma/common/memcmplen.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
-commit 7e68fda58c74ad9e5b876cc22fcbe80fc0e4747b
+commit dcfe5632992fb7f06f921da13fcdd84f83d0d285
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-28 11:00:23 +0300
+Date: 2023-10-30 17:43:03 +0200
- liblzma: Stream decoder: Fix comments.
+ liblzma: #define lzma_always_inline in common.h.
- src/liblzma/common/stream_decoder.c | 12 +++++-------
- 1 file changed, 5 insertions(+), 7 deletions(-)
+ src/liblzma/common/common.h | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
-commit f664cb25841fc1c478b819034a224a558e2ac6e7
+commit 41113fe30a47f6fd3e30cb4494dd538e86212edf
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-20 16:58:22 +0300
+Date: 2023-10-22 17:15:32 +0300
- liblzma: ARM64: Add comments.
+ liblzma: Use lzma_attr_visibility_hidden on private extern declarations.
+
+ These variables are internal to liblzma and not exposed in the API.
- src/liblzma/simple/arm64.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
+ src/liblzma/check/check.h | 7 +++++++
+ src/liblzma/common/stream_flags_common.h | 3 +++
+ src/liblzma/lz/lz_encoder_hash.h | 1 +
+ src/liblzma/lzma/fastpos.h | 1 +
+ src/liblzma/rangecoder/price.h | 1 +
+ 5 files changed, 13 insertions(+)
-commit b557b4a0eea05470fae8ba5ef4ad5a6dfb36ac41
+commit a2f5ca706acc6f7715b8d260a8c6ed50d7717478
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-20 16:27:50 +0300
+Date: 2023-10-22 17:08:39 +0300
- liblzma: ARM64: Fix wrong comment in API doc.
+ liblzma: #define lzma_attr_visibility_hidden in common.h.
+
+ In ELF shared libs:
+
+ -fvisibility=hidden affects definitions of symbols but not
+ declarations.[*] This doesn't affect direct calls to functions
+ inside liblzma as a linker can replace a call to lzma_foo@plt
+ with a call directly to lzma_foo when -fvisibility=hidden is used.
+
+ [*] It has to be like this because otherwise every installed
+ header file would need to explictly set the symbol visibility
+ to default.
+
+ When accessing extern variables that aren't defined in the
+ same translation unit, compiler assumes that the variable has
+ the default visibility and thus indirection is needed. Unlike
+ function calls, linker cannot optimize this.
+
+ Using __attribute__((__visibility__("hidden"))) with the extern
+ variable declarations tells the compiler that indirection isn't
+ needed because the definition is in the same shared library.
- Thanks to Jia Tan.
+ About 15+ years ago, someone told me that it would be good if
+ the CRC tables would be defined in the same translation unit
+ as the C code of the CRC functions. While I understood that it
+ could help a tiny amount, I didn't want to change the code because
+ a separate translation unit for the CRC tables was needed for the
+ x86 assembly code anyway. But when visibility attributes are
+ supported, simply marking the extern declaration with the
+ hidden attribute will get identical result. When there are only
+ a few affected variables, this is trivial to do. I wish I had
+ understood this back then already.
- src/liblzma/api/lzma/bcj.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/common/common.h | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
-commit d5b0906fa55157f48c200188a3951d80df9cb308
+commit 2c7ee92e44e1e66f0a427555233eb22c78f6c4f8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-19 20:24:26 +0300
+Date: 2023-09-30 22:54:28 +0300
- xz: Add --experimental-arm64[=width=WIDTH].
-
- It will be renamed to --arm64 once it is stable.
+ liblzma: Refer to MinGW-w64 instead of MinGW in the API headers.
- Man page or --long-help weren't updated yet.
+ MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project
+ at <https://osdn.net/projects/mingw/>) has GCC 9.2.0 as the
+ most recent GCC package (released 2021-02-02). The project might
+ still be alive but majority of people have switched to MinGW-w64.
+ Thus it seems clearer to refer to MinGW-w64 in our API headers too.
+ Building with MinGW is likely to still work but I haven't tested it
+ in the recent years.
- src/xz/args.c | 7 +++++++
- src/xz/message.c | 7 +++++++
- src/xz/options.c | 39 +++++++++++++++++++++++++++++++++++++++
- src/xz/options.h | 7 +++++++
- 4 files changed, 60 insertions(+)
+ src/liblzma/api/lzma.h | 4 ++--
+ src/liblzma/api/lzma/version.h | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
-commit ecb966de308c255bb4735a7307ef9901c643a9de
+commit 597f49b61475438a43a417236989b2acc968a686
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-19 19:34:56 +0300
+Date: 2023-09-27 00:58:17 +0300
- liblzma: Add experimental ARM64 BCJ filter with a temporary Filter ID.
+ CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed.
+
+ A CMake option LARGE_FILE_SUPPORT is created if and only if
+ -D_FILE_OFFSET_BITS=64 affects sizeof(off_t).
- That is, the Filter ID will be changed once the design is final.
- The current version will be removed. So files created with the
- tempoary Filter ID won't be supported in the future.
+ This is needed on many 32-bit platforms and even with 64-bit builds
+ with MinGW-w64 to get support for files larger than 2 GiB.
- CMakeLists.txt | 3 +
- configure.ac | 4 +-
- src/liblzma/api/lzma/bcj.h | 35 +++++-
- src/liblzma/common/filter_common.c | 9 ++
- src/liblzma/common/filter_decoder.c | 8 ++
- src/liblzma/common/filter_encoder.c | 11 ++
- src/liblzma/simple/Makefile.inc | 4 +
- src/liblzma/simple/arm64.c | 227 ++++++++++++++++++++++++++++++++++++
- src/liblzma/simple/simple_coder.h | 9 ++
- src/liblzma/simple/simple_decoder.h | 4 +
- src/liblzma/simple/simple_encoder.h | 2 +
- 11 files changed, 313 insertions(+), 3 deletions(-)
+ CMakeLists.txt | 7 ++++-
+ cmake/tuklib_large_file_support.cmake | 52 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 58 insertions(+), 1 deletion(-)
-commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8
+commit 1bc548b8210366e44ba35b0b11577a8e328c1228
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-17 22:42:18 +0300
+Date: 2023-09-30 02:14:25 +0300
- liblzma: Simple/BCJ filters: Allow disabling generic BCJ options.
+ CMake: Generate and install liblzma.pc if not using MSVC.
- This will be needed for the ARM64 BCJ filter as it will use
- its own options struct.
+ Autotools based build uses -pthread and thus adds it to Libs.private
+ in liblzma.pc. CMake doesn't use -pthread at all if pthread functions
+ are available in libc so Libs.private doesn't get -pthread either.
- src/liblzma/simple/arm.c | 2 +-
- src/liblzma/simple/armthumb.c | 2 +-
- src/liblzma/simple/ia64.c | 2 +-
- src/liblzma/simple/powerpc.c | 2 +-
- src/liblzma/simple/simple_coder.c | 4 ++--
- src/liblzma/simple/simple_private.h | 2 +-
- src/liblzma/simple/sparc.c | 2 +-
- src/liblzma/simple/x86.c | 3 ++-
- 8 files changed, 10 insertions(+), 9 deletions(-)
+ CMakeLists.txt | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
-commit c3592d0a55114144686ecf960cb516d6b31c98e9
+commit 2add71966f891d315105d6245f724ed4f43a4eff
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-16 17:08:53 +0300
+Date: 2023-09-30 01:13:13 +0300
- Tests: Add a test file for lzma_index_append() integer overflow bug.
+ CMake: Rearrange the PACKAGE_ variables.
- This test fails before commit 18d7facd3802b55c287581405c4d49c98708c136.
+ The windres workaround now replaces spaces with \x20 so
+ the package name isn't repeated.
- test_files.sh now runs xz -l for bad-3-index-uncomp-overflow.xz
- because only then the previously-buggy code path gets tested.
- Normal decompression doesn't use lzma_index_append() at all.
- Instead, lzma_index_hash functions are used and those already
- did the overflow check.
+ These changes will help with creation of liblzma.pc.
- tests/files/README | 10 ++++++++++
- tests/files/bad-3-index-uncomp-overflow.xz | Bin 0 -> 132 bytes
- tests/test_files.sh | 8 ++++++++
- 3 files changed, 18 insertions(+)
+ CMakeLists.txt | 26 +++++++++++++++-----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
-commit 982b29f828079a2a26253a40e975127a40a7d2bd
+commit a7d1b2825c49dc83f1910eeb8ba0f1dfbd886d91
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-16 15:10:07 +0300
+Date: 2023-09-29 20:46:11 +0300
- Translations: Add Turkish translation.
+ liblzma: Add Cflags.private to liblzma.pc.in for MSYS2.
+
+ It properly adds -DLZMA_API_STATIC when compiling code that
+ will be linked against static liblzma. Having it there on
+ systems other than Windows does no harm.
+
+ See: https://www.msys2.org/docs/pkgconfig/
- po/LINGUAS | 1 +
- po/tr.po | 977 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 978 insertions(+)
+ src/liblzma/liblzma.pc.in | 1 +
+ 1 file changed, 1 insertion(+)
-commit 1fc088d9f6d1697924aaeac8cd1fb9918d1532e2
+commit 80e0750e3996c1c659e972ce9cf789ca2e99f702
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-16 14:09:07 +0300
+Date: 2023-09-27 22:46:20 +0300
- Update THANKS.
+ CMake: Create liblzma.def when building liblzma.dll with MinGW-w64.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ CMakeLists.txt | 20 ++++++++++++++++++++
+ cmake/remove-ordinals.cmake | 26 ++++++++++++++++++++++++++
+ 2 files changed, 46 insertions(+)
-commit 097c7b67ce86ff16a7cef7631b39e5ca4ee3d420
+commit 08d12595f486890cf601b87f36ee0ddbce57728e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-16 14:07:03 +0300
+Date: 2023-10-26 21:44:42 +0300
- xzgrep: Fix compatibility with old shells.
-
- Running the current xzgrep on Slackware 10.1 with GNU bash 3.00.15:
-
- xzgrep: line 231: syntax error near unexpected token `;;'
-
- On SCO OpenServer 5.0.7 with Korn Shell 93r:
-
- syntax error at line 231 : `;;' unexpected
-
- Turns out that some old shells don't like apostrophes (') inside
- command substitutions. For example, the following fails:
-
- x=$(echo foo
- # asdf'zxcv
- echo bar)
- printf '%s\n' "$x"
-
- The problem was introduced by commits
- 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 (2022-03-29),
- bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5 (2022-07-18), and
- a648978b20495b7aa4a8b029c5a810b5ad9d08ff (2022-07-19).
- 5.2.6 is the only stable release that included
- this problem.
+ CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR.
- Thanks to Kevin R. Bulgrien for reporting the problem
- on SCO OpenServer 5.0.7 and for providing the fix.
+ In this case they have identical values.
- src/scripts/xzgrep.in | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit f2d084fe3f0d6d71488bfc6987f26542f67bfd99
+commit e67aaf698de75c73443a5ec786781cbf2034461d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-09 14:12:30 +0300
+Date: 2023-10-01 19:10:57 +0300
- Tests: Silence warnings about unused functions from tuktest.h.
-
- Warnings about unused tuktest_run_test conveniently tell which
- test programs haven't been converted to tuktest.h yet but I
- silenced that warning too for now anyway.
+ CMake/Windows: Fix the import library filename.
- It is fine to use __attribute__((__unused__)) even when the
- function is actually used because the attribute only means
- that the function might be unused.
+ Both PREFIX and IMPORT_PERFIX have to be set to "" to get
+ liblzma.dll and liblzma.dll.a.
- tests/tuktest.h | 10 ++++++++++
- 1 file changed, 10 insertions(+)
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
-commit f8ee61e74eb40600445fdb601c374d582e1e9c8a
+commit 88588b1246d8c26ffbc138b3e5c413c5f14c3179
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-09 13:51:57 +0300
+Date: 2023-10-25 19:13:25 +0300
- liblzma: lzma_filters_copy: Keep dest[] unmodified if an error occurs.
+ Build: Detect -fsanitize= in CFLAGS and incompatible build options.
- lzma_stream_encoder() and lzma_stream_encoder_mt() always assumed
- this. Before this patch, failing lzma_filters_copy() could result
- in free(invalid_pointer) or invalid memory reads in stream_encoder.c
- or stream_encoder_mt.c.
+ Now configure will fail if -fsanitize= is found in CFLAGS
+ and sanitizer-incompatible ifunc or Landlock sandboxing
+ would be used. These are incompatible with one or more sanitizers.
+ It's simpler to reject all -fsanitize= uses instead of trying to
+ pass those that might not cause problems.
- To trigger this, allocating memory for a filter options structure
- has to fail. These are tiny allocations so in practice they very
- rarely fail.
-
- Certain badness in the filter chain array could also make
- lzma_filters_copy() fail but both stream_encoder.c and
- stream_encoder_mt.c validate the filter chain before
- trying to copy it, so the crash cannot occur this way.
+ CMake-based build was updated similarly. It lets the configuration
+ finish (SEND_ERROR instead of FATAL_ERROR) so that both error
+ messages can be seen at once.
- src/liblzma/api/lzma/filter.h | 4 +++-
- src/liblzma/common/filter_common.c | 18 ++++++++++++------
- 2 files changed, 15 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 29 +++++++++++++++++++++++++++++
+ configure.ac | 37 +++++++++++++++++++++++++++++++++----
+ 2 files changed, 62 insertions(+), 4 deletions(-)
-commit 18d7facd3802b55c287581405c4d49c98708c136
+commit 5e3d890f8862a7d4fbef5e38e11b6c9fbd98f468
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-09-02 20:18:55 +0800
+Date: 2023-10-24 00:50:08 +0800
- liblzma: lzma_index_append: Add missing integer overflow check.
+ CI: Disable sandboxing in fsanitize=address,undefined job.
- The documentation in src/liblzma/api/lzma/index.h suggests that
- both the unpadded (compressed) size and the uncompressed size
- are checked for overflow, but only the unpadded size was checked.
- The uncompressed check is done first since that is more likely to
- occur than the unpadded or index field size overflows.
-
- src/liblzma/common/index.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ The sandboxing on Linux now supports Landlock, which restricts all
+ supported filesystem actions after xz opens the files it needs. The
+ sandbox is only enabled when one file is input and we are writing to
+ standard out. With fsanitize=address,undefined, the instrumentation
+ needs to read additional files after the sandbox is in place. This
+ forces all xz based test to fail, so the sandbox must instead be
+ disabled.
-commit 9ac06cb5b85274d18f9f70d82cf2d8c9c1151bd4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-08 15:11:08 +0300
-
- Update THANKS.
-
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ .github/workflows/ci.yml | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit ba3e4ba2de034ae93a513f9c3a0823b80cdb66dc
+commit b1408987ea832e2760e478ae960a636df17a1363
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-09-08 15:07:00 +0300
-
- CMake: Clarify a comment about Windows symlinks without file extension.
-
- CMakeLists.txt | 7 +++----
- 1 file changed, 3 insertions(+), 4 deletions(-)
-
-commit 17485e884ce5c74315f29a8a1507bc706cd5cd1d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-08 15:02:41 +0300
-
- CMake: Update for liblzma_*.map files and fix wrong common_w32res.rc dep.
-
- The previous commit split liblzma.map into liblzma_linux.map and
- liblzma_generic.map. This commit updates the CMake build for those.
-
- common_w32res.rc dependency was listed under Linux/FreeBSD while
- obviously it belongs to Windows when building a DLL.
-
- CMakeLists.txt | 24 +++++++++++++++++++-----
- 1 file changed, 19 insertions(+), 5 deletions(-)
-
-commit 913ddc5572b9455fa0cf299be2e35c708840e922
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-09-04 23:23:00 +0300
-
- liblzma: Vaccinate against an ill patch from RHEL/CentOS 7.
-
- RHEL/CentOS 7 shipped with 5.1.2alpha, including the threaded
- encoder that is behind #ifdef LZMA_UNSTABLE in the API headers.
- In 5.1.2alpha these symbols are under XZ_5.1.2alpha in liblzma.map.
- API/ABI compatibility tracking isn't done between development
- releases so newer releases didn't have XZ_5.1.2alpha anymore.
-
- Later RHEL/CentOS 7 updated xz to 5.2.2 but they wanted to keep
- the exported symbols compatible with 5.1.2alpha. After checking
- the ABI changes it turned out that >= 5.2.0 ABI is backward
- compatible with the threaded encoder functions from 5.1.2alpha
- (but not vice versa as fixes and extensions to these functions
- were made between 5.1.2alpha and 5.2.0).
-
- In RHEL/CentOS 7, XZ Utils 5.2.2 was patched with
- xz-5.2.2-compat-libs.patch to modify liblzma.map:
-
- - XZ_5.1.2alpha was added with lzma_stream_encoder_mt and
- lzma_stream_encoder_mt_memusage. This matched XZ Utils 5.1.2alpha.
-
- - XZ_5.2 was replaced with XZ_5.2.2. It is clear that this was
- an error; the intention was to keep using XZ_5.2 (XZ_5.2.2
- has never been used in XZ Utils). So XZ_5.2.2 lists all
- symbols that were listed under XZ_5.2 before the patch.
- lzma_stream_encoder_mt and _mt_memusage are included too so
- they are listed both here and under XZ_5.1.2alpha.
-
- The patch didn't add any __asm__(".symver ...") lines to the .c
- files. Thus the resulting liblzma.so exports the threaded encoder
- functions under XZ_5.1.2alpha only. Listing the two functions
- also under XZ_5.2.2 in liblzma.map has no effect without
- matching .symver lines.
-
- The lack of XZ_5.2 in RHEL/CentOS 7 means that binaries linked
- against unpatched XZ Utils 5.2.x won't run on RHEL/CentOS 7.
- This is unfortunate but this alone isn't too bad as the problem
- is contained within RHEL/CentOS 7 and doesn't affect users
- of other distributions. It could also be fixed internally in
- RHEL/CentOS 7.
-
- The second problem is more serious: In XZ Utils 5.2.2 the API
- headers don't have #ifdef LZMA_UNSTABLE for obvious reasons.
- This is true in RHEL/CentOS 7 version too. Thus now programs
- using new APIs can be compiled without an extra #define. However,
- the programs end up depending on symbol version XZ_5.1.2alpha
- (and possibly also XZ_5.2.2) instead of XZ_5.2 as they would
- with an unpatched XZ Utils 5.2.2. This means that such binaries
- won't run on other distributions shipping XZ Utils >= 5.2.0 as
- they don't provide XZ_5.1.2alpha or XZ_5.2.2; they only provide
- XZ_5.2 (and XZ_5.0). (This includes RHEL/CentOS 8 as the patch
- luckily isn't included there anymore with XZ Utils 5.2.4.)
-
- Binaries built by RHEL/CentOS 7 users get distributed and then
- people wonder why they don't run on some other distribution.
- Seems that people have found out about the patch and been copying
- it to some build scripts, seemingly curing the symptoms but
- actually spreading the illness further and outside RHEL/CentOS 7.
-
- The ill patch seems to be from late 2016 (RHEL 7.3) and in 2017 it
- had spread at least to EasyBuild. I heard about the events only
- recently. :-(
-
- This commit splits liblzma.map into two versions: one for
- GNU/Linux and another for other OSes that can use symbol versioning
- (FreeBSD, Solaris, maybe others). The Linux-specific file and the
- matching additions to .c files add full compatibility with binaries
- that have been built against a RHEL/CentOS-patched liblzma. Builds
- for OSes other than GNU/Linux won't get the vaccine as they should
- be immune to the problem (I really hope that no build script uses
- the RHEL/CentOS 7 patch outside GNU/Linux).
-
- The RHEL/CentOS compatibility symbols XZ_5.1.2alpha and XZ_5.2.2
- are intentionally put *after* XZ_5.2 in liblzma_linux.map. This way
- if one forgets to #define HAVE_SYMBOL_VERSIONS_LINUX when building,
- the resulting liblzma.so.5 will have lzma_stream_encoder_mt@@XZ_5.2
- since XZ_5.2 {...} is the first one that lists that function.
- Without HAVE_SYMBOL_VERSIONS_LINUX @XZ_5.1.2alpha and @XZ_5.2.2
- will be missing but that's still a minor problem compared to
- only having lzma_stream_encoder_mt@@XZ_5.1.2alpha!
-
- The "local: *;" line was moved to XZ_5.0 so that it doesn't need
- to be moved around. It doesn't matter where it is put.
-
- Having two similar liblzma_*.map files is a bit silly as it is,
- at least for now, easily possible to generate the generic one
- from the Linux-specific file. But that adds extra steps and
- increases the risk of mistakes when supporting more than one
- build system. So I rather maintain two files in parallel and let
- validate_map.sh check that they are in sync when "make mydist"
- is run.
-
- This adds .symver lines for lzma_stream_encoder_mt@XZ_5.2.2 and
- lzma_stream_encoder_mt_memusage@XZ_5.2.2 even though these
- weren't exported by RHEL/CentOS 7 (only @@XZ_5.1.2alpha was
- for these two). I added these anyway because someone might
- misunderstand the RHEL/CentOS 7 patch and think that @XZ_5.2.2
- (@@XZ_5.2.2) versions were exported too.
-
- At glance one could suggest using __typeof__ to copy the function
- prototypes when making aliases. However, this doesn't work trivially
- because __typeof__ won't copy attributes (lzma_nothrow, lzma_pure)
- and it won't change symbol visibility from hidden to default (done
- by LZMA_API()). Attributes could be copied with __copy__ attribute
- but that needs GCC 9 and a fallback method would be needed anyway.
-
- This uses __symver__ attribute with GCC >= 10 and
- __asm__(".symver ...") with everything else. The attribute method
- is required for LTO (-flto) support with GCC. Using -flto with
- GCC older than 10 is now broken on GNU/Linux and will not be fixed
- (can silently result in a broken liblzma build that has dangerously
- incorrect symbol versions). LTO builds with Clang seem to work
- with the traditional __asm__(".symver ...") method.
-
- Thanks to Boud Roukema for reporting the problem and discussing
- the details and testing the fix.
-
- configure.ac | 23 +++-
- src/liblzma/Makefile.am | 10 +-
- src/liblzma/common/block_buffer_encoder.c | 18 ++++
- src/liblzma/common/common.c | 14 +++
- src/liblzma/common/common.h | 28 +++++
- src/liblzma/common/hardware_cputhreads.c | 12 +++
- src/liblzma/common/stream_encoder_mt.c | 42 ++++++++
- src/liblzma/{liblzma.map => liblzma_generic.map} | 6 +-
- src/liblzma/liblzma_linux.map | 131 +++++++++++++++++++++++
- src/liblzma/validate_map.sh | 113 +++++++++++++++++--
- 10 files changed, 382 insertions(+), 15 deletions(-)
-
-commit 80a1a8bb838842a2be343bd88ad1462c21c5e2c9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-31 16:42:04 +0300
-
- CMake: Add xz symlinks.
-
- These are a minor thing especially since the xz build has
- some real problems still like lack of large file support
- on 32-bit systems but I'll commit this since the code exists.
-
- Thanks to Jia Tan.
-
- CMakeLists.txt | 38 +++++++++++++++++++++++++++++++++++++-
- 1 file changed, 37 insertions(+), 1 deletion(-)
-
-commit a4193bb6d85d7765b1b87faeab3e50106d3ab2e9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-31 16:29:38 +0300
-
- CMake: Put xz man page install under if(UNIX) like is for xzdec.
-
- Thanks to Jia Tan.
-
- CMakeLists.txt | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-commit c1555b1a221a1427d4d650647531016d754bc4da
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-22 18:16:40 +0300
+Date: 2023-10-24 00:15:39 +0800
- Bump version number for 5.3.3alpha.
+ CI: Allow disabling the sandbox in ci_build.sh.
- src/liblzma/api/lzma/version.h | 2 +-
- src/liblzma/liblzma.map | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ build-aux/ci_build.sh | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
-commit 44fedddc11c3f6ec2f7fe35a3e38f15ca93f90eb
+commit 91c435cf1c7a1e893706d4d716dfd361621ed824
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-22 18:13:56 +0300
+Date: 2023-10-11 19:47:44 +0300
- Add NEWS for 5.3.3alpha.
+ CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable.
+
+ Using set(ENABLE_THREADS "posix") is confusing because it sets
+ a new normal variable and leaves the cache entry with the same
+ name unchanged. The intent wasn't to change the cache entry so
+ this switches to a different variable name.
- NEWS | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 119 insertions(+)
+ CMakeLists.txt | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
-commit a93e235d7ca764cc19f8f9f9063b40ff361c3cfa
+commit fa1609eb9393ecd30decfed4891c907829f06710
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-12 17:59:41 +0300
+Date: 2023-10-09 22:28:49 +0300
- Translations: Add Portuguese translation.
-
- Jia Tan made white-space changes and also changed "Language: pt_BR\n"
- to pt. The translator wasn't reached so I'm hoping these changes
- are OK and will commit it without translator's approval.
-
- Thanks to Pedro Albuquerque and Jia Tan.
+ Docs: Update INSTALL about sandboxing support.
- po/LINGUAS | 1 +
- po/pt.po | 1001 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 1002 insertions(+)
+ INSTALL | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
-commit e7cf5a946f25e40d77f45e41f0dee7d42a04e9ae
+commit 8276c7f41c671eee4aa3239490658b23dcfd3021
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-10 21:16:40 +0300
+Date: 2023-10-09 22:07:52 +0300
- Translations: Add Serbian translation.
+ xz: Support basic sandboxing with Linux Landlock (ABI versions 1-3).
- Quite a few white-space changes were made by Jia Tan to make
- this look good. Contacting the translator didn't succeed so
- I'm committing this without getting translator's approval.
+ It is enabled only when decompressing one file to stdout,
+ similar to how Capsicum is used.
- Thanks to Мирослав Николић (Miroslav Nikolic) and Jia Tan.
+ Landlock was added in Linux 5.13.
- po/LINGUAS | 1 +
- po/sr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 988 insertions(+)
+ CMakeLists.txt | 12 +++++++++++-
+ configure.ac | 11 ++++++++---
+ src/xz/file_io.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/xz/main.c | 19 +++++++++++++++++++
+ src/xz/private.h | 3 ++-
+ 5 files changed, 98 insertions(+), 5 deletions(-)
-commit cc8617ab53b1f2a4da212fa76c92fe538269c5de
+commit 3a1e9fd031b9320d769d63b503ef4e82e1b6ea8c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-04 23:51:36 +0300
+Date: 2023-10-09 21:12:31 +0300
- Translations: Add Swedish translation.
+ CMake: Edit threading related messages.
- Thanks to Sebastian Rasmussen and Jia Tan.
+ It's mostly to change from "thread method" to "threading method".
- po/LINGUAS | 1 +
- po/sv.po | 983 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 984 insertions(+)
+ CMakeLists.txt | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
-commit c613598c358b640682d0ca2aed38fa7df763e8c7
+commit bf011352528ae3539ea7b780b45b96736ee57a99
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-04 23:40:27 +0300
+Date: 2023-10-09 20:59:24 +0300
- Translations: Add Esperanto translation.
+ CMake: Use FATAL_ERROR if user-supplied options aren't understood.
- Thanks to Keith Bowes and Jia Tan.
+ This way typos are caught quickly and compounding error messages
+ are avoided (a single typo could cause more than one error).
+
+ This keeps using SEND_ERROR when the system is lacking a feature
+ (like threading library or sandboxing method). This way the whole
+ configuration log will be generated in case someone wishes to
+ report a problem upstream.
- po/LINGUAS | 1 +
- po/eo.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 985 insertions(+)
+ CMakeLists.txt | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
-commit 659a587d678f21e98e91d2751c31d4ce050c081a
+commit 3f53870c249945d657ca3d75e0993e6267d71f75
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-01 00:22:33 +0300
+Date: 2023-10-09 18:37:32 +0300
- Translations: Add Catalan translation.
-
- Thanks to Jordi Mas and Jia Tan.
+ CMake: Add sandboxing support.
- po/LINGUAS | 1 +
- po/ca.po | 1076 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 1077 insertions(+)
+ CMakeLists.txt | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 49 insertions(+), 1 deletion(-)
-commit 739fd8c9bdf1d85f57d56642aad87148d4779530
+commit 2e2cd11535ad77364cf021297e0b3f162fa3a3d0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-30 17:47:08 +0300
+Date: 2023-10-09 18:13:08 +0300
- Translations: Add Ukrainian translation.
+ Simplify detection of Capsicum support.
- Thanks to Yuri Chornoivan and Jia Tan.
+ This removes support for FreeBSD 10.0 and 10.1 which used
+ <sys/capability.h> instead of <sys/capsicum.h>. Support for
+ FreeBSD 10.1 ended on 2016-12-31. So now FreeBSD >= 10.2 is
+ required to enable Capsicum support.
+
+ This also removes support for Capsicum on Linux (libcaprights)
+ which seems to have been unmaintained since 2017 and Linux 4.11:
+ https://github.com/google/capsicum-linux
- po/LINGUAS | 1 +
- po/uk.po | 996 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 997 insertions(+)
+ configure.ac | 4 +--
+ m4/ax_check_capsicum.m4 | 85 -------------------------------------------------
+ src/xz/Makefile.am | 2 +-
+ src/xz/file_io.c | 14 +++-----
+ src/xz/private.h | 2 +-
+ 5 files changed, 9 insertions(+), 98 deletions(-)
-commit 73280550b111930c62a667e56add8fd574f80bc8
+commit c57858b60e186d020b2dbaf7aabd9b32c71da824
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-30 17:45:26 +0300
+Date: 2023-09-25 01:46:36 +0300
- Translators: Add Romanian translation.
+ xz/Windows: Allow clock_gettime with POSIX threads.
- Thanks to Remus-Gabriel Chelu and Jia Tan.
+ If winpthreads are used for threading, it's OK to use clock_gettime()
+ from winpthreads too.
- po/LINGUAS | 1 +
- po/ro.po | 1016 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 1017 insertions(+)
+ src/xz/mytime.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
-commit 2465f5b825152714b2c357d96c2422c31109d320
+commit dd32f628bb5541ef4e8ce66966ef456a1934084c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-29 18:33:32 +0300
+Date: 2023-09-25 01:39:26 +0300
- Translations: Update Brazilian Portuguese translation.
-
- One msgstr was changed. The diff is long due to changes
- in the source code line numbers in the comments.
+ mythread.h: Make MYTHREAD_POSIX compatible with MinGW-w64's winpthreads.
- Thanks to Rafael Fontenelle.
+ This might be almost useless but it doesn't need much extra code either.
- po/pt_BR.po | 186 ++++++++++++++++++++++++++++++------------------------------
- 1 file changed, 92 insertions(+), 94 deletions(-)
+ src/common/mythread.h | 23 ++++++++++++++++++++++-
+ 1 file changed, 22 insertions(+), 1 deletion(-)
-commit 434e1ffd3e62719d509da10b646216f5ef53fe4d
+commit 680e52cdd086e92691d8a0bca2c98815565f60ca
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-29 18:04:44 +0300
+Date: 2023-09-23 03:06:36 +0300
- Translations: Add Croatian translation.
+ CMake: Check for clock_gettime() even on Windows.
- Thanks to Božidar Putanec and Jia Tan.
+ This mirrors configure.ac although currently MinGW-w64 builds
+ don't use clock_gettime() even if it is found.
- po/LINGUAS | 1 +
- po/hr.po | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 988 insertions(+)
+ CMakeLists.txt | 44 +++++++++++++++++++++-----------------------
+ 1 file changed, 21 insertions(+), 23 deletions(-)
-commit 0732d0f7065c9bd48bfe4f5983144ae970c4a499
+commit 1c1a8c3ee4dad0064dbe63b8dbc4ac4bc679f419
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-29 17:58:48 +0300
+Date: 2023-09-23 03:23:32 +0300
- Translations: Add Spanish translation.
+ Build: Check for clock_gettime() even if not using POSIX threads.
+
+ See the new comment in the code.
- Thanks to Cristian Othón Martínez Vera and Jia Tan.
+ This also makes the check for clock_gettime() run with MinGW-w64
+ with which we don't want to use clock_gettime(). The previous
+ commit already took care of this situation.
- po/LINGUAS | 1 +
- po/es.po | 984 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 985 insertions(+)
+ configure.ac | 31 ++++++++++++++++++-------------
+ 1 file changed, 18 insertions(+), 13 deletions(-)
-commit 9899b0f82bc130998d1f1f618a6ab805b73f2696
+commit 46fd991cd2808ef62554853864c946232e7547f0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-29 17:49:43 +0300
+Date: 2023-09-24 22:58:53 +0300
- Translations: Add Korean translation.
+ xz/Windows: Ensure that clock_gettime() isn't used with MinGW-w64.
+
+ This commit alone doesn't change anything in the real-world:
+
+ - configure.ac currently checks for clock_gettime() only
+ when using pthreads.
+
+ - CMakeLists.txt doesn't check for clock_gettime() on Windows.
+
+ So clock_gettime() wasn't used with MinGW-w64 before either.
+
+ clock_gettime() provides monotonic time and it's better than
+ gettimeofday() in this sense. But clock_gettime() is defined
+ in winpthreads, and liblzma or xz needs nothing else from
+ winpthreads. By avoiding clock_gettime(), we avoid the dependency on
+ libwinpthread-1.dll or the need to link against the static version.
- Thanks to Seong-ho Cho and Jia Tan.
+ As a bonus, GetTickCount64() and MinGW-w64's gettimeofday() can be
+ faster than clock_gettime(CLOCK_MONOTONIC, &tv). The resolution
+ is more than good enough for the progress indicator in xz.
- po/LINGUAS | 1 +
- po/ko.po | 972 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 973 insertions(+)
+ src/xz/mytime.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
-commit 65217eaf6bd195f3ef027d4ac55d57b7d133d69f
+commit cdb4d91f2464b50c985ef7b9517314ea237ddda7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-16 21:57:21 +0200
+Date: 2023-09-24 00:21:22 +0300
- Translations: Rebuild cs.po to avoid incorrect fuzzy strings.
-
- "make dist" updates the .po files and the fuzzy strings would
- result in multiple very wrong translations.
+ xz/Windows: Use GetTickCount64() with MinGW-w64 if using Vista threads.
- po/cs.po | 592 ++++++++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 322 insertions(+), 270 deletions(-)
+ src/xz/mytime.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
-commit e56ff423ee7af9e648e16b132f0d835d2cb4db26
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-16 17:30:39 +0200
+commit 988e09f27b9b04a43d45d10f92782e0092ee27a9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-20 19:17:46 +0800
- Translations: Add partial Danish translation.
+ liblzma: Move is_clmul_supported() back to crc_common.h.
- I made a few minor white space changes without getting them
- approved by the Danish translation team.
+ This partially reverts creating crc_clmul.c
+ (8c0f9376f58c0696d5d6719705164d35542dd891) where is_clmul_supported()
+ was moved, extern'ed, and renamed to lzma_is_clmul_supported(). This
+ caused a problem when the function call to lzma_is_clmul_supported()
+ results in a call through the PLT. ifunc resolvers run very early in
+ the dynamic loading sequence, so the PLT may not be setup properly at
+ this point. Whether the PLT is used or not for
+ lzma_is_clmul_supported() depened upon the compiler-toolchain used and
+ flags.
+
+ In liblzma compiled with GCC, for instance, GCC will go through the PLT
+ for function calls internal to liblzma if the version scripts and
+ symbol visibility hiding are not used. If lazy-binding is disabled,
+ then it would have made any program linked with liblzma fail during
+ dynamic loading in the ifunc resolver.
- po/LINGUAS | 1 +
- po/da.po | 896 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 897 insertions(+)
+ src/liblzma/check/crc32_fast.c | 2 +-
+ src/liblzma/check/crc64_fast.c | 2 +-
+ src/liblzma/check/crc_clmul.c | 45 ------------------------------------
+ src/liblzma/check/crc_common.h | 52 +++++++++++++++++++++++++++++++++++++++---
+ 4 files changed, 51 insertions(+), 50 deletions(-)
-commit 43e09c62e77cb8807d932c81de4decbdb956e184
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 22:37:54 +0200
+commit 105c7ca90d4152942e0798580a37f736d02faa22
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-19 16:23:32 +0800
- Translations: Add hu, zh_CN, and zh_TW.
+ Build: Remove check for COND_CHECK_CRC32 in check/Makefile.inc.
- I made a few white space changes to these without getting them
- approved by the translation teams. (I tried to contact the hu and
- zh_TW teams but didn't succeed. I didn't contact the zh_CN team.)
+ Currently crc32 is always enabled, so COND_CHECK_CRC32 must always be
+ set. Because of this, it makes the recent change to conditionally
+ compile check/crc_clmul.c appear wrong since that file has CLMUL
+ implementations for both CRC32 and CRC64.
- po/LINGUAS | 3 +
- po/hu.po | 985 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po/zh_CN.po | 963 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po/zh_TW.po | 956 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 2907 insertions(+)
+ src/liblzma/check/Makefile.inc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 982b6b198ae1ffe6093236dd8a3d03d1415b912b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 14:33:30 +0200
+commit 139757170468f0f1fafdf0a8ffa74363d1ea1d0c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-19 16:09:01 +0800
- Translations: Update vi.po to match the file from the TP.
+ CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL.
- The translated strings haven't been updated but word wrapping
- is different.
+ The option is enabled by default, but will only be visible to a user
+ listing cache variables or using a CMake GUI application if the
+ immintrin.h header file is found.
+
+ This mirrors our Autotools build --disable-clmul-crc functionality.
- po/vi.po | 407 ++++++++++++++++++++++++++++-----------------------------------
- 1 file changed, 179 insertions(+), 228 deletions(-)
+ CMakeLists.txt | 44 +++++++++++++++++++++++++-------------------
+ 1 file changed, 25 insertions(+), 19 deletions(-)
-commit 801f39691fc4abc6dd33d7653d498781b593f3eb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 14:18:03 +0200
+commit c60b25569d414bb73b705977a4dd342f8f9f1965
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-19 00:22:50 +0800
- Translations: Add fi and pt_BR, and update de, fr, it, and pl.
+ liblzma: Fix -fsanitize=address failure with crc_clmul functions.
+
+ After forcing crc_simd_body() to always be inlined it caused
+ -fsanitize=address to fail for lzma_crc32_clmul() and
+ lzma_crc64_clmul(). The __no_sanitize_address__ attribute was added
+ to lzma_crc32_clmul() and lzma_crc64_clmul(), but not removed from
+ crc_simd_body(). ASAN and inline functions behavior has changed over
+ the years for GCC specifically, so while strictly required we will
+ keep __attribute__((__no_sanitize_address__)) on crc_simd_body() in
+ case this becomes a requirement in the future.
- The German translation isn't identical to the file in
- the Translation Project but the changes (white space changes
- only) were approved by the translator Mario Blättermann.
+ Older GCC versions refuse to inline a function with ASAN if the
+ caller and callee do not agree on sanitization flags
+ (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124#c3). If the
+ function was forced to be inlined, it will not compile if the callee
+ function has __no_sanitize_address__ but the caller doesn't.
- po/LINGUAS | 2 +
- po/de.po | 476 ++++++++++++++--------------
- po/fi.po | 974 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po/fr.po | 272 ++++++++--------
- po/it.po | 479 ++++++++++++----------------
- po/pl.po | 239 +++++++-------
- po/pt_BR.po | 1001 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 7 files changed, 2697 insertions(+), 746 deletions(-)
+ src/liblzma/check/crc_clmul.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit 311e4f85ede5d2f0bb71f3ad70b5b7db1b5adf33
+commit 9a78971261bc67622cbd7dae02f6966968ac1393
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-22 17:27:19 +0300
+Date: 2023-10-14 20:16:13 +0300
- xz: Try to clarify --memlimit-mt-decompress vs. --memlimit-compress.
+ tuklib_integer: Update the CMake test for fast unaligned access.
- src/xz/xz.1 | 31 +++++++++++++++++++------------
- 1 file changed, 19 insertions(+), 12 deletions(-)
+ cmake/tuklib_integer.cmake | 69 ++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 54 insertions(+), 15 deletions(-)
-commit df23c31000283c00e5ef1ca32a0bc3bb757bd707
+commit 2f81ac852bc5aafc91c8e2adc66b5114761703c4
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-22 16:46:18 +0300
+Date: 2023-09-23 23:28:48 +0300
- CMake: Add liblzma tests.
+ Build: Enabled unaligned access by default on PowerPC64LE and some RISC-V.
- Thanks to Jia Tan for the patch.
-
- CMakeLists.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 52 insertions(+), 1 deletion(-)
-
-commit 02a777f9c422d3b5ec895078530bb1a2b6f7bdf5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-19 23:32:22 +0300
-
- xz: Revise --info-memory output.
+ PowerPC64LE wasn't tested but it seems like a safe change.
+ POWER8 supports unaligned access in little endian mode. Testing
+ on godbolt.org shows that GCC uses unaligned access by default.
+
+ The RISC-V macro __riscv_misaligned_fast is very new and not
+ in any stable compiler release yet.
- The strings could be more descriptive but it's good
- to have some version of this committed now.
+ Documentation in INSTALL was updated to match.
- --robot mode wasn't changed yet.
+ Documentation about an autodetection bug when using ARM64 GCC
+ with -mstrict-align was added to INSTALL.
+
+ CMake files weren't updated yet.
- src/xz/hardware.c | 32 ++++++++++++++++++++++++++------
- src/xz/xz.1 | 1 +
- 2 files changed, 27 insertions(+), 6 deletions(-)
+ INSTALL | 39 +++++++++++++++++++++++++++++++++++++--
+ m4/tuklib_integer.m4 | 34 +++++++++++++++++++++++++++-------
+ 2 files changed, 64 insertions(+), 9 deletions(-)
-commit f864f6d42eab57ea8ed82cc2dd19a03b51377442
+commit c8f715f1bca4c30db814fcf1fd2fe88b8992ede2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-19 23:12:02 +0300
+Date: 2023-10-14 17:56:59 +0300
- xz: Update the man page for threaded decompression and memlimits.
-
- This documents the changes made in commits
- 6c6da57ae2aa962aabde6892442227063d87e88c,
- cad299008cf73ec566f0662a9cf2b94f86a99659, and
- 898faa97287a756231c663a3ed5165672b417207.
+ tuklib_integer: Revise unaligned reads and writes on strict-align archs.
- The --info-memory bit hasn't been finished yet
- even though it's already mentioned in this commit
- under --memlimit-mt-decompress and --threads.
+ In XZ Utils context this doesn't matter much because
+ unaligned reads and writes aren't used in hot code
+ when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined.
- src/xz/xz.1 | 148 +++++++++++++++++++++++++++++++++++++++++++++++++-----------
- 1 file changed, 121 insertions(+), 27 deletions(-)
+ src/common/tuklib_integer.h | 256 ++++++++++++++++++++++++++++++++------------
+ 1 file changed, 189 insertions(+), 67 deletions(-)
-commit d13bfcc0056617dd648f655a01653932fad7067f
+commit 6828242735cbf61b93d140383336e1e51a006f2d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-18 17:49:16 +0300
+Date: 2023-09-23 02:21:49 +0300
- Build: Include the CMake files in the distribution.
-
- This was supposed to be done in 2020 with 5.2.5 release
- already but it was noticed only today. 5.2.5 and 5.2.6
- even mention experiemental CMake support in the NEWS entries.
-
- Thanks to Olivier B. for reporting the problem.
+ tuklib_integer: Add missing write64be and write64le fallback functions.
- Makefile.am | 2 ++
- 1 file changed, 2 insertions(+)
+ src/common/tuklib_integer.h | 34 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 34 insertions(+)
-commit e66787bcfefdb93f19c974f895f65969a77937b0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-18 17:38:05 +0300
+commit 1c8884f0af28b3a4690bb573cdf3240a8ec73416
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-18 19:57:10 +0800
- Windows: Fix broken liblzma.dll build with Visual Studio project files.
-
- The bug was introduced in 352ba2d69af2136bc814aa1df1a132559d445616
- "Windows: Fix building of resource files when config.h isn't used."
+ liblzma: Set the MSVC optimization fix to only cover lzma_crc64_clmul().
- That commit fixed liblzma.dll build with CMake while keeping it
- working with Autotools on Windows but the VS project files were
- forgotten.
-
- I haven't tested these changes.
-
- Thanks to Olivier B. for reporting the bug and for the initial patch.
+ After testing a 32-bit Release build on MSVC, only lzma_crc64_clmul()
+ has the bug. crc_simd_body() and lzma_crc32_clmul() do not need the
+ optimizations disabled.
- windows/vs2013/liblzma_dll.vcxproj | 6 ++++++
- windows/vs2017/liblzma_dll.vcxproj | 6 ++++++
- windows/vs2019/liblzma_dll.vcxproj | 6 ++++++
- 3 files changed, 18 insertions(+)
+ src/liblzma/check/crc_clmul.c | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
-commit c4e8e5fb311225b8b48d34157891a640b2535e0c
+commit 5ce0f7a48bdf5c3b45430850a4487307afac6143
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-18 17:16:49 +0300
+Date: 2023-10-18 14:30:00 +0300
- liblzma: Threaded decoder: Improve LZMA_FAIL_FAST when LZMA_FINISH is used.
-
- It will now return LZMA_DATA_ERROR (not LZMA_OK or LZMA_BUF_ERROR)
- if LZMA_FINISH is used and there isn't enough input to finish
- decoding the Block Header or the Block. The use of LZMA_DATA_ERROR
- is simpler and the less risky than LZMA_BUF_ERROR but this might
- be changed before 5.4.0.
+ liblzma: CRC_USE_GENERIC_FOR_SMALL_INPUTS cannot be used with ifunc.
- src/liblzma/api/lzma/container.h | 6 +++++
- src/liblzma/common/stream_decoder_mt.c | 42 ++++++++++++++++++++++++++++++++++
- 2 files changed, 48 insertions(+)
+ src/liblzma/check/crc_common.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
-commit 6dcf606e7efa2b259f0262f9e2f61e00116842d3
+commit 27735380491bb5ce0d0f41d5244d89c1d0825f6b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-12 18:31:47 +0300
+Date: 2023-10-17 21:53:11 +0300
- Add NEWS for 5.2.6.
+ liblzma: Include common.h in crc_common.h.
+
+ crc_common.h depends on common.h. The headers include common.h except
+ when there is a reason to not do so.
- NEWS | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 121 insertions(+)
+ src/liblzma/check/crc_clmul.c | 1 -
+ src/liblzma/check/crc_common.h | 3 +++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
-commit 413b86fcf8934fae5a004f378a9483d37d8fcaab
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-08-12 14:28:41 +0300
+commit e13b7947b92355c334edd594295d3a2c99c4bca1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-18 01:23:26 +0800
- Add Jia Tan to AUTHORS.
+ liblzma: Add include guards to crc_common.h.
- AUTHORS | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/liblzma/check/crc_common.h | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit 352672732c346c546ff3c26d0605bc0ed1c8b7c7
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-25 19:28:26 +0300
+commit 40abd88afcc61a8157fcd12d78d491caeb8e12be
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-18 22:50:25 +0800
- Build: Start the generated ChangeLog from around 5.2.0 instead of 5.0.0.
+ liblzma: Add the crc_always_inline macro to crc_simd_body().
- This makes ChangeLog smaller.
+ Forcing this to be inline has a significant speed improvement at the
+ cost of a few repeated instructions. The compilers tested on did not
+ inline this function since it is large and is used twice in the same
+ translation unit.
- Makefile.am | 2 +-
+ src/liblzma/check/crc_clmul.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 6f6d11225d6016be2bbb55d845b66f6b04d048df
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-25 19:11:05 +0300
+commit a5966c276bd6fa975f0389f8a8dc61393de750b0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-18 22:48:19 +0800
- Translations: Change the copyright comment string to use with po4a.
+ liblzma: Create crc_always_inline macro.
+
+ This macro must be used instead of the inline keyword. On MSVC, it is
+ a replacement for __forceinline which is an MSVC specific keyword that
+ should not be used with inline (it will issue a warning if it is).
- This affects the second line in po4a/xz-man.pot. The man pages of
- xzdiff, xzgrep, and xzmore are from GNU gzip and under GNU GPLv2+
- while the rest of the man pages are in the public domain.
+ It does not use a build system check to determine if
+ __attribute__((__always_inline__)) since all compilers that can use
+ CLMUL extensions (except the special case for MSVC) should support this
+ attribute. If this assumption is incorrect then it will result in a bug
+ report instead of silently producing slow code.
- po4a/update-po | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/liblzma/check/crc_common.h | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
-commit 61f8ec804abdb4c5dac01e8ae9b90c7be58a5c24
+commit 96b663f67c0e738a99ba8f35d9f4ced9add74544
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-07-25 18:30:05 +0300
+Date: 2023-10-14 13:23:23 +0800
- liblzma: Refactor lzma_mf_is_supported() to use a switch-statement.
+ liblzma: Refactor CRC comments.
+
+ A detailed description of the three dispatch methods was added. Also,
+ duplicated comments now only appear in crc32_fast.c or were removed from
+ both crc32_fast.c and crc64_fast.c if they appeared in crc_clmul.c.
- src/liblzma/lz/lz_encoder.c | 32 ++++++++++++++------------------
- 1 file changed, 14 insertions(+), 18 deletions(-)
+ src/liblzma/check/crc32_fast.c | 64 +++++++++++++++++++++++++++++-------------
+ src/liblzma/check/crc64_fast.c | 61 ++++++----------------------------------
+ 2 files changed, 53 insertions(+), 72 deletions(-)
-commit 4d80b463a1251aa22eabc87d2732fec13b1adda6
+commit 8c0f9376f58c0696d5d6719705164d35542dd891
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-07-25 18:20:01 +0300
+Date: 2023-10-14 12:17:57 +0800
- Build: Don't allow empty LIST in --enable-match-finders=LIST.
+ liblzma: Create crc_clmul.c.
- It's enforced only when a match finder is needed, that is,
- when LZMA1 or LZMA2 encoder is enabled.
+ Both crc32_clmul() and crc64_clmul() are now exported from
+ crc32_clmul.c as lzma_crc32_clmul() and lzma_crc64_clmul(). This
+ ensures that is_clmul_supported() (now lzma_is_clmul_supported()) is
+ not duplicated between crc32_fast.c and crc64_fast.c.
+
+ Also, it encapsulates the complexity of the CLMUL implementations into a
+ single file and reduces the complexity of crc32_fast.c and crc64_fast.c.
+ Before, CLMUL code was present in crc32_fast.c, crc64_fast.c, and
+ crc_common.h.
+
+ During the conversion, various cleanups were applied to code (thanks to
+ Lasse Collin) including:
+
+ - Require using semicolons with MASK_/L/H/LH macros.
+ - Variable typing and const handling improvements.
+ - Improvements to comments.
+ - Fixes to the pragmas used.
+ - Removed unneeded variables.
+ - Whitespace improvements.
+ - Fixed CRC_USE_GENERIC_FOR_SMALL_INPUTS handling.
+ - Silenced warnings and removed the need for some #pragmas
- configure.ac | 4 ++++
- 1 file changed, 4 insertions(+)
+ CMakeLists.txt | 6 +-
+ configure.ac | 6 +-
+ src/liblzma/check/Makefile.inc | 3 +
+ src/liblzma/check/crc32_fast.c | 120 +-----------
+ src/liblzma/check/crc64_fast.c | 128 +------------
+ src/liblzma/check/crc_clmul.c | 414 +++++++++++++++++++++++++++++++++++++++++
+ src/liblzma/check/crc_common.h | 190 +------------------
+ 7 files changed, 444 insertions(+), 423 deletions(-)
-commit 9cc721af5436908f2d5a828aebbc4050a32a3487
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-24 13:27:48 +0300
+commit a3ebc2c516b09616638060806c841bd4bcf7bce3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-14 10:23:03 +0800
- xz: Update the man page that change to --keep will be in 5.2.6.
+ liblzma: Define CRC_USE_IFUNC in crc_common.h.
+
+ When ifunc is supported, we can define a simpler macro instead of
+ repeating the more complex check in both crc32_fast.c and crc64_fast.c.
- src/xz/xz.1 | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/check/crc32_fast.c | 3 +--
+ src/liblzma/check/crc64_fast.c | 3 +--
+ src/liblzma/check/crc_common.h | 5 +++++
+ 3 files changed, 7 insertions(+), 4 deletions(-)
-commit b81bf0c7d1873e52a4086a9abb494471d652cb55
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-19 23:23:54 +0300
+commit f1cd9d7194f005cd66ec03c6635ceae75f90ef17
+Author: Hans Jansen <hansjansen162@outlook.com>
+Date: 2023-10-12 19:37:01 +0200
- Update THANKS.
+ liblzma: Added crc32_clmul to crc32_fast.c.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/check/crc32_fast.c | 247 ++++++++++++++++++++++++++++++++++++++--
+ src/liblzma/check/crc32_table.c | 19 +++-
+ 2 files changed, 255 insertions(+), 11 deletions(-)
-commit 340cf1ec3927767046b8293a49da3db4e393f426
-Author: Nicholas Jackson <nickajacks1@gmail.com>
-Date: 2022-07-17 17:39:23 -0700
+commit 93e6fb08b22c7c13be2dd1e7274fe78413436254
+Author: Hans Jansen <hansjansen162@outlook.com>
+Date: 2023-10-12 19:23:40 +0200
- CMake: Add missing source file to liblzma build
+ liblzma: Moved CLMUL CRC logic to crc_common.h.
+
+ crc64_fast.c was updated to use the code from crc_common.h instead.
- CMakeLists.txt | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/check/crc64_fast.c | 257 ++---------------------------------------
+ src/liblzma/check/crc_common.h | 230 +++++++++++++++++++++++++++++++++++-
+ 2 files changed, 240 insertions(+), 247 deletions(-)
-commit d796b6d7fdb8b7238b277056cf9146cce25db604
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-19 23:19:49 +0300
+commit 233885a437f8b55a5c8442984ebc0aaa579e92de
+Author: Hans Jansen <hansjansen162@outlook.com>
+Date: 2023-10-12 19:07:50 +0200
- xzgrep man page: Document exit statuses.
+ liblzma: Rename crc_macros.h to crc_common.h.
- src/scripts/xzgrep.1 | 15 ++++++++++++++-
- 1 file changed, 14 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 2 +-
+ src/liblzma/check/Makefile.inc | 2 +-
+ src/liblzma/check/crc32_fast.c | 2 +-
+ src/liblzma/check/crc64_fast.c | 2 +-
+ src/liblzma/check/{crc_macros.h => crc_common.h} | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
-commit 923bf96b55e5216a6c8df9d8331934f54784390e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-19 23:13:24 +0300
+commit 37947d4a7565b87e4cec8b89229d35b0a3f8d2cd
+Author: Gabriela Gutierrez <gabigutierrez@google.com>
+Date: 2023-09-26 15:55:13 +0000
- xzgrep: Improve error handling, especially signals.
+ CI: Bump and ref actions by commit SHA in windows-ci.yml
- xzgrep wouldn't exit on SIGPIPE or SIGQUIT when it clearly
- should have. It's quite possible that it's not perfect still
- but at least it's much better.
+ Referencing actions by commit SHA in GitHub workflows guarantees you are using an immutable version. Actions referenced by tags and branches are more vulnerable to attacks, such as the tag being moved to a malicious commit or a malicious commit being pushed to the branch.
- If multiple exit statuses compete, now it tries to pick
- the largest of value.
+ It's important to make sure the SHA's are from the original repositories and not forks.
- Some comments were added.
+ For reference:
- The exit status handling of signals is still broken if the shell
- uses values larger than 255 in $? to indicate that a process
- died due to a signal ***and*** their "exit" command doesn't take
- this into account. This seems to work well with the ksh and yash
- versions I tried. However, there is a report in gzip/zgrep that
- OpenSolaris 5.11 (not 5.10) has a problem with "exit" truncating
- the argument to 8 bits:
+ https://github.com/msys2/setup-msys2/releases/tag/v2.20.1
+ https://github.com/msys2/setup-msys2/commit/27b3aa77f672cb6b3054121cfd80c3d22ceebb1d
- https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22900#25
+ https://github.com/actions/checkout/releases/tag/v4.1.0
+ https://github.com/actions/checkout/commit/8ade135a41bc03ea155e62e844d188df1ea18608
- Such a bug would break xzgrep but I didn't add a workaround
- at least for now. 5.11 is old and I don't know if the problem
- exists in modern descendants, or if the problem exists in other
- ksh implementations in use.
-
- src/scripts/xzgrep.in | 72 +++++++++++++++++++++++++++++++++++++--------------
- 1 file changed, 53 insertions(+), 19 deletions(-)
-
-commit a648978b20495b7aa4a8b029c5a810b5ad9d08ff
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-19 00:10:55 +0300
-
- xzgrep: Make the fix for ZDI-CAN-16587 more robust.
+ https://github.com/actions/upload-artifact/releases/tag/v3.1.3
+ https://github.com/actions/upload-artifact/commit/a8a3f3ad30e3422c9c7b888a15615d19a852ae32
- I don't know if this can make a difference in the real world
- but it looked kind of suspicious (what happens with sed
- implementations that cannot process very long lines?).
- At least this commit shouldn't make it worse.
+ Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
- src/scripts/xzgrep.in | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ .github/workflows/windows-ci.yml | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit bd7b290f3fe4faeceb7d3497ed9bf2e6ed5e7dc5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-18 21:52:31 +0300
+commit f28cc9bd481ce493da11f98c18526d324211599a
+Author: Gabriela Gutierrez <gabigutierrez@google.com>
+Date: 2023-09-26 14:35:08 +0000
- xzgrep: Use grep -H --label when available (GNU, *BSDs).
+ CI: Bump and ref actions by commit SHA in ci.yml
+
+ Referencing actions by commit SHA in GitHub workflows guarantees you are using an immutable version. Actions referenced by tags and branches are more vulnerable to attacks, such as the tag being moved to a malicious commit or a malicious commit being pushed to the branch.
+
+ It's important to make sure the SHA's are from the original repositories and not forks.
- It avoids the use of sed for prefixing filenames to output lines.
- Using sed for that is slower and prone to security bugs so now
- the sed method is only used as a fallback.
+ For reference:
- This also fixes an actual bug: When grepping a binary file,
- GNU grep nowadays prints its diagnostics to stderr instead of
- stdout and thus the sed-method for prefixing the filename doesn't
- work. So with this commit grepping binary files gives reasonable
- output with GNU grep now.
+ https://github.com/actions/checkout/releases/tag/v4.1.0
+ https://github.com/actions/checkout/commit/8ade135a41bc03ea155e62e844d188df1ea18608
- This was inspired by zgrep but the implementation is different.
+ https://github.com/actions/upload-artifact/releases/tag/v3.1.3
+ https://github.com/actions/upload-artifact/commit/a8a3f3ad30e3422c9c7b888a15615d19a852ae32
+
+ Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
- src/scripts/xzgrep.in | 21 +++++++++++++++++++++
- 1 file changed, 21 insertions(+)
+ .github/workflows/ci.yml | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit b56729af9f1a596e57aeefd7570d8d7dce5c9f52
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-18 21:10:25 +0300
+commit f74f1740067b75042497edbfa6ea457ff75484b9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-10-12 20:12:18 +0800
- xzgrep: Use -e to specify the pattern to grep.
+ Build: Update visibility.m4 from Gnulib.
- Now we don't need the separate test for adding the -q option
- as it can be added directly in the two places where it's needed.
+ Updating from version 6 -> 8 from upstream. Declarations for variables
+ and function bodies were added to avoid unnecessary failures with
+ -Werror.
- src/scripts/xzgrep.in | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
+ m4/visibility.m4 | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
-commit bad61b5997e6647911974022bfb72f3d4818a594
+commit 5c4bca521e6fb435898a0012b3276eee70a6dadf
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-18 19:18:48 +0300
+Date: 2023-10-06 19:36:35 +0300
- Scripts: Use printf instead of echo in a few places.
-
- It's a good habbit as echo has some portability corner cases
- when the string contents can be anything.
+ Update THANKS.
- src/scripts/xzdiff.in | 6 +++---
- src/scripts/xzgrep.in | 4 ++--
- src/scripts/xzless.in | 4 ++--
- src/scripts/xzmore.in | 8 ++++----
- 4 files changed, 11 insertions(+), 11 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 6a4a4a7d2667837dc824c26fcb19ed6ca5aff645
+commit d91cb6e884c73d0b05d7e7d68ad4e6eb29f4b44b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-17 21:36:25 +0300
+Date: 2023-10-06 18:55:57 +0300
- xzgrep: Add more LC_ALL=C to avoid bugs with multibyte characters.
-
- Also replace one use of expr with printf.
-
- The rationale for LC_ALL=C was already mentioned in
- 69d1b3fc29677af8ade8dc15dba83f0589cb63d6 that fixed a security
- issue. However, unrelated uses weren't changed in that commit yet.
+ CMake/Windows: Fix when the windres workaround is applied.
- POSIX says that with sed and such tools one should use LC_ALL=C
- to ensure predictable behavior when strings contain byte sequences
- that aren't valid multibyte characters in the current locale. See
- under "Application usage" in here:
+ CMake doesn't set WIN32 on CYGWIN but the workaround is
+ probably needed on Cygwin too. Same for MSYS and MSYS2.
- https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
+ The workaround must not be used with Clang that is acting in
+ MSVC mode. This fixes it by checking for the known environments
+ that need the workaround instead of using "NOT MSVC".
- With GNU sed invalid multibyte strings would work without this;
- it's documented in its Texinfo manual. Some other implementations
- aren't so forgiving.
+ Thanks to Martin Storsjö.
+ https://github.com/tukaani-project/xz/commit/0570308ddd9c0e39e85597ebc0e31d4fc81d436f#commitcomment-129098431
- src/scripts/xzgrep.in | 14 ++++++++------
- 1 file changed, 8 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit b48f9d615f2c2e8d2f6e253d0e48ee66d0652b68
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-17 20:55:16 +0300
+commit 01e34aa1171b04f8b28960b1cc6135a903e0c13d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-29 22:11:54 +0800
- xzgrep: Fix parsing of certain options.
+ CI: Disable CLANG64 MSYS2 environment until bug is resolved.
- Fix handling of "xzgrep -25 foo" (in GNU grep "grep -25 foo" is
- an alias for "grep -C25 foo"). xzgrep would treat "foo" as filename
- instead of as a pattern. This bug was fixed in zgrep in gzip in 2012.
+ lld 17.0.1 searches for libraries to link first in the toolchain
+ directories before the local directory when building. The is a problem
+ for us because liblzma.a is installed in MSYS2 CLANG64 by default and
+ xz.exe will thus use the installed library instead of the one being
+ built.
- Add -E, -F, -G, and -P to the "no argument required" list.
+ This causes tests to fail when they are expecting features to be
+ disabled. More importantly, it will compile xz.exe with an incorrect
+ liblzma and could cause unexpected behavior by being unable to update
+ liblzma code in static builds. The CLANG64 environment can be tested
+ again once this is fixed.
- Add -X to "argument required" list. It is an
- intentionally-undocumented GNU grep option so this isn't
- an important option for xzgrep but it seems that other grep
- implementations (well, those that I checked) don't support -X
- so I hope this change is an improvement still.
+ Link to bug: https://github.com/llvm/llvm-project/issues/67779.
+
+ .github/workflows/windows-ci.yml | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+commit 30d0c35327f3639cb11224872aa58fdbf0b1526e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-29 20:14:39 +0800
+
+ CMake: Rename xz and man page symlink custom targets.
- grep -d (grep --directories=ACTION) requires an argument. In
- contrast to zgrep, I kept -d in the "no argument required" list
- because it's not supported in xzgrep (or zgrep). This way
- "xzgrep -d" gives an error about option being unsupported instead
- of telling that it requires an argument. Both zgrep and xzgrep
- tell that it's unsupported if an argument is specified.
+ The Ninja Generator for CMake cannot have a custom target and its
+ BYPRODUCTS have the same name. This has prevented Ninja builds on
+ Unix-like systems since the xz symlinks were introduced in
+ 80a1a8bb838842a2be343bd88ad1462c21c5e2c9.
+
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 506d03127a8565442b028ec991e1578124fd3025
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-29 19:58:44 +0800
+
+ CMake: Specify LINKER_LANGUAGE for libgnu target to fix Ninja Generator.
- Add comments.
+ CMake is unable to guess the linker language for just a header file so
+ it must be explicitly set.
- src/scripts/xzgrep.in | 19 +++++++++++++++++--
- 1 file changed, 17 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit 2d2201bc6315deda4d43625aa510972467bd51d4
+commit 0570308ddd9c0e39e85597ebc0e31d4fc81d436f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-14 20:33:05 +0300
+Date: 2023-09-27 19:54:35 +0300
- Tests: Add the .lzma files to test_files.sh.
+ CMake: Fix Windows build with Clang/LLVM 17.
+
+ llvm-windres 17.0.0 has more accurate emulation of GNU windres, so
+ the hack for GNU windres must now be used with llvm-windres too.
+
+ LLVM 16.0.6 has the old behavior and there likely won't be more
+ 16.x releases. So we can simply check for >= 17.0.0.
+
+ See also:
+ https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47
- tests/test_files.sh | 20 ++++++++++++++++++++
- 1 file changed, 20 insertions(+)
+ CMakeLists.txt | 26 ++++++++++++++------------
+ 1 file changed, 14 insertions(+), 12 deletions(-)
-commit ce5549a591bf126300618879f5b24023351baff6
+commit 5a9af95f85a7e5d4f9c10cb8cf737651a921f1d1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-14 19:37:42 +0300
+Date: 2023-09-26 21:47:13 +0300
- Tests: Add .lzma test files.
+ liblzma: Update a comment.
+
+ The C standards don't allow an empty translation unit which can be
+ avoided by declaring something, without exporting any symbols.
+
+ When I committed f644473a211394447824ea00518d0a214ff3f7f2 I had
+ a feeling that some specific toolchain somewhere didn't like
+ empty object files (assembler or maybe "ar" complained) but
+ I cannot find anything to confirm this now. Quite likely I
+ remembered nonsense. I leave this here as a note to my future self. :-)
- tests/files/README | 63 ++++++++++++++++-----
- tests/files/bad-too_big_size-with_eopm.lzma | Bin 0 -> 37 bytes
- tests/files/bad-too_small_size-without_eopm-1.lzma | Bin 0 -> 31 bytes
- tests/files/bad-too_small_size-without_eopm-2.lzma | Bin 0 -> 31 bytes
- tests/files/bad-too_small_size-without_eopm-3.lzma | Bin 0 -> 36 bytes
- tests/files/bad-unknown_size-without_eopm.lzma | Bin 0 -> 31 bytes
- tests/files/good-known_size-with_eopm.lzma | Bin 0 -> 37 bytes
- tests/files/good-known_size-without_eopm.lzma | Bin 0 -> 31 bytes
- tests/files/good-unknown_size-with_eopm.lzma | Bin 0 -> 37 bytes
- 9 files changed, 50 insertions(+), 13 deletions(-)
+ src/liblzma/check/crc64_table.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
-commit 107c93ee5cad51a6ea0cee471209bfe8d76deaa3
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-14 18:12:38 +0300
+commit 8ebaf3f665ddc7e4f19c613005050dde5ccbe499
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-27 00:02:11 +0800
- liblzma: Rename a variable and improve a comment.
+ liblzma: Avoid compiler warning without creating extra symbol.
+
+ When the generic fast crc64 method is used, then we omit
+ lzma_crc64_table[][]. Similar to
+ d9166b52cf3458a4da3eb92224837ca8fc208d79, we can avoid compiler warnings
+ with -Wempty-translation-unit (Clang) or -pedantic (GCC) by creating a
+ never used typedef instead of an extra symbol.
- src/liblzma/lzma/lzma_decoder.c | 13 +++++++++----
- 1 file changed, 9 insertions(+), 4 deletions(-)
+ src/liblzma/check/crc64_table.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
-commit 511feb5eadb988d641b025d597f4fac7502003b8
+commit 092d21db2e5eea19fe079264ce48c178989c7606
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-13 22:24:41 +0300
+Date: 2023-09-26 17:24:15 +0300
- Update THANKS.
+ Build: Update the comment about -Werror usage in checks.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ configure.ac | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
-commit 9595a3119b9faf0ce01375329cad8bbf85c35ea2
+commit a37a2763383e6c204fe878e1416dd35e7711d3a9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-13 22:24:07 +0300
+Date: 2023-09-26 15:00:43 +0300
- liblzma: Add optional autodetection of LZMA end marker.
+ Build: Fix __attribute__((ifunc(...))) detection with clang -Wall.
- Turns out that this is needed for .lzma files as the spec in
- LZMA SDK says that end marker may be present even if the size
- is stored in the header. Such files are rare but exist in the
- real world. The code in liblzma is so old that the spec didn't
- exist in LZMA SDK back then and I had understood that such
- files weren't possible (the lzma tool in LZMA SDK didn't
- create such files).
+ Now if user-supplied CFLAGS contains -Wall -Wextra -Wpedantic
+ the two checks that need -Werror will still work.
- This modifies the internal API so that LZMA decoder can be told
- if EOPM is allowed even when the uncompressed size is known.
- It's allowed with .lzma and not with other uses.
+ At CMake side there is add_compile_options(-Wall -Wextra)
+ but it didn't affect the -Werror tests. So with both Autotools
+ and CMake only user-supplied CFLAGS could make the checks fail
+ when they shouldn't.
- Thanks to Karl Beldan for reporting the problem.
+ This is not a full fix as things like -Wunused-macros in
+ user-supplied CFLAGS will still cause problems with both
+ GCC and Clang.
- doc/lzma-file-format.txt | 11 +++-
- src/liblzma/common/alone_decoder.c | 2 +-
- src/liblzma/common/microlzma_decoder.c | 2 +-
- src/liblzma/lz/lz_decoder.c | 10 +++-
- src/liblzma/lz/lz_decoder.h | 8 +--
- src/liblzma/lzma/lzma2_decoder.c | 2 +-
- src/liblzma/lzma/lzma_decoder.c | 99 ++++++++++++++++++++++++----------
- 7 files changed, 95 insertions(+), 39 deletions(-)
+ CMakeLists.txt | 8 ++++++++
+ configure.ac | 8 ++++++++
+ 2 files changed, 16 insertions(+)
-commit 0c0f8e9761eb6eaf199082cf144db7ac5f9d8cb2
+commit 9c42f936939b813f25d0ff4e99c3eb9c2d17a0d2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-07-12 18:53:04 +0300
+Date: 2023-09-26 13:51:31 +0300
- xz: Document the special memlimit case of 2000 MiB on MIPS32.
+ Build: Fix underquoted AC_LANG_SOURCE.
- See commit fc3d3a7296ef58bb799a73943636b8bfd95339f7.
+ It made no practical difference in this case.
- src/xz/xz.1 | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit d1bfa3dc703325ecd974167e864a8712fdfe936e
-Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-07-01 21:19:26 +0800
+commit 9f1444a8a5c0e724b2c7ef83424f642f07a95982
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-09-26 13:14:37 +0300
- Created script to generate code coverage reports.
+ Build: Silence two Autoconf warnings.
+
+ There were two uses of AC_COMPILE_IFELSE that didn't use
+ AC_LANG_SOURCE and Autoconf warned about these. The omission
+ had been intentional but it turned out that this didn't do
+ what I thought it would.
+
+ Autoconf 2.71 manual gives an impression that AC_LANG_SOURCE
+ inserts all #defines that have been made with AC_DEFINE so
+ far (confdefs.h). The idea was that omitting AC_LANG_SOURCE
+ would mean that only the exact code included in the
+ AC_COMPILE_IFELSE call would be compiled.
+
+ With C programs this is not true: the #defines get added without
+ AC_LANG_SOURCE too. There seems to be no neat way to avoid this.
+ Thus, with the C language at least, adding AC_LANG_SOURCE makes
+ no other difference than silencing a warning from Autoconf. The
+ generated "configure" remains identical. (Docs of AC_LANG_CONFTEST
+ say that the #defines have been inserted since Autoconf 2.63b and
+ that AC_COMPILE_IFELSE uses AC_LANG_CONFTEST. So the behavior is
+ documented if one also reads the docs of macros that one isn't
+ calling directly.)
+
+ Any extra code, including #defines, can cause problems for
+ these two tests because these tests must use -Werror.
+ CC=clang CFLAGS=-Weverything is the most extreme example.
+ It enables -Wreserved-macro-identifier which warns about
+ #define __EXTENSIONS__ 1 because it begins with two underscores.
+ It's possible to write a test file that passes -Weverything but
+ it becomes impossible when Autoconf inserts confdefs.h.
- The script uses lcov and genhtml after running the tests
- to show the code coverage statistics. The script will create
- a coverage directory where it is run. It can be run both in
- and out of the source directory.
+ So this commit adds AC_LANG_SOURCE to silence Autoconf warnings.
+ A different solution is needed for -Werror tests.
- .gitignore | 4 +++
- tests/code_coverage.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 83 insertions(+)
+ configure.ac | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
-commit 86a30b0255d8064169fabfd213d907016d2f9f2a
+commit 519e47c2818acde571fadc79551294527fe6cc22
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-06-16 17:32:19 +0300
+Date: 2023-09-26 01:17:11 +0800
- Tests: Add more tests into test_check.
+ CMake: Remove accidental extra newline.
- tests/test_check.c | 279 +++++++++++++++++++++++++++++++++++++++++++++++++++--
- tests/tests.h | 23 +++++
- 2 files changed, 295 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
-commit 82e30fed66a89706388a8c15dc954d84e63f38fa
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-16 15:02:57 +0300
+commit bbb42412da6a02705ba3e668e90840c2683e4e67
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-26 00:47:26 +0800
- Tests: Use char[][24] array for enum_strings_lzma_ret.
+ Build: Remove Gnulib dependency from tests.
- Array of pointers to short strings is a bit pointless here
- and now it's fully const.
+ The tests do not use any Gnulib replacements so they do not need to link
+ libgnu.a or have /lib in the include path.
- tests/tests.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/Makefile.am | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
-commit 5ba9459e6c4a29f6870ca78ce8ac6e519d59c41e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-16 14:12:14 +0300
+commit d265f6b75691c6c8fa876eb5320c3ff5aed17dfa
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-26 00:43:43 +0800
- Tests: tuktest.h: Add tuktest_error_impl to help with error conditions.
+ CMake: Remove /lib from tests include path.
+
+ The tests never included anything from /lib, so this was not needed.
- tests/tuktest.h | 72 +++++++++++++++++++++++++--------------------------------
- 1 file changed, 32 insertions(+), 40 deletions(-)
+ CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
-commit b339892668da20aea22a93668c82b87a38e4a97f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-16 13:29:59 +0300
+commit 9fb5de41f2fb654ca952d4bda15cf3777c2b720f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 22:10:41 +0800
- Tests: tuktest.h: Rename file_from_* and use tuktest_malloc there.
+ Scripts: Change quoting style from `...' to '...'.
- tests/test_bcj_exact_size.c | 4 +---
- tests/tuktest.h | 52 +++++++++++++++++++++------------------------
- 2 files changed, 25 insertions(+), 31 deletions(-)
+ src/scripts/xzdiff.in | 2 +-
+ src/scripts/xzgrep.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit d8b63a0ad68d1c461eb373466679ebc41fbc207d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-16 13:08:19 +0300
+commit eaebdef4d4de3c088b0905f42626b74e0d23abf3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 22:10:18 +0800
- Tests: tuktest.h: Add malloc wrapper with automatic freeing.
+ xz: Change quoting style from `...' to '...'.
- tests/tuktest.h | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 124 insertions(+)
+ src/xz/args.c | 6 +++---
+ src/xz/file_io.c | 2 +-
+ src/xz/main.c | 4 ++--
+ src/xz/message.c | 14 +++++++-------
+ src/xz/options.c | 2 +-
+ src/xz/suffix.c | 2 +-
+ src/xz/util.c | 6 +++---
+ 7 files changed, 18 insertions(+), 18 deletions(-)
-commit 1d51536a4b19a8fae768f8eb462fc2238cb36d53
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-16 11:47:37 +0300
+commit f6667702bf075a05fbe336dbf3576ad1a82ec645
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 22:09:47 +0800
- Tests: tuktest.h: Move a function.
+ liblzma: Change quoting style from `...' to '...'.
+
+ This was done for both internal and API headers.
- tests/tuktest.h | 44 ++++++++++++++++++++++----------------------
- 1 file changed, 22 insertions(+), 22 deletions(-)
+ src/liblzma/api/lzma/base.h | 18 +++++++++---------
+ src/liblzma/api/lzma/container.h | 10 +++++-----
+ src/liblzma/api/lzma/filter.h | 6 +++---
+ src/liblzma/api/lzma/index.h | 8 ++++----
+ src/liblzma/api/lzma/lzma12.h | 2 +-
+ src/liblzma/lz/lz_encoder.h | 2 +-
+ src/liblzma/rangecoder/range_decoder.h | 2 +-
+ 7 files changed, 24 insertions(+), 24 deletions(-)
-commit 70c7555f6403553ee35539e869de0025592d8564
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 22:21:15 +0300
+commit be012b8097a4eaee335b51357d6befa745f753ce
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 22:09:16 +0800
- Tests: test_vli: Remove an invalid test-assertion.
-
- lzma_vli is unsigned so trying a signed value results in
- a compiler warning from -Wsign-conversion. (lzma_vli)-1
- equals to LZMA_VLI_UNKNOWN anyway which is the next assertion.
+ Build: Change quoting style from `...' to '...'.
- tests/test_vli.c | 2 --
- 1 file changed, 2 deletions(-)
+ configure.ac | 18 +++++++++---------
+ dos/config.h | 6 +++---
+ m4/getopt.m4 | 2 +-
+ m4/tuklib_progname.m4 | 2 +-
+ windows/build.bash | 2 +-
+ 5 files changed, 15 insertions(+), 15 deletions(-)
-commit 154b73c5a1092c3f785e01666b564ad7ff1be555
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 22:10:10 +0300
+commit ce162db07f03495bd333696e66883c8f36abdc1e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 22:05:02 +0800
- Tests: test_vli: Add const where appropriate.
+ Docs: Change quoting style from `...' to '...'.
+
+ These days the ` and ' do not look symmetric. This quoting style has
+ been changed in various apps over the years including the GNU tools.
- tests/test_vli.c | 53 ++++++++++++++++++++++++++++-------------------------
- 1 file changed, 28 insertions(+), 25 deletions(-)
+ INSTALL | 6 +++---
+ doc/examples/01_compress_easy.c | 2 +-
+ doc/examples/11_file_info.c | 16 ++++++++--------
+ 3 files changed, 12 insertions(+), 12 deletions(-)
-commit 0354d6cce3ff98ea6f927107baf216253f6ce2bb
-Author: Jia Tan <jiat75@gmail.com>
-Date: 2022-06-13 20:27:03 +0800
+commit db17656721e43939bfa4ec13506e7c76f4b86da6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 21:25:01 +0800
- Added vli tests to .gitignore
+ lib: Silence -Wsign-conversion in getopt.c.
- .gitignore | 1 +
- 1 file changed, 1 insertion(+)
+ lib/getopt.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit a08f5ccf6bdc20ef70e41f6f3321618ef146f96e
+commit a6234f677d66888f435010bc0b67de6a32fefcf6
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-06-12 11:31:40 +0800
+Date: 2023-09-24 20:48:52 +0800
- Created tests for all functions exported in vli.h
+ Build: Update getopt.m4 from Gnulib.
- Achieved 100% code coverage vli_encoder.c, vli_decoder.c, and vli_size.c
+ This file was modified from upstream since we do not need to replace
+ getopt() and can avoid complexity and feature tests.
- tests/Makefile.am | 4 +-
- tests/test_vli.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 311 insertions(+), 1 deletion(-)
+ m4/getopt.m4 | 79 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 39 insertions(+), 40 deletions(-)
-commit 1e3eb61815a91c0a1bfbb802e2d95593f523491f
-Author: jiat75 <jiat0218@gmail.com>
-Date: 2022-06-03 21:24:54 +0800
+commit 84808b68f1075e8603a8ef95d361a61fdc6a5b10
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-26 00:09:53 +0800
- Added parallel test artifacts to .gitignore
+ CMake: Add /lib to include path.
- .gitignore | 2 ++
- 1 file changed, 2 insertions(+)
+ CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit 00e3613f1212eaa84e721585fdb4de6967cf2476
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 21:29:21 +0300
+commit 01804a0b4b64e0f33568e947e0579263808c59d3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 20:36:34 +0800
- Tests: Use good-1-empty-bcj-lzma2.xz in test_bcj_exact_size.
-
- It's much nicer this way so that the test data isn't a hardcoded
- table inside the C file.
+ CMake: Update libgnu target with new header files.
- tests/test_bcj_exact_size.c | 19 +++++++------------
- 1 file changed, 7 insertions(+), 12 deletions(-)
+ CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit 86bab755be252bfd3e0a9aee8e7b83a9bbb23ed0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 21:26:13 +0300
+commit d34558388fe1d8929f6478d61dc322eb4f2900af
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-23 00:47:52 +0800
- Tests: Add file reading helpers to tuktest.h.
+ lib: Update Makefile.am for new header files.
- tests/tuktest.h | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 176 insertions(+), 7 deletions(-)
+ lib/Makefile.am | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
-commit 83d2337b72dbf391c6f3b41889eea99e51679105
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 18:21:57 +0300
+commit 52bf644bdf536e20fcc743b712cede135e05eec5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-24 20:34:03 +0800
- Tests: tuktest.h: Move a printf from a macro to a helper function.
+ lib: Update getopt1.c from Gnulib.
+
+ The only difference was maintaining the conditional inclusion for
+ config.h.
- tests/tuktest.h | 26 ++++++++++++++++++--------
- 1 file changed, 18 insertions(+), 8 deletions(-)
+ lib/getopt1.c | 56 ++++++++++++++++++++++----------------------------------
+ 1 file changed, 22 insertions(+), 34 deletions(-)
-commit f9e8176ea7d520797a2db2d49a5a632c285674a8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-14 17:20:49 +0300
+commit 7e884c00d0093c38339f17fb1d280eec493f42ca
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-23 03:27:00 +0800
- Tests: Add test file good-1-empty-bcj-lzma2.xz.
+ lib: Update getopt.in.h from Gnulib with modifications.
+
+ We can still avoid modifying the contents of this file during
+ configuration to simplify the build systems. Gnulib added replacements
+ for inclusions guards for Cygwin. Cygwin should not need getopt_long
+ replacement so this feature can be omitted.
+
+ <unistd.h> is conditionally included to avoid MSVC since it is not
+ available.
- This is from test_bcj_exact_size.c.
- It's good to have it as a standalone file.
+ The definition for _GL_ARG_NONNULL was also copied into this file from
+ Gnulib since this stage is usually done during gnulib-tool.
- tests/files/README | 5 +++++
- tests/files/good-1-empty-bcj-lzma2.xz | Bin 0 -> 52 bytes
- 2 files changed, 5 insertions(+)
+ lib/getopt.in.h | 228 +++++++-------------------------------------------------
+ 1 file changed, 29 insertions(+), 199 deletions(-)
-commit aa75c5563a760aea3aa23d997d519e702e82726b
+commit cff05f82066ca3ce9425dafdb086325a8eef8de3
Author: Jia Tan <jiat0218@gmail.com>
-Date: 2022-06-10 21:35:18 +0800
+Date: 2023-09-23 00:31:55 +0800
- Tests: Created tests for hardware functions.
-
- Created tests for all API functions exported in
- src/liblzma/api/lzma/hardware.h. The tests are fairly trivial
- but are helpful because they will inform users if their machines
- cannot support these functions. They also improve the code
- coverage metrics.
+ lib: Update getopt_int.h from Gnulib.
- .gitignore | 1 +
- tests/Makefile.am | 2 ++
- tests/test_hardware.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 48 insertions(+)
+ lib/getopt_int.h | 109 ++++++++++++++++++++++++-------------------------------
+ 1 file changed, 48 insertions(+), 61 deletions(-)
-commit 5c8ffdca20813939818843476fb212dfae8838a3
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-02 21:01:45 +0300
+commit 04bd86a4b010d43c6a016a3857ecb38dc1d5b024
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-23 00:27:23 +0800
- Tests: Convert test_check to tuktest.
+ lib: Update getopt.c from Gnulib with modifications.
- Thanks to Jia Tan for help with all the tests.
+ The code maintains the prior modifications of conditionally including
+ config.h and disabling NLS support.
+
+ _GL_UNUSED is repalced with the simple cast to void trick. _GL_UNUSED
+ is only used for these two parameters so its simpler than having to
+ define it.
- tests/test_check.c | 67 +++++++++++++++++++++++++++---------------------------
- 1 file changed, 33 insertions(+), 34 deletions(-)
+ lib/getopt.c | 1134 +++++++++++++++++++---------------------------------------
+ 1 file changed, 377 insertions(+), 757 deletions(-)
-commit faf5ff8899d539b4dcd2a7e5280cb820a4746c86
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-02 20:31:03 +0300
+commit 56b42be7287844db20b3a3bc1372c6ae8c040d63
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-23 00:18:56 +0800
- Tests: Convert test_block_header to tuktest.
+ lib: Add getopt-cdefs.h for getopt_long update.
+
+ This was modified slightly from Gnulib. In Gnulib, it expects the
+ @HAVE_SYS_CDEFS_H@ to be replaced. Instead, we can set HAVE_SYS_CDEFS_H
+ on systems that have it and avoid copying another file into the build
+ directory. Since we are not using gnulib-tool, copying extra files
+ requires extra build system updates (and special handling with CMake) so
+ we should avoid when possible.
- tests/test_block_header.c | 89 +++++++++++++++++++++++++++--------------------
- 1 file changed, 52 insertions(+), 37 deletions(-)
+ lib/getopt-cdefs.h | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 70 insertions(+)
-commit 754d39fbebee3782258d42f154a223d3c5770ec7
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-02 20:28:23 +0300
+commit 9834e591a4cf9dc2f49e42e26bf28d1d247bc196
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-23 00:15:25 +0800
- Tests: Convert test_bcj_exact_size to tuktest.
+ lib: Copy new header files from Gnulib without modification.
- The compress() and decompress() functions were merged because
- the later depends on the former so they need to be a single
- test case.
+ The getopt related files have changed from Gnulib by splitting up
+ getopt.in.h into more modular header files. We could have kept
+ everything in just getopt.in.h, but this will help us continue to update
+ in the future.
- tests/test_bcj_exact_size.c | 75 +++++++++++++++++++++++++--------------------
- 1 file changed, 41 insertions(+), 34 deletions(-)
+ lib/getopt-core.h | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ lib/getopt-ext.h | 77 +++++++++++++++++++++++++++++++++++++++++
+ lib/getopt-pfx-core.h | 66 +++++++++++++++++++++++++++++++++++
+ lib/getopt-pfx-ext.h | 70 +++++++++++++++++++++++++++++++++++++
+ 4 files changed, 309 insertions(+)
-commit 96da21470f9570cd08286906a050a7c22631775b
+commit 5b7a6f06e93d99d6635a740fd2e12fab66096c93
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-02 20:27:00 +0300
+Date: 2023-09-22 21:16:52 +0300
- Tests: Include tuktest.h in tests.h.
-
- This breaks -Werror because none of the tests so far use
- tuktest.h and thus there are warnings about unused variables
- and functions.
+ Windows: Update the version requirement comments from Win95 to W2k.
- tests/tests.h | 47 +++++++++++++++++++++++------------------------
- 1 file changed, 23 insertions(+), 24 deletions(-)
+ windows/README-Windows.txt | 10 ++++------
+ windows/build.bash | 6 +++---
+ 2 files changed, 7 insertions(+), 9 deletions(-)
-commit df71ba1c991f60c3269aaadd398247e632714626
+commit e582f8e0fee46e7cd967f42f465d6bb608b73bc1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-06-02 20:25:21 +0300
+Date: 2023-09-22 21:12:54 +0300
- Tests: Add tuktest.h mini-test-framework.
+ tuklib_physmem: Comment out support for Windows versions older than 2000.
- tests/Makefile.am | 1 +
- tests/tuktest.h | 752 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 753 insertions(+)
+ src/common/tuklib_physmem.c | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
-commit 4773608554d1b684a05ff9c1d879cf5c42266d33
+commit 7d73d1f0e08f96c4ab7aac91b958e37a3dadf07a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 21:31:36 +0300
+Date: 2023-09-24 16:32:32 +0300
- Build: Enable Automake's parallel test harness.
-
- It has been the default for quite some time already and
- the old serial harness isn't discouraged. The downside is
- that with parallel tests one cannot print progress info or
- other diagnostics to the terminal; all output from the tests
- will be in the log files only. But now that the compression
- tests are separated the parallel tests will speed things up.
+ sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO.
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/common/sysdefs.h | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
-commit 9a6dd6d46f7f256a5573e5d874c1052033ed7b05
+commit 2a9929af0ab7e6c0ab725565034afe3293e51d71
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 21:17:47 +0300
+Date: 2023-09-22 02:33:29 +0300
- Tests: Split test_compress.sh into separate test unit for each file.
+ xz: Windows: Don't (de)compress to special files like "con" or "nul".
- test_compress.sh now takes one command line argument:
- a filename to be tested. If it begins with "compress_generated_"
- the file will be created with create_compress_files.
+ Before this commit, the following writes "foo" to the
+ console and deletes the input file:
- This will allow parallel execution of the slow tests.
+ echo foo | xz > con_xz
+ xz --suffix=_xz --decompress con_xz
+
+ It cannot happen without --suffix because names like con.xz
+ are also special and so attempting to decompress con.xz
+ (or compress con to con.xz) will already fail when opening
+ the input file.
+
+ Similar thing is possible when compressing. The following
+ writes to "nul" and the input file "n" is deleted.
+
+ echo foo | xz > n
+ xz --suffix=ul n
+
+ Now xz checks if the destination is a special file before
+ continuing. DOS/DJGPP version had a check for this but
+ Windows (and OS/2) didn't.
- tests/Makefile.am | 11 +++-
- tests/test_compress.sh | 91 +++++++++++++++++++---------------
- tests/test_compress_generated_abc | 3 ++
- tests/test_compress_generated_random | 3 ++
- tests/test_compress_generated_text | 3 ++
- tests/test_compress_prepared_bcj_sparc | 3 ++
- tests/test_compress_prepared_bcj_x86 | 3 ++
- 7 files changed, 77 insertions(+), 40 deletions(-)
+ src/xz/file_io.c | 35 ++++++++++++++++++++++++++++-------
+ 1 file changed, 28 insertions(+), 7 deletions(-)
-commit c7758ac9c734707514dd34f254173ebac5eea7f8
+commit 01311b81f03cce1c0ce847a3d556f84dbd439343
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 20:32:49 +0300
+Date: 2023-09-21 20:42:52 +0300
- Test: Make create_compress_files.c a little more flexible.
-
- If a command line argument is given, then only the test file
- of that type is created. It's quite dumb in sense that unknown
- names don't give an error but it's good enough here.
-
- Also use EXIT_FAILURE instead of 1 as exit status for errors.
+ CMake: Wrap two overlong lines that are possible to wrap.
- tests/create_compress_files.c | 25 +++++++++++++++----------
- 1 file changed, 15 insertions(+), 10 deletions(-)
+ CMakeLists.txt | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 4a8e4a7b0ad4b03c0ac6862716c3457452cdaf8c
+commit 152d0771ddd0cffcac9042ad1a66f110d228eee2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 20:17:42 +0300
+Date: 2023-09-21 20:36:31 +0300
- Tests: Remove unneeded commented lines from test_compress.sh.
+ CMake: Add a comment about threads on Cygwin.
- tests/test_compress.sh | 13 -------------
- 1 file changed, 13 deletions(-)
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
-commit 2ee50d150ee009f36135540b459e6ff328549725
+commit 6df988cceffaa3100b428ed816fad334935b27bf
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 20:16:00 +0300
+Date: 2023-09-12 23:53:25 +0300
- Tests: Remove progress indicator from test_compress.sh.
+ MSVC: Remove Visual Studio project files and update INSTALL-MSVC.txt.
- It will be useless with Automake's parallel tests.
+ CMake is now the preferred build file generator when building
+ with MSVC.
- tests/test_compress.sh | 9 ---------
- 1 file changed, 9 deletions(-)
+ windows/INSTALL-MSVC.txt | 37 ++--
+ windows/vs2013/config.h | 157 ---------------
+ windows/vs2013/liblzma.vcxproj | 363 ---------------------------------
+ windows/vs2013/liblzma_dll.vcxproj | 398 ------------------------------------
+ windows/vs2013/xz_win.sln | 48 -----
+ windows/vs2017/config.h | 157 ---------------
+ windows/vs2017/liblzma.vcxproj | 363 ---------------------------------
+ windows/vs2017/liblzma_dll.vcxproj | 398 ------------------------------------
+ windows/vs2017/xz_win.sln | 48 -----
+ windows/vs2019/config.h | 157 ---------------
+ windows/vs2019/liblzma.vcxproj | 364 ---------------------------------
+ windows/vs2019/liblzma_dll.vcxproj | 399 -------------------------------------
+ windows/vs2019/xz_win.sln | 51 -----
+ 13 files changed, 12 insertions(+), 2928 deletions(-)
-commit 2ce4f36f179a81d0c6e182a409f363df759d1ad0
+commit edd563daf0da1d00018684614803c77ab62efcd6
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-05-23 19:37:18 +0300
+Date: 2023-09-21 19:17:40 +0300
- liblzma: Silence a warning.
+ CMake: Require VS2015 or later for building xzdec.
- The actual initialization is done via mythread_sync and seems
- that GCC doesn't necessarily see that it gets initialized there.
+ xzdec might build with VS2013 but it hasn't been tested.
+ It was never supported before and VS2013 is old anyway
+ so for simplicity only liblzma is supported with VS2013.
- src/liblzma/common/stream_decoder_mt.c | 2 +-
+ CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 5d8f3764ef43c35910e6d7003c0900a961ef6544
+commit daea64d158a7151ca6c255a0e4554c6d521cd589
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-14 20:53:16 +0300
+Date: 2023-09-12 23:43:49 +0300
- xz: Fix build with --disable-threads.
+ CMake: Allow building xz with Visual Studio 2015 and later.
+
+ Building the command line tools xz and xzdec with the combination
+ of CMake + Visual Studio 2015/2017/2019/2022 works now.
+
+ VS2013 update 2 should still be able to build liblzma.
+ VS2013 cannot build the xz command line tool because xz
+ needs snprintf() that roughly conforms to C99.
+ VS2013 is old and no extra code will be added to support it.
+
+ Thanks to Kelvin Lee and Jia Tan for testing.
- src/xz/hardware.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 1d592897278b172d8549aa29c3a1f3a4f432a9b9
+commit 8c2d197c940d246849b2ec48109bb22e54036927
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-14 14:50:17 +0300
+Date: 2023-09-12 23:34:31 +0300
- xz: Change the cap of the default -T0 memlimit for 32-bit xz.
-
- The SIZE_MAX / 3 was 1365 MiB. 1400 MiB gives little more room
- and it looks like a round (artificial) number in --info-memory
- once --info-memory is made to display it.
+ MSVC: #define inline and restrict only when needed.
- Also, using #if avoids useless code on 64-bit builds.
+ This also drops the check for _WIN32 as that shouldn't be needed.
- src/xz/hardware.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ src/common/sysdefs.h | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
-commit c77fe55ddb7752ed0fec46967c5ec9a72632ea0c
+commit af66cd585902045e5689a0418103ec81f19f1d0a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-14 14:20:46 +0300
+Date: 2023-09-12 22:16:56 +0300
- xz: Add a default soft memory usage limit for --threads=0.
+ CMake: Add support for replacement getopt_long (lib/getopt*).
- This is a soft limit in sense that it only affects the number of
- threads. It never makes xz fail and it never makes xz change
- settings that would affect the compressed output.
-
- The idea is to make -T0 have more reasonable behavior when
- the system has very many cores or when a memory-hungry
- compression options are used. This also helps with 32-bit xz,
- preventing it from running out of address space.
-
- The downside of this commit is that now the number of threads
- might become too low compared to what the user expected. I
- hope this to be an acceptable compromise as the old behavior
- has been a source of well-argued complaints for a long time.
+ Thanks to Jia Tan for the initial work. I added the libgnu target
+ and made a few related minor edits.
- src/xz/coder.c | 28 ++++++++++++++++++++++++++--
- src/xz/hardware.c | 38 +++++++++++++++++++++++++++++---------
- src/xz/hardware.h | 27 +++++++++++++++++++++++++++
- 3 files changed, 82 insertions(+), 11 deletions(-)
+ CMakeLists.txt | 54 +++++++++++++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 47 insertions(+), 7 deletions(-)
-commit 0adc13bfe32c14f3e4c6ce9f2d4fdf4112ab53f4
+commit e3288fdb45c580cb849f6799cf419c4922004ae5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-14 12:59:09 +0300
+Date: 2023-09-12 21:12:34 +0300
- xz: Make -T0 use multithreaded mode on single-core systems.
+ CMake: Bump maximum policy version to 3.27.
- The main problem withi the old behavior is that the compressed
- output is different on single-core systems vs. multicore systems.
- This commit fixes it by making -T0 one thread in multithreaded mode
- on single-core systems.
+ There are several new policies. CMP0149 may affect the Windows SDK
+ version that CMake will choose by default. The new behavior is more
+ predictable, always choosing the latest SDK version by default.
- The downside of this is that it uses more memory. However, if
- --memlimit-compress is used, xz can (thanks to the previous commit)
- drop to the single-threaded mode still.
+ The other new policies shouldn't affect this package.
- src/xz/coder.c | 18 +++++++++---------
- src/xz/hardware.c | 14 ++++++++++++++
- src/xz/hardware.h | 4 ++++
- 3 files changed, 27 insertions(+), 9 deletions(-)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 898faa97287a756231c663a3ed5165672b417207
+commit aff1b479c7b168652bd20305ceed4317d5db6661
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-14 12:38:00 +0300
+Date: 2023-09-12 20:55:10 +0300
- xz: Changes to --memlimit-compress and --no-adjust.
+ lib/getopt*.c: Include <config.h> only HAVE_CONFIG_H is defined.
- In single-threaded mode, --memlimit-compress can make xz scale down
- the LZMA2 dictionary size to meet the memory usage limit. This
- obviously affects the compressed output. However, if xz was in
- threaded mode, --memlimit-compress could make xz reduce the number
- of threads but it wouldn't make xz switch from multithreaded mode
- to single-threaded mode or scale down the LZMA2 dictionary size.
- This seemed illogical and there was even a "FIXME?" about it.
+ The CMake-based build doesn't use config.h.
- Now --memlimit-compress can make xz switch to single-threaded
- mode if one thread in multithreaded mode uses too much memory.
- If memory usage is still too high, then the LZMA2 dictionary
- size can be scaled down too.
-
- The option --no-adjust was also changed so that it no longer
- prevents xz from scaling down the number of threads as that
- doesn't affect compressed output (only performance). After
- this commit --no-adjust only prevents adjustments that affect
- compressed output, that is, with --no-adjust xz won't switch
- from multithreaded mode to single-threaded mode and won't
- scale down the LZMA2 dictionary size.
-
- The man page wasn't updated yet.
+ Up-to-date getopt_long in Gnulib is LGPLv2 so at some
+ point it could be included in XZ Utils too but for now
+ this commit is enough to make CMake-based build possible.
- src/xz/coder.c | 63 +++++++++++++++++++++++++++++++++++++++-------------------
- 1 file changed, 43 insertions(+), 20 deletions(-)
+ lib/getopt.c | 4 +++-
+ lib/getopt1.c | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
-commit cad299008cf73ec566f0662a9cf2b94f86a99659
+commit aa0cd585d2ed1455d35732798e0d90e3520e8ba5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-11 22:20:49 +0300
+Date: 2023-09-08 19:08:57 +0300
- xz: Add --memlimit-mt-decompress along with a default limit value.
-
- --memlimit-mt-decompress allows specifying the limit for
- multithreaded decompression. This matches memlimit_threading in
- liblzma. This limit can only affect the number of threads being
- used; it will never prevent xz from decompressing a file. The
- old --memlimit-decompress option is still used at the same time.
-
- If the value of --memlimit-decompress (the default value or
- one specified by the user) is less than the value of
- --memlimit-mt-decompress , then --memlimit-mt-decompress is
- reduced to match --memlimit-decompress.
-
- Man page wasn't updated yet.
+ Doxygen: Add more C macro names to PREDEFINED.
- src/xz/args.c | 24 +++++++++++++++-------
- src/xz/coder.c | 34 ++++++++++---------------------
- src/xz/hardware.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
- src/xz/hardware.h | 17 ++++++++++------
- src/xz/message.c | 4 +++-
- 5 files changed, 97 insertions(+), 42 deletions(-)
+ doxygen/Doxyfile | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
-commit fe87b4cd5364f5bbb6a75a0299f1500c852d7c9a
+commit ee7709bae53637e1765ce142ef102914f1423cb5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-06 23:11:59 +0300
+Date: 2023-09-11 18:47:26 +0300
- liblzma: Threaded decoder: Improve setting of pending_error.
+ liblzma: Move a few __attribute__ uses in function declarations.
- It doesn't need to be done conditionally. The comments try
- to explain it.
+ The API headers have many attributes but these were left
+ as is for now.
- src/liblzma/common/stream_decoder_mt.c | 51 +++++++++++++++++++++++-----------
- 1 file changed, 35 insertions(+), 16 deletions(-)
+ src/liblzma/common/common.c | 6 ++++--
+ src/liblzma/common/common.h | 8 ++++----
+ src/liblzma/common/memcmplen.h | 3 ++-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
-commit 90621da7f6e1bfd6d91d60415eae04b2bca274c2
+commit 217958d88713b5dc73d366d24dd64b2b311b86fe
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-06 12:39:49 +0300
+Date: 2023-09-11 19:03:35 +0300
- liblzma: Add a new flag LZMA_FAIL_FAST for threaded decoder.
+ xz, xzdec, lzmainfo: Use tuklib_attr_noreturn.
- In most cases if the input file is corrupt the application won't
- care about the uncompressed content at all. With this new flag
- the threaded decoder will return an error as soon as any thread
- has detected an error; it won't wait to copy out the data before
- the location of the error.
+ For compatibility with C23's [[noreturn]], tuklib_attr_noreturn
+ must be at the beginning of declaration (before "extern" or
+ "static", and even before any GNU C's __attribute__).
- I don't plan to use this in xz to keep the behavior consistent
- between single-threaded and multi-threaded modes.
+ This commit also moves all other function attributes to
+ the beginning of function declarations. "extern" is kept
+ at the beginning of a line so the attributes are listed on
+ separate lines before "extern" or "static".
- src/liblzma/api/lzma/container.h | 25 ++++++++++++++++-
- src/liblzma/common/common.h | 7 +++--
- src/liblzma/common/stream_decoder_mt.c | 50 +++++++++++++++++++---------------
- 3 files changed, 56 insertions(+), 26 deletions(-)
+ src/lzmainfo/lzmainfo.c | 6 ++++--
+ src/xz/coder.c | 3 ++-
+ src/xz/hardware.h | 3 ++-
+ src/xz/message.h | 30 +++++++++++++++++-------------
+ src/xz/options.c | 3 ++-
+ src/xz/util.h | 8 ++++----
+ src/xzdec/xzdec.c | 9 ++++++---
+ 7 files changed, 37 insertions(+), 25 deletions(-)
-commit 64b6d496dc815a176d8307f418f6834a26783484
+commit 18a66fbac031c98f9c2077fc88846e4d07849197
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-05 12:24:57 +0300
+Date: 2023-09-11 18:53:31 +0300
- liblzma: Threaded decoder: Always wait for output if LZMA_FINISH is used.
+ Remove incorrect uses of __attribute__((__malloc__)).
- This makes the behavior consistent with the single-threaded
- decoder when handling truncated .xz files.
+ xrealloc() is obviously incorrect, modern GCC docs even
+ mention realloc() as an example where this attribute
+ cannot be used.
- Thanks to Jia Tan for finding this issue.
+ liblzma's lzma_alloc() and lzma_alloc_zero() would be
+ correct uses most of the time but custom allocators
+ may use a memory pool or otherwise hold the pointer
+ so aliasing issues could happen in theory.
+
+ The xstrdup() case likely was correct but I removed it anyway.
+ Now there are no __malloc__ attributes left in the code.
+ The allocations aren't in hot paths so this should make
+ no practical difference.
+
+ src/liblzma/common/common.c | 4 ++--
+ src/liblzma/common/common.h | 4 ++--
+ src/xz/util.h | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+commit 74b0e900c92d5b222b36f474f1efa431f8e262f7
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-09-08 18:41:25 +0300
+
+ Build: Omit -Wc99-c11-compat since it warns about _Noreturn.
- src/liblzma/common/stream_decoder_mt.c | 26 ++++++++++++++++++++++++--
- 1 file changed, 24 insertions(+), 2 deletions(-)
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
-commit e671bc8828b9c0c5406c3a22c541301d0eb54518
+commit 90c94dddfd57b7d744bfad64c54e10d15778144b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-04-02 21:49:59 +0300
+Date: 2023-09-08 18:19:26 +0300
- liblzma: Threaded decoder: Support zpipe.c-style decoding loop.
+ tuklib: Update tuklib_attr_noreturn for C11/C17 and C23.
- This makes it possible to call lzma_code() in a loop that only
- reads new input when lzma_code() didn't fill the output buffer
- completely. That isn't the calling style suggested by the
- liblzma example program 02_decompress.c so perhaps the usefulness
- of this feature is limited.
+ This makes no difference for GCC or Clang as they support
+ GNU C's __attribute__((__noreturn__)) but this helps with MSVC:
- Also, it is possible to write such a loop so that it works
- with the single-threaded decoder but not with the threaded
- decoder even after this commit, or so that it works only if
- lzma_mt.timeout = 0.
+ - VS 2019 version 16.7 and later support _Noreturn if the
+ options /std:c11 or /std:c17 are used. This gets handled
+ with the check for __STDC_VERSION__ >= 201112.
- The zlib tutorial <https://zlib.net/zlib_how.html> is a well-known
- example of a loop where more input is read only when output isn't
- full. Porting this as is to liblzma would work with the
- single-threaded decoder (if LZMA_CONCATENATED isn't used) but it
- wouldn't work with threaded decoder even after this commit because
- the loop assumes that no more output is possible when it cannot
- read more input ("if (strm.avail_in == 0) break;"). This cannot
- be fixed at liblzma side; the loop has to be modified at least
- a little.
+ - When MSVC isn't in C11/C17 mode, __declspec(noreturn) is used.
- I'm adding this in any case because the actual code is simple
- and short and should have no harmful side-effects in other
- situations.
+ C23 will deprecate _Noreturn (and <stdnoreturn.h>)
+ for [[noreturn]]. This commit anticipates that but
+ the final __STDC_VERSION__ value isn't known yet.
- src/liblzma/common/stream_decoder_mt.c | 77 +++++++++++++++++++++++++++++-----
- 1 file changed, 67 insertions(+), 10 deletions(-)
+ src/common/tuklib_common.h | 22 +++++++++++++++++++++-
+ src/common/tuklib_exit.h | 4 ++--
+ 2 files changed, 23 insertions(+), 3 deletions(-)
-commit 2ba8173e27be4793edb46497e499ac2ae753a316
+commit 189f72581329ab281ad6af37f60135910cb1b146
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-31 00:05:07 +0300
+Date: 2023-09-11 17:22:44 +0300
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 69d1b3fc29677af8ade8dc15dba83f0589cb63d6
+commit 79334e7f20f2bf9e0de095835b48868f1238f584
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-29 19:19:12 +0300
+Date: 2023-09-05 22:42:10 +0300
- xzgrep: Fix escaping of malicious filenames (ZDI-CAN-16587).
-
- Malicious filenames can make xzgrep to write to arbitrary files
- or (with a GNU sed extension) lead to arbitrary code execution.
-
- xzgrep from XZ Utils versions up to and including 5.2.5 are
- affected. 5.3.1alpha and 5.3.2alpha are affected as well.
- This patch works for all of them.
-
- This bug was inherited from gzip's zgrep. gzip 1.12 includes
- a fix for zgrep.
-
- The issue with the old sed script is that with multiple newlines,
- the N-command will read the second line of input, then the
- s-commands will be skipped because it's not the end of the
- file yet, then a new sed cycle starts and the pattern space
- is printed and emptied. So only the last line or two get escaped.
-
- One way to fix this would be to read all lines into the pattern
- space first. However, the included fix is even simpler: All lines
- except the last line get a backslash appended at the end. To ensure
- that shell command substitution doesn't eat a possible trailing
- newline, a colon is appended to the filename before escaping.
- The colon is later used to separate the filename from the grep
- output so it is fine to add it here instead of a few lines later.
+ MSVC: xz: Make file_io.c and file_io.h compatible with MSVC.
- The old code also wasn't POSIX compliant as it used \n in the
- replacement section of the s-command. Using \<newline> is the
- POSIX compatible method.
-
- LC_ALL=C was added to the two critical sed commands. POSIX sed
- manual recommends it when using sed to manipulate pathnames
- because in other locales invalid multibyte sequences might
- cause issues with some sed implementations. In case of GNU sed,
- these particular sed scripts wouldn't have such problems but some
- other scripts could have, see:
-
- info '(sed)Locale Considerations'
-
- This vulnerability was discovered by:
- cleemy desu wayo working with Trend Micro Zero Day Initiative
-
- Thanks to Jim Meyering and Paul Eggert discussing the different
- ways to fix this and for coordinating the patch release schedule
- with gzip.
+ Thanks to Kelvin Lee for the original patches
+ and testing the modifications I made.
- src/scripts/xzgrep.in | 20 ++++++++++++--------
- 1 file changed, 12 insertions(+), 8 deletions(-)
+ src/xz/file_io.c | 26 ++++++++++++++++++++++++++
+ src/xz/file_io.h | 10 ++++++++++
+ 2 files changed, 36 insertions(+)
-commit bd93b776c1bd15e90661033c918cdeb354dbcc38
+commit c660b8d78b7bda43b12b285550d8c70e8ccec698
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-26 01:02:44 +0200
+Date: 2023-09-05 21:33:35 +0300
- liblzma: Fix a deadlock in threaded decoder.
-
- If a worker thread has consumed all input so far and it's
- waiting on thr->cond and then the main thread enables
- partial update for that thread, the code used to deadlock.
- This commit allows one dummy decoding pass to occur in this
- situation which then also does the partial update.
-
- As part of the fix, this moves thr->progress_* updates to
- avoid the second thr->mutex locking.
+ MSVC: xz: Use GetTickCount64() to implement mytime_now().
- Thanks to Jia Tan for finding, debugging, and reporting the bug.
+ It's available since Windows Vista.
- src/liblzma/common/stream_decoder_mt.c | 71 +++++++++++++++++++++++++---------
- 1 file changed, 52 insertions(+), 19 deletions(-)
+ src/xz/mytime.c | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+commit 5c6f892d411670e3060f4bc309402617a209e57c
+Author: Kelvin Lee <kiyolee@gmail.com>
+Date: 2023-09-05 15:05:09 +0300
+
+ MSVC: xz: Use _stricmp() instead of strcasecmp() in suffix.c.
+
+ src/xz/suffix.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+commit e241051f50044259d174e8b4633dd9a1c4478408
+Author: Kelvin Lee <kiyolee@gmail.com>
+Date: 2023-09-05 15:01:10 +0300
+
+ MSVC: xz: Use _isatty() from <io.h> to implement isatty().
+
+ src/xz/message.c | 5 +++++
+ src/xz/util.c | 5 +++++
+ 2 files changed, 10 insertions(+)
+
+commit d14bba8fc2be02a9fed8c9bcaaf61103451755f8
+Author: Kelvin Lee <kiyolee@gmail.com>
+Date: 2023-09-05 15:10:31 +0300
+
+ MSVC: xz: Use _fileno() instead of fileno().
+
+ src/xz/private.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit c4edd367678e6a38c42b149856159bf417da7fe1
+Author: Kelvin Lee <kiyolee@gmail.com>
+Date: 2023-09-05 15:00:07 +0300
+
+ MSVC: xzdec: Use _fileno and _setmode.
-commit e0394e94230f208682ac1e1f4c41f22f9ad79916
+ src/xzdec/xzdec.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit cfd1054b9b539ee92524901e95d7bb5a1fe670a0
+Author: Kelvin Lee <kiyolee@gmail.com>
+Date: 2023-09-05 14:37:50 +0300
+
+ MSVC: Don't #include <unistd.h>.
+
+ lib/getopt.c | 4 +++-
+ lib/getopt.in.h | 4 +++-
+ src/xz/private.h | 5 ++++-
+ src/xzdec/xzdec.c | 5 ++++-
+ 4 files changed, 14 insertions(+), 4 deletions(-)
+
+commit adef92f23563a2cc088b31ddee9040ecc96bc996
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-23 16:34:00 +0200
+Date: 2023-09-19 14:03:45 +0300
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 487c77d48760564b1949c5067630b675b87be4de
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-23 16:28:55 +0200
+commit 953e775941a25bfcfa353f802b13e66acb1edf2c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-14 21:13:23 +0800
- liblzma: Threaded decoder: Don't stop threads on LZMA_TIMED_OUT.
-
- LZMA_TIMED_OUT is not an error and thus stopping threads on
- LZMA_TIMED_OUT breaks the decoder badly.
+ CI: Enable CLMUL in address sanitization test.
- Thanks to Jia Tan for finding the bug and for the patch.
+ The crc64_clmul() function should be ignored by the address sanitizer
+ now so these builds should still pass.
- src/liblzma/common/stream_decoder_mt.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ .github/workflows/ci.yml | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
-commit 6c6da57ae2aa962aabde6892442227063d87e88c
+commit f167e79bc98f3f56af2e767b83aa81c2d2b9ed77
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-07 00:36:16 +0200
+Date: 2023-09-14 16:35:46 +0300
- xz: Add initial support for threaded decompression.
-
- If threading support is enabled at build time, this will
- use lzma_stream_decoder_mt() even for single-threaded mode.
- With memlimit_threading=0 the behavior should be identical.
-
- This needs some work like adding --memlimit-threading=LIMIT.
-
- The original patch from Sebastian Andrzej Siewior included
- a method to get currently available RAM on Linux. It might
- be one way to go but as it is Linux-only, the available-RAM
- approach needs work for portability or using a fallback method
- on other OSes.
-
- The man page wasn't updated yet.
+ Update THANKS.
- src/xz/coder.c | 36 +++++++++++++++++++++++++++++++++++-
- 1 file changed, 35 insertions(+), 1 deletion(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 4cce3e27f529af33e0e7749a8cbcec59954946b5
+commit 4f44ef86758a41a8ec814096f4cb6ee6de04c82e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-06 23:36:20 +0200
+Date: 2023-09-14 16:34:07 +0300
- liblzma: Add threaded .xz decompressor.
-
- I realize that this is about a decade late.
+ liblzma: Mark crc64_clmul() with __attribute__((__no_sanitize_address__)).
- Big thanks to Sebastian Andrzej Siewior for the original patch.
- I made a bunch of smaller changes but after a while quite a few
- things got rewritten. So any bugs in the commit were created by me.
+ Thanks to Agostino Sarubbo.
+ Fixes: https://github.com/tukaani-project/xz/issues/62
- src/liblzma/api/lzma/container.h | 90 +-
- src/liblzma/common/Makefile.inc | 5 +
- src/liblzma/common/common.h | 4 +
- src/liblzma/common/stream_decoder_mt.c | 1814 ++++++++++++++++++++++++++++++++
- src/liblzma/liblzma.map | 1 +
- 5 files changed, 1907 insertions(+), 7 deletions(-)
+ src/liblzma/check/crc64_fast.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-commit 717631b9788dc9c100ee0c87d3c14a2782638ff4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-06 16:54:23 +0200
+commit 7379bb3eed428c0ae734d0cc4a1fd04359d53f08
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-12 22:36:12 +0800
- liblzma: Fix docs: lzma_block_decoder() cannot return LZMA_UNSUPPORTED_CHECK.
+ CMake: Fix time.h checks not running on second CMake run.
- If Check is unsupported, it will be silently ignored.
- It's the caller's job to handle it.
+ If CMake was configured more than once, HAVE_CLOCK_GETTIME and
+ HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check
+ for librt being needed to provide HAVE_CLOCK_GETTIME was also
+ simplified.
- src/liblzma/api/lzma/block.h | 3 ---
- 1 file changed, 3 deletions(-)
+ CMakeLists.txt | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
-commit 1a4bb97a00936535e30ac61945aeee38882b5d1a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-06 16:41:19 +0200
+commit 5d691fe58286b92d704c0dc5cd0c4df22881c6c6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-09-12 22:34:06 +0800
- liblzma: Add new output queue (lzma_outq) features.
-
- Add lzma_outq_clear_cache2() which may leave one buffer allocated
- in the cache.
-
- Add lzma_outq_outbuf_memusage() to get the memory needed for
- a single lzma_outbuf. This is now used internally in outqueue.c too.
-
- Track both the total amount of memory allocated and the amount of
- memory that is in active use (not in cache).
-
- In lzma_outbuf, allow storing the current input position that
- matches the current output position. This way the main thread
- can notice when no more output is possible without first providing
- more input.
+ CMake: Fix unconditionally defining HAVE_CLOCK_MONOTONIC.
- Allow specifying return code for lzma_outq_read() in a finished
- lzma_outbuf.
+ If HAVE_CLOCK_GETTIME was defined, then HAVE_CLOCK_MONOTONIC was always
+ added as a compile definition even if the check for it failed.
- src/liblzma/common/outqueue.c | 43 +++++++++++++++++++++++++++++++++++-------
- src/liblzma/common/outqueue.h | 44 ++++++++++++++++++++++++++++++++++++++++++-
- 2 files changed, 79 insertions(+), 8 deletions(-)
+ CMakeLists.txt | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
-commit ddbc6f58c2de388eed24cd7ea91b523d397da5f4
+commit eccf12866527b8d24c7d7f92f755142be8ef9b11
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-03-06 15:18:58 +0200
+Date: 2023-08-31 19:50:05 +0300
- liblzma: Index hash: Change return value type of hash_append() to void.
+ xz: Refactor thousand separator detection and disable it on MSVC.
+
+ Now the two variations of the format strings are created with
+ a macro, and the whole detection code can be easily disabled
+ on platforms where thousand separator formatting is known to
+ not work (MSVC has no support, and on DJGPP 2.05 it can have
+ problems in some cases).
- src/liblzma/common/index_hash.c | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
+ src/xz/util.c | 89 ++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 45 insertions(+), 44 deletions(-)
-commit 20e7a33e2d59c6a814447d3991f21e2702174b20
+commit f7093cd9d130477c234b40aeda613964171f8f21
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-22 03:42:57 +0200
+Date: 2023-08-31 18:14:43 +0300
- liblzma: Minor addition to lzma_vli_size() API doc.
+ xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX.
- Thanks to Jia Tan.
+ SSIZE_MAX isn't readily available on MSVC. Removing it means
+ that there is one thing less to worry when porting to MSVC.
- src/liblzma/api/lzma/vli.h | 2 ++
- 1 file changed, 2 insertions(+)
+ src/xz/file_io.c | 5 ++---
+ src/xz/file_io.h | 4 ++--
+ 2 files changed, 4 insertions(+), 5 deletions(-)
-commit 4f78f5fcf63592f2d77e921cfe0d5de300867374
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-22 02:04:18 +0200
+commit 74c3449d8b816a724b12ebce7417e00fb597309a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 23:14:45 +0800
- liblzma: Check the return value of lzma_index_append() in threaded encoder.
+ Tests: Improve invalid unpadded size check in test_lzma_index_append().
- If lzma_index_append() failed (most likely memory allocation failure)
- it could have gone unnoticed and the resulting .xz file would have
- an incorrect Index. Decompressing such a file would produce the
- correct uncompressed data but then an error would occur when
- verifying the Index field.
+ This check was extended to test the code added to fix a failing assert
+ in ae5c07b22a6b3766b84f409f1b6b5c100469068a.
- src/liblzma/common/stream_encoder_mt.c | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ tests/test_index.c | 26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
-commit 5313ad66b40aab822ddca3e9905254cb99a4080d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-22 01:37:39 +0200
+commit 2544274a8b8a27f4ea6c457d2c4c32eb1e4cd336
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 21:54:41 +0800
+
+ Tests: Improve comments in test_index.c.
+
+ tests/test_index.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+commit 49be29d6380b94e6fb26e511dd2cdbd9afce0f8b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 21:52:54 +0800
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 865e0a3689a25a7ee8eecae1a34c1775e3aa676e
-Author: Ed Maste <emaste@FreeBSD.org>
-Date: 2022-02-11 15:25:46 +0000
+commit 721e3d9f7a82f59f32795d5fb97e0210d1aa839a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 21:50:16 +0800
- liblzma: Use non-executable stack on FreeBSD as on Linux
+ liblzma: Update assert in vli_ceil4().
+
+ The argument to vli_ceil4() should always guarantee the return value
+ is also a valid lzma_vli. Thus the highest three valid lzma_vli values
+ are invalid arguments. All uses of the function ensure this so the
+ assert is updated to match this.
- src/liblzma/check/crc32_x86.S | 4 ++--
- src/liblzma/check/crc64_x86.S | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
+ src/liblzma/common/index.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 1c9a5786d206b4abc8e427326651c8174baea753
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-20 20:36:27 +0200
+commit ae5c07b22a6b3766b84f409f1b6b5c100469068a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 21:31:25 +0800
- liblzma: Make Block decoder catch certain types of errors better.
+ liblzma: Add overflow check for Unpadded size in lzma_index_append().
- Now it limits the input and output buffer sizes that are
- passed to a raw decoder. This way there's no need to check
- if the sizes can grow too big or overflow when updating
- Compressed Size and Uncompressed Size counts. This also means
- that a corrupt file cannot cause the raw decoder to process
- useless extra input or output that would exceed the size info
- in Block Header (and thus cause LZMA_DATA_ERROR anyway).
+ This was not a security bug since there was no path to overflow
+ UINT64_MAX in lzma_index_append() or when it calls index_file_size().
+ The bug was discovered by a failing assert() in vli_ceil4() when called
+ from index_file_size() when unpadded_sum (the sum of the compressed size
+ of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX.
- More importantly, now the size information is verified more
- carefully in case raw decoder returns LZMA_OK. This doesn't
- really matter with the current single-threaded .xz decoder
- as the errors would be detected slightly later anyway. But
- this helps avoiding corner cases in the upcoming threaded
- decompressor, and it might help other Block decoder uses
- outside liblzma too.
+ Previously, the unpadded_size parameter was checked to be not greater
+ than UNPADDED_SIZE_MAX, but no check was done once compressed_base was
+ added.
- The test files bad-1-lzma2-{9,10,11}.xz test these conditions.
- With the single-threaded .xz decoder the only difference is
- that LZMA_DATA_ERROR is detected in a difference place now.
+ This could not have caused an integer overflow in index_file_size() when
+ called by lzma_index_append(). The calculation for file_size breaks down
+ into the sum of:
+
+ - Compressed base from all previous Streams
+ - 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and
+ footer)
+ - stream_padding (can be set by lzma_index_stream_padding())
+ - Compressed base from the current Stream
+ - Unpadded size (parameter to lzma_index_append())
+
+ The sum of everything except for Unpadded size must be less than
+ LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions
+ that can set these values including lzma_index_stream_padding(),
+ lzma_index_append(), and lzma_index_cat(). The maximum value for
+ Unpadded size is enforced by lzma_index_append() to be less than or
+ equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since
+ LZMA_VLI_MAX is half of UINT64_MAX.
+
+ Thanks to Joona Kannisto for reporting this.
+
+ src/liblzma/common/index.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
- src/liblzma/common/block_decoder.c | 79 ++++++++++++++++++++++++++------------
- 1 file changed, 54 insertions(+), 25 deletions(-)
+commit 1057765aaabfe0f1397b8094531846655376ae38
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-28 22:18:29 +0800
-commit 555de11873eb00c9b94a8be70645db502e5a9dbd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-20 19:38:55 +0200
+ Translations: Update the Esperanto translation.
- Tests: Add bad-1-lzma2-11.xz.
+ po/eo.po | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
- tests/files/README | 5 +++++
- tests/files/bad-1-lzma2-11.xz | Bin 0 -> 64 bytes
- 2 files changed, 5 insertions(+)
+commit f2e94d064f305bb8ad77ca70f91d93e55f5cf856
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-26 20:10:23 +0800
-commit f0da507f22e7f4e3edb75b45b74d344244ca03fb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-18 18:51:10 +0200
+ Translations: Update the Esperanto translation.
+
+ po/eo.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
+
+commit 2b871f4dbffe3801d0da3f89806b5935f758d5f3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-09 20:55:36 +0800
- Translations: Fix po4a failure with the French man page translations.
+ Docs: Update INSTALL for --enable-threads method win95.
- Thanks to Mario Blättermann for the patch.
+ The Autotools build allows win95 threads and --enable-small together now
+ if the compiler supports __attribute__((__constructor__)).
- po4a/fr_FR.po | 6 ++++--
+ INSTALL | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
-commit f7711d228c3c32395460c82498c60a9f730d0239
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-07 01:14:37 +0200
+commit 356ad5b26b4196f085ce3afa1869154ca81faad8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-09 20:54:15 +0800
+
+ CMake: Conditionally allow win95 threads and --enable-small.
- Translations: Add French translation of man pages.
+ CMakeLists.txt | 28 ++++++++++++++++++++--------
+ 1 file changed, 20 insertions(+), 8 deletions(-)
+
+commit de574404c4c2f87aca049f232c38526e3ce092aa
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-09 20:35:16 +0800
+
+ Build: Conditionally allow win95 threads and --enable-small.
- This matches xz-utils 5.2.5-2 in Debian.
+ When the compiler supports __attribute__((__constructor__))
+ mythread_once() is never used, even with --enable-small. A configuration
+ with win95 threads and --enable-small will compile and be thread safe so
+ it can be allowed.
- The translation was done by "bubu", proofread by the debian-l10n-french
- mailing list contributors, and submitted to me on the xz-devel mailing
- list by Jean-Pierre Giraud. Thanks to everyone!
+ This isn't a very common configuration since MSVC does not support
+ __attribute__((__constructor__)), but MINGW32 and CLANG32 environments
+ for MSYS2 can use win95 threads and have
+ __attribute__((__constructor__)) support.
- po4a/fr_FR.po | 3541 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po4a/po4a.conf | 2 +-
- 2 files changed, 3542 insertions(+), 1 deletion(-)
+ configure.ac | 21 +++++++++++++--------
+ 1 file changed, 13 insertions(+), 8 deletions(-)
-commit 6468f7e41a8e9c611e4ba8d34e2175c5dacdbeb4
-Author: jiat75 <jiat0218@gmail.com>
-Date: 2022-01-28 20:47:55 +0800
+commit 6bf33b704cd31dccf25e68480464aa22d3fcad5a
+Author: Jamaika1 <lukaszcz18@wp.pl>
+Date: 2023-08-08 14:07:59 +0200
- liblzma: Add NULL checks to LZMA and LZMA2 properties encoders.
+ mythread.h: Fix typo error in Vista threads mythread_once().
- Previously lzma_lzma_props_encode() and lzma_lzma2_props_encode()
- assumed that the options pointers must be non-NULL because the
- with these filters the API says it must never be NULL. It is
- good to do these checks anyway.
+ The "once_" variable was accidentally referred to as just "once". This
+ prevented building with Vista threads when
+ HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined.
- src/liblzma/lzma/lzma2_encoder.c | 3 +++
- src/liblzma/lzma/lzma_encoder.c | 3 +++
- 2 files changed, 6 insertions(+)
+ src/common/mythread.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 2523c30705f49eabd27b854aa656ae87cc224808
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2022-02-06 23:19:32 +0200
+commit 80cb961e5380a3878246d41341ff91378ca59e05
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-04 22:17:11 +0800
- liblzma: Fix uint64_t vs. size_t confusion.
+ codespell: Add .codespellrc to set default options.
- This broke 32-bit builds due to a pointer type mismatch.
+ The .codespellrc allows setting default options to avoid false positive
+ matches, set additional dictionaries, etc. For now, codespell can be
+ used locally before committing doc and comment changes.
- This bug was introduced with the output-size-limited encoding
- in 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c.
-
- Thanks to huangqinjin for the bug report.
+ It should help prevent silly errors and fix up commits in the future.
- src/liblzma/rangecoder/range_encoder.h | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
+ .codespellrc | 24 ++++++++++++++++++++++++
+ 1 file changed, 24 insertions(+)
-commit 2bd36c91d03e03b31a4f12fd0afc100ae32d66e2
-Author: huangqinjin <huangqinjin@gmail.com>
-Date: 2021-12-13 20:49:21 +0800
+commit cd678a6077358935249b64a4a16fe8d17434f9c9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-03 20:10:21 +0800
- CMake: Keep compatible with Windows 95 for 32-bit build.
+ Tests: Style fixes to test_lzip_decoder.c.
- CMakeLists.txt | 12 +++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
+ tests/test_lzip_decoder.c | 36 ++++++++++++++++++++++++------------
+ 1 file changed, 24 insertions(+), 12 deletions(-)
-commit 2024fbf2794885277d05378d40b2b8015a7c3b40
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-11-13 21:04:05 +0200
+commit 1cac5ed4fa45c9861d745b02d80575cb2ff01d81
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-03 15:56:20 +0800
- xzgrep: Update man page timestamp.
+ Translations: Update the Chinese (simplified) translation.
- src/scripts/xzgrep.1 | 2 +-
+ po/zh_CN.po | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 400e7a239a53282cedaad927a41f3463d7f542e5
+commit 16068f6c30b888cdb873f6285af941d00f95741d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-11-13 18:23:24 +0200
+Date: 2023-08-02 17:15:12 +0300
- Update THANKS.
+ xz: Omit an empty paragraph on the man page.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/xz.1 | 1 -
+ 1 file changed, 1 deletion(-)
-commit 3a512c7787b2642ca946f4adc6e9a0a5d9b0d5a0
-Author: Ville Skyttä <ville.skytta@iki.fi>
-Date: 2021-11-13 10:11:57 +0200
+commit 9ae4371b5106189486e850ce777e40f7b6021c0b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-02 20:30:07 +0800
- xzgrep: use `grep -E/-F` instead of `egrep` and `fgrep`
-
- `egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in
- current post 3.7 Git they have been made to emit obsolescence warnings:
- https://git.savannah.gnu.org/cgit/grep.git/commit/?id=a9515624709865d480e3142fd959bccd1c9372d1
+ Add NEWS for 5.4.4.
- src/scripts/xzgrep.1 | 8 ++++----
- src/scripts/xzgrep.in | 4 ++--
- 2 files changed, 6 insertions(+), 6 deletions(-)
+ NEWS | 43 +++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 43 insertions(+)
-commit edf525e2b1840dcaf377df472c67d8f11f8ace1b
+commit e8c2203b2c76466d8d3387c5212b46151de8e605
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-10-28 23:02:11 +0300
+Date: 2023-08-02 15:19:43 +0300
- Bump the version number for 5.3.2alpha.
+ build-aux/manconv.sh: Fix US-ASCII and UTF-8 output.
+
+ groff defaults to SGR escapes. Using -P-c passes -c to grotty
+ which restores the old behavior. Perhaps there is a better way to
+ get pure plain text output but this works for now.
- src/liblzma/api/lzma/version.h | 2 +-
- src/liblzma/liblzma.map | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ build-aux/manconv.sh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit ea8c948655a86290524efe59cff067e06a886709
+commit 9a706167b0d903d92fd134895acb4bc6a5e3e688
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-10-28 22:59:52 +0300
+Date: 2023-08-01 19:10:43 +0300
- Add NEWS for 5.3.2alpha.
+ Update THANKS.
- NEWS | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 86 insertions(+)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit 52435f302f4724157ec50b4210cbe42b285c3cbc
+commit 33e25a0f5650754c38bed640deedefe3b4fec5ef
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-10-27 23:27:48 +0300
+Date: 2023-08-01 18:22:24 +0300
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit f2aea1d5a504b2021bf47a238390e4f12bdd518d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-10-27 23:23:11 +0300
+commit 81db3b889830132334d1f2129bdc93177ac2ca7d
+Author: ChanTsune <41658782+ChanTsune@users.noreply.github.com>
+Date: 2023-08-01 18:17:17 +0300
- xz: Change the coding style of the previous commit.
+ mythread.h: Disable signal functions in builds targeting Wasm + WASI.
- It isn't any better now but it's consistent with
- the rest of the code base.
+ signal.h in WASI SDK doesn't currently provide sigprocmask()
+ or sigset_t. liblzma doesn't need them so this change makes
+ liblzma and xzdec build against WASI SDK. xz doesn't build yet
+ and the tests don't either as tuktest needs setjmp() which
+ isn't (yet?) implemented in WASI SDK.
+
+ Closes: https://github.com/tukaani-project/xz/pull/57
+ See also: https://github.com/tukaani-project/xz/pull/56
+
+ (The original commit was edited a little by Lasse Collin.)
- src/xz/file_io.c | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
+ src/common/mythread.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 892b16cc282f5b4e1c49871b326f4db25c5b4d81
-Author: Alexander Bluhm <alexander.bluhm@gmx.net>
-Date: 2021-10-05 23:33:16 +0200
+commit 71c638c611324e606d324c8189fef8fe79db6991
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-08-01 21:58:51 +0800
- xz: Avoid fchown(2) failure.
+ Add newline to end of .gitignore.
- OpenBSD does not allow to change the group of a file if the user
- does not belong to this group. In contrast to Linux, OpenBSD also
- fails if the new group is the same as the old one. Do not call
- fchown(2) in this case, it would change nothing anyway.
-
- This fixes an issue with Perl Alien::Build module.
- https://github.com/PerlAlien/Alien-Build/issues/62
+ Newline was accidentally removed in commit
+ 01cbb7f023ee7fda8ddde04bd17cf7d3c2418706.
- src/xz/file_io.c | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
+ .gitignore | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 2b509c868cae3988bf21cd693fbf9021cdc85628
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-09-17 17:31:11 +0300
+commit 42df7c7aa1cca385e509eb33c65136e61890f0bf
+Author: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
+Date: 2023-07-31 14:02:21 +0200
- liblzma: Fix liblzma.map for the lzma_microlzma_* symbols.
-
- This should have been part of d267d109c370a40b502e73f8664b154b15e4f253.
-
- Thanks to Gao Xiang.
+ Docs: Fix typos found by codespell
- src/liblzma/liblzma.map | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 4 ++--
+ NEWS | 2 +-
+ configure.ac | 2 +-
+ src/liblzma/api/lzma/container.h | 4 ++--
+ src/liblzma/api/lzma/filter.h | 2 +-
+ src/liblzma/api/lzma/lzma12.h | 4 ++--
+ src/liblzma/common/block_buffer_encoder.c | 2 +-
+ src/liblzma/common/common.h | 2 +-
+ src/liblzma/common/file_info.c | 2 +-
+ src/liblzma/common/lzip_decoder.c | 2 +-
+ src/liblzma/common/stream_decoder_mt.c | 8 ++++----
+ src/liblzma/common/string_conversion.c | 6 +++---
+ src/liblzma/lz/lz_encoder.h | 2 +-
+ src/liblzma/lzma/lzma_encoder.c | 4 ++--
+ src/xz/hardware.c | 4 ++--
+ tests/test_filter_flags.c | 4 ++--
+ tests/test_index.c | 2 +-
+ tests/test_vli.c | 2 +-
+ 18 files changed, 29 insertions(+), 29 deletions(-)
-commit cacb06a954b58255dfc084a0bc9708f43a0fd6d6
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-09-09 22:21:07 +0300
+commit 01cbb7f023ee7fda8ddde04bd17cf7d3c2418706
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-26 20:26:23 +0800
- Update THANKS.
+ Update .gitignore.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ .gitignore | 4 ++++
+ 1 file changed, 4 insertions(+)
-commit 6928aac9da6ba612780b9f72ba1d6ecbe1e8b54e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-09-09 21:41:51 +0300
+commit f97a1afd564c48ad9cb94682e10972a72e11fa08
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-28 22:03:08 +0800
- liblzma: Use _MSVC_LANG to detect when "noexcept" can be used with MSVC.
-
- By default, MSVC always sets __cplusplus to 199711L. The real
- C++ standard version is available in _MSVC_LANG (or one could
- use /Zc:__cplusplus to set __cplusplus correctly).
+ CMake: Conditionally allow the creation of broken symlinks.
- Fixes <https://sourceforge.net/p/lzmautils/discussion/708858/thread/f6bc3b108a/>.
+ The CMake build will try to create broken symlinks on Unix and Unix-like
+ platforms. Cygwin and MSYS2 are Unix-like, but may not be able to create
+ broken symlinks. The value of the CYGWIN or MSYS environment variables
+ determine if broken symlinks are valid.
- Thanks to Dan Weiss.
+ The default for MSYS2 does not allow for broken symlinks, so the CMake
+ build has been broken for MSYS2 since commit
+ 80a1a8bb838842a2be343bd88ad1462c21c5e2c9.
- src/liblzma/api/lzma.h | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 75 insertions(+), 7 deletions(-)
-commit d267d109c370a40b502e73f8664b154b15e4f253
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-09-05 20:38:12 +0300
+commit 7190f4cc7c9ade5b9b3675d0cbfa3b6d6ec9cb4f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-28 21:56:48 +0800
- liblzma: Rename EROFS LZMA to MicroLZMA.
+ CI: Fix windows-ci dependency installation.
- It still exists primarily for EROFS but MicroLZMA is
- a more generic name (that hopefully doesn't clash with
- something that already exists).
+ All of the MSYS2 environments need make, and it does not come with the
+ toolchain package. The toolchain package will install the needed
+ compiler toolchains since without this package CMake cannot properly
+ generate the Makefiles.
- src/liblzma/api/lzma/container.h | 33 +++++++++++++---------
- src/liblzma/common/Makefile.inc | 4 +--
- .../{erofs_decoder.c => microlzma_decoder.c} | 32 ++++++++++-----------
- .../{erofs_encoder.c => microlzma_encoder.c} | 30 ++++++++++----------
- 4 files changed, 52 insertions(+), 47 deletions(-)
+ .github/workflows/windows-ci.yml | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 3247e95115acb95bc27f41e8cf4501db5b0b4309
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-06-04 19:02:38 +0300
+commit a048f472cd9a2245265cb292853cbbcdd4f02001
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-28 21:54:22 +0800
- xzdiff: Update the man page about the exit status.
+ CI: Update ci_build.sh CMake to always make Unix Makefiles.
- This was forgotten from 194029ffaf74282a81f0c299c07f73caca3232ca.
+ The default for many of the MSYS2 environments is for CMake to create
+ Ninja build files. This would complicate the build script since we would
+ need a different command to run the tests. Its simpler to always use
+ Unix Makefiles so that "make test" is always a usable target for
+ testing.
- src/scripts/xzdiff.1 | 4 ++--
+ build-aux/ci_build.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-commit 96f5a28a46fc93ac4e296808ac0f8631d05498bc
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-06-04 18:52:48 +0300
+commit 7870396a0ca945473aa0d1d790f4cbef456610bd
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-25 20:17:23 +0800
- xzless: Fix less(1) version detection when it contains a dot.
-
- Sometimes the version number from "less -V" contains a dot,
- sometimes not. xzless failed detect the version number when
- it does contain a dot. This fixes it.
+ CI: Test CMake builds and test framework with MSYS2.
+
+ .github/workflows/windows-ci.yml | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+commit 6497d1f8875cb7e3007f714336cc09c06fed235b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-25 20:14:53 +0800
+
+ CI: Windows CI rename system matrix variable -> msys2_env.
- Thanks to nick87720z for reporting this. Apparently it had been
- reported here <https://bugs.gentoo.org/489362> in 2013.
+ Calling the MSYS2 environment "system" was a bit vague and should be
+ more specific.
- src/scripts/xzless.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ .github/workflows/windows-ci.yml | 15 +++++----------
+ 1 file changed, 5 insertions(+), 10 deletions(-)
-commit 5fb5212d816addbc523d0798cb482fdd0484f8fa
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-04-11 19:58:10 +0300
+commit 785e4121d9b2921ad36bd3af1cf61fa20a9265bd
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-24 23:11:45 +0800
- Update THANKS.
+ CI: Add Clang64 MSYS2 environment to Windows CI.
- THANKS | 2 ++
- 1 file changed, 2 insertions(+)
+ .github/workflows/windows-ci.yml | 1 +
+ 1 file changed, 1 insertion(+)
-commit fc3d3a7296ef58bb799a73943636b8bfd95339f7
-Author: Ivan A. Melnikov <iv@altlinux.org>
-Date: 2021-04-09 11:45:10 +0300
+commit d9166b52cf3458a4da3eb92224837ca8fc208d79
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-24 21:43:44 +0800
- Reduce maximum possible memory limit on MIPS32
-
- Due to architectural limitations, address space available to a single
- userspace process on MIPS32 is limited to 2 GiB, not 4, even on systems
- that have more physical RAM -- e.g. 64-bit systems with 32-bit
- userspace, or systems that use XPA (an extension similar to x86's PAE).
+ liblzma: Prevent an empty translation unit in Windows builds.
- So, for MIPS32, we have to impose stronger memory limits. I've chosen
- 2000MiB to give the process some headroom.
+ To workaround Automake lacking Windows resource compiler support, an
+ empty source file is compiled to overwrite the resource files for static
+ library builds. Translation units without an external declaration are
+ not allowed by the C standard and result in a warning when used with
+ -Wempty-translation-unit (Clang) or -pedantic (GCC).
- src/xz/hardware.c | 6 ++++++
- 1 file changed, 6 insertions(+)
+ src/liblzma/Makefile.am | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
-commit e7da44d5151e21f153925781ad29334ae0786101
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-02-13 23:31:27 +0200
+commit db5019d691f980d622fb56fdcf383af2c3519c98
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-22 18:37:56 +0800
- CMake: Use interface library for better FindLibLZMA compatibility.
-
- https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html
-
- Thanks to Markus Rickert.
+ Translations: Update the Vietnamese translation.
- CMakeLists.txt | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
+ po/vi.po | 45 ++++++++++++++++++++++++++++-----------------
+ 1 file changed, 28 insertions(+), 17 deletions(-)
-commit a61dd82ada39030f41b4ffca9ea551714908bedc
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-30 18:36:04 +0200
+commit f3a055f762ba5b71b746fc2d44a6ababde2c61b5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-22 14:55:42 +0800
- CMake: Try to improve compatibility with the FindLibLZMA module.
-
- The naming conflict with FindLibLZMA module gets worse.
- Not avoiding it in the first place was stupid.
-
- Normally find_package(LibLZMA) will use the module and
- find_package(liblzma 5.2.5 REQUIRED CONFIG) will use the config
- file even with a case insensitive file system. However, if
- CMAKE_FIND_PACKAGE_PREFER_CONFIG is TRUE and the file system
- is case insensitive, find_package(LibLZMA) will find our liblzma
- config file instead of using FindLibLZMA module.
-
- One big problem with this is that FindLibLZMA uses
- LibLZMA::LibLZMA and we use liblzma::liblzma as the target
- name. With target names CMake happens to be case sensitive.
- To workaround this, this commit adds
-
- add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma)
+ CI: Add Windows runner for Autotools builds with MSYS2.
- to the config file. Then both spellings work.
+ Only a subset of the tests run by the Linux and MacOS Autotools builds
+ are run. The most interesting tests are the ones that disable threads,
+ encoders, and decoders.
- To make the behavior consistent between case sensitive and
- insensitive file systems, the config and related files are
- renamed from liblzmaConfig.cmake to liblzma-config.cmake style.
- With this style CMake looks for lowercase version of the package
- name so find_package(LiBLzmA 5.2.5 REQUIRED CONFIG) will work
- to find our config file.
+ The Windows runner will only be run manually since these tests will
+ likely take much longer than the Linux and MacOS runners. This runner
+ should be used before merging any large features and before releases.
- There are other differences between our config file and
- FindLibLZMA so it's still possible that things break for
- reasons other than the spelling of the target name. Hopefully
- those situations aren't too common.
+ Currently the clang64 environment fails to due to a warning and
+ -Werror is enabled for the CI tests. This is still an early version
+ since the CMake build can be done for MSVC and optionally each of the
+ MSYS2 environments. GitHub does not allow manually running the CI tests
+ unless the workflow is checked on the default branch so checking in a
+ minimum version is a good idea.
- When the config file is available, it should always give as good or
- better results as FindLibLZMA so this commit doesn't affect the
- recommendation to use find_package(liblzma 5.2.5 REQUIRED CONFIG)
- which explicitly avoids FindLibLZMA.
+ Thanks to Arthur S for the original proposing the original patch.
- Thanks to Markus Rickert.
+ Closes: https://github.com/tukaani-project/xz/pull/34
- CMakeLists.txt | 21 +++++++++++++--------
- 1 file changed, 13 insertions(+), 8 deletions(-)
+ .github/workflows/windows-ci.yml | 119 +++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 119 insertions(+)
-commit 5b7bc1b8ae766a76710ca1b99f909cf52c697f05
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-29 21:19:43 +0200
+commit 556536a3525df9e5ed78b8c7057991cfa9edfac8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-21 22:11:01 +0800
- Update THANKS.
+ CI: Add argument to ci_build.sh to pass flags to autogen.sh.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ build-aux/ci_build.sh | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
-commit 6c6f0db340dcb8bb424411cedba713405d55f6b8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-29 21:19:08 +0200
+commit 39a32d36fc465c4e70f13192eea380e518ba6e8a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-21 18:05:44 +0800
- liblzma: Fix unitialized variable.
-
- This was introduced two weeks ago in the commit
- 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c.
+ Tests: Skip .lz files in test_files.sh if not configured.
- Thanks to Nathan Moinvaziri.
+ Previously if the lzip decoder was not configured then test_files.sh
+ would pass the lzip tests instead of skipping them.
+
+ tests/test_files.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
- src/liblzma/lzma/lzma_encoder.c | 1 +
+commit 194d12724b30fe42789d12a0184f9d412c449347
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 22:11:13 +0800
+
+ Tests: Add ARM64 filter test to test_compress.sh.
+
+ tests/test_compress.sh | 1 +
1 file changed, 1 insertion(+)
-commit bb1d5c1fdd30550d4221ecd336e0be1206132a5c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-24 22:32:41 +0200
+commit d850365c444368102c69beaddf849ed463c33467
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:30:05 +0800
- Tests: Add bad-1-lzma2-10.xz and also modify -9.xz.
+ Translations: Update the Croatian translation.
- tests/files/README | 11 +++++++++--
- tests/files/bad-1-lzma2-10.xz | Bin 0 -> 60 bytes
- tests/files/bad-1-lzma2-9.xz | Bin 72 -> 72 bytes
- 3 files changed, 9 insertions(+), 2 deletions(-)
+ po/hr.po | 49 ++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 19 deletions(-)
-commit 6b8abc84a5469792e0355d0bfc0784d41cfdfef7
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-24 19:22:35 +0200
+commit 24049eb7acf6d42a60f00efe4e7289fe8e1797fe
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:28:32 +0800
- liblzma: Fix a wrong comment in stream_encoder_mt.c.
+ Translations: Update the Korean man page translations.
- src/liblzma/common/stream_encoder_mt.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
+ po4a/ko.po | 1255 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 629 insertions(+), 626 deletions(-)
-commit 939fc5ed654aac25fe0c8684b2df8dbeadb2de1e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-24 18:51:51 +0200
+commit 4d4a4fa07de6cb9d913fb2f97712fddda2527b49
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:25:24 +0800
- Tests: Add bad-1-lzma2-9.xz.
+ Translations: Update the Korean translation.
- tests/files/README | 4 ++++
- tests/files/bad-1-lzma2-9.xz | Bin 0 -> 72 bytes
- 2 files changed, 4 insertions(+)
+ po/ko.po | 45 ++++++++++++++++++++++++++++-----------------
+ 1 file changed, 28 insertions(+), 17 deletions(-)
-commit fdd30032f8531ac89519b48c21d810ecf06825f6
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-24 17:02:00 +0200
+commit 237f06d9c55cf438a7538a598354bcf103f23711
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:24:05 +0800
- Tests: Add bad-1-check-crc32-2.xz.
+ Translations: Update the Polish translation.
- tests/files/README | 7 +++++++
- tests/files/bad-1-check-crc32-2.xz | Bin 0 -> 72 bytes
- 2 files changed, 7 insertions(+)
+ po/pl.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
-commit db465419ae26ec7fb9b9472183911ff521620c77
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-17 19:20:50 +0200
+commit 80c2c832136656d5ac7a1bca8bc42d95e13d281a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:22:23 +0800
- liblzma: In EROFS LZMA decoder, verify that comp_size matches at the end.
-
- When the uncompressed size is known to be exact, after decompressing
- the stream exactly comp_size bytes of input must have been consumed.
- This is a minor improvement to error detection.
+ Translations: Update the German man page translations.
- src/liblzma/common/erofs_decoder.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
+ po4a/de.po | 1255 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 629 insertions(+), 626 deletions(-)
-commit 774cc0118ba2496581cb2621505a04bb6598cc75
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-17 18:53:34 +0200
+commit fdbde14503ca03069d3649aa51926f5f796b89d8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:18:44 +0800
- liblzma: Make EROFS LZMA decoder work when exact uncomp_size isn't known.
-
- The caller must still not specify an uncompressed size bigger
- than the actual uncompressed size.
-
- As a downside, this now needs the exact compressed size.
+ Translations: Update the German translation.
- src/liblzma/api/lzma/container.h | 23 ++++++++---
- src/liblzma/common/erofs_decoder.c | 80 ++++++++++++++++++++++++++++++++++----
- 2 files changed, 91 insertions(+), 12 deletions(-)
+ po/de.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
-commit 421b0aa352da244075db10205cf33712f91b9835
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-14 20:57:11 +0200
+commit 9f3bf5ff5b2b5cf0b252a2bf381238ca49dc4101
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:17:10 +0800
- liblzma: Fix missing normalization in rc_encode_dummy().
-
- Without this fix it could attempt to create too much output.
+ Translations: Update the Chinese (simplified) translation.
- src/liblzma/rangecoder/range_encoder.h | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
+ po/zh_CN.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
-commit 601ec0311e769fc704daaaa7dac0ca840aff080e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-14 20:07:01 +0200
+commit 376938c588011567c74f1d5a160c0ccce6336d46
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:15:47 +0800
- liblzma: Add EROFS LZMA encoder and decoder.
-
- Right now this is just a planned extra-compact format for use
- in the EROFS file system in Linux. At this point it's possible
- that the format will either change or be abandoned and removed
- completely.
-
- The special thing about the encoder is that it uses the
- output-size-limited encoding added in the previous commit.
- EROFS uses fixed-sized blocks (e.g. 4 KiB) to hold compressed
- data so the compressors must be able to create valid streams
- that fill the given block size.
+ Translations: Update the Swedish translation.
- src/liblzma/api/lzma/container.h | 76 +++++++++++++++++++
- src/liblzma/common/Makefile.inc | 2 +
- src/liblzma/common/erofs_decoder.c | 148 +++++++++++++++++++++++++++++++++++++
- src/liblzma/common/erofs_encoder.c | 139 ++++++++++++++++++++++++++++++++++
- src/liblzma/liblzma.map | 2 +
- 5 files changed, 367 insertions(+)
+ po/sv.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
-commit 625f4c7c99b2fcc4db9e7ab2deb4884790e2e17c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-13 19:16:32 +0200
+commit 26b0bc6eb82c84559936a7c7080de5c71c8276f8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:14:00 +0800
- liblzma: Add rough support for output-size-limited encoding in LZMA1.
-
- With this it is possible to encode LZMA1 data without EOPM so that
- the encoder will encode as much input as it can without exceeding
- the specified output size limit. The resulting LZMA1 stream will
- be a normal LZMA1 stream without EOPM. The actual uncompressed size
- will be available to the caller via the uncomp_size pointer.
-
- One missing thing is that the LZMA layer doesn't inform the LZ layer
- when the encoding is finished and thus the LZ may read more input
- when it won't be used. However, this doesn't matter if encoding is
- done with a single call (which is the planned use case for now).
- For proper multi-call encoding this should be improved.
-
- This commit only adds the functionality for internal use.
- Nothing uses it yet.
+ Translations: Update the Ukrainian man page translations.
- src/liblzma/common/common.h | 11 +++
- src/liblzma/lz/lz_encoder.c | 16 ++++
- src/liblzma/lz/lz_encoder.h | 4 +
- src/liblzma/lzma/lzma_encoder.c | 127 +++++++++++++++++++++++---------
- src/liblzma/lzma/lzma_encoder_private.h | 12 +++
- src/liblzma/rangecoder/range_encoder.h | 111 ++++++++++++++++++++++++++++
- 6 files changed, 246 insertions(+), 35 deletions(-)
+ po4a/uk.po | 1253 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 628 insertions(+), 625 deletions(-)
-commit 9cdabbeea891e8f1e7741b076f7db6ac05ae392a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-11 23:57:11 +0200
+commit 2d02c8b7640b54f3c5aa1c8b5990ba56f322393b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:09:15 +0800
- Scripts: Add zstd support to xzdiff.
+ Translations: Update the Ukrainian translation.
- src/scripts/xzdiff.1 | 6 ++++--
- src/scripts/xzdiff.in | 16 +++++++++++-----
- 2 files changed, 15 insertions(+), 7 deletions(-)
+ po/uk.po | 45 ++++++++++++++++++++++++++++-----------------
+ 1 file changed, 28 insertions(+), 17 deletions(-)
-commit d9ec3add97cf4c999a7f594c6529680227b6c274
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-11 23:41:30 +0200
+commit f881018b503fd334331c24a09075429558abbce1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:06:57 +0800
- Update THANKS.
+ Translations: Update the Spanish translation.
- THANKS | 2 ++
- 1 file changed, 2 insertions(+)
+ po/es.po | 47 +++++++++++++++++++++++++++++------------------
+ 1 file changed, 29 insertions(+), 18 deletions(-)
-commit 074259f4f3966aeac6edb205fecbc1a8d2b58bb2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-11 23:41:16 +0200
+commit 791fe6d3ffd6877fa5f852be69d9251397dfaa31
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:05:19 +0800
- xz: Make --keep accept symlinks, hardlinks, and setuid/setgid/sticky.
-
- Previously this required using --force but that has other
- effects too which might be undesirable. Changing the behavior
- of --keep has a small risk of breaking existing scripts but
- since this is a fairly special corner case I expect the
- likehood of breakage to be low enough.
-
- I think the new behavior is more logical. The only reason for
- the old behavior was to be consistent with gzip and bzip2.
-
- Thanks to Vincent Lefevre and Sebastian Andrzej Siewior.
+ Translations: Update the Romanian translation.
- src/xz/file_io.c | 9 +++++----
- src/xz/xz.1 | 16 +++++++++++++++-
- 2 files changed, 20 insertions(+), 5 deletions(-)
+ po/ro.po | 48 ++++++++++++++++++++++++++++++------------------
+ 1 file changed, 30 insertions(+), 18 deletions(-)
-commit 73c555b3077c19dda29b6f4592ced2af876f8333
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-11 23:28:52 +0200
+commit 8827e90704f699fe08bb5bed56b1717a2bc0eb77
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-20 20:02:56 +0800
- Scripts: Fix exit status of xzgrep.
-
- Omit the -q option from xz, gzip, and bzip2. With xz this shouldn't
- matter. With gzip it's important because -q makes gzip replace SIGPIPE
- with exit status 2. With bzip2 it's important because with -q bzip2
- is completely silent if input is corrupt while other decompressors
- still give an error message.
-
- Avoiding exit status 2 from gzip is important because bzip2 uses
- exit status 2 to indicate corrupt input. Before this commit xzgrep
- didn't recognize corrupt .bz2 files because xzgrep was treating
- exit status 2 as SIGPIPE for gzip compatibility.
-
- zstd still needs -q because otherwise it is noisy in normal
- operation.
-
- The code to detect real SIGPIPE didn't check if the exit status
- was due to a signal (>= 128) and so could ignore some other exit
- status too.
+ Translations: Update the Romanian man page translations.
- src/scripts/xzgrep.in | 20 +++++++++++++-------
- 1 file changed, 13 insertions(+), 7 deletions(-)
+ po4a/ro.po | 1254 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 629 insertions(+), 625 deletions(-)
-commit 194029ffaf74282a81f0c299c07f73caca3232ca
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-11 22:01:51 +0200
+commit 0184d344fa4f215cd345bb131db9068e077c69b8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-19 23:36:00 +0800
- Scripts: Fix exit status of xzdiff/xzcmp.
-
- This is a minor fix since this affects only the situation when
- the files differ and the exit status is something else than 0.
- In such case there could be SIGPIPE from a decompression tool
- and that would result in exit status of 2 from xzdiff/xzcmp
- while the correct behavior would be to return 1 or whatever
- else diff or cmp may have returned.
+ liblzma: Suppress -Wunused-function warning.
- This commit omits the -q option from xz/gzip/bzip2/lzop arguments.
- I'm not sure why the -q was used in the first place, perhaps it
- hides warnings in some situation that I cannot see at the moment.
- Hopefully the removal won't introduce a new bug.
+ Clang 16.0.0 and earlier have a bug that the ifunc resolver function
+ triggers the -Wunused-function warning. The resolver function is static
+ and only "used" by the __attribute__((__ifunc()__)).
- With gzip the -q option was harmful because it made gzip return 2
- instead of >= 128 with SIGPIPE. Ignoring exit status 2 (warning
- from gzip) isn't practical because bzip2 uses exit status 2 to
- indicate corrupt input file. It's better if SIGPIPE results in
- exit status >= 128.
+ At this time, the bug is still unresolved, but has been reported:
+ https://github.com/llvm/llvm-project/issues/63957
- With bzip2 the removal of -q seems to be good because with -q
- it prints nothing if input is corrupt. The other tools aren't
- silent in this situation even with -q. On the other hand, if
- zstd support is added, it will need -q since otherwise it's
- noisy in normal situations.
-
- Thanks to Étienne Mollier and Sebastian Andrzej Siewior.
+ This is not a problem in GCC.
- src/scripts/xzdiff.in | 35 +++++++++++++++++++++--------------
- 1 file changed, 21 insertions(+), 14 deletions(-)
+ src/liblzma/check/crc64_fast.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit f7fa309e1f7178d04c7bedc03b73077639371e97
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2021-01-09 21:14:36 +0200
+commit 43845fa70fc751736c44c18f4cee42d49bfd1392
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-18 22:52:25 +0800
- liblzma: Make lzma_outq usable for threaded decompression too.
-
- Before this commit all output queue buffers were allocated as
- a single big allocation. Now each buffer is allocated separately
- when needed. Used buffers are cached to avoid reallocation
- overhead but the cache will keep only one buffer size at a time.
- This should make things work OK in the decompression where most
- of the time the buffer sizes will be the same but with some less
- common files the buffer sizes may vary.
+ liblzma: Reword lzma_str_list_filters() documentation.
- While this should work fine, it's still a bit preliminary
- and may even get reverted if it turns out to be useless for
- decompression.
+ This further improves the documentation from commit
+ f36ca7982f6bd5e9827219ed4f3c5a1fbf5d7bdf. The previous wording of
+ "supported options" was slightly misleading since the options that are
+ printed are the ones that are relevant for encoding/decoding. It is not
+ about which options can or must be specified.
- src/liblzma/common/outqueue.c | 268 +++++++++++++++++++++------------
- src/liblzma/common/outqueue.h | 138 ++++++++++++-----
- src/liblzma/common/stream_encoder_mt.c | 52 ++++---
- 3 files changed, 301 insertions(+), 157 deletions(-)
+ src/liblzma/api/lzma/filter.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit a35a69d693ce37d4ba7c1855bda7d9cfa13d1778
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-12-23 17:15:49 +0200
+commit 818701ba1c9dff780b7fbf28f9ab8eb11a25dd67
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-18 22:49:57 +0800
- Update THANKS.
+ liblzma: Improve comment in string_conversion.c.
+
+ The comment used "flag" when referring to decoder options. Just
+ referring to them as options is more clear and consistent.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/common/string_conversion.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 4fd79b90c52396d70e0b1206ceb1a873a0ad2589
-Author: H.J. Lu <hjl.tools@gmail.com>
-Date: 2020-12-23 06:49:04 -0800
+commit b6b7d065853cd4c3f5b8d9be8aea0b6dcb0fe090
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-07-18 17:37:33 +0300
- liblzma: Enable Intel CET in x86 CRC assembly codes
-
- When Intel CET is enabled, we need to include <cet.h> in assembly codes
- to mark Intel CET support and add _CET_ENDBR to indirect jump targets.
+ xz: Translate the second "%s: " in message.c since French needs "%s : ".
- Tested on Intel Tiger Lake under CET enabled Linux.
+ This string is used to print a filename when using "xz -v" and
+ stderr isn't a terminal.
- src/liblzma/check/crc32_x86.S | 9 +++++++++
- src/liblzma/check/crc64_x86.S | 9 +++++++++
- 2 files changed, 18 insertions(+)
+ src/xz/message.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit bb3b8c6a23e25db79f862b1de325c56052e0354b
+commit be644042c3066d8e7a2834f989671ba74d27f749
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-12-16 18:33:29 +0200
+Date: 2023-07-18 14:35:33 +0300
- Update THANKS.
+ xz: Make "%s: %s" translatable because French needs "%s : %s".
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/args.c | 5 ++++-
+ src/xz/coder.c | 8 ++++----
+ src/xz/file_io.c | 8 ++++----
+ src/xz/list.c | 11 ++++++-----
+ 4 files changed, 18 insertions(+), 14 deletions(-)
-commit 21588ca34af98738954fc12ded1b89d7294ef646
+commit 97fd5cb669ee0afc48d2087675ab166aff89eaa2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-12-16 18:30:14 +0200
+Date: 2023-07-18 13:57:54 +0300
- Build: Don't build bundles on Apple OSes.
+ liblzma: Tweak #if condition in memcmplen.h.
- Thanks to Daniel Packard.
+ Maybe ICC always #defines _MSC_VER on Windows but now
+ it's very clear which code will get used.
- CMakeLists.txt | 3 +++
- 1 file changed, 3 insertions(+)
+ src/liblzma/common/memcmplen.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit d05b0c42dd8b38d8c6b8193c8af50e9bd3d16f28
+commit 40392c19f71985852d75997f109dea97177d6f3f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-12-05 22:44:03 +0200
+Date: 2023-07-18 13:49:43 +0300
- Update THANKS.
+ liblzma: Omit unnecessary parenthesis in a preprocessor directive.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/common/memcmplen.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 1890351f3423627ba5c4c495402f32d7e9ed90b7
-Author: Adam Borowski <kilobyte@angband.pl>
-Date: 2020-09-25 03:35:18 +0200
+commit abc1d5601b7e419ebc28a1ab4b268613b52e6f98
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-18 00:51:48 +0800
- Scripts: Add zstd support to xzgrep.
-
- Thanks to Adam Borowski.
+ xz: Update Authors list in a few files.
- src/scripts/xzgrep.1 | 9 ++++++---
- src/scripts/xzgrep.in | 1 +
- 2 files changed, 7 insertions(+), 3 deletions(-)
+ src/xz/args.c | 3 ++-
+ src/xz/args.h | 3 ++-
+ src/xz/coder.c | 3 ++-
+ src/xz/coder.h | 3 ++-
+ src/xz/message.c | 3 ++-
+ 5 files changed, 10 insertions(+), 5 deletions(-)
-commit 2f108abb3d82e4e2313b438dae9c0c7c7a6366f2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-17 20:51:48 +0200
+commit 289034a168878baa9df6ff6e159110aade69cba5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-14 23:20:33 +0800
- CMake: Fix compatibility with CMake 3.13.
+ Docs: Add a new section to INSTALL for Tests.
- The syntax "if(DEFINED CACHE{FOO})" requires CMake 3.14.
- In some other places the code treats the cache variables
- like normal variables already (${FOO} or if(FOO) is used,
- not ${CACHE{FOO}).
+ The new Tests section describes basic information about the tests, how
+ to run them, and important details when cross compiling. We have had a
+ few questions about how to compile the tests without running them, so
+ hopefully this information will help others with the same question in the
+ future.
- Thanks to ygrek for reporting the bug on IRC.
+ Fixes: https://github.com/tukaani-project/xz/issues/54
- CMakeLists.txt | 2 +-
- cmake/tuklib_cpucores.cmake | 4 ++--
- cmake/tuklib_physmem.cmake | 4 ++--
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ INSTALL | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 64 insertions(+), 17 deletions(-)
-commit 5af726a79273fafa5de5745b117e567f21c90e49
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-01 22:56:43 +0200
+commit 1119e5f5a519b0ab71c81fc4dc84c0cc72abe513
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-14 21:10:27 +0800
- Update THANKS.
+ Docs: Update README.
+
+ This adds an entry to "Other implementations of the .xz format" for
+ XZ for Java.
- THANKS | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ README | 4 ++++
+ 1 file changed, 4 insertions(+)
-commit 4575d9d365c756ec189899f9f743e0b3515ce72d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-01 22:34:25 +0200
+commit f99e2e4e53b7ea89e4eef32ddd4882e0416357c9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-13 23:32:10 +0800
- xz: Avoid unneeded \f escapes on the man page.
-
- I don't want to use \c in macro arguments but groff_man(7)
- suggests that \f has better portability. \f would be needed
- for the .TP strings for portability reasons anyway.
+ xz: Fix typo in man page.
- Thanks to Bjarni Ingi Gislason.
+ The Memory limit information section described three output
+ columns when it actually has six. This was reworded to
+ "multiple" to make it more future proof.
- src/xz/xz.1 | 31 ++++++++++++++++++++++---------
- 1 file changed, 22 insertions(+), 9 deletions(-)
+ src/xz/xz.1 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 620b32f5339f86710cb4435e01ecdac972ccac73
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-01 19:09:53 +0200
+commit f907705eb1f6c5edaafc9668a34c51a989932f1d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-13 21:46:12 +0800
- xz: Use non-breaking spaces when intentionally using more than one space.
+ xz: Minor clean up for coder.c
- This silences some style checker warnings. Seems that spaces
- in the beginning of a line don't need this treatment.
+ * Moved max_block_list_size from a global to local variable.
+ * Reworded error message in validate_block_list_filter().
+ * Removed helper function filter_chain_error().
+ * Changed 1 << X to 1U << X in many places
+
+ src/xz/coder.c | 53 +++++++++++++++++++++--------------------------------
+ 1 file changed, 21 insertions(+), 32 deletions(-)
+
+commit 9adc9e56157ecbf2948e5036df8567809b9ae177
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-13 21:26:47 +0800
+
+ xz: Update man page Authors and date.
+
+ src/xz/xz.1 | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit c12e429f2635da8d8f5749e5f733f451baca6945
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-20 20:32:59 +0800
+
+ xz: Add a section to man page for robot mode --filters-help.
+
+ src/xz/xz.1 | 32 ++++++++++++++++++++++++++++++--
+ 1 file changed, 30 insertions(+), 2 deletions(-)
+
+commit e10f2db5d10300c16fa482a136ed31c1aa6e8e8d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-19 23:11:41 +0800
+
+ xz: Slight reword in xz man page for consistency.
- Thanks to Bjarni Ingi Gislason.
+ Changed will print => prints in xz --robot --version description to
+ match --robot --info-memory description.
src/xz/xz.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit cb1f34988c8a4130485091b2f8b641303d8f701b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-01 18:49:37 +0200
+commit f5dc172a402fa946f3c45a16929d7fe14c9f5e81
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-19 23:07:10 +0800
- xz: Protect the ellipsis (...) on the man page with \&.
+ xz: Reorder robot mode subsections in the man page.
- This does it only when ... appears outside macro calls.
+ The order is now consistent with the order the command line arguments
+ are documented earlier in the man page. The new order is:
+ 1. --list
+ 2. --info-memory
+ 3. --version
- Thanks to Bjarni Ingi Gislason.
+ Instead of the previous order:
+ 1. --version
+ 2. --info-memory
+ 3. --list
- src/xz/xz.1 | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/xz/xz.1 | 192 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 96 insertions(+), 96 deletions(-)
-commit 5d224da3da87400f2fab313abbd7c710e7169ef9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-11-01 18:41:21 +0200
+commit 9628be23aef2784249fd9f3199799d785d2ec5cc
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 00:46:50 +0800
- xz: Avoid the abbreviation "e.g." on the man page.
-
- A few are simply omitted, most are converted to "for example"
- and surrounded with commas. Sounds like that this is better
- style, for example, man-pages(7) recommends avoiding such
- abbreviations except in parenthesis.
-
- Thanks to Bjarni Ingi Gislason.
+ xz: Update man page for new --filters-help option.
- src/xz/xz.1 | 66 ++++++++++++++++++++++++++++++-------------------------------
- 1 file changed, 33 insertions(+), 33 deletions(-)
+ src/xz/xz.1 | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit 90457dbe3e5717660f5b81f8c604860fc5137c0c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-07-12 23:10:03 +0300
+commit a165d7df1964121eb9df715e6f836a31c865beef
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 00:44:41 +0800
- xz man page: Change \- (minus) to \(en (en-dash) for a numeric range.
+ xz: Add a new --filters-help option.
- Docs of ancient troff/nroff mention \(em (em-dash) but not \(en
- and \- was used for both minus and en-dash. I don't know how
- portable \(en is nowadays but it can be changed back if someone
- complains. At least GNU groff and OpenBSD's mandoc support it.
+ The --filters-help can be used to help create filter chains with the
+ --filters and --filtersX options. The message in --long-help is too
+ short to fully explain the syntax to construct complex filter chains.
- Thanks to Bjarni Ingi Gislason for the patch.
+ In --robot mode, xz will only print the output from liblzma function
+ lzma_str_list_filters.
- src/xz/xz.1 | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
+ src/xz/args.c | 8 ++++++++
+ src/xz/message.c | 30 ++++++++++++++++++++++++++++++
+ src/xz/message.h | 5 +++++
+ 3 files changed, 43 insertions(+)
-commit 352ba2d69af2136bc814aa1df1a132559d445616
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-07-12 20:46:24 +0300
+commit 95f1a414b156ee35d3e71862a14915fdd138f913
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-21 20:28:11 +0800
- Windows: Fix building of resource files when config.h isn't used.
-
- Now CMake + Visual Studio works for building liblzma.dll.
+ xz: Update the man page for --block-list and --filtersX
- Thanks to Markus Rickert.
+ The --block-list option description needed updating since the new
+ --filtersX option changes how it can be used. The new entry for
+ --filters1=FILTERS ... --filter9=FILTERS was created right after
+ the --filters option.
- src/common/common_w32res.rc | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ src/xz/xz.1 | 106 +++++++++++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 80 insertions(+), 26 deletions(-)
-commit a9e2a87f1d61dcf684d809bf08c8ebea93f8a480
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-04-06 19:31:50 +0300
+commit 47a63cad2aa778280e0c1926b7159427ea028cb1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-21 19:50:14 +0800
- src/scripts/xzgrep.1: Filenames to xzgrep are optional.
-
- xzgrep --help was correct already.
+ xz: Update --long-help for the new --filtersX option.
- src/scripts/xzgrep.1 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/xz/message.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
-commit a7ba275d9b855d186abb29eb7a4f4cb6d9ca6fe0
-Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
-Date: 2020-03-26 22:17:31 +0000
+commit 8b9913a13daca2550d02dfdcdc9be15f55ca4d13
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-17 20:46:21 +0800
- src/script/xzgrep.1: Remove superfluous '.RB'
-
- Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
-
- [ "test-groff" is a developmental version of "groff" ]
+ xz: Ignore filter chains that are set but never used in --block-list.
- Input file is ./src/scripts/xzgrep.1
+ If a filter chain is set but not used in --block-list, it introduced
+ unexpected behavior such as requiring an unneeded amount of memory to
+ compress, reducing the number of threads in multi-threaded encoding, and
+ printing an incorrect amount of memory needed to decompress.
- <src/scripts/xzgrep.1>:20 (macro RB): only 1 argument, but more are expected
- <src/scripts/xzgrep.1>:23 (macro RB): only 1 argument, but more are expected
- <src/scripts/xzgrep.1>:26 (macro RB): only 1 argument, but more are expected
- <src/scripts/xzgrep.1>:29 (macro RB): only 1 argument, but more are expected
- <src/scripts/xzgrep.1>:32 (macro RB): only 1 argument, but more are expected
-
- "abc..." does not mean the same as "abc ...".
-
- The output from nroff and troff is unchanged except for the space
- between "file" and "...".
-
- Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
+ This also renames filters_init_mask => filters_used_mask. A filter is
+ assumed to be used if it is specified in --filtersX until
+ coder_set_compression_settings() determines which filters are referenced
+ in --block-list.
- src/scripts/xzgrep.1 | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ src/xz/coder.c | 66 ++++++++++++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 48 insertions(+), 18 deletions(-)
-commit 133d498db0f4b14f066d192d64dbcade45deae6b
-Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
-Date: 2020-03-30 21:56:36 +0000
+commit 183819bfd9efac8c184d9bf123325719b7eee30f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 20:11:13 +0800
- xzgrep.1: Delete superfluous '.PP'
-
- Summary:
-
- mandoc -T lint xzgrep.1 :
- mandoc: xzgrep.1:79:2: WARNING: skipping paragraph macro: PP empty
+ xz: Set the Block size for mt encoding correctly.
- There is no change in the output of "nroff" and "troff".
-
- Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
+ When opt_block_size is not used, the Block size for mt encoder is
+ derived from the minimum of the largest Block specified by
+ --block-list and the recommended Block size on all filter chains
+ calculated by lzma_mt_block_size(). This avoids using unnecessary
+ memory and ensures that all Blocks are large enough for the most memory
+ needy filter chain.
- src/scripts/xzgrep.1 | 1 -
- 1 file changed, 1 deletion(-)
+ src/xz/coder.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 67 insertions(+), 1 deletion(-)
-commit 057839ca982f886387b66746bffe749cb14fd8cd
-Author: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
-Date: 2020-03-26 21:16:18 +0000
+commit afb2dbec3d857b026486b75e42a4728e12d234cb
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-11 00:09:41 +0800
- src/xz/xz.1: Correct misused two-fonts macros
-
- Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
-
- [ "test-groff" is a developmental version of "groff" ]
-
- Input file is ./src/xz/xz.1
-
- <src/xz/xz.1>:408 (macro BR): only 1 argument, but more are expected
- <src/xz/xz.1>:1009 (macro BR): only 1 argument, but more are expected
- <src/xz/xz.1>:1743 (macro BR): only 1 argument, but more are expected
- <src/xz/xz.1>:1920 (macro BR): only 1 argument, but more are expected
- <src/xz/xz.1>:2213 (macro BR): only 1 argument, but more are expected
-
- Output from nroff and troff is unchanged, except for a font change of a
- full stop (.).
+ xz: Validate --flush-timeout for all specified filter chains.
+
+ src/xz/coder.c | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+commit 5f0c5a04388f8334962c70bc37a8c2ff8f605e0a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 19:54:33 +0800
+
+ xz: Allows --block-list filters to scale down memory usage.
- Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
+ Previously, only the default filter chain could have its memory usage
+ adjusted. The filter chains specified with --filtersX were not checked
+ for memory usage. Now, all used filter chains will be adjusted if
+ necessary.
- src/xz/xz.1 | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ src/xz/coder.c | 269 +++++++++++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 214 insertions(+), 55 deletions(-)
-commit b8e12f5ab4c9fd3cb09a4330b2861f6b979ababd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-23 18:07:50 +0200
+commit 479fd58d60622331fcbe48fddf756927b9f80d9a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-10 21:50:33 +0800
- Typo fixes from fossies.org.
+ xz: Do not include block splitting if encoders are disabled.
- https://fossies.org/linux/misc/xz-5.2.5.tar.xz/codespell.html
+ The block splitting logic and split_block() function are not needed if
+ encoders are disabled. This will help slightly reduce the binary size
+ when built without encoders and allow split_block() to use functions
+ that require encoders being enabled.
- Makefile.am | 2 +-
- doc/examples/01_compress_easy.c | 2 +-
- src/liblzma/api/lzma/base.h | 2 +-
- src/liblzma/check/crc32_x86.S | 2 +-
- src/liblzma/common/index.c | 2 +-
- src/xz/xz.1 | 4 ++--
- 6 files changed, 7 insertions(+), 7 deletions(-)
+ src/xz/coder.c | 29 ++++++++++++++++++++---------
+ 1 file changed, 20 insertions(+), 9 deletions(-)
-commit 869b9d1b4edd6df07f819d360d306251f8147353
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-17 16:24:28 +0200
+commit f86ede22500f7ae024ec3ec3f3489ab5a857a3b3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-10 22:38:59 +0800
- Update NEWS for 5.2.5.
+ xz: Free filters[] in debug mode.
+
+ This will only free filter chains created with --filters1-9 since the
+ default filter chain may be set from a static function variable. The
+ complexity to free the default filter chain is not worth the burden on
+ code maintenance.
- NEWS | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 105 insertions(+)
+ src/xz/coder.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit a048e3a92d238c65f050a765174d9c75417231d4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-16 20:01:37 +0200
+commit f281cd0d692ac0c70fc7669b80dddb863ea947e1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 19:28:23 +0800
- README: Update outdated sections.
+ xz: Add a message if --block-list is used outside of xz compresssion.
+
+ --block-list is only supported with compression in xz format. This avoids
+ silently ignoring when --block-list is unused.
- README | 21 +++++++++++----------
- 1 file changed, 11 insertions(+), 10 deletions(-)
+ src/xz/args.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
-commit 29aed815ad4f98f3e4d355faa76a244ecd8ce716
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-16 19:39:45 +0200
+commit d6af7f347077b22403133239592e478931307759
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-18 20:29:09 +0800
- README: Mention that man pages can be translated.
+ xz: Create command line options for filters[1-9].
+
+ The new command line options are meant to be combined with --block-list.
+ They work as an optional extension to --block-list to specify a custom
+ filter chain for each block listed. The new options allow the creation
+ of up to 9 reusable filter chains. For instance:
+
+ xz --block-list=1:10MiB,3:5MiB,,2:5MiB,1:0 --filters1=delta--lzma2 \
+ --filters2=x86--lzma2 --filters3=arm64--lzma2
+
+ Will create the following blocks:
+ 1. A block of size 10 MiB with filter chain delta, lzma2.
+ 2. A block of size 5 MiB with filter chain arm64, lzma2.
+ 3. A block of size 5 MiB with filter chain arm64, lzma2.
+ 4. A block of size 5 MiB with filter chain x86, lzma2.
+ 5. A block containing the rest of the file contents with filter chain
+ delta, lzma2.
- README | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
+ src/xz/args.c | 82 ++++++++++++++++++++++---
+ src/xz/coder.c | 188 ++++++++++++++++++++++++++++++++++++++++++---------------
+ src/xz/coder.h | 20 +++++-
+ 3 files changed, 230 insertions(+), 60 deletions(-)
-commit 7fa7653940cc9dcfcbce2fbc5166ea343ad4e3c1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-16 16:43:29 +0200
+commit 072d29250113268536719ad0e040ab8a66fb6435
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 19:36:09 +0800
- Update INSTALL.generic from Automake 1.16.1.
+ xz: Use lzma_filters_free() in forget_filter_chain().
+
+ This is a little cleaner than the previous implementation of
+ forget_filter_chain(). It is also more consistent since
+ lzma_str_to_filters() will always terminate the filter chain so there
+ is no need to terminate it later in coder_set_compression_settings().
- INSTALL.generic | 321 ++++++++++++++++++++++++++++----------------------------
- 1 file changed, 162 insertions(+), 159 deletions(-)
+ src/xz/coder.c | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
-commit 9bd317ef03ab9b3e6a927c27c2e9c4ac041182f0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-15 15:27:22 +0200
+commit 3d21da5cff4b511633cb6e0d8a1090485c0c1059
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-17 22:22:45 +0800
- Update INSTALL for Windows and DOS and add preliminary info for z/OS.
+ xz: Separate string to filter conversion into a helper function.
+
+ Converting from string to filter will also need to be done for block
+ specific filter chains.
- INSTALL | 51 +++++++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 41 insertions(+), 10 deletions(-)
+ src/xz/coder.c | 33 ++++++++++++++++++++-------------
+ 1 file changed, 20 insertions(+), 13 deletions(-)
-commit a3148c0446dc7fa96363752df414d22539c9007b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-15 15:26:20 +0200
+commit a6583726e5f950278f96abcf79c04f1056810be6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-06 00:03:35 +0800
- Build: Update m4/ax_pthread.m4 from Autoconf Archive (again).
+ Tests: Use new --filters option in test_compress.sh
- m4/ax_pthread.m4 | 219 +++++++++++++++++++++++++++++--------------------------
- 1 file changed, 117 insertions(+), 102 deletions(-)
+ tests/test_compress.sh | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
-commit 7812002dd3ed319e42a14662a8531802cca8ca67
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 21:15:35 +0200
+commit 5f3b898d07cc9b7160c7c88b3120b7edabb8a5b0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-06 00:03:06 +0800
- xz: Never use thousand separators in DJGPP builds.
-
- DJGPP 2.05 added support for thousands separators but it's
- broken at least under WinXP with Finnish locale that uses
- a non-breaking space as the thousands separator. Workaround
- by disabling thousands separators for DJGPP builds.
+ xz: Update --long-help and man page for new --filters option.
- src/xz/util.c | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
+ src/xz/message.c | 6 ++++++
+ src/xz/xz.1 | 41 ++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 42 insertions(+), 5 deletions(-)
-commit 7c8f688bf7fccd65d396e0130cbf4ea5dff5c56f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 19:38:08 +0200
+commit 9ded880a0221f4d1256845fc4ab957ffd377c760
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-06 00:02:29 +0800
- DOS: Update dos/Makefile for DJGPP 2.05.
+ xz: Add --filters option to CLI.
- It doesn't need -fgnu89-inline like 2.04beta did.
+ The --filters option uses the new lzma_str_to_filters() function
+ to convert a string into a full filter chain. Using this option
+ will reset all previous filters set by --preset, --[filter], or
+ --filters.
- dos/Makefile | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
+ src/xz/args.c | 9 +++++++--
+ src/xz/coder.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++--
+ src/xz/coder.h | 3 +++
+ 3 files changed, 58 insertions(+), 4 deletions(-)
-commit 319ca928d73de87940c54e30bffe69f9fa65efdf
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 19:36:07 +0200
+commit 2c189bb00af73dc7ba1a67a9d274d5be03ee3a88
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-14 21:30:25 +0800
- DOS: Update instructions in dos/INSTALL.txt.
+ Tests: Improve feature testing for skipping.
+
+ Fixed a bug where test_compress_* would all fail if arm64 or armthumb
+ filters were enabled for compression but arm was disabled. Since the
+ grep tests only checked for "define HAVE_ENCODER_ARM", this would match
+ on HAVE_ENCODER_ARM64 or HAVE_ENCODER_ARMTHUMB.
+
+ Now the config.h feature test requires " 1" at the end to prevent the
+ prefix problem. have_feature() was also updated for this even though
+ there were known current bugs affecting it. This is just in case future
+ features have a similar prefix problem.
- dos/INSTALL.txt | 59 ++++++++++++++++++++++++++++-----------------------------
- 1 file changed, 29 insertions(+), 30 deletions(-)
+ tests/test_compress.sh | 4 ++--
+ tests/test_files.sh | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
-commit cb6b227ce39932824812ccd8a0647bd968de27d2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-11 17:58:51 +0200
+commit 80a6b9bcad016c99c9ba3f3eeb4a619fcadfd357
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-10 20:56:28 +0800
- DOS: Update config.h.
-
- The added defines assume GCC >= 4.8.
+ Translations: Update the Chinese (traditional) translation.
- dos/config.h | 8 ++++++++
- 1 file changed, 8 insertions(+)
+ po/zh_TW.po | 659 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 377 insertions(+), 282 deletions(-)
-commit 4572d53e16e87eee375bc5624de2fd59bb0ae9cd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-03-02 13:54:33 +0200
+commit 17f8844e6fc355abf997d77637a7447c4f7bbcbd
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-08 21:24:19 +0800
- liblzma: Fix a comment and RC_SYMBOLS_MAX.
+ liblzma: Remove non-portable empty initializer.
- The comment didn't match the value of RC_SYMBOLS_MAX and the value
- itself was slightly larger than actually needed. The only harm
- about this was that memory usage was a few bytes larger.
+ Commit 78704f36e74205857c898a351c757719a6c8b666 added an empty
+ initializer {} to prevent a warning. The empty initializer is a GNU
+ extension and results in a build failure on MSVC. The -wpedantic flag
+ warns about empty initializers.
- src/liblzma/rangecoder/range_encoder.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/common/stream_encoder_mt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 265daa873c0d871f5f23f9b56e133a6f20045a0a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-27 20:58:52 +0200
+commit 3aca4f629cd577f0c54f594d5d88722edf0b0413
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-07-08 20:03:59 +0800
- Build: Make CMake build fail if tuklib_cpucores or tuklib_physmem fails.
+ Translations: Update the Vietnamese translation.
- CMakeLists.txt | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
+ po/vi.po | 620 +++++++++++++++++++++++++++++++++++----------------------------
+ 1 file changed, 349 insertions(+), 271 deletions(-)
-commit 7c8b904527cdbe61248c80edcc2e20d840c4fef9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-27 20:24:27 +0200
+commit 66bdcfa85fef2911cc80f5f30fed3f9610faccb4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 20:46:31 +0800
- Build: Add support for --no-po4a option to autogen.sh.
+ Tests: Fix memory leaks in test_index.
- Normally, if po4a isn't available, autogen.sh will return
- with non-zero exit status. The option --no-po4a can be useful
- when one knows that po4a isn't available but wants autogen.sh
- to still return with zero exit status.
+ Several tests were missing calls to lzma_index_end() to clean up the
+ lzma_index structs. The memory leaks were discovered by using
+ -fsanitize=address with GCC.
- autogen.sh | 11 ++++++++++-
- 1 file changed, 10 insertions(+), 1 deletion(-)
+ tests/test_index.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
-commit 292a5c0f9c9b3a66f5a5c652dc46381836d4537f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-25 21:35:14 +0200
+commit fe3bd438fb119f9bad3f08dc29d331e4956196e1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 20:43:29 +0800
- Update THANKS.
+ Tests: Fix memory leaks in test_block_header.
+
+ test_block_header was not properly freeing the filter options between
+ calls to lzma_block_header_decode(). The memory leaks were discovered by
+ using -fsanitize=address with GCC.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/test_block_header.c | 38 ++++++++++++++++++++++----------------
+ 1 file changed, 22 insertions(+), 16 deletions(-)
-commit 474320e9908786ba2021035f9013191e16cde08a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-25 20:42:31 +0200
+commit 78704f36e74205857c898a351c757719a6c8b666
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 20:31:11 +0800
- Build: Fix bugs in the CMake files.
+ liblzma: Prevent uninitialzed warning in mt stream encoder.
- Seems that the phrase "add more quotes" from sh/bash scripting
- applies to CMake as well. E.g. passing an unquoted list ${FOO}
- to a function that expects one argument results in only the
- first element of the list being passed as an argument and
- the rest get ignored. Adding quotes helps ("${FOO}").
+ This change only impacts the compiler warning since it was impossible
+ for the wait_abs struct in stream_encode_mt() to be used before it was
+ initialized since mythread_condtime_set() will always be called before
+ mythread_cond_timedwait().
- list(INSERT ...) is weird. Inserting an empty string to an empty
- variable results in empty list, but inserting it to a non-empty
- variable does insert an empty element to the list.
+ Since the mythread.h code is different between the POSIX and
+ Windows versions, this warning was only present on Windows builds.
- Since INSERT requires at least one element,
- "${CMAKE_THREAD_LIBS_INIT}" needs to be quoted in CMakeLists.txt.
- It might result in an empty element in the list. It seems to not
- matter as empty elements consistently get ignored in that variable.
- In fact, calling cmake_check_push_state() and cmake_check_pop_state()
- will strip the empty elements from CMAKE_REQUIRED_LIBRARIES!
+ Thanks to Arthur S for reporting the warning and providing an initial
+ patch.
+
+ src/liblzma/common/stream_encoder_mt.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit e3356a204c5ae02db3ec4552b6c1be354e9b6142
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 20:22:38 +0800
+
+ liblzma: Prevent warning for MSYS2 Windows build.
- In addition to quoting fixes, this fixes checks for the cache
- variables in tuklib_cpucores.cmake and tuklib_physmem.cmake.
+ In lzma_memcmplen(), the <intrin.h> header file is only included if
+ _MSC_VER and _M_X64 are both defined but _BitScanForward64() was
+ previously used if _M_X64 was defined. GCC for MSYS2 defines _M_X64 but
+ not _MSC_VER so _BitScanForward64() was used without including
+ <intrin.h>.
- Thanks to Martin Matuška for testing and reporting the problems.
- These fixes aren't tested yet but hopefully they soon will be.
+ Now, lzma_memcmplen() will use __builtin_ctzll() for MSYS2 GCC builds as
+ expected.
- CMakeLists.txt | 52 ++++++++++++++++++++++-----------------------
- cmake/tuklib_common.cmake | 8 ++++---
- cmake/tuklib_cpucores.cmake | 30 ++++++++++++++------------
- cmake/tuklib_integer.cmake | 34 +++++++++++++++--------------
- cmake/tuklib_mbstr.cmake | 6 +++---
- cmake/tuklib_physmem.cmake | 29 +++++++++++++------------
- cmake/tuklib_progname.cmake | 4 ++--
- 7 files changed, 85 insertions(+), 78 deletions(-)
+ src/liblzma/common/memcmplen.h | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
-commit 7e3493d40eac0c3fa3d5124097745a70e15c41f6
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-24 23:38:16 +0200
+commit 45e250a9e9f3c3e8e8af2983366b170bf54f890e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 21:01:22 +0800
- Build: Add very limited experimental CMake support.
+ CI: Add test with -fsanitize=address,undefined.
- This does *NOT* replace the Autotools-based build system in
- the foreseeable future. See the comment in the beginning
- of CMakeLists.txt.
+ ci_build.sh was updated to accept disabling of __attribute__ ifunc
+ and CLMUL. This will allow -fsanitize=address to pass because ifunc
+ is incompatible with -fsanitize=address. The CLMUL implementation has
+ optimizations that potentially read past the buffer and mask out the
+ unwanted bytes.
- So far this has been tested only on GNU/Linux but I commit
- it anyway to make it easier for others to test. Since I
- haven't played much with CMake before, it's likely that
- there are things that have been done in a silly or wrong
- way and need to be fixed.
+ This test will only run on Autotools Linux.
- CMakeLists.txt | 643 ++++++++++++++++++++++++++++++++++++++++++++
- cmake/tuklib_common.cmake | 47 ++++
- cmake/tuklib_cpucores.cmake | 173 ++++++++++++
- cmake/tuklib_integer.cmake | 100 +++++++
- cmake/tuklib_mbstr.cmake | 20 ++
- cmake/tuklib_physmem.cmake | 149 ++++++++++
- cmake/tuklib_progname.cmake | 19 ++
- 7 files changed, 1151 insertions(+)
+ .github/workflows/ci.yml | 23 +++++++++++++++++++----
+ build-aux/ci_build.sh | 8 +++++++-
+ 2 files changed, 26 insertions(+), 5 deletions(-)
-commit 21bd4701fca3e9002ce78bc135debca369ed8545
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-24 23:37:07 +0200
+commit 596ee722cd7ddf0afae584fc06365adc0e735977
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-28 20:16:04 +0800
- Update m4/.gitignore.
+ CI: Upgrade checkout action from v2 to v3.
- m4/.gitignore | 1 +
- 1 file changed, 1 insertion(+)
+ .github/workflows/ci.yml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit e094d1d0f196a91ec703e8d0055948feef349ae8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-24 23:29:35 +0200
+commit 86118ea320f867e09e98a8682cc08cbbdfd640e2
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-27 23:38:32 +0800
- tuklib: Omit an unneeded <sys/types.h> from a tests.
-
- tuklib_cpucores.c and tuklib_physmem.c don't include <sys/types.h>
- even via other files in this package, so clearly that header isn't
- needed in the tests either (no one has reported build problems due
- to a missing header in a .c file).
+ Update THANKS.
- m4/tuklib_cpucores.m4 | 1 -
- m4/tuklib_physmem.m4 | 1 -
- 2 files changed, 2 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit b3ed19a55fe99a45bd77614e149d39d18498075c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-24 23:01:00 +0200
+commit 3d1fdddf92321b516d55651888b9c669e254634e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-27 17:27:09 +0300
- liblzma: Remove unneeded <sys/types.h> from fastpos_tablegen.c.
-
- This file only generates fastpos_table.c.
- It isn't built as a part of liblzma.
+ Docs: Document the configure option --disable-ifunc in INSTALL.
- src/liblzma/lzma/fastpos_tablegen.c | 1 -
- 1 file changed, 1 deletion(-)
+ INSTALL | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-commit 7b8982b29179b3c586e0456dc9ecbd4f58dcea59
+commit b4cf7a2822e8d30eb2b12a1a07fd04383b10ade3
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-22 14:15:07 +0200
+Date: 2023-06-27 17:24:49 +0300
- Use defined(__GNUC__) before __GNUC__ in preprocessor lines.
-
- This should silence the equivalent of -Wundef in compilers that
- don't define __GNUC__.
+ Minor tweaks to style and comments.
- src/common/sysdefs.h | 3 ++-
- src/liblzma/api/lzma.h | 5 +++--
- 2 files changed, 5 insertions(+), 3 deletions(-)
+ CMakeLists.txt | 8 ++++----
+ configure.ac | 9 +++++----
+ 2 files changed, 9 insertions(+), 8 deletions(-)
-commit 43dfe04e6209c691cf4fbe3072d4ee91271748f1
+commit 23fb9e3a329117c2968c1e7388b6ef07c782dba1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-21 17:40:02 +0200
+Date: 2023-06-27 17:19:49 +0300
- liblzma: Add more uses of lzma_memcmplen() to the normal mode of LZMA.
+ CMake: Rename CHECK_ATTR_IFUNC to ALLOW_ATTR_IFUNC.
- This gives a tiny encoder speed improvement. This could have been done
- in 2014 after the commit 544aaa3d13554e8640f9caf7db717a96360ec0f6 but
- it was forgotten.
+ It's so that there's a clear difference in wording compared
+ to liblzma's integrity check types.
- src/liblzma/lzma/lzma_encoder_optimum_normal.c | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 59e6eb4840b9f52fa3a61544974017279b448216
+commit ee44863ae88e377a5df10db007ba9bfadde3d314
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-21 17:01:15 +0200
+Date: 2023-06-27 17:05:23 +0300
- Build: Add visibility.m4 from gnulib.
+ liblzma: Add ifunc implementation to crc64_fast.c.
+
+ The ifunc method avoids indirection via the function pointer
+ crc64_func. This works on GNU/Linux and probably on FreeBSD too.
+ The previous __attribute((__constructor__)) method is kept for
+ compatibility with ELF platforms which do support ifunc.
- Appears that this file used to get included as a side effect of
- gettext. After the change to gettext version requirements this file
- no longer got copied to the package and so the build was broken.
+ The ifunc method has some limitations, for example, building
+ liblzma with -fsanitize=address will result in segfaults.
+ The configure option --disable-ifunc must be used for such builds.
+
+ Thanks to Hans Jansen for the original patch.
+ Closes: https://github.com/tukaani-project/xz/pull/53
- m4/.gitignore | 1 -
- m4/visibility.m4 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 77 insertions(+), 1 deletion(-)
+ src/liblzma/check/crc64_fast.c | 35 ++++++++++++++++++++++++++---------
+ 1 file changed, 26 insertions(+), 9 deletions(-)
-commit 7fe3ef2eaa53d439cec043727ea1998f4ff0e22a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-21 16:10:44 +0200
+commit b72d21202402a603db6d512fb9271cfa83249639
+Author: Hans Jansen <hansjansen162@outlook.com>
+Date: 2023-06-22 19:49:30 +0200
- xz: Silence a warning when sig_atomic_t is long int.
+ Add ifunc check to CMakeLists.txt
- It can be true at least on z/OS.
+ CMake build system will now verify if __attribute__((__ifunc__())) can be
+ used in the build system. If so, HAVE_FUNC_ATTRIBUTE_IFUNC will be
+ defined to 1.
- src/xz/signals.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
-commit b0a2a77d10940c42b449d47a005bfc2e50ab5db8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-21 15:59:26 +0200
+commit 23b5c36fb71904bfbe16bb20f976da38dadf6c3b
+Author: Hans Jansen <hansjansen162@outlook.com>
+Date: 2023-06-22 19:46:55 +0200
- xz: Avoid unneeded access of a volatile variable.
+ Add ifunc check to configure.ac
+
+ configure.ac will now verify if __attribute__((__ifunc__())) can be used in
+ the build system. If so, HAVE_FUNC_ATTRIBUTE_IFUNC will be defined to 1.
- src/xz/signals.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ configure.ac | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
-commit 524c2f12c762032b819757aeda8af7c47c4cabce
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-21 01:24:18 +0200
+commit dbb3a536ed9873ffa0870321f6873e564c6a9da8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-07 00:18:30 +0800
- tuklib_integer.m4: Optimize the check order.
+ CI: Add apt update command before installing dependencies.
- The __builtin byteswapping is the preferred one so check for it first.
+ Without the extra command, all of the CI tests were automatically
+ failing because the Ubuntu servers could not be reached properly.
- m4/tuklib_integer.m4 | 56 +++++++++++++++++++++++++++-------------------------
- 1 file changed, 29 insertions(+), 27 deletions(-)
+ .github/workflows/ci.yml | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit 57360bb4fd79b358b36d2877db26ac828d1fdfcb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-20 18:54:04 +0200
+commit 6bcd516812331de42b347922913230895bebad34
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-06-07 00:10:38 +0800
- tuklib_exit: Add missing header.
-
- strerror() needs <string.h> which happened to be included via
- tuklib_common.h -> tuklib_config.h -> sysdefs.h if HAVE_CONFIG_H
- was defined. This wasn't tested without config.h before so it
- had worked fine.
+ Update THANKS.
- src/common/tuklib_exit.c | 1 +
+ THANKS | 1 +
1 file changed, 1 insertion(+)
-commit fddd31175e74a538997a939d930462fde17d2dd4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-18 19:12:35 +0200
+commit 0d94ba69220d894d2a86081821d2d7a89df5a10b
+Author: Benjamin Buch <bebuch@users.noreply.github.com>
+Date: 2023-06-06 15:32:45 +0200
- Revert the previous commit and add a comment.
+ CMake: Protects against double find_package
- The previous commit broke crc32_tablegen.c.
+ Boost iostream uses `find_package` in quiet mode and then again uses
+ `find_package` with required. This second call triggers a
+ `add_library cannot create imported target "ZLIB::ZLIB" because another
+ target with the same name already exists.`
- If the whole package is built without config.h (with defines
- set on the compiler command line) this should still work fine
- as long as these headers conform to C99 well enough.
+ This can simply be fixed by skipping the alias part on secondary
+ `find_package` runs.
- src/common/tuklib_config.h | 17 ++++++++++-------
- 1 file changed, 10 insertions(+), 7 deletions(-)
+ CMakeLists.txt | 16 +++++++++-------
+ 1 file changed, 9 insertions(+), 7 deletions(-)
-commit 4e4e9fbb7e66d45319525ac224bff48fbdd0cf6e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-17 23:37:20 +0200
+commit 045d7aae286ecd2ce163be9e0d9041343a03f89a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-31 20:26:42 +0800
- Do not check for HAVE_CONFIG_H in tuklib_config.h.
-
- In XZ Utils sysdefs.h takes care of it and the required headers.
+ Translations: Update the Esperanto translation.
- src/common/tuklib_config.h | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
+ po/eo.po | 185 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 92 insertions(+), 93 deletions(-)
-commit 2d4cef954feba82073951358466a1d614141cf33
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-16 11:18:28 +0200
+commit b0cc7c2dcefe4cbc4e1e697598c14fb687ed0b78
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-31 20:25:00 +0800
- sysdefs.h: Omit the conditionals around string.h and limits.h.
-
- string.h is used unconditionally elsewhere in the project and
- configure has always stopped if limits.h is missing, so these
- headers must have been always available even on the weirdest
- systems.
+ Translations: Update the Croatian translation.
- src/common/sysdefs.h | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
+ po/hr.po | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit feb9c1969bc3eb33d4ecb72cfa897f92dae84939
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-15 15:07:11 +0200
+commit af045ef6f848f02cd14c9ad195a5f87bb0c02dce
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-31 20:15:53 +0800
- Build: Bump Autoconf and Libtool version requirements.
-
- There is no specific reason for this other than blocking
- the most ancient versions. These are still old:
-
- Autoconf 2.69 (2012)
- Automake 1.12 (2012)
- gettext 0.19.6 (2015)
- Libtool 2.4 (2010)
+ Translations: Update the Chinese (simplified) translation.
- configure.ac | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ po/zh_CN.po | 317 ++++++++++++++++++++++++++++++------------------------------
+ 1 file changed, 157 insertions(+), 160 deletions(-)
-commit 3d576cf92158d62790017ad7f2dd6dc1dd6b42bb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-15 03:08:32 +0200
+commit e6b92d5817fe91ad27a0f7f57bd0f2144311e383
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-17 23:12:13 +0800
- Build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6.
-
- This bumps the version requirement from 0.19 (from 2014) to
- 0.19.6 (2015).
-
- Using only the old AM_GNU_GETTEXT_VERSION results in old
- gettext infrastructure being placed in the package. By using
- both macros we get the latest gettext files while the other
- programs in the Autotools family can still see the old macro.
+ Translations: Update German translation of man pages.
- configure.ac | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
+ po4a/de.po | 52 ++++++++++++----------------------------------------
+ 1 file changed, 12 insertions(+), 40 deletions(-)
-commit fa792b8befaf7cb3960b655e0a9410da866d756f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-14 20:42:06 +0200
+commit 592961ccdbba39c7d60fe37e36764232feb57c60
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-17 23:09:18 +0800
- Translations: Add German translation of the man pages.
-
- Thanks to Mario Blättermann.
+ Translations: Update the German translation.
- po4a/de.po | 5532 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- po4a/po4a.conf | 2 +-
- 2 files changed, 5533 insertions(+), 1 deletion(-)
+ po/de.po | 189 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 94 insertions(+), 95 deletions(-)
-commit 6f7211b6bb47a895b47f533282dba9ee9a1b0c8b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-07 15:32:21 +0200
+commit 13572cb2c391f5b7503e333c6e05b20bd5bbb524
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-17 20:30:01 +0800
- Build: Add support for translated man pages using po4a.
-
- The dependency on po4a is optional. It's never required to install
- the translated man pages when xz is built from a release tarball.
- If po4a is missing when building from xz.git, the translated man
- pages won't be generated but otherwise the build will work normally.
-
- The translations are only updated automatically by autogen.sh and
- by "make mydist". This makes it easy to keep po4a as an optional
- dependency and ensures that I won't forget to put updated
- translations to a release tarball.
-
- The translated man pages aren't installed if --disable-nls is used.
-
- The installation of translated man pages abuses Automake internals
- by calling "install-man" with redefined dist_man_MANS and man_MANS.
- This makes the hairy script code slightly less hairy. If it breaks
- some day, this code needs to be fixed; don't blame Automake developers.
-
- Also, this adds more quotes to the existing shell script code in
- the Makefile.am "-hook"s.
+ Translations: Update the Croatian translation.
- Makefile.am | 4 ++++
- autogen.sh | 8 ++++---
- po4a/.gitignore | 2 ++
- po4a/po4a.conf | 14 +++++++++++
- po4a/update-po | 45 ++++++++++++++++++++++++++++++++++
- src/scripts/Makefile.am | 64 +++++++++++++++++++++++++++++++++++++------------
- src/xz/Makefile.am | 50 +++++++++++++++++++++++++++-----------
- src/xzdec/Makefile.am | 55 ++++++++++++++++++++++++++++++++----------
- 8 files changed, 197 insertions(+), 45 deletions(-)
+ po/hr.po | 187 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 93 insertions(+), 94 deletions(-)
-commit 426f9e5819ff7710a5ff573a96c02940be65d52f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-06 17:31:38 +0200
+commit 4e6e425ea8f097c6fb43e69cc9540294dca3680d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-17 20:26:54 +0800
- Update THANKS.
+ Translations: Update Korean translation of man pages.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ po4a/ko.po | 3015 ++++++++++++------------------------------------------------
+ 1 file changed, 568 insertions(+), 2447 deletions(-)
-commit e3a4481d020e4de89efa037f335cf50f3ca55592
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 22:35:06 +0200
+commit d5ef1f6faf7c270f60093629257150085ecf19ca
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-17 20:13:01 +0800
- Update tests/.gitignore.
+ Translations: Update the Korean translation.
- .gitignore | 4 ++++
- 1 file changed, 4 insertions(+)
+ po/ko.po | 319 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 158 insertions(+), 161 deletions(-)
-commit 07208de92f2d5bca764f6d0ebe9d9866051dc4ef
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 22:28:51 +0200
+commit e22d0b0f2e301e7906d0106689d967ed84362028
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:49:09 +0800
- Update m4/.gitignore.
+ Translations: Update the Spanish translation.
- m4/.gitignore | 1 +
- 1 file changed, 1 insertion(+)
+ po/es.po | 319 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 158 insertions(+), 161 deletions(-)
-commit c91fbf223db46c3b3cb9df769863a1a60cd9c908
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 20:47:38 +0200
+commit f50da74d52d01f6cfd826a921249e289cf671678
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:47:23 +0800
- Update THANKS.
+ Translations: Update the Romanian translation.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ po/ro.po | 195 ++++++++++++++++++++++++++++++++-------------------------------
+ 1 file changed, 98 insertions(+), 97 deletions(-)
-commit 15a133b6d1a3eab4faf6eb52a71fdc56bd65846f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 20:40:14 +0200
+commit 4b9ad60a7305e9841b7cb4ea611bdf5fa7271696
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:45:43 +0800
- xz: Make it a fatal error if enabling the sandbox fails.
-
- Perhaps it's too drastic but on the other hand it will let me
- learn about possible problems if people report the errors.
- This won't be backported to the v5.2 branch.
+ Translations: Update Romanian translation of man pages.
- src/xz/file_io.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ po4a/ro.po | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
-commit af0fb386ef55db66654ae39e2deec6e04190c4ff
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 20:33:50 +0200
+commit cb6fd57f889c5d9fab36ae8c9e10083a5fe32dea
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:43:51 +0800
- xz: Comment out annoying sandboxing messages.
+ Translations: Update Ukrainian translation of man pages.
- src/xz/file_io.c | 10 +++++++---
- 1 file changed, 7 insertions(+), 3 deletions(-)
+ po4a/uk.po | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
-commit 986d8c9b52b824474088e5bb3b6940651660f0e2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-05 19:33:37 +0200
+commit c3e8fcbc2db4861f92ad15606c995bd255803c52
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:37:54 +0800
- Build: Workaround a POSIX shell detection problem on Solaris.
-
- I don't know if the problem is in gnulib's gl_POSIX_SHELL macro
- or if xzgrep does something that isn't in POSIX. The workaround
- adds a special case for Solaris: if /usr/xpg4/bin/sh exists and
- gl_cv_posix_shell wasn't overriden on the configure command line,
- use that shell for xzgrep and other scripts. That shell is known
- to work and exists on most Solaris systems.
+ Translations: Update the Ukrainian translation.
- configure.ac | 10 ++++++++++
- 1 file changed, 10 insertions(+)
+ po/uk.po | 321 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 159 insertions(+), 162 deletions(-)
-commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-03 22:03:50 +0200
+commit 27b81b84fcedbc55aa6e6b21004c44070b15b038
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 23:07:35 +0800
- Build: Update m4/ax_pthread.m4 from Autoconf Archive.
+ Translations: Update the Polish translation.
- m4/ax_pthread.m4 | 398 ++++++++++++++++++++++++++++++++++++++-----------------
- 1 file changed, 279 insertions(+), 119 deletions(-)
+ po/pl.po | 316 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 155 insertions(+), 161 deletions(-)
-commit 353970510895f6a80adfe60cf71b70a95adfa8bc
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-02-01 19:56:18 +0200
+commit 8024ad636a65ed6ea95c94d57255be4c6724d6ed
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 22:52:14 +0800
- xz: Limit --memlimit-compress to at most 4020 MiB for 32-bit xz.
-
- See the code comment for reasoning. It's far from perfect but
- hopefully good enough for certain cases while hopefully doing
- nothing bad in other situations.
-
- At presets -5 ... -9, 4020 MiB vs. 4096 MiB makes no difference
- on how xz scales down the number of threads.
-
- The limit has to be a few MiB below 4096 MiB because otherwise
- things like "xz --lzma2=dict=500MiB" won't scale down the dict
- size enough and xz cannot allocate enough memory. With
- "ulimit -v $((4096 * 1024))" on x86-64, the limit in xz had
- to be no more than 4085 MiB. Some safety margin is good though.
-
- This is hack but it should be useful when running 32-bit xz on
- a 64-bit kernel that gives full 4 GiB address space to xz.
- Hopefully this is enough to solve this:
-
- https://bugzilla.redhat.com/show_bug.cgi?id=1196786
-
- FreeBSD has a patch that limits the result in tuklib_physmem()
- to SIZE_MAX on 32-bit systems. While I think it's not the way
- to do it, the results on --memlimit-compress have been good. This
- commit should achieve practically identical results for compression
- while leaving decompression and tuklib_physmem() and thus
- lzma_physmem() unaffected.
+ Translations: Update the Swedish translation.
- src/xz/hardware.c | 32 +++++++++++++++++++++++++++++++-
- src/xz/xz.1 | 21 ++++++++++++++++++++-
- 2 files changed, 51 insertions(+), 2 deletions(-)
+ po/sv.po | 319 +++++++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 158 insertions(+), 161 deletions(-)
-commit ba76d67585f88677af9f48b48e7bdc3bb7687def
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 20:53:25 +0200
+commit 6699a29673f227c4664826db485ed9f7596320d2
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-16 21:21:38 +0800
- xz: Set the --flush-timeout deadline when the first input byte arrives.
-
- xz --flush-timeout=2000, old version:
-
- 1. xz is started. The next flush will happen after two seconds.
- 2. No input for one second.
- 3. A burst of a few kilobytes of input.
- 4. No input for one second.
- 5. Two seconds have passed and flushing starts.
-
- The first second counted towards the flush-timeout even though
- there was no pending data. This can cause flushing to occur more
- often than needed.
-
- xz --flush-timeout=2000, after this commit:
+ Translations: Update the Esperanto translation.
+
+ po/eo.po | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+commit f36ca7982f6bd5e9827219ed4f3c5a1fbf5d7bdf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-13 21:21:54 +0800
+
+ liblzma: Slightly rewords lzma_str_list_filters() documentation.
- 1. xz is started.
- 2. No input for one second.
- 3. A burst of a few kilobytes of input. The next flush will
- happen after two seconds counted from the time when the
- first bytes of the burst were read.
- 4. No input for one second.
- 5. No input for another second.
- 6. Two seconds have passed and flushing starts.
+ Reword "options required" to "supported options". The previous may have
+ suggested that the options listed were all required anytime a filter is
+ used for encoding or decoding. The reword makes this more clear that
+ adjusting the options is optional.
- src/xz/coder.c | 6 +-----
- src/xz/file_io.c | 6 +++++-
- src/xz/mytime.c | 1 -
- 3 files changed, 6 insertions(+), 7 deletions(-)
+ src/liblzma/api/lzma/filter.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit fd47fd62bbb1bfd13ab63869137971d8b390025f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 20:19:19 +0200
+commit 3374a5359e52f1671d8f831d65827d5020fe2595
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-11 23:49:23 +0800
- xz: Move flush_needed from mytime.h to file_pair struct in file_io.h.
+ liblzma: Adds lzma_nothrow to MicroLZMA API functions.
+
+ None of the liblzma functions may throw an exception, so this
+ attribute should be applied to all liblzma API functions.
- src/xz/coder.c | 3 ++-
- src/xz/file_io.c | 3 ++-
- src/xz/file_io.h | 3 +++
- src/xz/mytime.c | 3 ---
- src/xz/mytime.h | 4 ----
- 5 files changed, 7 insertions(+), 9 deletions(-)
+ src/liblzma/api/lzma/container.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
-commit 815035681063d5774d3640fc20b8ede783dd574e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 14:49:22 +0200
+commit 8f236574986e7c414c0ea059f441982d1387e6a4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-09 20:20:06 +0800
- xz: coder.c: Make writing output a separate function.
+ liblzma: Exports lzma_mt_block_size() as an API function.
+
+ The lzma_mt_block_size() was previously just an internal function for
+ the multithreaded .xz encoder. It is used to provide a recommended Block
+ size for a given filter chain.
- The same code sequence repeats so it's nicer as a separate function.
- Note that in one case there was no test for opt_mode != MODE_TEST,
- but that was only because that condition would always be true, so
- this commit doesn't change the behavior there.
+ This function is helpful to determine the maximum Block size for the
+ multithreaded .xz encoder when one wants to change the filters between
+ blocks. Then, this determined Block size can be provided to
+ lzma_stream_encoder_mt() in the lzma_mt options parameter when
+ intializing the coder. This requires one to know all the filter chains
+ they are using before starting to encode (or at least the filter chain
+ that will need the largest Block size), but that isn't a bad limitation.
- src/xz/coder.c | 30 +++++++++++++++++-------------
- 1 file changed, 17 insertions(+), 13 deletions(-)
+ src/liblzma/api/lzma/container.h | 28 ++++++++++++++++++++++++++++
+ src/liblzma/common/filter_encoder.c | 16 ++++++++++------
+ src/liblzma/common/filter_encoder.h | 6 +-----
+ src/liblzma/common/stream_encoder_mt.c | 20 +++++++++-----------
+ src/liblzma/liblzma_generic.map | 5 +++++
+ src/liblzma/liblzma_linux.map | 5 +++++
+ src/liblzma/lzma/lzma2_encoder.c | 3 +++
+ 7 files changed, 61 insertions(+), 22 deletions(-)
-commit 5a49e081a098455bcdbd95cefb90e9b18780fe58
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 14:13:42 +0200
+commit d0f33d672a4da7985ebb5ba8d829f885de49c171
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-08 22:58:09 +0800
- xz: Fix semi-busy-waiting in xz --flush-timeout.
+ liblzma: Creates IS_ENC_DICT_SIZE_VALID() macro.
- When input blocked, xz --flush-timeout=1 would wake up every
- millisecond and initiate flushing which would have nothing to
- flush and thus would just waste CPU time. The fix disables the
- timeout when no input has been seen since the previous flush.
+ This creates an internal liblzma macro to test if the dictionary size
+ is valid for encoding.
- src/xz/coder.c | 4 ++++
- src/xz/file_io.c | 15 +++++++++++----
- src/xz/file_io.h | 4 ++++
- 3 files changed, 19 insertions(+), 4 deletions(-)
+ src/liblzma/lz/lz_encoder.c | 4 +---
+ src/liblzma/lz/lz_encoder.h | 8 ++++++++
+ 2 files changed, 9 insertions(+), 3 deletions(-)
-commit dcca70fe9fa3c4bec56cf9c79e966166c9a9cf6a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 13:47:31 +0200
+commit c247d06e1f6cada9a76f4f6225cbd97ea760f52f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-02 20:39:56 +0800
- xz: Refactor io_read() a bit.
+ Add NEWS for 5.4.3.
- src/xz/file_io.c | 17 ++++++++---------
- 1 file changed, 8 insertions(+), 9 deletions(-)
+ NEWS | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
-commit 4ae9ab70cd3214395756435d13d8d000368ca2cb
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 13:37:08 +0200
+commit 77050b78364ffb6b0f129e742b7c31602d725c08
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-02 20:39:37 +0800
- xz: Update a comment in file_io.h.
+ Add NEWS for 5.2.12.
- src/xz/file_io.h | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ NEWS | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
-commit 3333ba4a6795a55cf0375329ba08152bd7fcbd46
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-26 13:27:51 +0200
+commit 713e15e43eb6279a7ab4bbad3d1325ebfdcf09a0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-04 20:38:52 +0800
- xz: Move the setting of flush_needed in file_io.c to a nicer location.
+ Translations: Update the Croatian translation.
- src/xz/file_io.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
+ po/hr.po | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit cf2df0f05ac98c1158c6e48145900b773223605d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2020-01-19 21:54:33 +0200
+commit 9ad64bdf309844b6ca6c3e8a4dfb6dbaedda0ca9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-04 20:30:25 +0800
- Use $(LIB_FUZZING_ENGINE) in tests/ossfuzz/Makefile.
+ tuklib_integer.h: Reverts previous commit.
- https://github.com/google/oss-fuzz/pull/3219#issuecomment-573751048
-
- Thanks to Bhargava Shastry for sending the patch.
+ Previous commit 6be460dde07113fe3f08f814b61ddc3264125a96 would cause an
+ error if the integer size was 32 bit.
- tests/ossfuzz/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/common/tuklib_integer.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 7136f1735c60ac6967c4b8e277fcde53d485234f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-12-31 00:41:28 +0200
+commit 6be460dde07113fe3f08f814b61ddc3264125a96
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-05-04 19:25:20 +0800
- Rename unaligned_read32ne to read32ne, and similarly for the others.
+ tuklib_integer.h: Changes two other UINT_MAX == UINT32_MAX to >=.
- src/common/tuklib_integer.h | 64 +++++++++++++++----------------
- src/liblzma/common/alone_encoder.c | 2 +-
- src/liblzma/common/block_header_decoder.c | 2 +-
- src/liblzma/common/block_header_encoder.c | 2 +-
- src/liblzma/common/memcmplen.h | 9 ++---
- src/liblzma/common/stream_flags_decoder.c | 6 +--
- src/liblzma/common/stream_flags_encoder.c | 8 ++--
- src/liblzma/lz/lz_encoder_hash.h | 2 +-
- src/liblzma/lzma/lzma_decoder.c | 2 +-
- src/liblzma/lzma/lzma_encoder.c | 2 +-
- src/liblzma/lzma/lzma_encoder_private.h | 3 +-
- src/liblzma/simple/simple_decoder.c | 2 +-
- src/liblzma/simple/simple_encoder.c | 2 +-
- tests/test_block_header.c | 4 +-
- tests/test_stream_flags.c | 6 +--
- 15 files changed, 54 insertions(+), 62 deletions(-)
+ src/common/tuklib_integer.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 5e78fcbf2eb21936022c9c5c3625d4da76f4b241
+commit 44c0c5eae990a22ef04e9b88c1a15838a0d00878
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-12-31 00:29:48 +0200
+Date: 2023-05-03 22:46:42 +0300
- Rename read32ne to aligned_read32ne, and similarly for the others.
+ tuklib_integer.h: Fix a recent copypaste error in Clang detection.
- Using the aligned methods requires more care to ensure that
- the address really is aligned, so it's nicer if the aligned
- methods are prefixed. The next commit will remove the unaligned_
- prefix from the unaligned methods which in liblzma are used in
- more places than the aligned ones.
+ Wrong line was changed in 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7.
+ Also, this has >= instead of == since ints larger than 32 bits would
+ work too even if not relevant in practice.
- src/common/tuklib_integer.h | 56 +++++++++++++++++++++---------------------
- src/liblzma/check/crc32_fast.c | 4 +--
- src/liblzma/check/crc64_fast.c | 4 +--
- 3 files changed, 32 insertions(+), 32 deletions(-)
+ src/common/tuklib_integer.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 77bc5bc6dd67056cfd5888520ac930cfc57b4516
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-12-31 00:18:24 +0200
+commit 2cf5ae5b5b279b0b2e69ca4724e7bd705865fe68
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-25 20:06:15 +0800
+
+ CI: Adds a build and test for small configuration.
+
+ .github/workflows/ci.yml | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+commit 16b81a057a87c2f18e6ed6447f003af0cbdcfe43
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-25 20:05:26 +0800
+
+ CI: ci_build.sh allows configuring small build.
+
+ build-aux/ci_build.sh | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 78ccd93951f9e988d447bcdd70b24f6df5448d1d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-20 20:15:00 +0800
+
+ Update THANKS.
+
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
- Revise tuklib_integer.h and .m4.
+commit f41df2ac2fed347d3f107f3533e76e000d29c6cb
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-19 22:22:16 +0800
+
+ Windows: Include <intrin.h> when needed.
- Add a configure option --enable-unsafe-type-punning to get the
- old non-conforming memory access methods. It can be useful with
- old compilers or in some other less typical situations but
- shouldn't normally be used.
+ Legacy Windows did not need to #include <intrin.h> to use the MSVC
+ intrinsics. Newer versions likely just issue a warning, but the MSVC
+ documentation says to include the header file for the intrinsics we use.
- Omit the packed struct trick for unaligned access. While it's
- best in some cases, this is simpler. If the memcpy trick doesn't
- work, one can request unsafe type punning from configure.
+ GCC and Clang can "pretend" to be MSVC on Windows, so extra checks are
+ needed in tuklib_integer.h to only include <intrin.h> when it will is
+ actually needed.
+
+ src/common/tuklib_integer.h | 6 ++++++
+ src/liblzma/common/memcmplen.h | 10 ++++++++++
+ 2 files changed, 16 insertions(+)
+
+commit 7062348bf35c1e4cbfee00ad9fffb4a21aa6eff7
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-19 21:59:03 +0800
+
+ tuklib_integer: Use __builtin_clz() with Clang.
- Because CRC32/CRC64 code needs fast aligned reads, if no very
- safe way to do it is found, type punning is used as a fallback.
- This sucks but since it currently works in practice, it seems to
- be the least bad option. It's never needed with GCC >= 4.7 or
- Clang >= 3.6 since these support __builtin_assume_aligned and
- thus fast aligned access can be done with the memcpy trick.
+ Clang has support for __builtin_clz(), but previously Clang would
+ fallback to either the MSVC intrinsic or the regular C code. This was
+ discovered due to a bug where a new version of Clang required the
+ <intrin.h> header file in order to use the MSVC intrinsics.
- Other things:
- - Support GCC/Clang __builtin_bswapXX
- - Cleaner bswap fallback macros
- - Minor cleanups
+ Thanks to Anton Kochkov for notifying us about the bug.
- m4/tuklib_integer.m4 | 46 ++++-
- src/common/tuklib_integer.h | 488 ++++++++++++++++++++++++--------------------
- 2 files changed, 316 insertions(+), 218 deletions(-)
+ src/common/tuklib_integer.h | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 8b72950a6b2e2a36c2d8fdc8857564b57191b088
+commit 3938718ce3773c90755785c0df8777f133b7ae29
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-12-29 22:51:58 +0200
+Date: 2023-04-14 18:42:33 +0300
- Tests: Hopefully fix test_check.c to work on EBCDIC systems.
+ liblzma: Update project maintainers in lzma.h.
- Thanks to Daniel Richard G.
+ AUTHORS was updated earlier, lzma.h was simply forgotten.
- tests/test_check.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 43ce4ea7c762238d3df9717b34126d3e0d7cd51c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-09-24 23:02:40 +0300
+commit 2a89670ab295e377f8b44f5bda6d198deb8ea285
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-13 20:45:19 +0800
- Scripts: Put /usr/xpg4/bin to the beginning of PATH on Solaris.
-
- This adds a configure option --enable-path-for-scripts=PREFIX
- which defaults to empty except on Solaris it is /usr/xpg4/bin
- to make POSIX grep and others available. The Solaris case had
- been documented in INSTALL with a manual fix but it's better
- to do this automatically since it is needed on most Solaris
- systems anyway.
-
- Thanks to Daniel Richard G.
+ liblzma: Cleans up old commented out code.
- INSTALL | 43 +++++++++++++++++++++++++++++++++++--------
- configure.ac | 26 ++++++++++++++++++++++++++
- src/scripts/xzdiff.in | 1 +
- src/scripts/xzgrep.in | 1 +
- src/scripts/xzless.in | 1 +
- src/scripts/xzmore.in | 1 +
- 6 files changed, 65 insertions(+), 8 deletions(-)
+ src/liblzma/common/alone_encoder.c | 11 -----------
+ 1 file changed, 11 deletions(-)
-commit 6a89e656ebedd53a10cd1a063a32a9e4ade0da1f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-07-12 18:57:43 +0300
+commit 0fbb2b87a7b5a1dd9d0f4a5e84ac7919557dbe81
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-07 20:46:41 +0800
- Fix comment typos in tuklib_mbstr* files.
+ Docs: Add missing word to SECURITY.md.
- src/common/tuklib_mbstr.h | 2 +-
- src/common/tuklib_mbstr_fw.c | 2 +-
- src/common/tuklib_mbstr_width.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
+ .github/SECURITY.md | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit ac0b4212656a48ef0c187c0c941d40ac9489ae36
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-07-12 18:30:46 +0300
+commit fb9c50f38a17bf37581de4034b36c8df8ec90a87
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-07 20:43:22 +0800
- Add missing include to tuklib_mbstr_width.c.
-
- It didn't matter in XZ Utils because sysdefs.h
- includes string.h anyway.
+ Update THANKS.
- src/common/tuklib_mbstr_width.c | 1 +
+ THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 72a443281fb0b91aebf8cdff2ab1f7c07b081240
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-07-12 18:10:57 +0300
+commit 537c6cd8a9db0dd6b13683e64ddac2943190d715
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-04-07 20:42:12 +0800
- Update tuklib base headers to include stdbool.h.
+ Docs: Minor edits to SECURITY.md.
- src/common/tuklib_common.h | 2 +-
- src/common/tuklib_config.h | 1 +
- 2 files changed, 2 insertions(+), 1 deletion(-)
+ .github/SECURITY.md | 25 ++++++++++++++++++++-----
+ 1 file changed, 20 insertions(+), 5 deletions(-)
-commit de1f47b2b40e960b7bc3acba754f66dd19705921
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-28 00:54:31 +0300
+commit 6549df8dd53f358345957e232648fdb699930074
+Author: Gabriela Gutierrez <gabigutierrez@google.com>
+Date: 2023-04-07 12:08:30 +0000
- xz: Automatically align the strings in --info-memory.
+ Docs: Create SECURITY.md
- This makes it easier to translate the strings.
-
- Also, the string for amount of RAM was shortened.
+ Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
- src/xz/hardware.c | 45 ++++++++++++++++++++++++++++++++++-----------
- 1 file changed, 34 insertions(+), 11 deletions(-)
+ .github/SECURITY.md | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
-commit 8ce679125dbd0e2058d8f886e738d7f19a45cab5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-25 23:15:21 +0300
+commit d0faa85df5a5d253a4625d45313cf5e9277e6cd2
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-28 22:48:24 +0800
- liblzma: Fix a buggy comment.
+ CI: Tests for disabling threading on CMake builds.
- src/liblzma/lz/lz_encoder_mf.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ .github/workflows/ci.yml | 3 ---
+ build-aux/ci_build.sh | 4 ++--
+ 2 files changed, 2 insertions(+), 5 deletions(-)
-commit fc77929e92e869f6869bf88931066103fd75f376
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-25 00:16:06 +0300
+commit 8be5cc3b1359d88b4b30a39067466c0ae0bfbc4d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-28 22:45:42 +0800
- configure.ac: Fix a typo in a comment.
+ CI: Removes CMakeCache.txt between builds.
+
+ If the cache file is not removed, CMake will not reset configurations
+ back to their default values. In order to make the tests independent, it
+ is simplest to purge the cache. Unfortunatly, this will slow down the
+ tests a little and repeat some checks.
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ build-aux/ci_build.sh | 2 ++
+ 1 file changed, 2 insertions(+)
-commit e873902641794210ad7db59743f98e3e1cd6139f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-25 00:08:13 +0300
+commit 2cb6028fc31de082b7f927632363bb1426b61aaa
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-28 22:32:40 +0800
- Tests: Silence warnings from clang -Wassign-enum.
+ CMake: Update liblzma-config.cmake generation.
- Also changed 999 to 99 so it fits even if lzma_check happened
- to be 8 bits wide.
+ Now that the threading is configurable, the liblzma CMake package only
+ needs the threading library when using POSIX threads.
- tests/test_block_header.c | 3 ++-
- tests/test_stream_flags.c | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
+ CMakeLists.txt | 33 ++++++++++++++++++++++-----------
+ 1 file changed, 22 insertions(+), 11 deletions(-)
-commit d499e467d99efeaae688564eedc4548837c1416a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 23:52:17 +0300
+commit 4d7fac0b07cc722825ba8d7838c558827e635611
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-28 22:25:33 +0800
- liblzma: Add a comment.
+ CMake: Allows setting thread method.
+
+ The thread method is now configurable for the CMake build. It matches
+ the Autotools build by allowing ON (pick the best threading method),
+ OFF (no threading), posix, win95, and vista. If both Windows and
+ posix threading are both available, then ON will choose Windows
+ threading. Windows threading will also not use:
+
+ target_link_libraries(liblzma Threads::Threads)
+
+ since on systems like MinGW-w64 it would link the posix threads
+ without purpose.
- src/liblzma/common/stream_encoder_mt.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ CMakeLists.txt | 144 +++++++++++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 104 insertions(+), 40 deletions(-)
-commit a12b13c5f0d54c684fa8446f93fdac08ab2a716b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 23:45:21 +0300
+commit 20cd905d898c1494dee42b78530769bb9c9f8076
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-24 23:05:48 +0800
- liblzma: Silence clang -Wmissing-variable-declarations.
+ CI: Runs CMake feature tests.
+
+ Now, CMake will run similar feature disable tests that the Autotools
+ version did before. In order to do this without repeating lines in
+ ci.yml, it now makes sense to use the GitHub Workflow matrix to create
+ a loop.
- src/liblzma/check/crc32_table.c | 3 +++
- src/liblzma/check/crc64_table.c | 3 +++
- 2 files changed, 6 insertions(+)
+ .github/workflows/ci.yml | 169 +++++++++++++++--------------------------------
+ 1 file changed, 55 insertions(+), 114 deletions(-)
-commit 1b4675cebf7471f7cc9b7072c950e3de97147063
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 23:25:41 +0300
+commit 4fabdb269f1fc5624b3b94a170c4efb329d1d229
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-24 20:35:11 +0800
- Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT.
+ CI: ci_build.sh allows CMake features to be configured.
- LZMA_TIMED_OUT is *internally* used as a value for lzma_ret
- enumeration. Previously it was #defined to 32 and cast to lzma_ret.
- That way it wasn't visible in the public API, but this was hackish.
+ Also included various clean ups for style and helper functions for
+ repeated work.
+
+ build-aux/ci_build.sh | 233 +++++++++++++++++++++++++++++++-------------------
+ 1 file changed, 143 insertions(+), 90 deletions(-)
+
+commit cf3d1f130e50cf63da4bb1031771605f6f443b6a
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-24 20:06:33 +0800
+
+ CI: Change ci_build.sh to use bash instead of sh.
- Now the public API has eight LZMA_RET_INTERNALx members and
- LZMA_TIMED_OUT is #defined to LZMA_RET_INTERNAL1. This way
- the code is cleaner overall although the public API has a few
- extra mysterious enum members.
+ This script is only meant to be run as part of the CI build/test process
+ on machines that are known to have bash (Ubuntu and MacOS). If this
+ assumption changes in the future, then the bash specific commands will
+ need to be replaced with a more portable option. For now, it is
+ convenient to use bash commands.
- src/liblzma/api/lzma/base.h | 15 ++++++++++++++-
- src/liblzma/common/common.c | 4 +---
- src/liblzma/common/common.h | 5 ++---
- src/xz/message.c | 8 ++++++++
- 4 files changed, 25 insertions(+), 7 deletions(-)
+ build-aux/ci_build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 159c43875eb25deea626ed651274464bae3e32ef
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 22:57:43 +0300
+commit ddfe164368e779c40d061aa4ccc376129e92f8e1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-24 20:05:59 +0800
- xz: Silence a warning from clang -Wsign-conversion in main.c.
+ CMake: Only build xzdec if decoders are enabled.
- src/xz/main.c | 2 +-
+ CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 466cfcd3e52f6750ce28a635997f3dd84fb18515
+commit 116e81f002c503d3c3cd12726db8f9116e58ef25
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-22 15:42:04 +0800
+
+ Build: Removes redundant check for LZMA1 filter support.
+
+ src/liblzma/lzma/Makefile.inc | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+commit 0ba234f692772595329d225462d391fe2c199d0a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 22:52:20 +0300
+Date: 2023-03-23 15:14:29 +0200
- xz: Make "headings" static in list.c.
+ CMake: Bump maximum policy version to 3.26.
- Caught by clang -Wmissing-variable-declarations.
+ It adds only one new policy related to FOLDERS which we don't use.
+ This makes it clear that the code is compatible with the policies
+ up to 3.26.
- src/xz/list.c | 2 +-
+ CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 608517b9b76c41fac6613dbda1193d6f41338e19
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 22:47:39 +0300
+commit b0891684b4436aed31510fddcbb218d513bd5489
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-21 23:36:00 +0800
+
+ CMake: Conditionally build xz list.* files if decoders are enabled.
+
+ CMakeLists.txt | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+commit 2c1a830efb61d9d65906a09c9ee3ce27c2c49227
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-25 11:46:50 +0800
- liblzma: Remove incorrect uses of lzma_attribute((__unused__)).
+ CMake: Allow configuring features as cache variables.
- Caught by clang -Wused-but-marked-unused.
+ This allows users to change the features they build either in
+ CMakeCache.txt or by using a CMake GUI. The sources built for
+ liblzma are affected by this too, so only the necessary files
+ will be compiled.
- src/liblzma/common/alone_decoder.c | 3 +--
- src/liblzma/common/alone_encoder.c | 3 +--
- src/liblzma/lz/lz_decoder.c | 3 +--
- 3 files changed, 3 insertions(+), 6 deletions(-)
+ CMakeLists.txt | 528 ++++++++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 391 insertions(+), 137 deletions(-)
-commit c2d2ab6a9d41a2b55d047c5b710aacf80d219255
+commit 8be136f667aaeb8f9e16fbd57a83cb282f0c27ff
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 20:53:55 +0300
+Date: 2023-03-21 14:07:51 +0200
- Tests: Silence a warning from -Wsign-conversion.
+ Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.
+
+ It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC
+ but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler.
- tests/create_compress_files.c | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
+ configure.ac | 3 +++
+ 1 file changed, 3 insertions(+)
-commit 2402f7873dcae719d0ebddd23bb579074519ac52
+commit 53cc475f2652d9e390ca002018dfd0af0626ef80
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 20:45:49 +0300
+Date: 2023-03-21 14:04:37 +0200
- xz: Fix an integer overflow with 32-bit off_t.
+ Build: configure.ac: Use AS_IF and AS_CASE where required.
- Or any off_t which isn't very big (like signed 64 bit integer
- that most system have). A small off_t could overflow if the
- file being decompressed had long enough run of zero bytes,
- which would result in corrupt output.
+ This makes no functional difference in the generated configure
+ (at least with the Autotools versions I have installed) but this
+ change might prevent future bugs like the one that was just
+ fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294.
- src/xz/file_io.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
+ configure.ac | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
-commit 4fd3a8dd0b60f029e1c66a0ee634f9e9fda3caa9
+commit 3b8890a40233b6c783bb101ec14405e786871775
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 01:24:17 +0300
+Date: 2023-03-21 13:12:03 +0200
- xz: Cleanup io_seek_src() a bit.
-
- lseek() returns -1 on error and checking for -1 is nicer.
+ Update THANKS.
- src/xz/file_io.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
+ THANKS | 1 +
+ 1 file changed, 1 insertion(+)
-commit dfda7cf6afa486e10df035327d68753896dfb48a
+commit 5a5bd7f871818029d5ccbe189f087f591258c294
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 00:57:23 +0300
+Date: 2023-03-21 13:11:49 +0200
- Tests: Remove a duplicate branch from tests/tests.h.
+ Build: Fix --disable-threads breaking the building of shared libs.
- The duplication was introduced about eleven years ago and
- should have been cleaned up back then already.
+ This is broken in the releases 5.2.6 to 5.4.2. A workaround
+ for these releases is to pass EGREP='grep -E' as an argument
+ to configure in addition to --disable-threads.
- This was caught by -Wduplicated-branches.
+ The problem appeared when m4/ax_pthread.m4 was updated in
+ the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which
+ introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls
+ AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP
+ but this was only executed if POSIX threads were enabled.
+ Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf
+ omits it as AC_PROG_EGREP has already been required earlier.
+ Thus, if not using POSIX threads, the shell variable EGREP
+ would be undefined in the Libtool code in configure.
+
+ ax_pthread.m4 is fine. The bug was in configure.ac which called
+ AX_PTHREAD conditionally in an incorrect way. Using AS_CASE
+ ensures that all AC_REQUIREs get always run.
+
+ Thanks to Frank Busse for reporting the bug.
+ Fixes: https://github.com/tukaani-project/xz/issues/45
- tests/tests.h | 9 ++-------
- 1 file changed, 2 insertions(+), 7 deletions(-)
+ configure.ac | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
-commit 1d4a904d8fb634bd5a04f7fbdd17d3739f3d8866
+commit dfe1710784c0a3c3a90c17b80c9e1fe19b5fce06
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 00:40:45 +0300
+Date: 2023-03-19 22:45:59 +0200
- xz: Change io_seek_src and io_pread arguments from off_t to uint64_t.
+ liblzma: Silence -Wsign-conversion in SSE2 code in memcmplen.h.
- This helps fixing warnings from -Wsign-conversion and makes the
- code look better too.
+ Thanks to Christian Hesse for reporting the issue.
+ Fixes: https://github.com/tukaani-project/xz/issues/44
- src/xz/file_io.c | 16 ++++++++++++----
- src/xz/file_io.h | 4 ++--
- src/xz/list.c | 9 ++++-----
- 3 files changed, 18 insertions(+), 11 deletions(-)
+ src/liblzma/common/memcmplen.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 50120deb0159fcb53ee1a6caffb2bb81a1ecd990
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-24 00:12:38 +0300
+commit f0c580c5fc38bf49a184b48d76c1d8c057d499ce
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-18 22:10:57 +0800
- xz: list.c: Fix some warnings from -Wsign-conversion.
+ Add NEWS for 5.4.2.
- src/xz/list.c | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
+ NEWS | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
-commit d0a78751eb54fb1572002746c533936a118e4e42
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 23:22:45 +0300
+commit af4925e6043113ec9b5f9c0cf13abf2a18ccb1f6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-18 22:10:12 +0800
- tuklib_mbstr_width: Fix a warning from -Wsign-conversion.
+ Add NEWS for 5.2.11.
- src/common/tuklib_mbstr_width.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ NEWS | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
-commit 7883d73530b4b2a701ddd7d50c35676cbc158039
+commit 5a7b930efa7f9849d8da8397e8e5d8638f92be40
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 23:19:34 +0300
+Date: 2023-03-18 16:00:54 +0200
- xz: Fix some of the warnings from -Wsign-conversion.
+ Update the copy of GNU GPLv3 from gnu.org to COPYING.GPLv3.
- src/xz/args.c | 4 ++--
- src/xz/coder.c | 4 ++--
- src/xz/file_io.c | 5 +++--
- src/xz/message.c | 4 ++--
- src/xz/mytime.c | 4 ++--
- src/xz/options.c | 2 +-
- src/xz/util.c | 4 ++--
- 7 files changed, 14 insertions(+), 13 deletions(-)
+ COPYING.GPLv3 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
-commit c2b994fe3d35e9e575c28869a2f7f534f2495d05
+commit b473a92891f7e991398a3b5eff305f6f2b6d7293
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 22:27:45 +0300
+Date: 2023-03-18 15:51:57 +0200
- tuklib_cpucores: Silence warnings from -Wsign-conversion.
+ Change a few HTTP URLs to HTTPS.
+
+ The xz man page timestamp was intentionally left unchanged.
- src/common/tuklib_cpucores.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
+ INSTALL | 2 +-
+ README | 8 ++++----
+ configure.ac | 2 +-
+ dos/INSTALL.txt | 4 ++--
+ src/liblzma/api/lzma.h | 8 ++++----
+ src/liblzma/check/sha256.c | 2 +-
+ src/xz/xz.1 | 2 +-
+ windows/INSTALL-MinGW.txt | 10 +++++-----
+ 8 files changed, 19 insertions(+), 19 deletions(-)
-commit 07c4fa9e1a195e0543f271380c8de22a3ab145ff
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 21:40:47 +0300
+commit 8b2f6001b4f412c259a7883427f2f2c8cea98ea8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-18 00:40:28 +0800
- xzdec: Fix warnings from -Wsign-conversion.
+ CMake: Fix typo in a comment.
- src/xzdec/xzdec.c | 2 +-
+ CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit dfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf
+commit 76e2315e14c399c15cc90e7930fd4d3d086b0227
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 21:38:56 +0300
+Date: 2023-03-17 18:36:22 +0200
- liblzma: Fix warnings from -Wsign-conversion.
-
- Also, more parentheses were added to the literal_subcoder
- macro in lzma_comon.h (better style but no functional change
- in the current usage).
+ Windows: build.bash: Copy liblzma API docs to the output package.
- src/liblzma/common/block_header_decoder.c | 2 +-
- src/liblzma/delta/delta_decoder.c | 2 +-
- src/liblzma/lzma/fastpos.h | 2 +-
- src/liblzma/lzma/lzma2_decoder.c | 8 ++++----
- src/liblzma/lzma/lzma_common.h | 3 ++-
- src/liblzma/lzma/lzma_decoder.c | 16 ++++++++--------
- src/liblzma/simple/arm.c | 6 +++---
- src/liblzma/simple/armthumb.c | 8 ++++----
- src/liblzma/simple/ia64.c | 2 +-
- src/liblzma/simple/powerpc.c | 9 +++++----
- src/liblzma/simple/x86.c | 2 +-
- 11 files changed, 31 insertions(+), 29 deletions(-)
+ windows/build.bash | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 41838dcc26375f6aa393a63e4d81e2f4d223de07
+commit 133cf55edc5ce92952d2709abd992e48ef1f45ee
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-23 19:33:55 +0300
+Date: 2023-03-17 08:53:38 +0200
- tuklib_integer: Silence warnings from -Wsign-conversion.
+ Windows: Add microlzma_*.c to the VS project files.
+
+ These should have been included in 5.3.2alpha already.
- src/common/tuklib_integer.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ windows/vs2013/liblzma.vcxproj | 2 ++
+ windows/vs2013/liblzma_dll.vcxproj | 2 ++
+ windows/vs2017/liblzma.vcxproj | 2 ++
+ windows/vs2017/liblzma_dll.vcxproj | 2 ++
+ windows/vs2019/liblzma.vcxproj | 2 ++
+ windows/vs2019/liblzma_dll.vcxproj | 2 ++
+ 6 files changed, 12 insertions(+)
-commit 3ce05d235f736d392347a05086b8033416874b87
+commit 75c9ca450fab6982fda9286b168081c9d54126cd
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-20 19:40:30 +0300
+Date: 2023-03-17 08:43:51 +0200
- tuklib_integer: Fix usage of conv macros.
+ CMake: Add microlzma_*.c to the build.
- Use a temporary variable instead of e.g.
- conv32le(unaligned_read32ne(buf)) because the macro can
- evaluate its argument multiple times.
+ These should have been included in 5.3.2alpha already.
- src/common/tuklib_integer.h | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
-commit b525b0c0ef40cd89b69294c9b8d57f4a8db58e1f
+commit 0cc3313bd4e569c51e686e5aab8c40c35241d34b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-03 20:44:19 +0300
+Date: 2023-03-17 08:41:36 +0200
- Update THANKS.
+ Build: Update comments about unaligned access to mention 64-bit.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ cmake/tuklib_integer.cmake | 7 +++----
+ m4/tuklib_integer.m4 | 4 ++--
+ 2 files changed, 5 insertions(+), 6 deletions(-)
-commit 039a168e8cf201d5104a25ec41f0cf25eda6cc53
+commit 5e57e3301319f20c35f8111dea73fa58403b96b1
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-03 20:41:54 +0300
+Date: 2023-03-17 00:02:30 +0200
- liblzma: Fix comments.
-
- Thanks to Bruce Stark.
+ Tests: Update .gitignore.
- src/liblzma/common/alone_encoder.c | 4 ++--
- src/liblzma/common/block_util.c | 2 +-
- src/liblzma/common/common.c | 2 +-
- src/liblzma/common/filter_common.h | 2 +-
- src/liblzma/common/filter_decoder.h | 2 +-
- src/liblzma/common/filter_flags_encoder.c | 2 +-
- 6 files changed, 7 insertions(+), 7 deletions(-)
+ .gitignore | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit c460f6defebc5a81bbca90adc2476154ca244f69
+commit 0007394d54e21bf30abb9a5e09cbc1e8d44a73ac
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-02 00:50:59 +0300
+Date: 2023-03-14 20:04:03 +0200
- liblzma: Fix one more unaligned read to use unaligned_read16ne().
+ po4a/update-po: Display the script name consistently in error messages.
- src/liblzma/lz/lz_encoder_hash.h | 2 +-
+ po4a/update-po | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit c81d77c537f0b8c8672868e1dc6cf7290ce4a25b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 21:41:55 +0300
+commit 509157c80c500426ec853bd992d684ebafc8500c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-17 01:30:36 +0800
- Update THANKS.
+ Doc: Rename Doxygen HTML doc directory name liblzma => api.
+
+ When the docs are installed, calling the directory "liblzma" is
+ confusing since multiple other files in the doc directory are for
+ liblzma. This should also make it more natural for distros when they
+ package the documentation.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ .gitignore | 2 +-
+ Makefile.am | 18 +++++++++---------
+ PACKAGERS | 4 ++--
+ doxygen/Doxyfile | 2 +-
+ doxygen/update-doxygen | 18 +++++++++---------
+ 5 files changed, 22 insertions(+), 22 deletions(-)
-commit 386394fc9fcde2615391f804eaa466749f96f4ef
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 21:36:13 +0300
+commit fd90e2f4c29180b44e33c7ef726f94e4eae54ed3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 22:07:15 +0800
- liblzma: memcmplen: Use ctz32() from tuklib_integer.h.
+ liblzma: Remove note from lzma_options_bcj about the ARM64 exception.
- The same compiler-specific #ifdefs are already in tuklib_integer.h
+ This was left in by mistake since an early version of the ARM64 filter
+ used a different struct for its options.
- src/liblzma/common/memcmplen.h | 10 +---------
- 1 file changed, 1 insertion(+), 9 deletions(-)
+ src/liblzma/api/lzma/bcj.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 264ab971ce2994baac41b1579c9c35aba7743fc8
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 21:30:03 +0300
+commit 4f50763b981f9056c5f1763dfb26cfa4a26a181d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:44:02 +0800
- tuklib_integer: Cleanup MSVC-specific code.
+ CI: Add doxygen as a dependency.
+
+ Autogen now requires --no-doxygen or having doxygen installed to run
+ without errors.
- src/common/tuklib_integer.h | 20 +++++++++-----------
- 1 file changed, 9 insertions(+), 11 deletions(-)
+ .github/workflows/ci.yml | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
-commit 33773c6f2a8711d4aa6656795db52c59a28580ec
+commit f68f4b27f62f53fdac570885a1f4f23367ce6599
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 19:01:21 +0300
+Date: 2023-03-15 19:19:13 +0200
+
+ COPYING: Add a note about the included Doxygen-generated HTML.
+
+ COPYING | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+commit 8979308528c1f45cb9ee52d511f05232b4ad90a1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:41:09 +0800
+
+ Doc: Update PACKAGERS with details about liblzma API docs install.
+
+ PACKAGERS | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
- liblzma: Use unaligned_readXXne functions instead of type punning.
+commit 55ba6e93004842ae0a0792214a23504267ad8f43
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:38:32 +0800
+
+ liblzma: Add set lzma.h as the main page for Doxygen documentation.
+
+ The \mainpage command is used in the first block of comments in lzma.h.
+ This changes the previously nearly empty index.html to use the first
+ comment block in lzma.h for its contents.
- Now gcc -fsanitize=undefined should be clean.
+ lzma.h is no longer documented separately, but this is for the better
+ since lzma.h only defined a few macros that users do not need to use.
+ The individual API header files all have a disclaimer that they should
+ not be #included directly, so there should be no confusion on the fact
+ that lzma.h should be the only header used by applications.
- Thanks to Jeffrey Walton.
+ Additionally, the note "See ../lzma.h for information about liblzma as
+ a whole." was removed since lzma.h is now the main page of the
+ generated HTML and does not have its own page anymore. So it would be
+ confusing in the HTML version and was only a "nice to have" when
+ browsing the source files.
- src/liblzma/common/memcmplen.h | 12 ++++++------
- src/liblzma/lzma/lzma_encoder_private.h | 2 +-
- 2 files changed, 7 insertions(+), 7 deletions(-)
+ src/liblzma/api/lzma.h | 1 +
+ src/liblzma/api/lzma/base.h | 2 --
+ src/liblzma/api/lzma/bcj.h | 2 --
+ src/liblzma/api/lzma/block.h | 2 --
+ src/liblzma/api/lzma/check.h | 2 --
+ src/liblzma/api/lzma/container.h | 2 --
+ src/liblzma/api/lzma/delta.h | 2 --
+ src/liblzma/api/lzma/filter.h | 2 --
+ src/liblzma/api/lzma/hardware.h | 2 --
+ src/liblzma/api/lzma/index.h | 2 --
+ src/liblzma/api/lzma/index_hash.h | 4 +---
+ src/liblzma/api/lzma/lzma12.h | 2 --
+ src/liblzma/api/lzma/stream_flags.h | 2 --
+ src/liblzma/api/lzma/version.h | 2 --
+ src/liblzma/api/lzma/vli.h | 2 --
+ 15 files changed, 2 insertions(+), 29 deletions(-)
-commit e5f13a66567b1987e0aae42c6fdcd277bb5810ba
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 18:46:54 +0300
+commit 16f21255597f6a57e5692780f962cdc090f62b8c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:37:32 +0800
- tuklib_integer: Autodetect support for unaligned access on ARM.
+ Build: Generate doxygen documentation in autogen.sh.
- The result is used as the default for --enable-unaligned-access.
- The test should work with GCC and Clang.
+ Another command line option (--no-doxygen) was added to disable
+ creating the doxygen documenation in cases where it not wanted or
+ if the doxygen tool is not installed.
- m4/tuklib_integer.m4 | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ autogen.sh | 35 +++++++++++++++++++++++++++++------
+ 1 file changed, 29 insertions(+), 6 deletions(-)
-commit 3bc112c2d38d5f348bce7bc2422286b1692c7490
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-06-01 18:41:16 +0300
+commit 1321852a3be7196bd7fcfd146221a5669e46407c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:35:55 +0800
- tuklib_integer: Improve unaligned memory access.
+ Build: Create doxygen/update-doxygen script.
- Now memcpy() or GNU C packed structs for unaligned access instead
- of type punning. See the comment in this commit for details.
+ This is a helper script to generate the Doxygen documentation. It can be
+ run in 'liblzma' or 'internal' mode by setting the first argument. It
+ will default to 'liblzma' mode and only generate documentation for the
+ liblzma API header files.
- Avoiding type punning with unaligned access is needed to
- silence gcc -fsanitize=undefined.
+ The helper script will be run during the custom mydist hook when we
+ create releases. This hook already alters the source directory, so its
+ fine to do it here too. This way, we can include the Doxygen generated
+ files in the distrubtion and when installing.
- New functions: unaliged_readXXne and unaligned_writeXXne where
- XX is 16, 32, or 64.
+ In 'liblzma' mode, the JavaScript is stripped from the .html files and
+ the .js files are removed. This avoids license hassle from jQuery and
+ other libraries that Doxygen 1.9.6 puts into jquery.js in minified form.
- src/common/tuklib_integer.h | 180 +++++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 168 insertions(+), 12 deletions(-)
+ Makefile.am | 1 +
+ doxygen/update-doxygen | 111 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 112 insertions(+)
-commit 2a22de439ec63da1927b640eda309296a1e8dce5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-13 20:05:17 +0300
+commit b1216a7772952d2fe7fe9c6acfcbd98d30abbc7b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-16 21:34:36 +0800
- liblzma: Avoid memcpy(NULL, foo, 0) because it is undefined behavior.
+ Build: Install Doxygen docs and include in distribution if generated.
- I should have always known this but I didn't. Here is an example
- as a reminder to myself:
+ Added a install-data-local target to install the Doxygen documentation
+ only when it has been generated. In order to correctly remove the docs,
+ a corresponding uninstall-local target was added.
- int mycopy(void *dest, void *src, size_t n)
- {
- memcpy(dest, src, n);
- return dest == NULL;
- }
+ If the doxygen docs exist in the source tree, they will also be included
+ in the distribution now too.
+
+ Makefile.am | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+commit c97d12f300b2a94c9f54a44c8931c8bc08cf0a73
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-03-16 21:23:48 +0800
+
+ Doxygen: Refactor Doxyfile.in to doxygen/Doxyfile.
- In the example, a compiler may assume that dest != NULL because
- passing NULL to memcpy() would be undefined behavior. Testing
- with GCC 8.2.1, mycopy(NULL, NULL, 0) returns 1 with -O0 and -O1.
- With -O2 the return value is 0 because the compiler infers that
- dest cannot be NULL because it was already used with memcpy()
- and thus the test for NULL gets optimized out.
+ Instead of having Doxyfile.in configured by Autoconf, the Doxyfile
+ can have the tags that need to be configured piped into the doxygen
+ command through stdin with the overrides after Doxyfile's contents.
- In liblzma, if a null-pointer was passed to memcpy(), there were
- no checks for NULL *after* the memcpy() call, so I cautiously
- suspect that it shouldn't have caused bad behavior in practice,
- but it's hard to be sure, and the problematic cases had to be
- fixed anyway.
+ Going forward, the documentation should be generated in two different
+ modes: liblzma or internal.
+
+ liblzma is useful for most users. It is the documentation for just
+ the liblzma API header files. This is the default.
- Thanks to Jeffrey Walton.
+ internal is for people who want to understand how xz and liblzma work.
+ It might be useful for people who want to contribute to the project.
- src/liblzma/common/common.c | 6 +++++-
- src/liblzma/lz/lz_decoder.c | 12 +++++++++---
- src/liblzma/simple/simple_coder.c | 10 +++++++++-
- 3 files changed, 23 insertions(+), 5 deletions(-)
+ .gitignore | 3 +-
+ Makefile.am | 1 -
+ configure.ac | 40 ---
+ Doxyfile.in => doxygen/Doxyfile | 721 +++++++++++++++++++++++++---------------
+ 4 files changed, 456 insertions(+), 309 deletions(-)
-commit d3fc850cfedc058247d9e334ce59bbc8f2286d8a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-11 20:56:08 +0300
+commit 1b7661faa4bbf4a54c6b75900b5059835c382a0f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-28 23:22:36 +0800
- Update THANKS.
+ Tests: Remove unused macros and functions.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/tests.h | 75 -----------------------------------------------------------
+ 1 file changed, 75 deletions(-)
-commit 4adb8288ab61d5f14e212007b8742df0710baf73
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-11 20:54:12 +0300
+commit af55191102f01e76de658c881299f0909ca0feda
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 21:52:15 +0800
- xz: Update xz man page date.
+ liblzma: Defines masks for return values from lzma_index_checks().
- src/xz/xz.1 | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/liblzma/api/lzma/index.h | 23 +++++++++++++++++++++++
+ tests/test_index.c | 22 +++++++++++-----------
+ 2 files changed, 34 insertions(+), 11 deletions(-)
-commit 2fb0ddaa557ce86e38fe06439930fa8665f092fd
-Author: Antoine Cœur <antoine.coeur@ef.com>
-Date: 2019-05-08 13:30:57 +0800
+commit 8f38cdd9ab71e2a9d5a9787550222b7578243b73
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 22:29:07 +0800
- spelling
+ Tests: Refactors existing lzma_index tests.
+
+ Converts the existing lzma_index tests into tuktests and covers every
+ API function from index.h except for lzma_file_info_decoder, which can
+ be tested in the future.
- Doxyfile.in | 2 +-
- NEWS | 2 +-
- doc/examples/11_file_info.c | 2 +-
- src/liblzma/api/lzma/block.h | 2 +-
- src/liblzma/api/lzma/hardware.h | 2 +-
- src/liblzma/api/lzma/lzma12.h | 2 +-
- src/liblzma/api/lzma/vli.h | 2 +-
- src/liblzma/common/file_info.c | 4 ++--
- src/liblzma/common/hardware_physmem.c | 2 +-
- src/liblzma/common/index.c | 4 ++--
- src/liblzma/common/stream_encoder_mt.c | 2 +-
- src/liblzma/common/vli_decoder.c | 2 +-
- src/liblzma/lz/lz_decoder.c | 2 +-
- src/scripts/xzgrep.in | 2 +-
- src/xz/args.c | 2 +-
- src/xz/coder.c | 4 ++--
- src/xz/list.c | 4 ++--
- src/xz/main.c | 2 +-
- src/xz/mytime.h | 2 +-
- src/xz/private.h | 2 +-
- src/xz/xz.1 | 2 +-
- windows/build.bash | 2 +-
- 22 files changed, 26 insertions(+), 26 deletions(-)
+ tests/test_index.c | 2036 ++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 1492 insertions(+), 544 deletions(-)
-commit 4ed339606156bd313ed99237485cb8ed0362d64f
+commit 717aa3651ce582807f379d8654c2516e1594df77
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-01 18:43:10 +0300
+Date: 2023-03-11 18:42:08 +0200
- xz: In xz -lvv look at the widths of the check names too.
+ xz: Simplify the error-label in Capsicum sandbox code.
- Now the widths of the check names is used to adjust the width
- of the Check column. This way there no longer is a need to restrict
- the widths of the check names to be at most ten terminal-columns.
+ Also remove unneeded "sandbox_allowed = false;" as this code
+ will never be run more than once (making it work with multiple
+ input files isn't trivial).
- src/xz/list.c | 32 ++++++++++++++++++++++++++------
- 1 file changed, 26 insertions(+), 6 deletions(-)
+ src/xz/file_io.c | 27 ++++++++++++---------------
+ 1 file changed, 12 insertions(+), 15 deletions(-)
-commit 2f4281a1001dcf7fdf1418c0c0d246c16561fb65
+commit a0eecc235d3ba8ad3453da98b46c7bc3e644de75
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-01 18:33:25 +0300
+Date: 2023-03-07 19:59:23 +0200
- xz: Fix xz -lvv column alignment to look at the translated strings.
+ xz: Make Capsicum sandbox more strict with stdin and stdout.
- src/xz/list.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/xz/file_io.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
-commit 01d01b7c7c0b8eaf7f780a5584ec52c22d10fa4a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-01 16:52:36 +0300
+commit 916448d624aaf55cef0fc3e53754affb8c4f309d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-08 23:08:46 +0800
- Update THANKS.
+ Revert: "Add warning if Capsicum sandbox system calls are unsupported."
+
+ The warning causes the exit status to be 2, so this will cause problems
+ for many scripted use cases for xz. The sandbox usage is already very
+ limited already, so silently disabling this allows it to be more usable.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/file_io.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
-commit 64030c6b17f7743df03a9948a0ccfcdf40c6b97c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-05-01 16:43:16 +0300
+commit 01587dda2a8f13fef7e12fd624e6d05da5f9624f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-07 20:02:22 +0800
- Windows: Update VS version in windows/vs2019/config.h.
+ xz: Fix -Wunused-label in io_sandbox_enter().
+
+ Thanks to Xin Li for recommending the fix.
- windows/vs2019/config.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/xz/file_io.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 2dc9117f5fbfab31444a3ca1e55795ccfa8a9f51
-Author: Julien Marrec <julien.marrec@gmail.com>
-Date: 2019-04-25 17:44:06 +0200
+commit 5fb936786601a1cd013a5d436adde65982b1e13c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-06 21:37:45 +0800
- Windows: Upgrade solution itself
+ xz: Add warning if Capsicum sandbox system calls are unsupported.
+
+ The warning is only used when errno == ENOSYS. Otherwise, xz still
+ issues a fatal error.
- windows/vs2019/xz_win.sln | 7 +++++--
- 1 file changed, 5 insertions(+), 2 deletions(-)
+ src/xz/file_io.c | 2 ++
+ 1 file changed, 2 insertions(+)
-commit ac31413916fa9b11bab17f0f0aa63e2869360f6f
-Author: Julien Marrec <julien.marrec@gmail.com>
-Date: 2019-04-25 17:40:24 +0200
+commit 61ee82cb1232a402c82282bbae42821f2b952b0d
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-06 21:27:53 +0800
- Windows: Upgrade solution with VS2019
+ xz: Skip Capsicum sandbox system calls when they are unsupported.
+
+ If a system has the Capsicum header files but does not actually
+ implement the system calls, then this would render xz unusable. Instead,
+ we can check if errno == ENOSYS and not issue a fatal error.
- windows/vs2019/liblzma.vcxproj | 15 ++++++++-------
- windows/vs2019/liblzma_dll.vcxproj | 15 ++++++++-------
- 2 files changed, 16 insertions(+), 14 deletions(-)
+ src/xz/file_io.c | 22 +++++++++++++++++-----
+ 1 file changed, 17 insertions(+), 5 deletions(-)
-commit be25a0c37ba92a20c390b4d17fe502457fe96b71
-Author: Julien Marrec <julien.marrec@gmail.com>
-Date: 2019-04-25 17:39:32 +0200
+commit f070722b57ba975a0dff36492d766f03026b1d21
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-03-06 21:08:26 +0800
- Windows: Duplicate windows/vs2017 before upgrading
+ xz: Reorder cap_enter() to beginning of capsicum sandbox code.
+
+ cap_enter() puts the process into the sandbox. If later calls to
+ cap_rights_limit() fail, then the process can still have some extra
+ protections.
- windows/vs2019/config.h | 148 ++++++++++++++
- windows/vs2019/liblzma.vcxproj | 356 ++++++++++++++++++++++++++++++++++
- windows/vs2019/liblzma_dll.vcxproj | 385 +++++++++++++++++++++++++++++++++++++
- windows/vs2019/xz_win.sln | 48 +++++
- 4 files changed, 937 insertions(+)
+ src/xz/file_io.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit d0e58b3a51e8e616f3dc26ec7b7e4aa0fa6991ad
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-03-04 22:49:04 +0200
+commit f1ab1f6b339d16a53ac53efeb97779ecd2bae70f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-24 23:46:23 +0800
- README: Update translation instructions.
+ liblzma: Clarify lzma_lzma_preset() documentation in lzma12.h.
+
+ lzma_lzma_preset() does not guarentee that the lzma_options_lzma are
+ usable in an encoder even if it returns false (success). If liblzma
+ is built with default configurations, then the options will always be
+ usable. However if the match finders hc3, hc4, or bt4 are disabled, then
+ the options may not be usable depending on the preset level requested.
- XZ Utils is now part of the Translation Project
- <https://translationproject.org/>.
+ The documentation was updated to reflect this complexity, since this
+ behavior was unclear before.
- README | 32 +++++++++++++-------------------
- 1 file changed, 13 insertions(+), 19 deletions(-)
+ src/liblzma/api/lzma/lzma12.h | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit a750c35a7d45a16c11c1d40fecee8443c32a9996
+commit 4b7fb3bf41a0ca4c97fad3799949a2aa61b13b99
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-03-04 21:20:39 +0200
+Date: 2023-02-27 18:38:35 +0200
+
+ CMake: Require that the C compiler supports C99 or a newer standard.
+
+ Thanks to autoantwort for reporting the issue and suggesting
+ a different patch:
+ https://github.com/tukaani-project/xz/pull/42
- xz: Automatically align column headings in xz -lvv.
+ CMakeLists.txt | 8 ++++++++
+ 1 file changed, 8 insertions(+)
- src/xz/list.c | 263 ++++++++++++++++++++++++++++++++++++++++++++++------------
- 1 file changed, 212 insertions(+), 51 deletions(-)
+commit 9aa7fdeb04c486d2700967090956af88fdccab7e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-24 18:10:37 +0800
-commit 6cb42e8aa1dc37bf403a9f5acbd07e86036b7e77
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-03-04 01:07:59 +0200
+ Tests: Small tweak to test-vli.c.
+
+ The static global variables can be disabled if encoders and decoders
+ are not built. If they are not disabled and -Werror is used, it will
+ cause an usused warning as an error.
- xz: Automatically align strings ending in a colon in --list output.
+ tests/test_vli.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+commit 3cf72c4bcba5370f07477c9b9b62ae33069ef9a9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-06 21:46:43 +0800
+
+ liblzma: Replace '\n' -> newline in filter.h documentation.
- This should avoid alignment errors in translations with these
- strings.
+ The '\n' renders as a newline when the comments are converted to html
+ by Doxygen.
- src/xz/list.c | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 102 insertions(+), 12 deletions(-)
+ src/liblzma/api/lzma/filter.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 1e3f29b62f2c03e50fc9ebea7b83c1497dd35484
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2019-01-13 17:29:23 +0200
+commit 002006be62d77c706565fa6ec828bea64be302da
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-06 21:45:37 +0800
- Windows/VS2017: Omit WindowsTargetPlatformVersion from project files.
+ liblzma: Shorten return description for two functions in filter.h.
- I understood that if a WTPV is specified, it's often wrong
- because different VS installations have different SDK version
- installed. Omitting the WTPV tag makes VS2017 default to
- Windows SDK 8.1 which often is also missing, so in any case
- people may need to specify the WTPV before building. But some
- day in the future a missing WTPV tag will start to default to
- the latest installed SDK which sounds reasonable:
+ Shorten the description for lzma_raw_encoder_memusage() and
+ lzma_raw_decoder_memusage().
+
+ src/liblzma/api/lzma/filter.h | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
+
+commit 463d9359b8595f01d44ada1739d75aeb87f36524
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-06 21:44:45 +0800
+
+ liblzma: Reword a few lines in filter.h
+
+ src/liblzma/api/lzma/filter.h | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+commit 01441df92c0fd6a6c02fe5ac27982a54ce887cc0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-06 21:35:06 +0800
+
+ liblzma: Improve documentation in filter.h.
- https://developercommunity.visualstudio.com/content/problem/140294/windowstargetplatformversion-makes-it-impossible-t.html
+ All functions now explicitly specify parameter and return values.
+ The notes and code annotations were moved before the parameter and
+ return value descriptions for consistency.
- Thanks to "dom".
+ Also, the description above lzma_filter_encoder_is_supported() about
+ not being able to list available filters was removed since
+ lzma_str_list_filters() will do this.
- windows/INSTALL-MSVC.txt | 4 ++++
- windows/vs2017/liblzma.vcxproj | 1 -
- windows/vs2017/liblzma_dll.vcxproj | 1 -
- 3 files changed, 4 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma/filter.h | 226 ++++++++++++++++++++++++++----------------
+ 1 file changed, 143 insertions(+), 83 deletions(-)
-commit 4d86076332aece6314063d3712a5f364172bbb0f
+commit 805b45cd60bfd5da3d3d89077de3789df179b324
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-12-20 20:42:29 +0200
+Date: 2023-02-23 20:46:16 +0200
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit b55d79461d1f6aeaac03c7dae84481e5eb8bea4c
+commit 30e95bb44c36ae26b2ab12a94343b215fec285e7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-12-14 20:34:30 +0200
+Date: 2023-02-21 22:57:10 +0200
- xz: Fix a crash in progress indicator when in passthru mode.
+ liblzma: Avoid null pointer + 0 (undefined behavior in C).
+
+ In the C99 and C17 standards, section 6.5.6 paragraph 8 means that
+ adding 0 to a null pointer is undefined behavior. As of writing,
+ "clang -fsanitize=undefined" (Clang 15) diagnoses this. However,
+ I'm not aware of any compiler that would take advantage of this
+ when optimizing (Clang 15 included). It's good to avoid this anyway
+ since compilers might some day infer that pointer arithmetic implies
+ that the pointer is not NULL. That is, the following foo() would then
+ unconditionally return 0, even for foo(NULL, 0):
+
+ void bar(char *a, char *b);
+
+ int foo(char *a, size_t n)
+ {
+ bar(a, a + n);
+ return a == NULL;
+ }
+
+ In contrast to C, C++ explicitly allows null pointer + 0. So if
+ the above is compiled as C++ then there is no undefined behavior
+ in the foo(NULL, 0) call.
+
+ To me it seems that changing the C standard would be the sane
+ thing to do (just add one sentence) as it would ensure that a huge
+ amount of old code won't break in the future. Based on web searches
+ it seems that a large number of codebases (where null pointer + 0
+ occurs) are being fixed instead to be future-proof in case compilers
+ will some day optimize based on it (like making the above foo(NULL, 0)
+ return 0) which in the worst case will cause security bugs.
+
+ Some projects don't plan to change it. For example, gnulib and thus
+ many GNU tools currently require that null pointer + 0 is defined:
- "xz -dcfv not_an_xz_file" crashed (all four options are
- required to trigger it). It caused xz to call
- lzma_get_progress(&strm, ...) when no coder was initialized
- in strm. In this situation strm.internal is NULL which leads
- to a crash in lzma_get_progress().
+ https://lists.gnu.org/archive/html/bug-gnulib/2021-11/msg00000.html
- The bug was introduced when xz started using lzma_get_progress()
- to get progress info for multi-threaded compression, so the
- bug is present in versions 5.1.3alpha and higher.
+ https://www.gnu.org/software/gnulib/manual/html_node/Other-portability-assumptions.html
- Thanks to Filip Palian <Filip.Palian@pjwstk.edu.pl> for
- the bug report.
+ In XZ Utils null pointer + 0 issue should be fixed after this
+ commit. This adds a few if-statements and thus branches to avoid
+ null pointer + 0. These check for size > 0 instead of ptr != NULL
+ because this way bugs where size > 0 && ptr == NULL will likely
+ get caught quickly. None of them are in hot spots so it shouldn't
+ matter for performance.
+
+ A little less readable version would be replacing
+
+ ptr + offset
+
+ with
+
+ offset != 0 ? ptr + offset : ptr
+
+ or creating a macro for it:
+
+ #define my_ptr_add(ptr, offset) \
+ ((offset) != 0 ? ((ptr) + (offset)) : (ptr))
+
+ Checking for offset != 0 instead of ptr != NULL allows GCC >= 8.1,
+ Clang >= 7, and Clang-based ICX to optimize it to the very same code
+ as ptr + offset. That is, it won't create a branch. So for hot code
+ this could be a good solution to avoid null pointer + 0. Unfortunately
+ other compilers like ICC 2021 or MSVC 19.33 (VS2022) will create a
+ branch from my_ptr_add().
+
+ Thanks to Marcin Kowalczyk for reporting the problem:
+ https://github.com/tukaani-project/xz/issues/36
- src/xz/coder.c | 11 +++++++----
- src/xz/message.c | 18 ++++++++++++++++--
- src/xz/message.h | 3 ++-
- 3 files changed, 25 insertions(+), 7 deletions(-)
+ src/liblzma/common/block_decoder.c | 5 ++++-
+ src/liblzma/common/block_encoder.c | 7 +++++--
+ src/liblzma/common/common.c | 20 ++++++++++++++------
+ src/liblzma/common/index_decoder.c | 13 ++++++++++---
+ src/liblzma/common/index_encoder.c | 11 +++++++++--
+ src/liblzma/common/index_hash.c | 13 ++++++++++---
+ src/liblzma/common/lzip_decoder.c | 6 +++++-
+ src/liblzma/delta/delta_decoder.c | 7 ++++++-
+ src/liblzma/delta/delta_encoder.c | 12 ++++++++++--
+ src/liblzma/simple/simple_coder.c | 6 ++++--
+ 10 files changed, 77 insertions(+), 23 deletions(-)
-commit 4ae5526de013efd1021686fa80bdd10cf1cb9c56
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-11-22 17:20:31 +0200
+commit fa9065fac54194fe0407fc7f0cc9633fdce13c21
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-07 00:00:44 +0800
- xz: Update man page timestamp.
+ liblzma: Adjust container.h for consistency with filter.h.
- src/xz/xz.1 | 2 +-
+ src/liblzma/api/lzma/container.h | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+commit 00a721b63d82dfb658dca8d8cb599d8a245c663f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-07 00:00:09 +0800
+
+ liblzma: Fix small typos and reword a few things in filter.h.
+
+ src/liblzma/api/lzma/container.h | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+commit 5b1c171d4ffe89ef18fa31509bb0185d6fd11d39
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-06 23:42:08 +0800
+
+ liblzma: Convert list of flags in lzma_mt to bulleted list.
+
+ src/liblzma/api/lzma/container.h | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+commit dbd47622eb99fefb3538a22baec3def002aa56f5
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-26 23:17:41 +0800
+
+ liblzma: Fix typo in documentation in container.h
+
+ lzma_microlzma_decoder -> lzma_microlzma_encoder
+
+ src/liblzma/api/lzma/container.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 6a36d0d5f49e0080ff64dd9ef250abd489bea2ad
-Author: Pavel Raiskup <praiskup@redhat.com>
-Date: 2018-11-22 15:14:34 +0100
+commit 14cd30806d69e55906073745bcce3ee50e0ec942
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-26 23:16:34 +0800
- 'have have' typos
+ liblzma: Improve documentation for container.h
+
+ Standardizing each function to always specify parameters and return
+ values. Also moved the parameters and return values to the end of each
+ function description.
- src/xz/signals.c | 2 +-
- src/xz/xz.1 | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma/container.h | 146 +++++++++++++++++++++++++--------------
+ 1 file changed, 93 insertions(+), 53 deletions(-)
-commit 9eca51ef805ed8002a851df1b4995d71826c8b6e
+commit c9c8bfae3502842dcead85eeb2b951b437c2cd88
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-22 20:59:41 +0800
+
+ CMake: Add LZIP decoder test to list of tests.
+
+ CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit b9f171dd00a3cc32b6d41ea8e082cf545640ec2a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-11-02 20:40:48 +0200
+Date: 2023-02-17 20:56:49 +0200
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 106d1a663d4ba42b63231caa289f531548df81c1
+commit 2ee86d20e49985b903b78ebcfa3fa672e73e93aa
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-11-02 20:18:45 +0200
+Date: 2023-02-17 20:48:28 +0200
- Tests: Add a fuzz test program and a config file for OSS-Fuzz.
+ Build: Use only the generic symbol versioning on MicroBlaze.
+
+ On MicroBlaze, GCC 12 is broken in sense that
+ __has_attribute(__symver__) returns true but it still doesn't
+ support the __symver__ attribute even though the platform is ELF
+ and symbol versioning is supported if using the traditional
+ __asm__(".symver ...") method. Avoiding the traditional method is
+ good because it breaks LTO (-flto) builds with GCC.
+
+ See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101766
+
+ For now the only extra symbols in liblzma_linux.map are the
+ compatibility symbols with the patch that spread from RHEL/CentOS 7.
+ These require the use of __symver__ attribute or __asm__(".symver ...")
+ in the C code. Compatibility with the patch from CentOS 7 doesn't
+ seem valuable on MicroBlaze so use liblzma_generic.map on MicroBlaze
+ instead. It doesn't require anything special in the C code and thus
+ no LTO issues either.
+
+ An alternative would be to detect support for __symver__
+ attribute in configure.ac and CMakeLists.txt and fall back
+ to __asm__(".symver ...") but then LTO would be silently broken
+ on MicroBlaze. It sounds likely that MicroBlaze is a special
+ case so let's treat it as a such because that is simpler. If
+ a similar issue exists on some other platform too then hopefully
+ someone will report it and this can be reconsidered.
+
+ (This doesn't do the same fix in CMakeLists.txt. Perhaps it should
+ but perhaps CMake build of liblzma doesn't matter much on MicroBlaze.
+ The problem breaks the build so it's easy to notice and can be fixed
+ later.)
- Thanks to Bhargava Shastry and Github user pdknsk.
+ Thanks to Vincent Fazio for reporting the problem and proposing
+ a patch (in the end that solution wasn't used):
+ https://github.com/tukaani-project/xz/pull/32
- tests/Makefile.am | 1 +
- tests/ossfuzz/Makefile | 7 ++++
- tests/ossfuzz/config/fuzz.dict | 2 +
- tests/ossfuzz/config/fuzz.options | 2 +
- tests/ossfuzz/fuzz.c | 82 +++++++++++++++++++++++++++++++++++++++
- 5 files changed, 94 insertions(+)
+ configure.ac | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
-commit a18ae42a79a19b1394b41eb3e238139fd28012ec
+commit d831072cceca458d94d2d5da201862f6d43a417b
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-10-26 22:49:10 +0300
+Date: 2023-02-16 21:09:00 +0200
- liblzma: Don't verify header CRC32s if building for fuzz testing.
+ liblzma: Very minor API doc tweaks.
- FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION is #defined when liblzma
- is being built for fuzz testing.
+ Use "member" to refer to struct members as that's the term used
+ by the C standard.
- Most fuzzed inputs would normally get rejected because of incorrect
- CRC32 and the actual header decoding code wouldn't get fuzzed.
- Disabling CRC32 checks avoids this problem. The fuzzer program
- must still use LZMA_IGNORE_CHECK flag to disable verification of
- integrity checks of uncompressed data.
+ Use lzma_options_delta.dist and such in docs so that in Doxygen's
+ HTML output they will link to the doc of the struct member.
+
+ Clean up a few trailing white spaces too.
- src/liblzma/common/block_header_decoder.c | 5 ++++-
- src/liblzma/common/index_decoder.c | 5 ++++-
- src/liblzma/common/index_hash.c | 5 ++++-
- src/liblzma/common/stream_flags_decoder.c | 10 ++++++++--
- 4 files changed, 20 insertions(+), 5 deletions(-)
+ src/liblzma/api/lzma/block.h | 6 +++---
+ src/liblzma/api/lzma/delta.h | 6 +++---
+ src/liblzma/api/lzma/index.h | 10 +++++-----
+ src/liblzma/api/lzma/stream_flags.h | 6 +++---
+ 4 files changed, 14 insertions(+), 14 deletions(-)
+
+commit f029daea39c215fd7d5cb6b6798818b055cf5b22
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-17 00:54:33 +0800
+
+ liblzma: Adjust spacing in doc headers in bcj.h.
+
+ src/liblzma/api/lzma/bcj.h | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
-commit f76f7516d6a1c832f61810c82e92d151cc80966c
+commit a5de68bac2bb7e1b9119e6cea7d761a22ea73e9c
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-17 00:44:44 +0800
+
+ liblzma: Adjust documentation in bcj.h for consistent style.
+
+ src/liblzma/api/lzma/bcj.h | 43 ++++++++++++++++++++++---------------------
+ 1 file changed, 22 insertions(+), 21 deletions(-)
+
+commit efa498c13b883810497e0ea8a169efd6f48f5026
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-17 00:36:05 +0800
+
+ liblzma: Rename field => member in documentation.
+
+ Also adjusted preset value => preset level.
+
+ src/liblzma/api/lzma/base.h | 18 +++++++--------
+ src/liblzma/api/lzma/block.h | 44 ++++++++++++++++++-------------------
+ src/liblzma/api/lzma/container.h | 26 +++++++++++-----------
+ src/liblzma/api/lzma/delta.h | 12 +++++-----
+ src/liblzma/api/lzma/index.h | 30 ++++++++++++-------------
+ src/liblzma/api/lzma/lzma12.h | 28 +++++++++++------------
+ src/liblzma/api/lzma/stream_flags.h | 32 +++++++++++++--------------
+ 7 files changed, 95 insertions(+), 95 deletions(-)
+
+commit 718b22a6c5e3ee5de123323ea798872381f9320e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-07-27 18:10:44 +0300
+Date: 2023-02-16 17:59:50 +0200
- xzless: Rename unused variables to silence static analysers.
+ liblzma: Silence a warning from MSVC.
- In this particular case I don't see this affecting readability
- of the code.
+ It gives C4146 here since unary minus with unsigned integer
+ is still unsigned (which is the intention here). Doing it
+ with substraction makes it clearer and avoids the warning.
- Thanks to Pavel Raiskup.
+ Thanks to Nathan Moinvaziri for reporting this.
- src/scripts/xzless.in | 2 +-
+ src/liblzma/check/crc64_fast.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit 3cbcaeb07eb7543735befd6f507fdb5fa4363cff
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-07-27 16:02:58 +0300
+commit 87c53553fa7d50f777b4edfa99f2083628f590fe
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-16 21:04:54 +0800
- liblzma: Remove an always-true condition from lzma_index_cat().
+ liblzma: Improve documentation for stream_flags.h
- This should help static analysis tools to see that newg
- isn't leaked.
+ Standardizing each function to always specify parameters and return
+ values. Also moved the parameters and return values to the end of each
+ function description.
- Thanks to Pavel Raiskup.
+ A few small things were reworded and long sentences broken up.
- src/liblzma/common/index.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma/stream_flags.h | 76 ++++++++++++++++++++++---------------
+ 1 file changed, 46 insertions(+), 30 deletions(-)
-commit 76762ae6098ec55c326f4b4b4a42e8c1918ee81f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-05-19 21:23:25 +0300
+commit 13d99e75a543e9e5f8633cc241eae55b91a3b242
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-14 21:50:16 +0800
- liblzma: Improve lzma_properties_decode() API documentation.
+ liblzma: Improve documentation in lzma12.h.
+
+ All functions now explicitly specify parameter and return values.
- src/liblzma/api/lzma/filter.h | 7 ++++---
- 1 file changed, 4 insertions(+), 3 deletions(-)
+ src/liblzma/api/lzma/lzma12.h | 32 +++++++++++++++++++++++---------
+ 1 file changed, 23 insertions(+), 9 deletions(-)
-commit 2267f5b0d20a5d24e93fcd9f72ea7eeb0d89708c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-04-29 18:58:19 +0300
+commit 43ec344c868f930e96879eb9e49212cce92a9884
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-27 22:44:06 +0800
- Bump the version number to 5.3.1alpha.
+ liblzma: Improve documentation in check.h.
+
+ All functions now explicitly specify parameter and return values.
+ Also moved the note about SHA-256 functions not being exported to the
+ top of the file.
- src/liblzma/api/lzma/version.h | 2 +-
- src/liblzma/liblzma.map | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma/check.h | 41 ++++++++++++++++++++++++++++-------------
+ 1 file changed, 28 insertions(+), 13 deletions(-)
-commit cee3021d30704858e4bdd22240e7d28e570d7451
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-04-29 18:48:00 +0300
+commit 9c71db4e884fd49aea3d1e711036bff45ca66487
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-08 21:33:52 +0800
- extra/scanlzma: Fix compiler warnings.
+ liblzma: Improve documentation in index.h
+
+ All functions now explicitly specify parameter and return values.
- extra/scanlzma/scanlzma.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
+ src/liblzma/api/lzma/index.h | 177 ++++++++++++++++++++++++++++++-------------
+ 1 file changed, 126 insertions(+), 51 deletions(-)
-commit c5c7ceb08a011b97d261798033e2c39613a69eb7
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-04-29 18:44:47 +0300
+commit 421f2f2e160720f6009e3b6a125cafe2feaa9419
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-08 20:35:32 +0800
- DOS: Add file_info.c to the list of files to build.
+ liblzma: Reword a comment in index.h.
- dos/Makefile | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/api/lzma/index.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 114cab97af766b21e0fc8620479202fb1e7a5e41
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-04-29 18:33:10 +0300
+commit b67539484981351d501b68de5e925425e50c59b1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-08 20:30:23 +0800
- Update NEWS for 5.3.1alpha.
+ liblzma: Omit lzma_index_iter's internal field from Doxygen docs.
+
+ Add \private above this field and its sub-fields since it is not meant
+ to be modified by users.
- NEWS | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ src/liblzma/api/lzma/index.h | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
-commit b8139e11c512bbf32bf58ab0689f9bb6c52819da
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-04-29 18:15:37 +0300
+commit 0c9e4fc2ad6d88d54f299240fcc5a2ce7d695d96
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-21 21:32:03 +0800
- Add NEWS for 5.2.4.
+ liblzma: Fix documentation for LZMA_MEMLIMIT_ERROR.
+
+ LZMA_MEMLIMIT_ERROR was missing the "<" character needed to put
+ documentation after a member.
- NEWS | 27 +++++++++++++++++++++++++++
- 1 file changed, 27 insertions(+)
+ src/liblzma/api/lzma/base.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 47b59d47cfd904a420fbd45629d168ca1973721d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-02-06 19:36:30 +0200
+commit 816fec125aa74bcef46512c73acc6d9e5a700d15
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-21 00:29:38 +0800
- Update THANKS.
+ liblzma: Improve documentation for base.h.
+
+ Standardizing each function to always specify params and return values.
+ Also fixed a small grammar mistake.
- THANKS | 2 ++
- 1 file changed, 2 insertions(+)
+ src/liblzma/api/lzma/base.h | 30 +++++++++++++++++++++++++-----
+ 1 file changed, 25 insertions(+), 5 deletions(-)
+
+commit 862dacef1a4e7e1b28d465956fa4244ed01df154
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-14 00:12:34 +0800
-commit bc197991690ede24ab143665b5b0f0f9cb35cc46
-Author: Ben Boeckel <mathstuf@gmail.com>
-Date: 2018-01-29 13:58:18 -0500
+ liblzma: Add one more missing [out] annotation in vli.h
- nothrow: use noexcept for C++11 and newer
+ src/liblzma/api/lzma/vli.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit 867b08ae4254bf55dd1f7fd502cc618231b92f75
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-14 00:08:33 +0800
+
+ liblzma: Minor improvements to vli.h.
- In C++11, the `throw()` specifier is deprecated and `noexcept` is
- preffered instead.
+ Added [out] annotations to parameters that are pointers and can have
+ their value changed. Also added a clarification to lzma_vli_is_valid.
- src/liblzma/api/lzma.h | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
+ src/liblzma/api/lzma/vli.h | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
-commit fb6d4f83cb6e144734f2a4216bb117bd56dc3cb5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-02-06 18:02:48 +0200
+commit 90d0e628ff11e5030bcc4fc000bca056adda6603
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-10 21:38:02 +0800
- liblzma: Remove incorrect #ifdef from range_common.h.
+ liblzma: Add comments for macros in delta.h.
- In most cases it was harmless but it could affect some
- custom build systems.
+ Document LZMA_DELTA_DIST_MIN and LZMA_DELTA_DIST_MAX for completeness
+ and to avoid Doxygen warnings.
+
+ src/liblzma/api/lzma/delta.h | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+commit 9255fffdb13e59874bf7f95c370c410ad3a7e114
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-10 21:35:23 +0800
+
+ liblzma: Improve documentation in index_hash.h.
- Thanks to Pippijn van Steenhoven.
+ All functions now explicitly specify parameter and return values.
+ Also reworded the description of lzma_index_hash_init() for readability.
- src/liblzma/rangecoder/range_common.h | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
+ src/liblzma/api/lzma/index_hash.h | 36 +++++++++++++++++++++++++++---------
+ 1 file changed, 27 insertions(+), 9 deletions(-)
-commit bc577d35c2d0ed17f554d2d8107b2a2a9abbac76
+commit 1dbe12b90cff79bb51923733ac0840747b4b4131
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-01-10 22:10:39 +0200
+Date: 2023-02-07 19:07:45 +0200
- Update THANKS.
+ xz: Improve the comment about start_time in mytime.c.
+
+ start_time is relative to an arbitary point in time, it's not
+ time of day, so using it for anything else than time differences
+ wouldn't make sense.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/mytime.c | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
-commit 713bbc1a80f26d34c96ed3dbb9887362204de3a1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2018-01-10 21:54:27 +0200
+commit 7673ef5aa80c1af7fb693360dd82f527b46c2c56
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-04 21:06:35 +0800
- tuklib_integer: New Intel C compiler needs immintrin.h.
+ Build: Adjust CMake version search regex.
- Thanks to Melanie Blower (Intel) for the patch.
+ Now, the LZMA_VERSION_MAJOR, LZMA_VERSION_MINOR, and LZMA_VERSION_PATCH
+ macros do not need to be on consecutive lines in version.h. They can be
+ separated by more whitespace, comments, or even other content, as long
+ as they appear in the proper order (major, minor, patch).
- src/common/tuklib_integer.h | 11 +++++++++++
- 1 file changed, 11 insertions(+)
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
-commit a0ee1afbd99da138b559cb27fa2022e7f1ab44f3
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-24 20:04:24 +0300
+commit b8bce89be7fb5bffe5fef4a2782ca9b2b107eaac
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-04 12:01:23 +0800
- Update THANKS.
+ xz: Add a comment clarifying the use of start_time in mytime.c.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/mytime.c | 5 +++++
+ 1 file changed, 5 insertions(+)
-commit a1e2c568de29c0b57d873eab40a2879b749da429
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-16 20:36:20 +0300
+commit 912af91b10a18fb9bb3167247ecaaefca8248ee9
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-26 09:50:21 +0800
- Windows: Fix paths in VS project files.
+ liblzma: Improve documentation for version.h.
- Some paths use slashes instead of backslashes as directory
- separators... now it should work (I tested VS2013 version).
+ Specified parameter and return values for API functions and documented
+ a few more of the macros.
- windows/vs2013/liblzma.vcxproj | 12 ++++++------
- windows/vs2013/liblzma_dll.vcxproj | 24 ++++++++++++------------
- windows/vs2017/liblzma.vcxproj | 12 ++++++------
- windows/vs2017/liblzma_dll.vcxproj | 24 ++++++++++++------------
- 4 files changed, 36 insertions(+), 36 deletions(-)
+ src/liblzma/api/lzma/version.h | 29 ++++++++++++++++++++++-------
+ 1 file changed, 22 insertions(+), 7 deletions(-)
-commit cea5cf8d26c9d1dc30a808614d79c0b25640e15e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-16 12:56:20 +0300
+commit 850adec171203cd22b57d016084d713f72ae5307
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 22:52:55 +0800
- Windows: Update VS2017 project files to include file info decoder.
+ Docs: Omit SIGTSTP not handled from TODO.
- windows/vs2017/liblzma.vcxproj | 2 ++
- windows/vs2017/liblzma_dll.vcxproj | 2 ++
- 2 files changed, 4 insertions(+)
+ TODO | 4 ----
+ 1 file changed, 4 deletions(-)
-commit 95d563db3ee497b223e522b699c4d4c29943eef0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-16 12:54:23 +0300
+commit 2c78a83c6faec70154d9eb78022a618ed62cdcb3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:33:32 +0800
- Windows: Add project files for VS2017.
+ liblzma: Fix bug in lzma_str_from_filters() not checking filters[] length.
- These files match the v5.2 branch (no file info decoder).
+ The bug is only a problem in applications that do not properly terminate
+ the filters[] array with LZMA_VLI_UNKNOWN or have more than
+ LZMA_FILTERS_MAX filters. This bug does not affect xz.
- windows/vs2017/config.h | 148 ++++++++++++++
- windows/vs2017/liblzma.vcxproj | 355 ++++++++++++++++++++++++++++++++++
- windows/vs2017/liblzma_dll.vcxproj | 384 +++++++++++++++++++++++++++++++++++++
- windows/vs2017/xz_win.sln | 48 +++++
- 4 files changed, 935 insertions(+)
+ src/liblzma/common/string_conversion.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
-commit ab72416d62ea8f50ad31d5b8545fcb6a2bf96b73
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-16 12:45:50 +0300
+commit e01f01b9af1c074463b92694a16ecc16a31907c0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:32:47 +0800
- Windows: Update VS2013 project files to include file info decoder.
+ Tests: Create test_filter_str.c.
+
+ Tests lzma_str_to_filters(), lzma_str_from_filters(), and
+ lzma_str_list_filters() API functions.
- windows/vs2013/liblzma.vcxproj | 2 ++
- windows/vs2013/liblzma_dll.vcxproj | 2 ++
- 2 files changed, 4 insertions(+)
+ CMakeLists.txt | 1 +
+ tests/Makefile.am | 2 +
+ tests/test_filter_str.c | 593 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 596 insertions(+)
-commit 82388980187b0e3794d187762054200bbdcc9a53
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-09-16 12:39:43 +0300
+commit 8dfc029e7a4ce45809c30313dc0e502f0d22be26
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-22 08:49:00 +0800
- Windows: Move VS2013 files into windows/vs2013 directory.
+ liblzma: Fix typos in comments in string_conversion.c.
- windows/{ => vs2013}/config.h | 0
- windows/{ => vs2013}/liblzma.vcxproj | 278 +++++++++++++++---------------
- windows/{ => vs2013}/liblzma_dll.vcxproj | 280 +++++++++++++++----------------
- windows/{ => vs2013}/xz_win.sln | 0
- 4 files changed, 279 insertions(+), 279 deletions(-)
+ src/liblzma/common/string_conversion.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 94e3f986aa4e14b4ff01ac24857f499630d6d180
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-08-14 20:08:33 +0300
+commit 54ad83c1ae2180dcc0cb2445b181dc1e9732a5d6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:20:20 +0800
- Fix or hide warnings from GCC 7's -Wimplicit-fallthrough.
+ liblzma: Clarify block encoder and decoder documentation.
+
+ Added a few sentences to the description for lzma_block_encoder() and
+ lzma_block_decoder() to highlight that the Block Header must be coded
+ before calling these functions.
- src/liblzma/lzma/lzma_decoder.c | 6 ++++++
- src/xz/list.c | 2 ++
- 2 files changed, 8 insertions(+)
+ src/liblzma/api/lzma/block.h | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
-commit 0b0e1e6803456aac641a59332200f8e95e2b7ea8
-Author: Alexey Tourbin <alexey.tourbin@gmail.com>
-Date: 2017-05-16 23:56:35 +0300
+commit f680e771b3eb2a46310fe85b3e000ac3a1a0640f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:12:24 +0800
- Docs: Fix a typo in a comment in doc/examples/02_decompress.c.
+ Update lzma_block documentation for lzma_block_uncomp_encode().
- doc/examples/02_decompress.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/liblzma/api/lzma/block.h | 3 +++
+ 1 file changed, 3 insertions(+)
-commit a015cd1f90116e655be4eaf4aad42c4c911c2807
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-05-23 18:34:43 +0300
+commit 504cf4af895fd45aad0c56eb3b49d90acd54465b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:11:37 +0800
- xz: Fix "xz --list --robot missing_or_bad_file.xz".
-
- It ended up printing an uninitialized char-array when trying to
- print the check names (column 7) on the "totals" line.
-
- This also changes the column 12 (minimum xz version) to
- 50000002 (xz 5.0.0) instead of 0 when there are no valid
- input files.
-
- Thanks to kidmin for the bug report.
+ liblzma: Minor edits to lzma_block header_size documentation.
- src/xz/list.c | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
+ src/liblzma/api/lzma/block.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit c2e29f06a7d1e3ba242ac2fafc69f5d6e92f62cd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-24 20:20:11 +0300
+commit 115b720fb521f99aa832d06b2c12b7f8c6c50680
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:11:07 +0800
- Docs: Add doc/examples/11_file_info.c.
+ liblzma: Enumerate functions that read version in lzma_block.
- doc/examples/11_file_info.c | 206 ++++++++++++++++++++++++++++++++++++++++++++
- doc/examples/Makefile | 3 +-
- 2 files changed, 208 insertions(+), 1 deletion(-)
+ src/liblzma/api/lzma/block.h | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
-commit 1520f6ec808896375ac7bf778c449e0f7dea5f46
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-24 19:48:47 +0300
+commit 85ea0979adcf808a3830aefbe7a4ec884e542ea1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:10:34 +0800
- Build: Omit pre-5.0.0 entries from the generated ChangeLog.
-
- It makes ChangeLog significantly smaller.
+ liblzma: Clarify comment in block.h.
- Makefile.am | 3 ++-
+ src/liblzma/api/lzma/block.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
-commit 8269782283806c90a8509c2ac2a308344f70e171
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-24 19:48:23 +0300
+commit 1f7ab90d9ce224230a04de6b921ad6e2029023a8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-03 00:07:23 +0800
- xz: Use lzma_file_info_decoder() for --list.
+ liblzma: Improve documentation for block.h.
+
+ Standardizing each function to always specify params and return values.
+ Output pointer parameters are also marked with doxygen style [out] to
+ make it clear. Any note sections were also moved above the parameter and
+ return sections for consistency.
- src/xz/list.c | 254 ++++++++++------------------------------------------------
- 1 file changed, 44 insertions(+), 210 deletions(-)
+ src/liblzma/api/lzma/block.h | 96 ++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 75 insertions(+), 21 deletions(-)
-commit e353d0b1cc0d3997ae5048faa8e6786414953e06
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-24 19:35:50 +0300
+commit c563a4bc554a96bd0b6aab3c139715b7ec8f6ca3
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-01 23:38:30 +0800
+
+ liblzma: Clarify a comment about LZMA_STR_NO_VALIDATION.
+
+ The flag description for LZMA_STR_NO_VALIDATION was previously confusing
+ about the treatment for filters than cannot be used with .xz format
+ (lzma1) without using LZMA_STR_ALL_FILTERS. Now, it is clear that
+ LZMA_STR_NO_VALIDATION is not a super set of LZMA_STR_ALL_FILTERS.
- liblzma: Add lzma_file_info_decoder().
+ src/liblzma/api/lzma/filter.h | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
- src/liblzma/api/lzma/index.h | 66 ++++
- src/liblzma/common/Makefile.inc | 1 +
- src/liblzma/common/file_info.c | 855 ++++++++++++++++++++++++++++++++++++++++
- src/liblzma/liblzma.map | 7 +-
- 4 files changed, 928 insertions(+), 1 deletion(-)
+commit 315c64c7e18acc59a745b68148188a73e998252b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-01 21:43:33 +0800
-commit 144ef9e19e9496c995b21505dd1e111c442968d1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-24 19:30:22 +0300
+ CI: Update .gitignore for artifacts directory in build-aux.
+
+ The workflow action for our CI pipeline can only reference artifacts in
+ the source directory, so we should ignore these files if the ci_build.sh
+ is run locally.
- Update the Git repository URL to HTTPS in ChangeLog.
+ .gitignore | 1 +
+ 1 file changed, 1 insertion(+)
- ChangeLog | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+commit 2c1341f4fa06e7f487d61142aa354c433e17ec7f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-01 21:36:46 +0800
-commit 8c9842c265993d7dd4039f732d3546267fb5ecc4
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-21 15:05:16 +0300
+ CI: Add quotes around variables in a few places.
- liblzma: Rename LZMA_SEEK to LZMA_SEEK_NEEDED and seek_in to seek_pos.
+ build-aux/ci_build.sh | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
- src/liblzma/api/lzma/base.h | 18 +++++++++---------
- src/liblzma/common/common.c | 2 +-
- src/xz/message.c | 2 +-
- 3 files changed, 11 insertions(+), 11 deletions(-)
+commit 3a401b0e0c7a2658af7801dd0690256ef24149e0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-02-01 21:36:22 +0800
-commit 662b27c417cab248cb365dd7682121bdec4d5ae7
+ CI: Upload test logs as artifacts if a test fails.
+
+ .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++--------------
+ build-aux/ci_build.sh | 31 ++++++++++++++++++++-----
+ 2 files changed, 68 insertions(+), 23 deletions(-)
+
+commit 610dde15a88f12cc540424eb3eb3ed61f3876f74
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-19 22:17:35 +0300
+Date: 2023-01-27 20:02:49 +0200
- Update the home page URLs to HTTPS.
+ xz: Use clock_gettime() even if CLOCK_MONOTONIC isn't available.
+
+ mythread.h and thus liblzma already does it.
- COPYING | 2 +-
- README | 2 +-
- configure.ac | 2 +-
- doc/faq.txt | 4 ++--
- dos/config.h | 2 +-
- src/common/common_w32res.rc | 2 +-
- src/xz/xz.1 | 6 +++---
- src/xzdec/xzdec.1 | 4 ++--
- windows/README-Windows.txt | 2 +-
- windows/config.h | 2 +-
- 10 files changed, 14 insertions(+), 14 deletions(-)
+ src/xz/mytime.c | 11 ++++++++---
+ src/xz/private.h | 3 +--
+ 2 files changed, 9 insertions(+), 5 deletions(-)
-commit c28f0b3d00af87b92dda229831548d8eb0067d1d
+commit 2e02877288f6576cd4595e9ac7684f867cd47d68
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-04-05 18:47:22 +0300
+Date: 2023-01-27 19:41:19 +0200
- xz: Add io_seek_src().
+ po4a/po4a.conf: Sort the language identifiers in alphabetical order.
- src/xz/file_io.c | 20 +++++++++++++++++---
- src/xz/file_io.h | 13 +++++++++++++
- 2 files changed, 30 insertions(+), 3 deletions(-)
+ po4a/po4a.conf | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit bba477257d7319c8764890f3669175b866d24944
+commit ff592c616eda274215b485cf1b8d34f060c9f3be
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 22:01:54 +0300
+Date: 2023-01-26 18:29:17 +0200
- xz: Use POSIX_FADV_RANDOM for in "xz --list" mode.
+ xz: Add SIGTSTP handler for progress indicator time keeping.
+
+ This way, if xz is stopped the elapsed time and estimated time
+ remaining won't get confused by the amount of time spent in
+ the stopped state.
+
+ This raises SIGSTOP. It's not clear to me if this is the correct way.
+ POSIX and glibc docs say that SIGTSTP shouldn't stop the process if
+ it is orphaned but this commit doesn't attempt to handle that.
+
+ Search for SIGTSTP in section 2.4.3:
- xz --list is random access so POSIX_FADV_SEQUENTIAL was clearly
- wrong.
+ https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
- src/xz/file_io.c | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ src/xz/mytime.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ src/xz/mytime.h | 6 ++++++
+ src/xz/private.h | 12 ++++++++++++
+ src/xz/signals.c | 17 ++++++++++++++++-
+ 4 files changed, 89 insertions(+), 2 deletions(-)
-commit 310d19816d1652b0c8bb1b82574d46345d924752
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 20:03:05 +0300
+commit 3b1c8ac8d1d553cbb1fb22b545d2b1424c752b76
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-27 20:14:51 +0800
- liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs.
+ Translations: Add Brazilian Portuguese translation of man pages.
- This is to allow other functions to use it without going
- via the public API (lzma_index_decoder()).
+ Thanks to Rafael Fontenelle.
- src/liblzma/common/Makefile.inc | 1 +
- src/liblzma/common/index_decoder.c | 10 +++++-----
- src/liblzma/common/index_decoder.h | 24 ++++++++++++++++++++++++
- 3 files changed, 30 insertions(+), 5 deletions(-)
+ po4a/po4a.conf | 2 +-
+ po4a/pt_BR.po | 3677 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 3678 insertions(+), 1 deletion(-)
-commit a27920002dbc469f778a134fc665b7c3ea73701b
+commit a15a7552f9f67c4e402f5d2967324e0ccfd6fccc
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 20:00:09 +0300
+Date: 2023-01-26 17:51:06 +0200
- liblzma: Add generic support for input seeking (LZMA_SEEK).
-
- Also mention LZMA_SEEK in xz/message.c to silence a warning.
+ Build: Avoid different quoting style in --enable-doxygen doc.
- src/liblzma/api/lzma/base.h | 31 ++++++++++++++++++++++++++++++-
- src/liblzma/common/common.c | 12 +++++++++++-
- src/xz/message.c | 1 +
- 3 files changed, 42 insertions(+), 2 deletions(-)
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
-commit a0b1dda409bc3e6e2957a2651663fc411d2caf2d
+commit af5a4bd5afc089d9697756dded38feafaa987ae4
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 19:47:45 +0300
+Date: 2023-01-26 17:39:46 +0200
- liblzma: Fix lzma_memlimit_set(strm, 0).
-
- The 0 got treated specially in a buggy way and as a result
- the function did nothing. The API doc said that 0 was supposed
- to return LZMA_PROG_ERROR but it didn't.
-
- Now 0 is treated as if 1 had been specified. This is done because
- 0 is already used to indicate an error from lzma_memlimit_get()
- and lzma_memusage().
+ tuklib_physmem: Check for __has_warning before GCC version.
- In addition, lzma_memlimit_set() no longer checks that the new
- limit is at least LZMA_MEMUSAGE_BASE. It's counter-productive
- for the Index decoder and was actually needed only by the
- auto decoder. Auto decoder has now been modified to check for
- LZMA_MEMUSAGE_BASE.
+ Clang can be configured to fake a too high GCC version so
+ this way it's more robust.
- src/liblzma/api/lzma/base.h | 7 ++++++-
- src/liblzma/common/auto_decoder.c | 3 +++
- src/liblzma/common/common.c | 6 ++++--
- 3 files changed, 13 insertions(+), 3 deletions(-)
+ src/common/tuklib_physmem.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 84462afaada61379f5878e46f8f00e25a1cdcf29
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 19:16:55 +0300
+commit f35d98e20609e0be6a04ae2604bfb7cb9d5bd5e4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-24 20:48:50 +0800
- liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder.
+ liblzma: Fix documentation in filter.h for lzma_str_to_filters()
+
+ The previous documentation for lzma_str_to_filters() was technically
+ correct, but misleading. lzma_str_to_filters() returns NULL on success,
+ which is in practice always defined to 0. This is the same value as
+ LZMA_OK, but lzma_str_to_filters() does not return lzma_ret so we should
+ be more clear.
- src/liblzma/api/lzma/container.h | 21 +++++++++++++++++----
- src/liblzma/common/alone_decoder.c | 5 +----
- src/liblzma/common/auto_decoder.c | 5 +----
- src/liblzma/common/stream_decoder.c | 5 +----
- 4 files changed, 20 insertions(+), 16 deletions(-)
+ src/liblzma/api/lzma/filter.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit cbc74017939690d13441b8926bb743fb03211b83
+commit 2f78ecc5939b3d97ddfc2a6bd31b50108a28d0a2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2017-03-30 18:58:18 +0300
+Date: 2023-01-23 23:44:58 +0200
- liblzma: Fix handling of memlimit == 0 in lzma_index_decoder().
+ Revert "tuklib_common: Define __has_warning if it is not defined."
- It returned LZMA_PROG_ERROR, which was done to avoid zero as
- the limit (because it's a special value elsewhere), but using
- LZMA_PROG_ERROR is simply inconvenient and can cause bugs.
+ This reverts commit 82e3c968bfa10e3ff13333bd9cbbadb5988d6766.
- The fix/workaround is to treat 0 as if it were 1 byte. It's
- effectively the same thing. The only weird consequence is
- that then lzma_memlimit_get() will return 1 even when 0 was
- specified as the limit.
+ Macros in the reserved namespace (_foo or __foo) shouldn't be #defined
+ without a very good reason. Here the alternative would have been
+ to #define tuklib_has_warning(str) to an approriate value.
- This fixes a very rare corner case in xz --list where a specific
- memory usage limit and a multi-stream file could print the
- error message "Internal error (bug)" instead of saying that
- the memory usage limit is too low.
+ Also the tuklib_* files should stay namespace clean if possible.
- src/liblzma/api/lzma/index.h | 18 +++++++++++-------
- src/liblzma/common/index_decoder.c | 4 ++--
- 2 files changed, 13 insertions(+), 9 deletions(-)
+ src/common/tuklib_common.h | 7 -------
+ 1 file changed, 7 deletions(-)
-commit 78ae13bced912b1b92ae927992c99cbcc463cae7
+commit 8366cf8738e8b7bb74c967d07bf0fd2a1878e575
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-12-30 13:25:10 +0200
+Date: 2023-01-23 23:38:34 +0200
- Update NEWS for 5.2.3.
+ tuklib_physmem: Clean up the way -Wcast-function-type is silenced on Windows.
+
+ __has_warning and other __has_foo macros are meant to become
+ compiler-agnostic so it's not good to check for __clang__ with it.
+
+ This also relied on tuklib_common.h for #defining __has_warning
+ which was confusing as #defining reserved macros is generally
+ not a good idea.
- NEWS | 39 +++++++++++++++++++++++++++++++++++++++
- 1 file changed, 39 insertions(+)
+ src/common/tuklib_physmem.c | 17 +++++++++++++----
+ 1 file changed, 13 insertions(+), 4 deletions(-)
-commit 0297863fdb453aed1a25eb025f3ba7bacbbb1357
+commit 683a3c7e2fcd922200c31078e5c9dd1348e90941
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-12-26 20:55:52 +0200
+Date: 2023-01-24 00:05:38 +0200
- Document --enable-sandbox configure option in INSTALL.
+ xz: Flip the return value of suffix_is_set to match the documentation.
+
+ Also edit style to match the existing coding style in the project.
- INSTALL | 23 +++++++++++++++++++++++
- 1 file changed, 23 insertions(+)
+ src/xz/args.c | 6 +++---
+ src/xz/suffix.c | 2 +-
+ src/xz/suffix.h | 1 +
+ 3 files changed, 5 insertions(+), 4 deletions(-)
-commit d4a0462abe5478193521c14625e1c81fead87f9f
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-11-21 20:24:50 +0200
-
- liblzma: Avoid multiple definitions of lzma_coder structures.
-
- Only one definition was visible in a translation unit.
- It avoided a few casts and temp variables but seems that
- this hack doesn't work with link-time optimizations in compilers
- as it's not C99/C11 compliant.
-
- Fixes:
- http://www.mail-archive.com/xz-devel@tukaani.org/msg00279.html
-
- src/liblzma/common/alone_decoder.c | 44 +++++----
- src/liblzma/common/alone_encoder.c | 34 ++++---
- src/liblzma/common/auto_decoder.c | 35 ++++---
- src/liblzma/common/block_decoder.c | 41 ++++----
- src/liblzma/common/block_encoder.c | 40 ++++----
- src/liblzma/common/common.h | 18 ++--
- src/liblzma/common/index_decoder.c | 33 ++++---
- src/liblzma/common/index_encoder.c | 16 ++--
- src/liblzma/common/stream_decoder.c | 50 +++++-----
- src/liblzma/common/stream_encoder.c | 56 ++++++-----
- src/liblzma/common/stream_encoder_mt.c | 124 ++++++++++++++-----------
- src/liblzma/delta/delta_common.c | 25 ++---
- src/liblzma/delta/delta_decoder.c | 6 +-
- src/liblzma/delta/delta_encoder.c | 12 ++-
- src/liblzma/delta/delta_private.h | 4 +-
- src/liblzma/lz/lz_decoder.c | 60 ++++++------
- src/liblzma/lz/lz_decoder.h | 13 ++-
- src/liblzma/lz/lz_encoder.c | 57 +++++++-----
- src/liblzma/lz/lz_encoder.h | 9 +-
- src/liblzma/lzma/lzma2_decoder.c | 32 ++++---
- src/liblzma/lzma/lzma2_encoder.c | 51 +++++-----
- src/liblzma/lzma/lzma_decoder.c | 27 +++---
- src/liblzma/lzma/lzma_encoder.c | 29 +++---
- src/liblzma/lzma/lzma_encoder.h | 9 +-
- src/liblzma/lzma/lzma_encoder_optimum_fast.c | 3 +-
- src/liblzma/lzma/lzma_encoder_optimum_normal.c | 23 ++---
- src/liblzma/lzma/lzma_encoder_private.h | 6 +-
- src/liblzma/simple/arm.c | 2 +-
- src/liblzma/simple/armthumb.c | 2 +-
- src/liblzma/simple/ia64.c | 2 +-
- src/liblzma/simple/powerpc.c | 2 +-
- src/liblzma/simple/simple_coder.c | 61 ++++++------
- src/liblzma/simple/simple_private.h | 12 +--
- src/liblzma/simple/sparc.c | 2 +-
- src/liblzma/simple/x86.c | 15 +--
- 35 files changed, 532 insertions(+), 423 deletions(-)
-
-commit a01794c52add98263b49119842c3e7141d1b9ced
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-10-24 18:53:25 +0300
+commit cc5aa9ab138beeecaee5a1e81197591893ee9ca0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-07 21:55:06 +0800
- Update THANKS.
+ xz: Refactor duplicated check for custom suffix when using --format=raw
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/xz/args.c | 8 ++++++++
+ src/xz/suffix.c | 26 ++++++++------------------
+ src/xz/suffix.h | 7 +++++++
+ 3 files changed, 23 insertions(+), 18 deletions(-)
-commit df8f446e3ad47e5148b8c8d8b6e519d3ce29cb9d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-10-24 18:51:36 +0300
+commit 9663141274e01592a281a7f2df5d7a31a1dac8bf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-20 21:53:14 +0800
- tuklib_cpucores: Add support for sched_getaffinity().
-
- It's available in glibc (GNU/Linux, GNU/kFreeBSD). It's better
- than sysconf(_SC_NPROCESSORS_ONLN) because sched_getaffinity()
- gives the number of cores available to the process instead of
- the total number of cores online.
+ liblzma: Set documentation on all reserved fields to private.
- As a side effect, this commit fixes a bug on GNU/kFreeBSD where
- configure would detect the FreeBSD-specific cpuset_getaffinity()
- but it wouldn't actually work because on GNU/kFreeBSD it requires
- using -lfreebsd-glue when linking. Now the glibc-specific function
- will be used instead.
+ This prevents the reserved fields from being part of the generated
+ Doxygen documentation.
+
+ src/liblzma/api/lzma/base.h | 17 +++++++++++++++
+ src/liblzma/api/lzma/block.h | 43 +++++++++++++++++++++++++++++++++++++
+ src/liblzma/api/lzma/container.h | 24 +++++++++++++++++++++
+ src/liblzma/api/lzma/delta.h | 12 +++++++++++
+ src/liblzma/api/lzma/index.h | 27 +++++++++++++++++++++++
+ src/liblzma/api/lzma/lzma12.h | 22 +++++++++++++++++++
+ src/liblzma/api/lzma/stream_flags.h | 28 ++++++++++++++++++++++++
+ 7 files changed, 173 insertions(+)
+
+commit 6327a045f34d48fc5afc58ba0d32a82c94403049
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-20 21:39:59 +0800
+
+ Doxygen: Update Doxyfile.in from 1.4.7 to 1.8.17.
- Thanks to Sebastian Andrzej Siewior for the original patch
- and testing.
+ A few Doxygen tags were obsolete from 1.4.7. Version 1.8.17 released
+ in 2019, so this should be compatible with resonable modern distros.
+ The purpose of Doxygen these days is for docs on the website, so it
+ doesn't necessarily have to work for everyone. Just when the maintainers
+ want to update the docs.
- m4/tuklib_cpucores.m4 | 30 +++++++++++++++++++++++++++++-
- src/common/tuklib_cpucores.c | 9 +++++++++
- 2 files changed, 38 insertions(+), 1 deletion(-)
+ Doxyfile.in | 2523 ++++++++++++++++++++++++++++++++++++++++++++---------------
+ 1 file changed, 1893 insertions(+), 630 deletions(-)
-commit 446e4318fa79788e09299d5953b5dd428953d14b
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-06-30 20:27:36 +0300
+commit bbf71b69ebf9d0d62a0af150a5c37d193b8159ad
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-03 20:37:30 +0800
- xz: Fix copying of timestamps on Windows.
+ Doxygen: Make Doxygen only produce liblzma API documentation by default.
- xz used to call utime() on Windows, but its result gets lost
- on close(). Using _futime() seems to work.
+ Doxygen is now configurable in autotools only with
+ --enable-doxygen=[api|all]. The default is "api", which will only
+ generate HTML output for liblzma API functions. The LaTex documentation
+ output was also disabled.
+
+ Doxyfile.in | 18 +++++++++---------
+ configure.ac | 39 +++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 48 insertions(+), 9 deletions(-)
+
+commit 6fcf4671b6047113c583a0919fc850987a4ec5f4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-21 23:59:43 +0800
+
+ liblzma: Highlight liblzma API headers should not be included directly.
- Thanks to Martok for reporting the bug:
- http://www.mail-archive.com/xz-devel@tukaani.org/msg00261.html
+ This improves the generated Doxygen HTML files to better highlight
+ how to properly use the liblzma API header files.
- configure.ac | 2 +-
- src/xz/file_io.c | 18 ++++++++++++++++++
- 2 files changed, 19 insertions(+), 1 deletion(-)
+ src/liblzma/api/lzma/base.h | 5 +++--
+ src/liblzma/api/lzma/bcj.h | 5 +++--
+ src/liblzma/api/lzma/block.h | 5 +++--
+ src/liblzma/api/lzma/check.h | 5 +++--
+ src/liblzma/api/lzma/container.h | 5 +++--
+ src/liblzma/api/lzma/delta.h | 5 +++--
+ src/liblzma/api/lzma/filter.h | 5 +++--
+ src/liblzma/api/lzma/hardware.h | 5 +++--
+ src/liblzma/api/lzma/index.h | 5 +++--
+ src/liblzma/api/lzma/index_hash.h | 5 +++--
+ src/liblzma/api/lzma/lzma12.h | 5 +++--
+ src/liblzma/api/lzma/stream_flags.h | 5 +++--
+ src/liblzma/api/lzma/version.h | 5 +++--
+ src/liblzma/api/lzma/vli.h | 5 +++--
+ 14 files changed, 42 insertions(+), 28 deletions(-)
-commit 1b0ac0c53c761263e91e34195cb21dfdcfeac0bd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-06-16 22:46:02 +0300
+commit b43ff180fb2e372adce876bfa155fc9bcf0c3db4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-19 20:35:09 +0800
- xz: Silence warnings from -Wlogical-op.
+ tuklib_physmem: Silence warning from -Wcast-function-type on MinGW-w64.
- Thanks to Evan Nemerson.
+ tuklib_physmem depends on GetProcAddress() for both MSVC and MinGW-w64
+ to retrieve a function address. The proper way to do this is to cast the
+ return value to the type of function pointer retrieved. Unfortunately,
+ this causes a cast-function-type warning, so the best solution is to
+ simply ignore the warning.
- src/xz/file_io.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
+ src/common/tuklib_physmem.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
-commit c83b7a03342c3325ff10400b22ee21edfcd1e026
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-04-10 20:55:49 +0300
+commit 82e3c968bfa10e3ff13333bd9cbbadb5988d6766
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-19 20:32:40 +0800
- Build: Fix = to += for xz_SOURCES in src/xz/Makefile.am.
+ tuklib_common: Define __has_warning if it is not defined.
- Thanks to Christian Kujau.
+ clang supports the __has_warning macro to determine if the version of
+ clang compiling the code supports a given warning. If we do not define
+ it for other compilers, it may cause a preprocessor error.
- src/xz/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ src/common/tuklib_common.h | 7 +++++++
+ 1 file changed, 7 insertions(+)
-commit ade31a2bfb95c94d05fbfc0ecbba5d6377f2506e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-04-10 20:54:17 +0300
+commit b2ba1a489df451cdcd93b2334e319dd06778de19
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-18 22:11:05 +0800
- Build: Bump GNU Gettext version requirement to 0.19.
+ CI: Reorder 32-bit build first for Linux autotool builds.
- It silences a few warnings and most people probably have
- 0.19 even on stable distributions.
+ The 32-bit build needs to be first so the configure cache only needs to
+ be reset one time. The 32-bit build sets the CFLAGS env variable, so any
+ build using that flag after will fail unless the cache is reset.
+
+ .github/workflows/ci.yml | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+commit dd1c1135741057c91e8d018be9ec4d43968b0e64
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-18 21:51:43 +0800
+
+ CI: Enable --config-cache in autotool builds.
- Thanks to Christian Kujau.
+ If CFLAGS are set in a build, the cache must be cleared with
+ "make distclean", or by deleting the cache file.
- configure.ac | 2 +-
+ build-aux/ci_build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-commit ac398c3bafa6e4c80e20571373a96947db863b3d
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-03-13 20:21:49 +0200
+commit d3e11477053764c003eec2daa5198c747d70ff69
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-16 21:35:45 +0800
- liblzma: Disable external SHA-256 by default.
-
- This is the sane thing to do. The conflict with OpenSSL
- on some OSes and especially that the OS-provided versions
- can be significantly slower makes it clear that it was
- a mistake to have the external SHA-256 support enabled by
- default.
-
- Those who want it can now pass --enable-external-sha256 to
- configure. INSTALL was updated with notes about OSes where
- this can be a bad idea.
-
- The SHA-256 detection code in configure.ac had some bugs that
- could lead to a build failure in some situations. These were
- fixed, although it doesn't matter that much now that the
- external SHA-256 is disabled by default.
+ xz: Add missing comment for coder_set_compression_settings()
+
+ src/xz/coder.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 123255b6ed15f4428b2aa92e4962015a5362f6bf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-16 20:55:10 +0800
+
+ xz: Do not set compression settings with raw format in list mode.
- MINIX >= 3.2.0 uses NetBSD's libc and thus has SHA256_Init
- in libc instead of libutil. Support for the libutil version
- was removed.
+ Calling coder_set_compression_settings() in list mode with verbose mode
+ on caused the filter chain and memory requirements to print. This was
+ unnecessary since the command results in an error and not consistent
+ with other formats like lzma and alone.
- INSTALL | 36 ++++++++++++++++++++++
- configure.ac | 76 +++++++++++++++++++++++------------------------
- src/liblzma/check/check.h | 16 ++++------
- 3 files changed, 79 insertions(+), 49 deletions(-)
+ src/xz/args.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
-commit 6fd5ecb589a9fdd7a576ea48c4850d496bab9ce5
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-03-10 20:27:05 +0200
+commit 571919c47b9ff5171ede84378620ed0a9aeb98c0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-13 20:37:06 +0800
- Update THANKS.
+ Translations: Update the Brazilian Portuguese translation.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ po/pt_BR.po | 603 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 344 insertions(+), 259 deletions(-)
-commit 473ef0dc69a30e64d5fa0d34aca02f7309faa3e9
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2016-03-10 20:26:49 +0200
+commit 81cb02e2c22bbc036cdfaa2d2c4176f6bd60d3cf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 23:43:06 +0800
- Build: Avoid SHA256_Init on FreeBSD and MINIX 3.
-
- On FreeBSD 10 and older, SHA256_Init from libmd conflicts
- with libcrypto from OpenSSL. The OpenSSL version has
- different sizeof(SHA256_CTX) and it can cause weird
- problems if wrong SHA256_Init gets used.
+ CI: Disable shared and nls from various jobs in autotool runners.
- Looking at the source, MINIX 3 seems to have a similar issue but
- I'm not sure. To be safe, I disabled SHA256_Init on MINIX 3 too.
+ Disabling shared library generation and linking should help speed up the
+ runners. The shared library is still being tested in the 32 bit build
+ and the full feature.
- NetBSD has SHA256_Init in libc and they had a similar problem,
- but they already fixed it in 2009.
+ Disabling nls is to check for any unexpected warnings or errors.
+
+ .github/workflows/ci.yml | 56 ++++++++++++++++++++++++------------------------
+ 1 file changed, 28 insertions(+), 28 deletions(-)
+
+commit 58a052198a7bcaf6e958f87fad72e69e19a2579b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 23:39:19 +0800
+
+ CI: Reorder the 32-bit job in the Ubuntu runner.
- Thanks to Jim Wilcoxson for the bug report that helped
- in finding the problem.
+ Run the 32 bit job sooner since this is a more interesting test than
+ some of the later jobs.
- configure.ac | 27 +++++++++++++++++++++------
- 1 file changed, 21 insertions(+), 6 deletions(-)
+ .github/workflows/ci.yml | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
-commit faf302137e54d605b44ecf0373cb51a6403a2de1
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-08 20:16:10 +0200
+commit 4110a998b83459fe2bc9bc1bec30ad68afa8f797
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 23:09:03 +0800
- tuklib_physmem: Hopefully silence a warning on Windows.
+ CI: Allow disabling Native Language Support.
- src/common/tuklib_physmem.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ build-aux/ci_build.sh | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
-commit e52e9151cf8613022d1de4712ff39dbcb666e991
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-04 23:17:43 +0200
+commit 0dec634e705b5bf89a37c5d62d71e8511d480058
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 23:02:20 +0800
- Update THANKS.
+ CI: Only run autogen.sh if it has not already run.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ build-aux/ci_build.sh | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
-commit 14115f84a38161d55eaa2d070f08739bde37e966
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-04 23:14:00 +0200
+commit 32287dc8def94df4546e903495d14c132bd54cc4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 22:58:36 +0800
- liblzma: Make Valgrind happier with optimized (gcc -O2) liblzma.
-
- When optimizing, GCC can reorder code so that an uninitialized
- value gets used in a comparison, which makes Valgrind unhappy.
- It doesn't happen when compiled with -O0, which I tend to use
- when running Valgrind.
-
- Thanks to Rich Prohaska. I remember this being mentioned long
- ago by someone else but nothing was done back then.
+ CI: Allow disabling shared library in autotools builds.
- src/liblzma/lz/lz_encoder.c | 4 ++++
- 1 file changed, 4 insertions(+)
+ build-aux/ci_build.sh | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
-commit f4c95ba94beb71a608eb6eadbf82b44f53a0260e
+commit 77d1ebcc99ddd82a300d1838f608150221931dcd
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-12 22:44:18 +0800
+
+ CI: Improve Usage readability and add -h option.
+
+ build-aux/ci_build.sh | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+commit a8bb8358d10b059274f3cf993d9b8f490bafb268
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:55:45 +0200
+Date: 2023-01-12 13:04:05 +0200
- liblzma: Rename lzma_presets.c back to lzma_encoder_presets.c.
+ Build: Omit -Wmissing-noreturn from the default warnings.
- It would be too annoying to update other build systems
- just because of this.
+ It's not that important. It can be annoying in builds that
+ disable many features since in those cases the tests programs
+ will correctly trigger this warning with Clang.
- src/liblzma/lzma/Makefile.inc | 2 +-
- src/liblzma/lzma/{lzma_presets.c => lzma_encoder_presets.c} | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ configure.ac | 1 -
+ 1 file changed, 1 deletion(-)
-commit c7bc20a6f3e71920871d48db31a79ab58b5a0a4b
+commit 52dc033d0bde0d19e3912303c6c74bae559d6498
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:47:07 +0200
+Date: 2023-01-12 06:05:58 +0200
- Build: Disable xzdec, lzmadec, and lzmainfo when they cannot be built.
+ xz: Use ssize_t for the to-be-ignored return value from write(fd, ptr, 1).
- They all need decoder support and if that isn't available,
- there's no point trying to build them.
+ It makes no difference here as the return value fits into an int
+ too and it then gets ignored but this looks better.
- configure.ac | 3 +++
- 1 file changed, 3 insertions(+)
+ src/xz/file_io.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 5cbca1205deeb6fb7afe7a864fa68a57466d928a
+commit b1a6d180a363d57b2b1c89526ff3f0782bf863d3
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:35:19 +0200
+Date: 2023-01-12 06:01:12 +0200
- Build: Simplify $enable_{encoders,decoders} usage a bit.
+ xz: Silence warnings from -Wsign-conversion in a 32-bit build.
- configure.ac | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ src/common/tuklib_mbstr_fw.c | 2 +-
+ src/xz/list.c | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
-commit af13781886c8e7a0aabebb5141ea282dc364f5c6
+commit 31c21c734b7c7d7428a3da7402a2cb7bc2587339
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:31:31 +0200
+Date: 2023-01-12 05:38:48 +0200
- Windows/MSVC: Update config.h.
+ liblzma: Silence another warning from -Wsign-conversion in a 32-bit build.
+
+ It doesn't warn on a 64-bit system because truncating
+ a ptrdiff_t (signed long) to uint32_t is diagnosed under
+ -Wconversion by GCC and -Wshorten-64-to-32 by Clang.
- windows/config.h | 6 ++++++
- 1 file changed, 6 insertions(+)
+ src/liblzma/lz/lz_encoder_mf.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
-commit 9fa5949330f162c5a2f6653f83025327837e8f39
+commit 37fbdfb7263522c11c7ad2685413d6295532581d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:29:58 +0200
+Date: 2023-01-12 04:46:45 +0200
- DOS: Update config.h.
+ liblzma: Silence a warning from -Wsign-conversion in a 32-bit build.
- dos/config.h | 6 ++++++
- 1 file changed, 6 insertions(+)
+ src/common/mythread.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit cb3111e3ed84152912b5138d690c8d9f00c6ef02
+commit 5ce6ddc221d0bfb57d810d845bb65fb0aac0b008
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 20:29:33 +0200
+Date: 2023-01-12 04:17:24 +0200
- xz: Make xz buildable even when encoders or decoders are disabled.
+ Build: Make configure add more warning flags for GCC and Clang.
- The patch is quite long but it's mostly about adding new #ifdefs
- to omit code when encoders or decoders have been disabled.
+ -Wstrict-aliasing was removed from the list since it is enabled
+ by -Wall already.
- This adds two new #defines to config.h: HAVE_ENCODERS and
- HAVE_DECODERS.
+ A normal build is clean with these on GNU/Linux x86-64 with
+ GCC 12.2.0 and Clang 14.0.6.
- configure.ac | 4 ++++
- src/xz/Makefile.am | 8 ++++++--
- src/xz/args.c | 16 ++++++++++++++++
- src/xz/coder.c | 33 +++++++++++++++++++++++++--------
- src/xz/main.c | 9 +++++++--
- src/xz/private.h | 5 ++++-
- 6 files changed, 62 insertions(+), 13 deletions(-)
+ configure.ac | 36 +++++++++++++++++++++++++++++++-----
+ 1 file changed, 31 insertions(+), 5 deletions(-)
-commit 4cc584985c0b7a13901da1b7a64ef9f7cc36e8ab
+commit bfc3a0a8ac16de90049c1b1ba1445a7626d0230c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 18:06:40 +0200
+Date: 2023-01-12 04:14:18 +0200
- Build: Build LZMA1/2 presets also when only decoder is wanted.
+ Tests: Fix warnings from clang --Wassign-enum.
- People shouldn't rely on the presets when decoding raw streams,
- but xz uses the presets as the starting point for raw decoder
- options anyway.
+ Explicitly casting the integer to lzma_check silences the warning.
+ Since such an invalid value is needed in multiple tests, a constant
+ INVALID_LZMA_CHECK_ID was added to tests.h.
- lzma_encocder_presets.c was renamed to lzma_presets.c to
- make it clear it's not used solely by the encoder code.
+ The use of 0x1000 for lzma_block.check wasn't optimal as if
+ the underlying type is a char then 0x1000 will be truncated to 0.
+ However, in these test cases the value is ignored, thus even with
+ such truncation the test would have passed.
- src/liblzma/lzma/Makefile.inc | 6 +++++-
- src/liblzma/lzma/{lzma_encoder_presets.c => lzma_presets.c} | 3 ++-
- 2 files changed, 7 insertions(+), 2 deletions(-)
+ tests/test_block_header.c | 6 +++---
+ tests/test_check.c | 2 +-
+ tests/test_stream_flags.c | 8 ++++----
+ tests/tests.h | 9 +++++++++
+ 4 files changed, 17 insertions(+), 8 deletions(-)
-commit 23ed1d41489f632155bbc9660f323d57e09da180
+commit 49245bb31e215ad455a1ab85e4ed6783152dc522
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 17:54:48 +0200
+Date: 2023-01-12 03:51:07 +0200
- Build: Fix configure to handle LZMA1 dependency with LZMA2.
+ Tests: Silence warnings from -Wsign-conversion.
- Now it gives an error if LZMA1 encoder/decoder is missing
- when LZMA2 encoder/decoder was requested. Even better would
- be LZMA2 implicitly enabling LZMA1 but it would need more code.
+ Note that assigning an unsigned int to lzma_check doesn't warn
+ on GNU/Linux x86-64 since the enum type is unsigned on that
+ platform. The enum can be signed on some other platform though
+ so it's best to use enumeration type lzma_check in these situations.
- configure.ac | 5 -----
- 1 file changed, 5 deletions(-)
+ tests/test_check.c | 6 +++---
+ tests/test_stream_flags.c | 10 +++++-----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
-commit b0bc3e03852af13419ea2960881824258d451117
+commit 3f13bf6b9e8624cbe6d6e3e82d6c98a3ed1ad571
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-03 17:41:54 +0200
+Date: 2023-01-12 03:19:59 +0200
- Build: Don't omit lzma_cputhreads() unless using --disable-threads.
+ liblzma: Silence warnings from clang -Wconditional-uninitialized.
- Previously it was omitted if encoders were disabled
- with --disable-encoders. It didn't make sense and
- it also broke the build.
+ This is similar to 2ce4f36f179a81d0c6e182a409f363df759d1ad0.
+ The actual initialization of the variables is done inside
+ mythread_sync() macro. Clang doesn't seem to see that
+ the initialization code inside the macro is always executed.
- src/liblzma/common/Makefile.inc | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ src/liblzma/common/stream_decoder_mt.c | 8 +++++---
+ src/liblzma/common/stream_encoder_mt.c | 2 +-
+ 2 files changed, 6 insertions(+), 4 deletions(-)
-commit c6bf438ab39e0fb4a47d3c81725c227919502726
+commit 6c886cc5b3c90c6a75e6be8b1278ec2261e452a6
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-02 18:16:51 +0200
+Date: 2023-01-12 03:11:40 +0200
- liblzma: Fix a build failure related to external SHA-256 support.
-
- If an appropriate header and structure were found by configure,
- but a library with a usable SHA-256 functions wasn't, the build
- failed.
+ Fix warnings from clang -Wdocumentation.
- src/liblzma/check/check.h | 32 +++++++++++++++++++++++---------
- 1 file changed, 23 insertions(+), 9 deletions(-)
+ src/liblzma/check/check.h | 4 ----
+ src/liblzma/lz/lz_encoder_mf.c | 4 ++--
+ src/xz/options.c | 4 ++--
+ 3 files changed, 4 insertions(+), 8 deletions(-)
-commit e18adc56f2262aa9394d46681e9e4b9981ed5e97
+commit a0e7fb1c1ea658b67f30517f5d1975efd0226dba
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-11-02 15:19:10 +0200
+Date: 2023-01-12 03:04:28 +0200
- xz: Always close the file before trying to delete it.
-
- unlink() can return EBUSY in errno for open files on some
- operating systems and file systems.
+ Tests: test_lzip_decoder: Remove trailing white-space.
- src/xz/file_io.c | 25 ++++++++++++-------------
- 1 file changed, 12 insertions(+), 13 deletions(-)
+ tests/test_lzip_decoder.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 282e768a1484e88c8b7ec35655ee4959954ec87a
+commit c0f8d6782f29e219fd496dd23f6a033270509d5c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-10-12 21:08:42 +0300
+Date: 2023-01-12 03:03:55 +0200
- Update THANKS.
+ Tests: test_lzip_decoder: Silence warnings from -Wsign-conversion.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ tests/test_lzip_decoder.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
-commit 372e402713a1d4337ffce5f56d5c5c9ed99a66d0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-10-12 21:07:41 +0300
+commit 62efd48a825e8f439e84c85e165d8774ddc68fd2
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 23:58:16 +0800
- Tests: Add tests for the two bugs fixed in index.c.
+ Add NEWS for 5.4.1.
- tests/test_index.c | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
+ NEWS | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 70 insertions(+)
-commit 21515d79d778b8730a434f151b07202d52a04611
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-10-12 20:45:15 +0300
+commit d1561c47ec8cd3844a785d3741dc932f9b9c5790
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 22:46:48 +0800
- liblzma: Fix lzma_index_dup() for empty Streams.
+ xz: Fix warning -Wformat-nonliteral on clang in message.c.
- Stream Flags and Stream Padding weren't copied from
- empty Streams.
+ clang and gcc differ in how they handle -Wformat-nonliteral. gcc will
+ allow a non-literal format string as long as the function takes its
+ format arguments as a va_list.
- src/liblzma/common/index.c | 11 ++++++-----
- 1 file changed, 6 insertions(+), 5 deletions(-)
+ src/xz/message.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
-commit 09f395b6b360c0b13e8559eece1d179b908ebd3a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-10-12 20:31:44 +0300
+commit 8c0f115cc489331c48df77beca92fe378039d919
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 20:58:31 +0800
- liblzma: Add a note to index.c for those using static analyzers.
+ Tests: Fix test_filter_flags copy/paste error.
- src/liblzma/common/index.c | 3 +++
- 1 file changed, 3 insertions(+)
+ tests/test_filter_flags.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 3bf857edfef51374f6f3fffae3d817f57d3264a0
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-10-12 20:29:09 +0300
+commit 25035813d1d596fde692addc33e7f715f1fe55eb
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 20:42:29 +0800
- liblzma: Fix a memory leak in error path of lzma_index_dup().
-
- lzma_index_dup() calls index_dup_stream() which, in case of
- an error, calls index_stream_end() to free memory allocated
- by index_stream_init(). However, it illogically didn't
- actually free the memory. To make it logical, the tree
- handling code was modified a bit in addition to changing
- index_stream_end().
+ Tests: Fix type-limits warning in test_filter_flags.
- Thanks to Evan Nemerson for the bug report.
+ This only occurs in test_filter_flags when the BCJ filters are not
+ configured and built. In this case, ARRAY_SIZE() returns 0 and causes a
+ type-limits warning with the loop variable since an unsigned number will
+ always be >= 0.
- src/liblzma/common/index.c | 18 +++++++++---------
- 1 file changed, 9 insertions(+), 9 deletions(-)
+ tests/test_filter_flags.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
-commit 7f05803979b4b79642d5be4218a79da7a0b12c47
+commit 0b8fa310cf56fec55663f62340e49e8e1441594f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-09-29 13:57:28 +0300
+Date: 2023-01-10 22:14:03 +0200
- Update NEWS for 5.2.2.
+ liblzma: CLMUL CRC64: Work around a bug in MSVC, second attempt.
+
+ This affects only 32-bit x86 builds. x86-64 is OK as is.
+
+ I still cannot easily test this myself. The reporter has tested
+ this and it passes the tests included in the CMake build and
+ performance is good: raw CRC64 is 2-3 times faster than the
+ C version of the slice-by-four method. (Note that liblzma doesn't
+ include a MSVC-compatible version of the 32-bit x86 assembly code
+ for the slice-by-four method.)
+
+ Thanks to Iouri Kharon for figuring out a fix, testing, and
+ benchmarking.
- NEWS | 18 ++++++++++++++++++
+ src/liblzma/check/crc64_fast.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
-commit 397fcc0946315b55c3c6d80e37e82a2a78bc15c1
-Author: Hauke Henningsen <sqrt@entless.org>
-Date: 2015-08-17 04:59:54 +0200
+commit 765354b50c2886fc0d294d6be3b207f7ae2ada70
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 01:18:50 +0800
+
+ Tests: Fix unused function warning in test_block_header.
+
+ One of the global arrays of filters was only used in a test that
+ required both encoders and decoders to be configured in the build.
+
+ tests/test_block_header.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 7c23c05befdcc73231c0d6632a7d943dbeaea1aa
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 01:08:03 +0800
+
+ Tests: Fix unused function warning in test_index_hash.
+
+ test_index_hash does not use fill_index_hash() unless both encoders
+ and decoders are configured in the build.
+
+ tests/test_index_hash.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+commit 57464bb4ebd6c00dc8b19803f05ea55ddd0826f6
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 00:54:45 +0800
- Update German translation, mostly wrt orthography
+ CI/CD: Add 32-bit build and test steps to Ubuntu autotools runner.
- Provide an update of the German translation.
- * A lot of compound words were previously written with spaces, while
- German orthography is relatively clear in that the components
- should not be separated.
- * When referring to the actual process of (de)compression rather than the
- concept, replace “(De-)Kompression” with “(De-)Komprimierung”.
- Previously, both forms were used in this context and are now used in a
- manner consistent with “Komprimierung” being more likely to refer to
- a process.
- * Consistently translate “standard input”/“output”
- * Use “Zeichen” instead of false friend “Charakter” for “character”
- * Insert commas around relative clauses (as required in German)
- * Some other minor corrections
- * Capitalize “ß” as “ẞ”
- * Consistently start option descriptions in --help with capital letters
+ If all goes well, Mac autotools and Linux and Mac CMake will be added
+ later for 32-bit builds.
+
+ .github/workflows/ci.yml | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+commit 923eb689a4b863b6cca8df6360d4962aae994edf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 00:51:01 +0800
+
+ CI/CD: Enables warnings as errors in autotool build.
- Acked-By: Andre Noll <maan@tuebingen.mpg.de>
+ This will help us catch warnings and potential bugs in builds that are
+ not often tested by us.
+
+ build-aux/ci_build.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+commit feae5528a30c006b6e2f96a95116e20b983703fc
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-11 00:48:35 +0800
+
+ CI/CD: Add -f argument to set CFLAGS in ci_build.sh.
- * Update after msgmerge
+ For now, the suggested option is for -m32 only, but this can be updated
+ later if other flags are deemed useful.
- po/de.po | 383 ++++++++++++++++++++++++++++++++-------------------------------
- 1 file changed, 196 insertions(+), 187 deletions(-)
+ build-aux/ci_build.sh | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit cbc9e39bae715accb44168930a71888480aad569
+commit cfabb62a4874c146e7d6f30445637602545bc054
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-08-11 13:23:04 +0300
+Date: 2023-01-10 12:47:16 +0200
- Build: Minor Cygwin cleanup.
+ Revert "liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022)."
+
+ This reverts commit 36edc65ab4cf10a131f239acbd423b4510ba52d5.
- Some tests used "cygwin*" and some used "cygwin". I changed
- them all to use "cygwin". Shouldn't affect anything in practice.
+ It was reported that it wasn't a good enough fix and MSVC
+ still produced (different kind of) bad code when building
+ for 32-bit x86 if optimizations are enabled.
+
+ Thanks to Iouri Kharon.
- configure.ac | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ src/liblzma/check/crc64_fast.c | 6 ------
+ 1 file changed, 6 deletions(-)
-commit bcacd8ce7a031566858e5e03c1009064c3f1c89e
+commit 0b64215170dd3562f207ef26f794755bcd600526
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-08-11 13:21:52 +0300
+Date: 2023-01-10 11:56:11 +0200
- Build: Support building of MSYS2 binaries.
+ sysdefs.h: Don't include strings.h anymore.
+
+ On some platforms src/xz/suffix.c may need <strings.h> for
+ strcasecmp() but suffix.c includes the header when it needs it.
+
+ Unless there is an old system that otherwise supports enough C99
+ to build XZ Utils but doesn't have C89/C90-compatible <string.h>,
+ there should be no need to include <strings.h> in sysdefs.h.
- configure.ac | 16 +++++++++++-----
- 1 file changed, 11 insertions(+), 5 deletions(-)
+ src/common/sysdefs.h | 6 ------
+ 1 file changed, 6 deletions(-)
-commit 0275a5398c01d57b724dec7fea52dec3bd6edc6c
+commit ec2fc39fe4f4e6e242b3a669585049763968cdeb
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-08-09 21:06:26 +0300
+Date: 2023-01-10 11:23:41 +0200
- Windows: Define DLL_EXPORT when building liblzma.dll with MSVC.
+ xz: Include <strings.h> in suffix.c if needed for strcasecmp().
- src/liblzma/common/common.h uses it to set __declspec(dllexport)
- for the API symbols.
+ SUSv2 and POSIX.1‐2017 declare only a few functions in <strings.h>.
+ Of these, strcasecmp() is used on some platforms in suffix.c.
+ Nothing else in the project needs <strings.h> (at least if
+ building on a modern system).
+
+ sysdefs.h currently includes <strings.h> if HAVE_STRINGS_H is
+ defined and suffix.c relied on this.
- Thanks to Adam Walling.
+ Note that dos/config.h doesn't #define HAVE_STRINGS_H even though
+ DJGPP does have strings.h. It isn't needed with DJGPP as strcasecmp()
+ is also in <string.h> in DJGPP.
- windows/liblzma_dll.vcxproj | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ src/xz/suffix.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit a74525cf9b945fb0b370e64cf406104beb31729b
+commit 7049c4a76c805ad27d6cf4ee119a2ef2a7add59f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-08-09 21:02:20 +0300
+Date: 2023-01-10 10:05:13 +0200
- Windows: Omit unneeded header files from MSVC project files.
+ sysdefs.h: Fix a comment.
- windows/liblzma.vcxproj | 5 -----
- windows/liblzma_dll.vcxproj | 5 -----
- 2 files changed, 10 deletions(-)
+ src/common/sysdefs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit fbbb295a91caf39faf8838c8c39526e4cb4dc121
+commit 194a5fab69277d9e804a6113b5f676b8666b3a61
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-07-12 20:48:19 +0300
+Date: 2023-01-10 10:04:06 +0200
- liblzma: A MSVC-specific hack isn't needed with MSVC 2013 and newer.
+ sysdefs.h: Don't include memory.h anymore even if it were available.
+
+ It quite probably was never needed, that is, any system where memory.h
+ was required likely couldn't compile XZ Utils for other reasons anyway.
+
+ XZ Utils 5.2.6 and later source packages were generated using
+ Autoconf 2.71 which no longer defines HAVE_MEMORY_H. So the code
+ being removed is no longer used anyway.
- src/liblzma/api/lzma.h | 18 +++++++++++++-----
- 1 file changed, 13 insertions(+), 5 deletions(-)
+ src/common/sysdefs.h | 8 ++------
+ 1 file changed, 2 insertions(+), 6 deletions(-)
-commit 713dbe5c230fe00865a54f5c32358ea30f9a1156
+commit 5e34774c31d1b7509b5cb77a3be9973adec59ea0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-06-19 20:38:55 +0300
+Date: 2023-01-10 08:29:32 +0200
- Update THANKS.
+ CMake: Fix appending to CMAKE_RC_FLAGS.
+
+ It's a string, not a list. It only worked when the variable was empty.
+
+ Thanks to Iouri Kharon.
- THANKS | 2 ++
- 1 file changed, 2 insertions(+)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 3a5d755d055d51f99c523b4c2952727e1e69cfa1
+commit 6e652ceb18c615c578c869db300fa0756788b4e0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-06-19 20:21:30 +0300
+Date: 2023-01-10 00:33:14 +0200
- Windows: Update the docs.
+ Windows: Update INSTALL-MSVC.txt to recommend CMake over project files.
- INSTALL | 29 ++++++++-----
- windows/INSTALL-MSVC.txt | 47 ++++++++++++++++++++++
- windows/{INSTALL-Windows.txt => INSTALL-MinGW.txt} | 2 +-
- 3 files changed, 67 insertions(+), 11 deletions(-)
+ windows/INSTALL-MSVC.txt | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
-commit b0798c6aa6184efcefd0bdcca20f96121a13feda
+commit 6b117d3b1fe91eb26d533ab16a2e552f84148d47
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-06-19 17:25:31 +0300
+Date: 2023-01-09 23:41:25 +0200
- Windows: Add MSVC project files for building liblzma.
+ CMake: Fix windres issues again.
- Thanks to Adam Walling for creating these files.
+ At least on some systems, GNU windres needs --use-temp-file
+ in addition to the \x20 hack to avoid spaces in the command line
+ argument. Hovever, that \x20 syntax is broken with llvm-windres
+ version 15.0.0 (results in "XZx20Utils") but luckily it works
+ with a regular space. Thus it is best to limit the workarounds
+ to GNU toolchain on Windows.
- windows/liblzma.vcxproj | 359 ++++++++++++++++++++++++++++++++++++++++
- windows/liblzma_dll.vcxproj | 388 ++++++++++++++++++++++++++++++++++++++++++++
- windows/xz_win.sln | 48 ++++++
- 3 files changed, 795 insertions(+)
+ CMakeLists.txt | 35 +++++++++++++++++++++++------------
+ 1 file changed, 23 insertions(+), 12 deletions(-)
-commit 9b02a4ffdac1b9f066658ec4c95c0834f4cd2fb7
-Author: Andre Noll <maan@tuebingen.mpg.de>
-Date: 2015-05-28 15:50:00 +0200
+commit 0c210ca7f489e971e94e1ddc72b0b0806e3c7935
+Author: Lasse Collin <lasse.collin@tukaani.org>
+Date: 2023-01-06 22:53:38 +0200
- Fix typo in German translation.
+ Tests: test_filter_flags: Clean up minor issues.
- As pointed out by Robert Pollak, there's a typo in the German
- translation of the compression preset option (-0 ... -9) help text.
- "The compressor" translates to "der Komprimierer", and the genitive
- form is "des Komprimierers". The old word makes no sense at all.
+ Here are the list of the most significant issues addressed:
+ - Avoid using internal common.h header. It's not good to copy the
+ constants like this but common.h cannot be included for use outside
+ of liblzma. This is the quickest thing to do that could be fixed later.
+
+ - Omit the INIT_FILTER macro. Initialization should be done with just
+ regular designated initializers.
+
+ - Use start_offset = 257 for BCJ tests. It demonstrates that Filter
+ Flags encoder and decoder don't validate the options thoroughly.
+ 257 is valid only for the x86 filter. This is a bit silly but
+ not a significant problem in practice because the encoder and
+ decoder initialization functions will catch bad alignment still.
+ Perhaps this should be fixed but it's not urgent and doesn't need
+ to be in 5.4.x.
+
+ - Various tweaks to comments such as filter id -> Filter ID
- po/de.po | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_filter_flags.c | 153 +++++++++++++++++++++++-----------------------
+ 1 file changed, 78 insertions(+), 75 deletions(-)
+
+commit 5c9fdd3bf53a9655f5eb2807d662b3af0d5e1865
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 23:33:33 +0800
+
+ Tests: Refactors existing filter flags tests.
+
+ Converts the existing filter flags tests into tuktests.
-commit c7f4041f6b8f4729f88d3bc888b2a4080ae51f72
+ tests/test_filter_flags.c | 655 ++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 457 insertions(+), 198 deletions(-)
+
+commit 36edc65ab4cf10a131f239acbd423b4510ba52d5
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-05-13 20:57:55 +0300
+Date: 2023-01-09 12:22:05 +0200
- Tests: Fix a memory leak in test_bcj_exact_size.
+ liblzma: CLMUL CRC64: Workaround a bug in MSVC (VS2015-2022).
+
+ I haven't tested with MSVC myself and there doesn't seem to be
+ information about the problem online, so I'm relying on the bug report.
- Thanks to Cristian Rodríguez.
+ Thanks to Iouri Kharon for the bug report and the patch.
- tests/test_bcj_exact_size.c | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/check/crc64_fast.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
-commit 17b29d4f0ae0f780fbd69e15a398dc478d8492f8
+commit 790a12a95a78ff82d8c6d4efe3b789851ca9470d
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-05-12 18:08:24 +0300
+Date: 2023-01-09 11:27:24 +0200
- Fix NEWS about threading in 5.2.0.
+ CMake: Fix a copypaste error in xzdec Windows resource file handling.
- Thanks to Andy Hochhaus.
+ It was my mistake. Thanks to Iouri Kharon for the bug report.
- NEWS | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 49c26920d6e2d85e5c6123e34958aed2e77485ad
+commit 0e1545fea39c0514c7b7032a0a3592a9a33d2848
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-05-11 21:26:16 +0300
+Date: 2023-01-08 00:32:29 +0200
- xz: Document that threaded decompression hasn't been implemented yet.
+ Tests: tuktest.h: Support tuktest_malloc(0).
+
+ It's not needed in XZ Utils at least for now. It's good to support
+ it still because if such use is needed later, it wouldn't be
+ caught on GNU/Linux since malloc(0) from glibc returns non-NULL.
- src/xz/xz.1 | 10 +++++++++-
- 1 file changed, 9 insertions(+), 1 deletion(-)
+ tests/tuktest.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
-commit 5b2458cb244ed237efe4de1ebcf06e1b3a1f4256
+commit 69d5d78c6904668eb09a131da86276beec3281f8
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-04-20 20:20:29 +0300
+Date: 2023-01-08 00:24:23 +0200
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 6bd0349c58451b13442e8f463e35de83548bf985
+commit dd38655f80c113c9db73b9ed370dc900e1c4dc41
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-04-20 19:59:18 +0300
+Date: 2023-01-07 21:57:11 +0200
- Revert "xz: Use pipe2() if available."
-
- This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd.
- It is a problem when libc has pipe2() but the kernel is too
- old to have pipe2() and thus pipe2() fails. In xz it's pointless
- to have a fallback for non-functioning pipe2(); it's better to
- avoid pipe2() completely.
+ CMake: Update cmake_minimum_required from 3.13...3.16 to 3.13...3.25.
- Thanks to Michael Fox for the bug report.
-
- configure.ac | 4 ++--
- src/xz/file_io.c | 9 +--------
- 2 files changed, 3 insertions(+), 10 deletions(-)
-
-commit fc0df0f8db87dff45543708a711e17d29c37f632
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-04-01 14:45:25 +0300
-
- xz: Fix the Capsicum rights on user_abort_pipe.
+ The changes listed on cmake-policies(7) for versions 3.17 to 3.25
+ shouldn't affect this project.
- src/xz/file_io.c | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 57393615b31b3788dd77280452d845bcc12d33af
+commit a890a637bee9193d5b690aefa9a59eba5b8532ae
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-31 22:20:11 +0300
+Date: 2023-01-07 19:50:35 +0200
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit 1238381143a9a7ce84839c2582ccd56ff750a440
+commit 6e38e595dd56ac1800478cef1f6f754d0eba0d2e
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-31 22:19:34 +0300
+Date: 2023-01-07 19:50:03 +0200
- xz: Add support for sandboxing with Capsicum.
-
- The sandboxing is used conditionally as described in main.c.
- This isn't optimal but it was much easier to implement than
- a full sandboxing solution and it still covers the most common
- use cases where xz is writing to standard output. This should
- have practically no effect on performance even with small files
- as fork() isn't needed.
-
- C and locale libraries can open files as needed. This has been
- fine in the past, but it's a problem with things like Capsicum.
- io_sandbox_enter() tries to ensure that various locale-related
- files have been loaded before cap_enter() is called, but it's
- possible that there are other similar problems which haven't
- been seen yet.
+ CMake/Windows: Add resource files to xz.exe and xzdec.exe.
- Currently Capsicum is available on FreeBSD 10 and later
- and there is a port to Linux too.
+ The command line tools cannot be built with MSVC for now but
+ they can be built with MinGW-w64.
- Thanks to Loganaden Velvindron for help.
+ Thanks to Iouri Kharon for the bug report and the original patch.
- configure.ac | 41 +++++++++++++++++++++++++++
- src/xz/Makefile.am | 2 +-
- src/xz/file_io.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/xz/file_io.h | 6 ++++
- src/xz/main.c | 18 ++++++++++++
- src/xz/private.h | 4 +++
- 6 files changed, 151 insertions(+), 1 deletion(-)
+ CMakeLists.txt | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
-commit 29a087fb5a0c879f0b1bc4c6b989f7b87bacdf9e
+commit 443dfebced041adc88f10d824188eeef5b5821a9
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-31 21:12:30 +0300
+Date: 2023-01-07 19:48:52 +0200
- Fix bugs and otherwise improve ax_check_capsicum.m4.
-
- AU_ALIAS was removed because the new version is incompatible
- with the old version.
-
- It no longer checks for <sys/capability.h> separately.
- It's enough to test for it as part of AC_CHECK_DECL.
- The defines HAVE_CAPSICUM_SYS_CAPSICUM_H and
- HAVE_CAPSICUM_SYS_CAPABILITY_H were removed as unneeded.
- HAVE_SYS_CAPSICUM_H from AC_CHECK_HEADERS is enough.
-
- It no longer does a useless search for the Capsicum library
- if the header wasn't found.
-
- Fixed a bug in ACTION-IF-FOUND (the first argument). Specifying
- the argument omitted the default action but the given action
- wasn't used instead.
-
- AC_DEFINE([HAVE_CAPSICUM]) is now always called when Capsicum
- support is found. Previously it was part of the default
- ACTION-IF-FOUND which a custom action would override. Now
- the default action only prepends ${CAPSICUM_LIB} to LIBS.
-
- The documentation was updated.
+ CMake/Windows: Add a workaround for windres from GNU binutils.
- Since there as no serial number, "#serial 2" was added.
+ Thanks to Iouri Kharon for the bug report and the original patch.
- m4/ax_check_capsicum.m4 | 103 ++++++++++++++++++++++++------------------------
- 1 file changed, 51 insertions(+), 52 deletions(-)
+ CMakeLists.txt | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
-commit 6e845c6a3eddf2fde9db5a29950421dff60a43ac
+commit ceb805011747d04a915f3f39e4bed9eed151c634
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-31 19:20:24 +0300
+Date: 2023-01-07 19:31:15 +0200
- Add m4/ax_check_capsicum.m4 for detecting Capsicum support.
+ Build: Require that _mm_set_epi64x() is usable to enable CLMUL support.
- The file was loaded from this web page:
- https://github.com/google/capsicum-test/blob/dev/autoconf/m4/ax_check_capsicum.m4
+ VS2013 doesn't have _mm_set_epi64x() so this way CLMUL gets
+ disabled with VS2013.
- Thanks to Loganaden Velvindron for pointing it out for me.
+ Thanks to Iouri Kharon for the bug report.
- m4/ax_check_capsicum.m4 | 86 +++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 86 insertions(+)
+ CMakeLists.txt | 3 ++-
+ configure.ac | 8 ++++++--
+ 2 files changed, 8 insertions(+), 3 deletions(-)
-commit 3717885f9ef2c06f1bcbad9f4c2ed2d5695f844e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-30 22:44:02 +0300
+commit 8d372bd94066b1a5b0570b2550f83c2868486adf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-07 21:05:15 +0800
- Bump version to 5.3.0alpha and soname to 5.3.99.
+ CI/CD: Split CMake Linux and MacOS build phase to build and test.
- The idea of 99 is that it looks a bit weird in this context.
- For new features there's no API/ABI stability in devel versions.
+ The phase split was only done for Autotools before, so should also
+ apply to CMake.
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 6 +++---
- 2 files changed, 4 insertions(+), 4 deletions(-)
+ .github/workflows/ci.yml | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit eccd8155e107c5ada03d13e7730675cdf1a44ddc
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-29 22:14:47 +0300
+commit 747c7f2b34bd498f6702c6875500a26b06201772
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-07 11:16:55 +0800
- Update THANKS.
+ CI/CD: Reduce job runners to 4 instead of using matrix strategy.
+
+ The old version used too many runners that resulted in unnecessary
+ dependency downloads. Now, the runners are reused for the different
+ configurations for each OS and build system.
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ .github/workflows/ci.yml | 95 ++++++++++++++++++++++++++++++++++++++++++------
+ 1 file changed, 83 insertions(+), 12 deletions(-)
-commit 25263fd9e7a8a913395cb93d7c104cd48c2b4a00
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-29 22:13:48 +0300
+commit 4de35fd6b58d46fc887c78faf163f6a37b790c45
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-07 10:07:20 +0800
- Fix the detection of installed RAM on QNX.
-
- The earlier version compiled but didn't actually work
- since sysconf(_SC_PHYS_PAGES) always fails (or so I was told).
+ CI/CD: Add new -p (PHASE) argument to ci_build.sh
- Thanks to Ole André Vadla Ravnås for the patch and testing.
+ The new PHASE argument can be build, test, or all. all is the default.
+ This way, the CI/CD script can differentiate between the build and test
+ phases to make it easier to track down errors when they happen.
- m4/tuklib_physmem.m4 | 6 +++---
- src/common/tuklib_physmem.c | 14 +++++++++++++-
- 2 files changed, 16 insertions(+), 4 deletions(-)
+ build-aux/ci_build.sh | 140 +++++++++++++++++++++++++++-----------------------
+ 1 file changed, 76 insertions(+), 64 deletions(-)
-commit 4c544d2410903d38402221cb783ed85585b6a007
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-27 22:39:07 +0200
+commit 6fd39664de47801e670a16617863196bfbde4755
+Merge: 78e0561d fc0c7884
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-07 00:10:50 +0800
- Fix CPU core count detection on QNX.
-
- It tried to use sysctl() on QNX but
- - it broke the build because sysctl() needs -lsocket on QNX;
- - sysctl() doesn't work for detecting the core count on QNX
- even if it compiled.
+ Merge pull request #7 from tukaani-project/tuktest_index_hash
- sysconf() works. An alternative would have been to use
- QNX-specific SYSPAGE_ENTRY(num_cpu) from <sys/syspage.h>.
-
- Thanks to Ole André Vadla Ravnås.
-
- m4/tuklib_cpucores.m4 | 15 +++++++++++----
- 1 file changed, 11 insertions(+), 4 deletions(-)
+ Tuktest index hash
-commit e0ea6737b03e83ccaff4514d00e31bb926f8f0f3
+commit fc0c788469159f634f09ff23c8cef6925c91da57
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-07 22:05:57 +0200
+Date: 2023-01-06 17:58:48 +0200
- xz: size_t/uint32_t cleanup in options.c.
+ Tests: test_index_hash: Add an assert_uint_eq().
- src/xz/options.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
+ tests/test_index_hash.c | 3 +++
+ 1 file changed, 3 insertions(+)
-commit 8bcca29a65335fd679c13814b70b35b68fa5daed
+commit d550304f5343b3a082da265107cd820e0d81dc71
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-07 22:04:23 +0200
+Date: 2023-01-06 17:55:06 +0200
- xz: Fix a comment and silence a warning in message.c.
+ Tests: test_index_hash: Fix a memory leak.
- src/xz/message.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
+ tests/test_index_hash.c | 2 ++
+ 1 file changed, 2 insertions(+)
-commit f243f5f44c6b19a7c289a0ec73a03ee08364cb5b
+commit 02608f74ea1f2d2d56585711ff241c34b4ad0937
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-07 22:01:00 +0200
+Date: 2023-01-06 17:53:03 +0200
- liblzma: Silence more uint32_t vs. size_t warnings.
+ Tests: test_index_hash: Don't treat pointers as booleans.
- src/liblzma/lz/lz_encoder.c | 2 +-
- src/liblzma/lzma/lzma_encoder.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ tests/test_index_hash.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
-commit 7f0a4c50f4a374c40acf4b86848f301ad1e82d34
+commit 056766c8601a3808bea1761f6cc833197a35a3e0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-07 19:54:00 +0200
+Date: 2023-01-06 17:51:41 +0200
- xz: Make arg_count an unsigned int to silence a warning.
-
- Actually the value of arg_count cannot exceed INT_MAX
- but it's nicer as an unsigned int.
+ Tests: test_index_hash: Fix a typo in a comment.
- src/xz/args.h | 2 +-
- src/xz/main.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ tests/test_index_hash.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit f6ec46801588b1be29c07c9db98558b521304002
+commit 873e684028ba9738f071c5236db7d452ed797b4c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-03-07 19:33:17 +0200
+Date: 2023-01-06 17:44:29 +0200
- liblzma: Fix a warning in index.c.
+ Tests: test_index_hash: Avoid the variable name "index".
+
+ It can trigger warnings from -Wshadow on some systems.
- src/liblzma/common/index.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
+ tests/test_index_hash.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
-commit a24518971cc621315af142dd3bb7614fab04ad27
+commit d1f24c35874eeba8432d75aa77b06c50375ed937
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-26 20:46:14 +0200
+Date: 2023-01-06 17:35:50 +0200
- Build: Fix a CR+LF problem when running autoreconf -fi on OS/2.
+ Tests: test_index_hash: Use the word "Record" instead of "entry".
- build-aux/version.sh | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/test_index_hash.c | 102 ++++++++++++++++++++++++------------------------
+ 1 file changed, 51 insertions(+), 51 deletions(-)
-commit dec11497a71518423b5ff0e759100cf8aadf6c7b
+commit b93f7c5cbb02b42024ac866fc0af541de3d816e2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-26 16:53:44 +0200
+Date: 2023-01-06 17:35:05 +0200
- Bump version and soname for 5.2.1.
+ Tests: test_index_hash: Tweak comments and style.
+
+ The words defined in the .xz file format specification
+ begin with capital letter to emphasize that they have
+ a specific meaning.
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ tests/test_index_hash.c | 62 ++++++++++++++++++++++++++-----------------------
+ 1 file changed, 33 insertions(+), 29 deletions(-)
-commit 29e39c79975ab89ee5dd671e97064534a9f3a649
+commit c48b24fc06d98569adb72f13c2e8e5ff30bb8036
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-26 13:01:09 +0200
+Date: 2023-01-06 17:17:37 +0200
- Update NEWS for 5.2.1.
+ Tests: test_index_hash: Use INDEX_INDICATOR constant instead of 0.
- NEWS | 14 ++++++++++++++
- 1 file changed, 14 insertions(+)
+ tests/test_index_hash.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-22 19:38:48 +0200
+commit 78e0561dfebaa9d5e34558de537efcda890e0629
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-06 20:43:31 +0800
- xz: Use pipe2() if available.
+ Style: Change #if !defined() to #ifndef in mythread.h.
- configure.ac | 4 ++--
- src/xz/file_io.c | 9 ++++++++-
- 2 files changed, 10 insertions(+), 3 deletions(-)
+ src/common/mythread.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 117d962685c72682c63edc9bb765367189800202
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-21 23:40:26 +0200
+commit e834e1e934ed0af673598d8c0c34afb2af56bee0
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-06 20:35:55 +0800
- liblzma: Fix a compression-ratio regression in LZMA1/2 in fast mode.
+ Build: Add missing stream_decoder_mt.c to .vcxproj files.
- The bug was added in the commit
- f48fce093b07aeda95c18850f5e086d9f2383380 and thus
- affected 5.1.4beta and 5.2.0. Luckily the bug cannot
- cause data corruption or other nasty things.
+ The line in the .vcxproj files for building with was missing in 5.4.0.
+ Thank to Hajin Jang for reporting the issue.
- src/liblzma/lzma/lzma_encoder_optimum_fast.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ windows/vs2013/liblzma.vcxproj | 1 +
+ windows/vs2013/liblzma_dll.vcxproj | 1 +
+ windows/vs2017/liblzma.vcxproj | 1 +
+ windows/vs2017/liblzma_dll.vcxproj | 1 +
+ windows/vs2019/liblzma.vcxproj | 1 +
+ windows/vs2019/liblzma_dll.vcxproj | 1 +
+ 6 files changed, 6 insertions(+)
-commit ae984e31c167d3bc52972ec422dd1ebd5f5d5719
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-21 23:00:19 +0200
+commit 84f9687cbae972c2c342e10bf69f8ec8f70ae111
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-05 20:57:25 +0800
- xz: Fix the fcntl() usage when creating a pipe for the self-pipe trick.
+ liblzma: Remove common.h include from common/index.h.
- Now it reads the old flags instead of blindly setting O_NONBLOCK.
- The old code may have worked correctly, but this is better.
+ common/index.h is needed by liblzma internally and tests. common.h will
+ include and define many things that are not needed by the tests. Also,
+ this prevents include order problems because common.h will redefine
+ LZMA_API resulting in a warning.
- src/xz/file_io.c | 16 +++++++++++-----
- 1 file changed, 11 insertions(+), 5 deletions(-)
+ src/liblzma/common/index.c | 1 +
+ src/liblzma/common/index.h | 9 +++++++--
+ src/liblzma/common/index_decoder.h | 1 +
+ src/liblzma/common/stream_buffer_encoder.c | 1 +
+ 4 files changed, 10 insertions(+), 2 deletions(-)
-commit 2205bb5853098aea36a56df6f5747037175f66b4
+commit 7657ce1c3c4abff7560336a7b687d98e0e2bd14f
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-10 15:29:34 +0200
+Date: 2023-01-04 22:40:54 +0200
Update THANKS.
THANKS | 1 +
1 file changed, 1 insertion(+)
-commit d935b0cdf3db440269b9d952b2b281b18f8c7b08
+commit aafd67fba045ab99683971263a5a26fb2a6e8ce2
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-10 15:28:30 +0200
+Date: 2023-01-04 18:40:28 +0200
- tuklib_cpucores: Use cpuset_getaffinity() on FreeBSD if available.
-
- In FreeBSD, cpuset_getaffinity() is the preferred way to get
- the number of available cores.
+ Tests: Adjust style in test_compress.sh.
+
+ tests/test_compress.sh | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+commit 52380678f42364daa4510f92f6d3b18ec98c3638
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-04 23:58:58 +0800
+
+ Tests: Replace non portable shell parameter expansion
- Thanks to Rui Paulo for the patch. I edited it slightly, but
- hopefully I didn't break anything.
+ The shell parameter expansion using # and ## is not supported in
+ Solaris 10 Bourne shell (/bin/sh). Even though this is POSIX, it is not fully
+ portable, so we should avoid it.
- m4/tuklib_cpucores.m4 | 23 ++++++++++++++++++++++-
- src/common/tuklib_cpucores.c | 18 ++++++++++++++++++
- 2 files changed, 40 insertions(+), 1 deletion(-)
+ tests/create_compress_files.c | 2 +-
+ tests/test_compress.sh | 20 +++++++++++++-------
+ tests/test_compress_prepared_bcj_sparc | 2 +-
+ tests/test_compress_prepared_bcj_x86 | 2 +-
+ 4 files changed, 16 insertions(+), 10 deletions(-)
-commit eb61bc58c20769cac4d05f363b9c0e8c9c71a560
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-09 22:08:37 +0200
+commit d0eb345bb7d148a62883ee299adec2b74a0f6f3b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-03 21:02:38 +0800
- xzdiff: Make the mktemp usage compatible with FreeBSD's mktemp.
+ Translations: Add Korean translation of man pages.
- Thanks to Rui Paulo for the fix.
+ Thanks to Seong-ho Cho
- src/scripts/xzdiff.in | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
+ po4a/ko.po | 5552 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ po4a/po4a.conf | 2 +-
+ 2 files changed, 5553 insertions(+), 1 deletion(-)
-commit b9a5b6b7a29029680af733082b6a46e0fc01623a
+commit c4145978d95ebf1690c778d354e15f7c2823d7a8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-03 20:47:27 +0800
+
+ Translations: Update the Esperanto translation.
+
+ po/eo.po | 620 ++++++++++++++++++++++++++++++++++-----------------------------
+ 1 file changed, 332 insertions(+), 288 deletions(-)
+
+commit 4103a2e78ac60b00c888485cd967a5fe5d1b917c
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-02-03 21:45:53 +0200
+Date: 2023-01-02 17:20:47 +0200
- Add a few casts to tuklib_integer.h to silence possible warnings.
+ Bump version and soname for 5.5.0alpha.
- I heard that Visual Studio 2013 gave warnings without the casts.
+ 5.5.0alpha won't be released, it's just to mark that
+ the branch is not for stable 5.4.x.
- Thanks to Gabi Davar.
+ Once again there is no API/ABI stability for new features
+ in devel versions. The major soname won't be bumped even
+ if API/ABI of new features breaks between devel releases.
- src/common/tuklib_integer.h | 24 ++++++++++++------------
- 1 file changed, 12 insertions(+), 12 deletions(-)
+ src/liblzma/Makefile.am | 2 +-
+ src/liblzma/api/lzma/version.h | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
-commit c45757135f40e4a0de730ba5fff0100219493982
+commit 73c9e6d6b970ccc3d5ad61dcaa21cba050e5df0a
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-26 21:24:39 +0200
+Date: 2023-01-02 17:05:07 +0200
- liblzma: Set LZMA_MEMCMPLEN_EXTRA depending on the compare method.
+ Build: Fix config.h comments.
- src/liblzma/common/memcmplen.h | 15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
+ configure.ac | 2 +-
+ m4/tuklib_progname.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
-commit 3c500174ed5485f550972a2a6109c361e875f069
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-26 20:40:16 +0200
+commit bb740e3b117f1a3c65152d01e5755523a908ecb1
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2023-01-02 22:33:48 +0800
- Update THANKS.
+ Build: Only define HAVE_PROGRAM_INVOCATION_NAME if it is set to 1.
+
+ HAVE_DECL_PROGRAM_INVOCATION_NAME is renamed to
+ HAVE_PROGRAM_INVOCATION_NAME. Previously,
+ HAVE_DECL_PROGRAM_INVOCATION_NAME was always set when
+ building with autotools. CMake would only set this when it was 1, and the
+ dos/config.h did not define it. The new macro definition is consistent
+ across build systems.
- THANKS | 1 +
+ cmake/tuklib_progname.cmake | 5 ++---
+ m4/tuklib_progname.m4 | 5 ++++-
+ src/common/tuklib_progname.c | 2 +-
+ src/common/tuklib_progname.h | 2 +-
+ 4 files changed, 8 insertions(+), 6 deletions(-)
+
+commit 064cd385a716abc78d93a3612411a82d69ceb221
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 00:30:52 +0800
+
+ Adds test_index_hash to .gitignore.
+
+ .gitignore | 1 +
1 file changed, 1 insertion(+)
-commit fec88d41e672d9e197c9442aecf02bd0dfa6d516
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-26 20:39:28 +0200
+commit 3959162baec074511d83ba0fec1284c3ed724799
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 00:25:18 +0800
- liblzma: Silence harmless Valgrind errors.
+ Tests: Creates test_index_hash.c
- Thanks to Torsten Rupp for reporting this. I had
- forgotten to run Valgrind before the 5.2.0 release.
+ Tests all API functions exported from index_hash.h. Does not have a
+ dedicated test for lzma_index_hash_end.
- src/liblzma/lz/lz_encoder.c | 6 ++++++
- 1 file changed, 6 insertions(+)
+ CMakeLists.txt | 2 +
+ tests/Makefile.am | 3 +
+ tests/test_index_hash.c | 379 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 384 insertions(+)
-commit a9b45badfec0928d20a27c7176c005fa637f7d1e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-09 21:50:19 +0200
+commit f16e12d5e755d371247202fcccbcccd1ec16b2cf
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-08-17 20:20:16 +0800
- xz: Fix comments.
+ liblzma: Add NULL check to lzma_index_hash_append.
+
+ This is for consistency with lzma_index_append.
- src/xz/file_io.c | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
+ src/liblzma/common/index_hash.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-commit 541aee6dd4aa97a809aba281475a21b641bb89e2
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-09 21:35:06 +0200
+commit 203b008eb220208981902e0db541c02d1c1c9f5e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-08-17 17:59:51 +0800
- Update THANKS.
+ liblzma: Replaced hardcoded 0x0 index indicator byte with macro
- THANKS | 1 +
- 1 file changed, 1 insertion(+)
+ src/liblzma/common/index.h | 3 +++
+ src/liblzma/common/index_decoder.c | 2 +-
+ src/liblzma/common/index_encoder.c | 2 +-
+ src/liblzma/common/index_hash.c | 2 +-
+ src/liblzma/common/stream_decoder.c | 3 ++-
+ src/liblzma/common/stream_decoder_mt.c | 2 +-
+ 6 files changed, 9 insertions(+), 5 deletions(-)
-commit 4170edc914655310d2363baccf5e615e09b04911
+commit dfecda875211f737d0db92dc1d3c58a3a2afb0c0
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-09 21:34:06 +0200
+Date: 2022-12-30 20:10:08 +0200
- xz: Don't fail if stdout doesn't support O_NONBLOCK.
-
- This is similar to the case with stdin.
-
- Thanks to Brad Smith for the bug report and testing
- on OpenBSD.
+ Tests: test_check: Test corner cases of CLMUL CRC64.
- src/xz/file_io.c | 36 +++++++++++++++---------------------
- 1 file changed, 15 insertions(+), 21 deletions(-)
+ tests/test_check.c | 27 +++++++++++++++++++++++++++
+ 1 file changed, 27 insertions(+)
-commit 04bbc0c2843c50c8ad1cba42b937118e38b0508d
+commit ce96bb20435212fe797d6d84738fb9fd4ea13cc7
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-07 19:18:20 +0200
+Date: 2022-12-30 19:36:49 +0200
- xz: Fix a memory leak in DOS-specific code.
+ Tests: Clarify a comment in test_lzip_decoder.c.
- src/xz/file_io.c | 2 ++
- 1 file changed, 2 insertions(+)
+ tests/test_lzip_decoder.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
-commit f0f1f6c7235ffa901cf76fe18e33749e200b3eea
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-07 19:08:06 +0200
+commit 2fcba17fc4d7eda8fc60567169cf2a0e6fcfb2f8
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 01:55:19 +0800
+
+ xz: Includes <time.h> and <sys/time.h> conditionally in mytime.c.
+
+ Previously, mytime.c depended on mythread.h for <time.h> to be included.
+
+ src/xz/mytime.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit f82294c8318a7a0990583d51ac5c7de682ad36ef
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 01:15:27 +0800
- xz: Don't fail if stdin doesn't support O_NONBLOCK.
+ liblzma: Includes sys/time.h conditionally in mythread
- It's a problem at least on OpenBSD which doesn't support
- O_NONBLOCK on e.g. /dev/null. I'm not surprised if it's
- a problem on other OSes too since this behavior is allowed
- in POSIX-1.2008.
+ Previously, <sys/time.h> was always included, even if mythread only used
+ clock_gettime. <time.h> is still needed even if clock_gettime is not used
+ though because struct timespec is needed for mythread_condtime.
+
+ src/common/mythread.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+commit 74dae7d30091e906d6a92a57952dea4354473f9b
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-29 01:10:53 +0800
+
+ Build: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set.
- The code relying on this behavior was committed in June 2013
- and included in 5.1.3alpha released on 2013-10-26. Clearly
- the development releases only get limited testing.
+ Previously, if threading was enabled HAVE_DECL_CLOCK_MONOTONIC would always
+ be set to 0 or 1. However, this macro was needed in xz so if xz was not
+ built with threading and HAVE_DECL_CLOCK_MONOTONIC was not defined but
+ HAVE_CLOCK_GETTIME was, it caused a warning during build. Now,
+ HAVE_DECL_CLOCK_MONOTONIC has been renamed to HAVE_CLOCK_MONOTONIC and
+ will only be set if it is 1.
- src/xz/file_io.c | 18 +++++++-----------
- 1 file changed, 7 insertions(+), 11 deletions(-)
+ CMakeLists.txt | 8 +++-----
+ configure.ac | 5 ++++-
+ src/common/mythread.h | 4 ++--
+ src/xz/mytime.c | 5 ++---
+ 4 files changed, 11 insertions(+), 11 deletions(-)
-commit d2d484647d9d9d679f03c75abb0404f67069271c
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2015-01-06 20:30:15 +0200
+commit 7339e39dc060df6eda74a2c5b69961befc3d5d24
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-28 01:14:07 +0800
- Tests: Don't hide unexpected error messages in test_files.sh.
+ Translations: Add Ukrainian translations of man pages.
- Hiding them makes no sense since normally there's no error
- when testing the "good" files. With "bad" files errors are
- expected and then it makes sense to keep the messages hidden.
+ Thanks to Yuri Chornoivan
- tests/test_files.sh | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
+ po4a/po4a.conf | 2 +-
+ po4a/uk.po | 3676 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 3677 insertions(+), 1 deletion(-)
-commit aae6a6aeda51cf94a47e39ad624728f9bee75e30
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-30 11:17:16 +0200
+commit 9f05c27a58ce8cd7803079aa295e41c24665ce6e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-23 00:34:48 +0800
- Update Solaris notes in INSTALL.
+ CI/CD: Create initial version of CI/CD workflow.
- Mention the possible "make check" failure on Solaris in the
- Solaris-specific section of INSTALL. It was already in
- section 4.5 but it is better mention it in the OS-specific
- section too.
+ The CI/CD workflow will only execute on Ubuntu and MacOS latest version.
+ The workflow will attempt to build with autotools and CMake and execute
+ the tests. The workflow will run for all pull requests and pushes done
+ to the master branch.
- INSTALL | 4 ++++
- 1 file changed, 4 insertions(+)
+ .github/workflows/ci.yml | 72 ++++++++++++++++++++++++
+ build-aux/ci_build.sh | 141 +++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 213 insertions(+)
-commit 7815112153178800a3521b9f31960e7cdc26cfba
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-26 12:00:05 +0200
+commit 1275ebfba74230dbd028049141423c79c8b83b8f
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-22 23:14:53 +0800
- Build: POSIX shell isn't required if scripts are disabled.
+ liblzma: Update documentation for lzma_filter_encoder.
- INSTALL | 3 ++-
- configure.ac | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
+ src/liblzma/common/filter_encoder.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
-commit a0cd05ee71d330b79ead6eb9222e1b24e1559d3a
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-21 20:48:37 +0200
+commit 7c9ff5f1667a16733163b75dfd4b509662c387f4
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-21 21:12:03 +0800
+
+ Tests: Adds lzip decoder tests
- DOS: Update Makefile.
+ .gitignore | 1 +
+ tests/Makefile.am | 2 +
+ tests/test_lzip_decoder.c | 471 ++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 474 insertions(+)
- dos/Makefile | 1 +
- 1 file changed, 1 insertion(+)
+commit 799ead162de63b8400733603d3abcd2e1977bdca
+Author: Jia Cheong Tan <jiat0218@gmail.com>
+Date: 2022-12-20 22:05:21 +0800
-commit b85ee0905ec4ab7656d22e63519fdd3bedb21f2e
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-21 19:50:38 +0200
+ Doxygen: Update .gitignore for generating docs for in source build.
+
+ In source builds are not recommended, but we should still ignore
+ the generated artifacts.
- Windows: Fix bin_i486 to bin_i686 in build.bash.
+ .gitignore | 2 ++
+ 1 file changed, 2 insertions(+)
- windows/build.bash | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+commit 5f7ce42a16b1e86ca8408b5c670c25e2a12acc4e
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-20 20:46:44 +0800
-commit cbafa710918195dbba3db02c3fab4f0538235206
-Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-21 18:58:44 +0200
+ liblzma: Fix lzma_microlzma_encoder() return value.
+
+ Using return_if_error on lzma_lzma_lclppb_encode was improper because
+ return_if_error is expecting an lzma_ret value, but
+ lzma_lzma_lclppb_encode returns a boolean. This could result in
+ lzma_microlzma_encoder, which would be misleading for applications.
- Docs: Use lzma_cputhreads() in 04_compress_easy_mt.c.
+ src/liblzma/common/microlzma_encoder.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
- doc/examples/04_compress_easy_mt.c | 30 ++++++++++++++++++++++++++----
- 1 file changed, 26 insertions(+), 4 deletions(-)
+commit 8ace358d65059152d9a1f43f4770170d29d35754
+Author: Jia Tan <jiat0218@gmail.com>
+Date: 2022-12-16 20:58:55 +0800
-commit 8dbb57238d372c7263cfeb3e7f7fd9a73173156a
+ CMake: Update .gitignore for CMake artifacts from in source build.
+
+ In source builds are not recommended, but we can make it easier
+ by ignoring the generated artifacts from CMake.
+
+ .gitignore | 23 +++++++++++++++++++++++
+ 1 file changed, 23 insertions(+)
+
+commit 8fd225a2c149f30aeac377e68eb5abf6b28300ad
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-21 18:56:44 +0200
+Date: 2022-12-16 18:30:02 +0200
- Docs: Update docs/examples/00_README.txt.
+ liblzma: Update authors list in arm64.c.
- doc/examples/00_README.txt | 4 ++++
- 1 file changed, 4 insertions(+)
+ src/liblzma/simple/arm64.c | 1 +
+ 1 file changed, 1 insertion(+)
-commit 6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6
+commit b69da6d4bb6bb11fc0cf066920791990d2b22a06
Author: Lasse Collin <lasse.collin@tukaani.org>
-Date: 2014-12-21 18:11:17 +0200
+Date: 2022-12-13 20:37:17 +0200
- Bump version and soname for 5.2.0.
-
- I know that soname != app version, but I skip AGE=1
- in -version-info to make the soname match the liblzma
- version anyway. It doesn't hurt anything as long as
- it doesn't conflict with library versioning rules.
+ Bump version to 5.4.0 and soname to 5.4.0.
- src/liblzma/Makefile.am | 2 +-
- src/liblzma/api/lzma/version.h | 6 +++---
- src/liblzma/liblzma.map | 2 +-
- 3 files changed, 5 insertions(+), 5 deletions(-)
+ src/liblzma/Makefile.am | 2 +-
+ src/liblzma/api/lzma/version.h | 6 +++---
+ src/liblzma/liblzma_generic.map | 2 +-
+ src/liblzma/liblzma_linux.map | 2 +-
+ 4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/contrib/xz/README b/contrib/xz/README
index 9e76301b95cd..9d097deff371 100644
--- a/contrib/xz/README
+++ b/contrib/xz/README
@@ -67,24 +67,25 @@ XZ Utils
1.1. Overall documentation
- README This file
-
- INSTALL.generic Generic install instructions for those not familiar
- with packages using GNU Autotools
- INSTALL Installation instructions specific to XZ Utils
- PACKAGERS Information to packagers of XZ Utils
-
- COPYING XZ Utils copyright and license information
- COPYING.GPLv2 GNU General Public License version 2
- COPYING.GPLv3 GNU General Public License version 3
- COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
-
- AUTHORS The main authors of XZ Utils
- THANKS Incomplete list of people who have helped making
- this software
- NEWS User-visible changes between XZ Utils releases
- ChangeLog Detailed list of changes (commit log)
- TODO Known bugs and some sort of to-do list
+ README This file
+
+ INSTALL.generic Generic install instructions for those not
+ familiar with packages using GNU Autotools
+ INSTALL Installation instructions specific to XZ Utils
+ PACKAGERS Information to packagers of XZ Utils
+
+ COPYING XZ Utils copyright and license information
+ COPYING.0BSD BSD Zero Clause License
+ COPYING.GPLv2 GNU General Public License version 2
+ COPYING.GPLv3 GNU General Public License version 3
+ COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
+
+ AUTHORS The main authors of XZ Utils
+ THANKS Incomplete list of people who have helped making
+ this software
+ NEWS User-visible changes between XZ Utils releases
+ ChangeLog Detailed list of changes (commit log)
+ TODO Known bugs and some sort of to-do list
Note that only some of the above files are included in binary
packages.
@@ -94,9 +95,9 @@ XZ Utils
The command-line tools are documented as man pages. In source code
releases (and possibly also in some binary packages), the man pages
- are also provided in plain text (ASCII only) and PDF formats in the
- directory "doc/man" to make the man pages more accessible to those
- whose operating system doesn't provide an easy way to view man pages.
+ are also provided in plain text (ASCII only) format in the directory
+ "doc/man" to make the man pages more accessible to those whose
+ operating system doesn't provide an easy way to view man pages.
1.3. Documentation for liblzma
@@ -297,11 +298,13 @@ XZ Utils
6. Contact information
----------------------
- If you have questions, bug reports, patches etc. related to XZ Utils,
- the project maintainers Lasse Collin and Jia Tan can be reached via
- <xz@tukaani.org>.
+ XZ Utils in general:
+ - Home page: https://tukaani.org/xz/
+ - Email to maintainer(s): xz@tukaani.org
+ - IRC: #tukaani on Libera Chat
+ - GitHub: https://github.com/tukaani-project/xz
- You might find Lasse also from #tukaani on Libera Chat (IRC).
- The nick is Larhzu. The channel tends to be pretty quiet,
- so just ask your question and someone might wake up.
+ Lead maintainer:
+ - Email: Lasse Collin <lasse.collin@tukaani.org>
+ - IRC: Larhzu on Libera Chat
diff --git a/contrib/xz/THANKS b/contrib/xz/THANKS
index 0206af938f1a..7d2d4fe82ad8 100644
--- a/contrib/xz/THANKS
+++ b/contrib/xz/THANKS
@@ -5,6 +5,7 @@ Thanks
Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order:
- Mark Adler
+ - Kian-Meng Ang
- H. Peter Anvin
- Jeff Bastian
- Nelson H. F. Beebe
@@ -45,15 +46,18 @@ has been important. :-) In alphabetical order:
- Vincent Fazio
- Michael Felt
- Michael Fox
+ - Andres Freund
- Mike Frysinger
- Daniel Richard G.
- Tomasz Gajc
- Bjarni Ingi Gislason
- John Paul Adrian Glaubitz
- Bill Glessner
+ - Matthew Good
- Michał Górny
- Jason Gorski
- Juan Manuel Guerrero
+ - Gabriela Gutierrez
- Diederik de Haas
- Joachim Henke
- Christian Hesse
@@ -62,6 +66,7 @@ has been important. :-) In alphabetical order:
- Nicholas Jackson
- Sam James
- Hajin Jang
+ - Hans Jansen
- Jouk Jansen
- Jun I Jin
- Kiyoshi Kanazawa
@@ -72,6 +77,7 @@ has been important. :-) In alphabetical order:
- Richard Koch
- Anton Kochkov
- Ville Koskinen
+ - Sergey Kosukhin
- Marcin Kowalczyk
- Jan Kratochvil
- Christian Kujau
@@ -79,6 +85,7 @@ has been important. :-) In alphabetical order:
- Ilya Kurdyukov
- Peter Lawler
- James M Leddy
+ - Kelvin Lee
- Vincent Lefevre
- Hin-Tak Leung
- Andraž 'ruskie' Levstik
@@ -89,6 +96,7 @@ has been important. :-) In alphabetical order:
- Lorenzo De Liso
- H.J. Lu
- Bela Lubkin
+ - Chenxi Mao
- Gregory Margo
- Julien Marrec
- Ed Maste
@@ -144,12 +152,12 @@ has been important. :-) In alphabetical order:
- Martin Storsjö
- Jonathan Stott
- Dan Stromberg
- - Jia Tan
- Vincent Torri
+ - Alexey Tourbin
- Paul Townsend
- Mohammed Adnène Trojette
- - Alexey Tourbin
- Taiki Tsunekawa
+ - Maksym Vatsyk
- Loganaden Velvindron
- Patrick J. Volkerding
- Martin Väth
@@ -164,6 +172,7 @@ has been important. :-) In alphabetical order:
- Charles Wilson
- Lars Wirzenius
- Pilorz Wojciech
+ - Chien Wong
- Ryan Young
- Andreas Zieringer
diff --git a/contrib/xz/TODO b/contrib/xz/TODO
index 7b9a3adfc716..ad37f3f559aa 100644
--- a/contrib/xz/TODO
+++ b/contrib/xz/TODO
@@ -24,10 +24,6 @@ Known bugs
tuklib_exit() doesn't block signals => EINTR is possible.
- SIGTSTP is not handled. If xz is stopped, the estimated remaining
- time and calculated (de)compression speed won't make sense in the
- progress indicator (xz --verbose).
-
If liblzma has created threads and fork() gets called, liblzma
code will break in the child process unless it calls exec() and
doesn't touch liblzma.
diff --git a/contrib/xz/doxygen/Doxyfile b/contrib/xz/doxygen/Doxyfile
index 14350cf44f64..25428e925168 100644
--- a/contrib/xz/doxygen/Doxyfile
+++ b/contrib/xz/doxygen/Doxyfile
@@ -1,2687 +1,39 @@
-# Doxyfile 1.9.6
+# SPDX-License-Identifier: 0BSD
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
+# Run "doxygen" in this directory to generate the liblzma API documentation
+# into ../doc/api.
#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
+# Use the "update-doxygen" script for more choices:
+# - Include the liblzma version number in the generated documentation.
+# - Instead of API docs, docs of XZ Utils internals may be built.
+# - Change the output directory for out-of-tree builds.
#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-#
-# Note:
-#
-# Use doxygen to compare the used configuration file with the template
-# configuration file:
-# doxygen -x [configFile]
-# Use doxygen to compare the used configuration file with the template
-# configuration file without replacing the environment variables or CMake type
-# replacement variables:
-# doxygen -x_noenv [configFile]
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the configuration
-# file that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
+# These options were tested with Doxygen 1.10.0.
PROJECT_NAME = "liblzma (XZ Utils)"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
OUTPUT_DIRECTORY = ../doc
-
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
-# sub-directories (in 2 levels) under the output directory of each output format
-# and will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to
-# control the number of sub-directories.
-# The default value is: NO.
-
-CREATE_SUBDIRS = NO
-
-# Controls the number of sub-directories that will be created when
-# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every
-# level increment doubles the number of directories, resulting in 4096
-# directories at level 8 which is the default and also the maximum value. The
-# sub-directories are organized in 2 levels, the first level always has a fixed
-# number of 16 directories.
-# Minimum value: 0, maximum value: 8, default value: 8.
-# This tag requires that the tag CREATE_SUBDIRS is set to YES.
-
-CREATE_SUBDIRS_LEVEL = 8
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,
-# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English
-# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,
-# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with
-# English messages), Korean, Korean-en (Korean with English messages), Latvian,
-# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,
-# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,
-# Swedish, Turkish, Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
STRIP_FROM_PATH = ../src/liblzma/api
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
-# such as
-# /***************
-# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
-# Javadoc-style will behave just like regular comments and it will not be
-# interpreted by doxygen.
-# The default value is: NO.
-
-JAVADOC_BANNER = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# By default Python docstrings are displayed as preformatted text and doxygen's
-# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
-# doxygen's special commands can be used and the contents of the docstring
-# documentation blocks is shown as doxygen documentation.
-# The default value is: YES.
-
-PYTHON_DOCSTRING = YES
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:^^"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". Note that you cannot put \n's in the value part of an alias
-# to insert newlines (in the resulting output). You can put ^^ in the value part
-# of an alias to insert a newline as if a physical newline was in the original
-# file. When you need a literal { or } or , in the value part of an alias you
-# have to escape them by means of a backslash (\), this can lead to conflicts
-# with the commands \{ and \} for these it is advised to use the version @{ and
-# @} or use a double escape (\\{ and \\})
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
-# sources only. Doxygen will then generate output that is more tailored for that
-# language. For instance, namespaces will be presented as modules, types will be
-# separated into more groups, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_SLICE = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
-# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
-# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
-# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
-# tries to guess whether the code is fixed or free formatted code, this is the
-# default for Fortran type files). For instance to make doxygen treat .inc files
-# as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen. When specifying no_extension you should add
-# * to the FILE_PATTERNS.
-#
-# Note see also the list of default file extension mappings.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See https://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = NO
-
-# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
-# to that level are automatically included in the table of contents, even if
-# they do not have an id attribute.
-# Note: This feature currently applies only to Markdown headings.
-# Minimum value: 0, maximum value: 99, default value: 5.
-# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
-
-TOC_INCLUDE_HEADINGS = 5
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = NO
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# If one adds a struct or class to a group and this option is enabled, then also
-# any nested class or struct is added to the same group. By default this option
-# is disabled and one has to add nested compounds explicitly via \ingroup.
-# The default value is: NO.
-
-GROUP_NESTED_COMPOUNDS = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use
-# during processing. When set to 0 doxygen will based this on the number of
-# cores available in the system. You can set it explicitly to a value larger
-# than 0 to get more control over the balance between CPU load and processing
-# speed. At this moment only the input processing can be done using multiple
-# threads. Since this is still an experimental feature the default is set to 1,
-# which effectively disables parallel processing. Please report any issues you
-# encounter. Generating dot graphs in parallel is controlled by the
-# DOT_NUM_THREADS setting.
-# Minimum value: 0, maximum value: 32, default value: 1.
-
-NUM_PROC_THREADS = 1
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
-# methods of a class will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIV_VIRTUAL = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = NO
-
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If this flag is set to YES, the name of an unnamed parameter in a declaration
-# will be determined by the corresponding definition. By default unnamed
-# parameters remain unnamed in the output.
-# The default value is: YES.
-
-RESOLVE_UNNAMED_PARAMS = YES
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# will also hide undocumented C++ concepts if enabled. This option has no effect
-# if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# declarations. If set to NO, these declarations will be included in the
-# documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
-# able to match the capabilities of the underlying filesystem. In case the
-# filesystem is case sensitive (i.e. it supports files in the same directory
-# whose names only differ in casing), the option must be set to YES to properly
-# deal with such files in case they appear in the input. For filesystems that
-# are not case sensitive the option should be set to NO to properly deal with
-# output files written for symbols that only differ in casing, such as for two
-# classes, one named CLASS and the other named Class, and to also support
-# references to files without having to specify the exact matching casing. On
-# Windows (including Cygwin) and MacOS, users should typically set this option
-# to NO, whereas on Linux or other Unix flavors it should typically be set to
-# YES.
-# Possible values are: SYSTEM, NO and YES.
-# The default value is: SYSTEM.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
-# will show which file needs to be included to use the class.
-# The default value is: YES.
-
-SHOW_HEADERFILE = YES
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = NO
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
-# list will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file. See also section "Changing the
-# layout of pages" for information.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as documenting some parameters in
-# a documented function twice, or documenting parameters that don't exist or
-# using markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = YES
-
-# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
-# function parameter documentation. If set to NO, doxygen will accept that some
-# parameters have no documentation without warning.
-# The default value is: YES.
-
-WARN_IF_INCOMPLETE_DOC = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong parameter
-# documentation, but not about the absence of documentation. If EXTRACT_ALL is
-# set to YES then this flag will automatically be disabled. See also
-# WARN_IF_INCOMPLETE_DOC
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = NO
-
-# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about
-# undocumented enumeration values. If set to NO, doxygen will accept
-# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: NO.
-
-WARN_IF_UNDOC_ENUM_VAL = NO
-
-# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
-# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
-# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
-# at the end of the doxygen process doxygen will return with a non-zero status.
-# Possible values are: NO, YES and FAIL_ON_WARNINGS.
-# The default value is: NO.
-
-WARN_AS_ERROR = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# See also: WARN_LINE_FORMAT
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# In the $text part of the WARN_FORMAT command it is possible that a reference
-# to a more specific place is given. To make it easier to jump to this place
-# (outside of doxygen) the user can define a custom "cut" / "paste" string.
-# Example:
-# WARN_LINE_FORMAT = "'vi $file +$line'"
-# See also: WARN_FORMAT
-# The default value is: at line $line of file $file.
-
-WARN_LINE_FORMAT = "at line $line of file $file"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr). In case the file specified cannot be opened for writing the
-# warning and error messages are written to standard error. When as file - is
-# specified the warning and error messages are written to standard output
-# (stdout).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
-# Note: If this tag is empty the current directory is searched.
-
INPUT = ../src/liblzma/api
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see:
-# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
-# See also: INPUT_FILE_ENCODING
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
-# character encoding on a per file pattern basis. Doxygen will compare the file
-# name with each pattern and apply the encoding instead of the default
-# INPUT_ENCODING) if there is a match. The character encodings are a list of the
-# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
-# "INPUT_ENCODING" for further information on supported encodings.
-
-INPUT_FILE_ENCODING =
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# read by doxygen.
-#
-# Note the list of default checked file patterns might differ from the list of
-# default file extension mappings.
-#
-# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
-# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
-# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
-# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
-# *.vhdl, *.ucf, *.qsf and *.ice.
-
-FILE_PATTERNS = *.c \
- *.h
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
+FILE_PATTERNS = *.c *.h
RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = YES
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# ANamespace::AClass, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-#
-# Note that doxygen will use the data processed and written to standard output
-# for further processing, therefore nothing else, like debug statements or used
-# commands (so in case of a Windows batch file always use @echo OFF), should be
-# written to standard output.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# properly processed by doxygen.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-# The Fortran standard specifies that for fixed formatted Fortran code all
-# characters from position 72 are to be considered as comment. A common
-# extension is to allow longer lines before the automatic comment starts. The
-# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
-# be processed before the automatic comment starts.
-# Minimum value: 7, maximum value: 10000, default value: 72.
-
-FORTRAN_COMMENT_AFTER = 72
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# entity all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
+OPTIMIZE_OUTPUT_FOR_C = YES
+EXTRACT_STATIC = YES
+SORT_MEMBER_DOCS = NO
SOURCE_TOOLTIPS = NO
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see https://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
VERBATIM_HEADERS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
ALPHABETICAL_INDEX = NO
-
-# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
-# that should be ignored while generating the index headers. The IGNORE_PREFIX
-# tag works for classes, function and member names. The entity will be placed in
-# the alphabetical list under the first letter of the entity name that remains
-# after removing the prefix.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
HTML_OUTPUT = api
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# Note: Since the styling of scrollbars can currently not be overruled in
-# Webkit/Chromium, the styling will be left out of the default doxygen.css if
-# one or more extra stylesheets have been specified. So if scrollbar
-# customization is desired it has to be added explicitly. For an example see the
-# documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
-# should be rendered with a dark or light theme.
-# Possible values are: LIGHT always generate light mode output, DARK always
-# generate dark mode output, AUTO_LIGHT automatically set the mode according to
-# the user preference, use light mode if no preference is set (the default),
-# AUTO_DARK automatically set the mode according to the user preference, use
-# dark mode if no preference is set and TOGGLE allow to user to switch between
-# light and dark mode via a button.
-# The default value is: AUTO_LIGHT.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE = AUTO_LIGHT
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a color-wheel, see
-# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
HTML_COLORSTYLE_HUE = 210
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use gray-scales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
HTML_COLORSTYLE_SAT = 180
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
HTML_COLORSTYLE_GAMMA = 110
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = NO
-
-# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
-# documentation will contain a main index with vertical navigation menus that
-# are dynamically created via JavaScript. If disabled, the navigation index will
-# consists of multiple levels of tabs that are statically embedded in every HTML
-# page. Disable this option to support browsers that do not have JavaScript,
-# like the Qt help browser.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
HTML_DYNAMIC_MENUS = NO
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see:
-# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
-# create a documentation set, doxygen will generate a Makefile in the HTML
-# output directory. Running make will produce the docset in that directory and
-# running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
-# genXcode/_index.html for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag determines the URL of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDURL =
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# on Windows. In the beginning of 2021 Microsoft took the original page, with
-# a.o. the download links, offline the HTML help workshop was already many years
-# in maintenance mode). You can download the HTML help workshop from the web
-# archives at Installation executable (see:
-# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
-# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the main .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location (absolute path
-# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
-# run qhelpgenerator on the generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine tune the look of the index (see "Fine-tuning the output"). As an
-# example, the default style sheet generated by doxygen has an example that
-# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
-# Since the tree basically has the same information as the tab index, you could
-# consider setting DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = NO
-
-# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
-# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
-# area (value NO) or if it should extend to the full height of the window (value
-# YES). Setting this to YES gives a layout similar to
-# https://docs.readthedocs.io with more room for contents, but less room for the
-# project logo, title, and description. If either GENERATE_TREEVIEW or
-# DISABLE_INDEX is set to NO, this option has no effect.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FULL_SIDEBAR = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
-# addresses.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-OBFUSCATE_EMAILS = YES
-
-# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
-# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
-# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
-# the HTML output. These images will generally look nicer at scaled resolutions.
-# Possible values are: png (the default) and svg (looks nicer but requires the
-# pdf2svg or inkscape tool).
-# The default value is: png.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FORMULA_FORMAT = png
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
-# to create new LaTeX commands to be used in formulas as building blocks. See
-# the section "Including formulas" for details.
-
-FORMULA_MACROFILE =
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# https://www.mathjax.org) which uses client side JavaScript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
-# Note that the different versions of MathJax have different requirements with
-# regards to the different settings, so it is possible that also other MathJax
-# settings have to be changed when switching between the different MathJax
-# versions.
-# Possible values are: MathJax_2 and MathJax_3.
-# The default value is: MathJax_2.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_VERSION = MathJax_2
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. For more details about the output format see MathJax
-# version 2 (see:
-# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
-# (see:
-# http://docs.mathjax.org/en/latest/web/components/output.html).
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility. This is the name for Mathjax version 2, for MathJax version 3
-# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
-# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
-# is the name for Mathjax version 3, for MathJax version 2 this will be
-# translated into HTML-CSS) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from https://www.mathjax.org before deployment. The default value is:
-# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
-# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# for MathJax version 2 (see
-# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# For example for MathJax version 3 (see
-# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
-# MATHJAX_EXTENSIONS = ams
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see:
-# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
SEARCHENGINE = NO
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using JavaScript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see:
-# https://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see:
-# https://xapian.org/). See the section "External Indexing and Searching" for
-# details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
-
GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when not enabling USE_PDFLATEX the default is latex when enabling
-# USE_PDFLATEX the default is pdflatex and when in the later case latex is
-# chosen this is overwritten by pdflatex. For specific output languages the
-# default can have been set differently, this depends on the implementation of
-# the output language.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# Note: This tag is used in the Makefile / make.bat.
-# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
-# (.tex).
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
-# generate index for LaTeX. In case there is no backslash (\) as first character
-# it will be automatically added in the LaTeX code.
-# Note: This tag is used in the generated output file (.tex).
-# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
-# The default value is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_MAKEINDEX_CMD = makeindex
-
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. The package can be specified just
-# by its name or with the correct syntax as to be used with the LaTeX
-# \usepackage command. To get the times font for instance you can specify :
-# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
-# To use the option intlimits with the amsmath package you can specify:
-# EXTRA_PACKAGES=[intlimits]{amsmath}
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
-# the generated LaTeX document. The header should contain everything until the
-# first chapter. If it is left blank doxygen will generate a standard header. It
-# is highly recommended to start with a default header using
-# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
-# and then modify the file new_header.tex. See also section "Doxygen usage" for
-# information on how to generate the default header that doxygen normally uses.
-#
-# Note: Only use a user-defined header if you know what you are doing!
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. The following
-# commands have a special meaning inside the header (and footer): For a
-# description of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
-# the generated LaTeX document. The footer should contain everything after the
-# last chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer. See also section "Doxygen
-# usage" for information on how to generate the default footer that doxygen
-# normally uses. Note: Only use a user-defined footer if you know what you are
-# doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER =
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
-# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
-# files. Set this option to YES, to get a higher quality PDF documentation.
-#
-# See also section LATEX_CMD_NAME for selecting the engine.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE = plain
-
-# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_TIMESTAMP = NO
-
-# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
-# path from which the emoji images will be read. If a relative path is entered,
-# it will be relative to the LATEX_OUTPUT directory. If left blank the
-# LATEX_OUTPUT directory will be used.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EMOJI_DIRECTORY =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# configuration file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's configuration file. A template extensions file can be
-# generated using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING = NO
-
-# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
-# namespace members in file scope as well, matching the HTML output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_NS_MEMB_FILE_SCOPE = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT = docbook
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
-# the structure of the code including all documentation. Note that this feature
-# is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
EXPAND_ONLY_PREDEF = YES
-
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of
-# RECURSIVE has no effect here.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
PREDEFINED = LZMA_API(type)=type \
LZMA_API_IMPORT= \
LZMA_API_CALL= \
tuklib_attr_noreturn= \
lzma_attribute(attr)= \
lzma_attr_alloc_size(size)=
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
-# The default value is: NO.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS = YES
-
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH =
-
-# If set to YES the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS = 0
-
-# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
-# subgraphs. When you want a differently looking font in the dot files that
-# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
-# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,
-# Edge and Graph Attributes specification</a> You need to make sure dot is able
-# to find the font, which can be done by putting it in a standard location or by
-# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font. Default graphviz fontsize is 14.
-# The default value is: fontname=Helvetica,fontsize=10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10"
-
-# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
-# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a
-# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about
-# arrows shapes.</a>
-# The default value is: labelfontname=Helvetica,labelfontsize=10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10"
-
-# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
-# around nodes set 'shape=plain' or 'shape=plaintext' <a
-# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>
-# The default value is: shape=box,height=0.2,width=0.4.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
-
-# You can set the path where dot can find font specified with fontname in
-# DOT_COMMON_ATTR and others dot attributes.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH tag is set to YES (or GRAPH) then doxygen will generate a
-# graph for each documented class showing the direct and indirect inheritance
-# relations. In case HAVE_DOT is set as well dot will be used to draw the graph,
-# otherwise the built-in generator will be used. If the CLASS_GRAPH tag is set
-# to TEXT the direct and indirect inheritance relations will be shown as texts /
-# links.
-# Possible values are: NO, YES, TEXT and GRAPH.
-# The default value is: YES.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies. See also the chapter Grouping
-# in the manual.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag UML_LOOK is set to YES.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
-# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
-# tag is set to YES, doxygen will add type and arguments for attributes and
-# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
-# will not generate fields with class member information in the UML graphs. The
-# class diagrams will look similar to the default class diagrams but using UML
-# notation for the relationships.
-# Possible values are: NO, YES and NONE.
-# The default value is: NO.
-# This tag requires that the tag UML_LOOK is set to YES.
-
-DOT_UML_DETAILS = NO
-
-# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
-# to display on a single line. If the actual line length exceeds this threshold
-# significantly it will wrapped across multiple lines. Some heuristics are apply
-# to avoid ugly line breaks.
-# Minimum value: 0, maximum value: 1000, default value: 17.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_WRAP_THRESHOLD = 17
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command. Disabling a call graph can be
-# accomplished by means of the command \hidecallgraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command. Disabling a caller graph can be
-# accomplished by means of the command \hidecallergraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH = YES
-
-# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels
-# of child directories generated in directory dependency graphs by dot.
-# Minimum value: 1, maximum value: 25, default value: 1.
-# This tag requires that the tag DIRECTORY_GRAPH is set to YES.
-
-DIR_GRAPH_MAX_DEPTH = 1
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. For an explanation of the image formats see the section
-# output formats in the documentation of the dot tool (Graphviz (see:
-# http://www.graphviz.org/)).
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
-# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
-# png:gdiplus:gdiplus.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS =
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file or to the filename of jar file
-# to be used. If left blank, it is assumed PlantUML is not used or called during
-# a preprocessing step. Doxygen will generate a warning when it encounters a
-# \startuml command in this case and will not generate output for the diagram.
-
-PLANTUML_JAR_PATH =
-
-# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
-# configuration file for plantuml.
-
-PLANTUML_CFG_FILE =
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
-# graphical representation for inheritance and collaboration diagrams is used.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
-# files that are used to generate the various graphs.
-#
-# Note: This setting is not only used for dot files but also for msc temporary
-# files.
-# The default value is: YES.
-
-DOT_CLEANUP = YES
diff --git a/contrib/xz/doxygen/update-doxygen b/contrib/xz/doxygen/update-doxygen
index a5103199a8d1..c5d6ad39f1b1 100755
--- a/contrib/xz/doxygen/update-doxygen
+++ b/contrib/xz/doxygen/update-doxygen
@@ -1,53 +1,86 @@
#!/bin/sh
-#
+# SPDX-License-Identifier: 0BSD
+
#############################################################################
#
-# Updates the Doxygen generated documentation files in the source tree.
-# If the doxygen command is not installed, it will exit with an error.
-# This script can generate Doxygen documentation for all source files or for
-# just liblzma API header files.
+# While it's possible to use the Doxyfile as is to generate liblzma API
+# documentation, it is recommended to use this script because this adds
+# the XZ Utils version number to the generated HTML.
#
-# It is recommended to use this script to update the Doxygen-generated HTML
-# files since this will include the package version in the output and,
-# in case of liblzma API docs, strip JavaScript files from the output.
+# Other features:
+# - Generate documentation of the XZ Utils internals.
+# - Set input and output paths for out-of-tree builds.
#
#############################################################################
#
# Authors: Jia Tan
# Lasse Collin
#
-# This file has been put into the public domain.
-# You can do whatever you want with this file.
-#
#############################################################################
set -e
+show_usage()
+{
+ echo "Usage: $0 <api|internal> [ABS_TOP_SRCDIR ABS_OUTDIR]"
+ echo
+ echo "Supported modes:"
+ echo " - 'api' (default): liblzma API docs into doc/api"
+ echo " - 'internal': internal docs into doc/internal"
+ echo
+ echo "Absolute source and output dirs may be set" \
+ "to do an out-of-tree build."
+ echo "The output directory must already exist."
+ exit 1
+}
+
+case $1 in
+ api|internal)
+ ;;
+ *)
+ show_usage
+ ;;
+esac
+
if type doxygen > /dev/null 2>&1; then
:
else
- echo "doxygen/update-doxygen: 'doxygen' command not found." >&2
- echo "doxygen/update-doxygen: Skipping Doxygen docs generation." >&2
+ echo "$0: 'doxygen' command not found" >&2
exit 1
fi
-if test ! -f Doxyfile; then
- cd `dirname "$0"` || exit 1
- if test ! -f Doxyfile; then
- echo "doxygen/update-doxygen: Cannot find Doxyfile" >&2
- exit 1
- fi
+case $# in
+ 1)
+ # One argument: Building inside the source tree
+ ABS_TOP_SRCDIR=`dirname "$0"`/..
+ ABS_OUTDIR=$ABS_TOP_SRCDIR/doc
+ ;;
+ 3)
+ # Three arguments: Possibly an out of tree build
+ ABS_TOP_SRCDIR=$2
+ ABS_OUTDIR=$3
+ ;;
+ *)
+ show_usage
+ ;;
+esac
+
+if test ! -f "$ABS_TOP_SRCDIR/doxygen/Doxyfile"; then
+ echo "$0: Source dir '$ABS_TOP_SRCDIR/doxygen/Doxyfile' not found" >&2
+ exit 1
+fi
+if test ! -d "$ABS_OUTDIR"; then
+ echo "$0: Output dir '$ABS_OUTDIR' not found" >&2
+ exit 1
fi
# Get the package version so that it can be included in the generated docs.
-PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
+PACKAGE_VERSION=`cd "$ABS_TOP_SRCDIR" && sh build-aux/version.sh`
-# If no arguments are specified, default to generating liblzma API header
-# documentation only.
case $1 in
- '' | api)
+ api)
# Remove old documentation before re-generating the new.
- rm -rf ../doc/api
+ rm -rf "$ABS_OUTDIR/api"
# Generate the HTML documentation by preparing the Doxyfile
# in stdin and piping the result to the doxygen command.
@@ -55,57 +88,27 @@ case $1 in
# override any earlier assignment. So, we can use this
# feature to override the tags that need to change between
# "api" and "internal" modes.
+ ABS_SRCDIR=$ABS_TOP_SRCDIR/src/liblzma/api
(
- cat Doxyfile
+ cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
- ) | doxygen -
-
- # As of Doxygen 1.8.0 - 1.9.6 and the Doxyfile options we use,
- # the output is good without any JavaScript. Unfortunately
- # Doxygen doesn't have an option to disable JavaScript usage
- # completely so we strip it away with the hack below.
- #
- # Omitting the JavaScript code avoids some license hassle
- # as jquery.js is fairly big, it contains more than jQuery
- # itself, and doesn't include the actual license text (it
- # only refers to the MIT license by name).
- echo "Stripping JavaScript from Doxygen output..."
- for F in ../doc/api/*.html
- do
- sed 's/<script [^>]*><\/script>//g
- s/onclick="[^"]*"//g' \
- "$F" > ../doc/api/tmp
- mv -f ../doc/api/tmp "$F"
- done
- rm -f ../doc/api/*.js
+ echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
+ echo "STRIP_FROM_PATH = $ABS_SRCDIR"
+ echo "INPUT = $ABS_SRCDIR"
+ ) | doxygen -q -
;;
internal)
- # The docs from internal aren't for distribution so
- # the JavaScript files aren't an issue here.
- rm -rf ../doc/internal
+ rm -rf "$ABS_OUTDIR/internal"
(
- cat Doxyfile
- echo "PROJECT_NUMBER = $PACKAGE_VERSION"
+ cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
echo 'PROJECT_NAME = "XZ Utils"'
- echo 'STRIP_FROM_PATH = ../src'
- echo 'INPUT = ../src'
+ echo "PROJECT_NUMBER = $PACKAGE_VERSION"
+ echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
+ echo "STRIP_FROM_PATH = $ABS_TOP_SRCDIR"
+ echo "INPUT = $ABS_TOP_SRCDIR/src"
echo 'HTML_OUTPUT = internal'
- echo 'EXTRACT_PRIVATE = YES'
- echo 'EXTRACT_STATIC = YES'
- echo 'EXTRACT_LOCAL_CLASSES = YES'
echo 'SEARCHENGINE = YES'
- ) | doxygen -
- ;;
-
- *)
- echo "doxygen/update-doxygen: Error: mode argument '$1'" \
- "is not supported." >&2
- echo "doxygen/update-doxygen: Supported modes:" >&2
- echo "doxygen/update-doxygen: - 'api' (default):" \
- "liblzma API docs into doc/api" >&2
- echo "doxygen/update-doxygen: - 'internal':"\
- "internal docs into doc/internal" >&2
- exit 1
+ ) | doxygen -q -
;;
esac
diff --git a/contrib/xz/src/common/mythread.h b/contrib/xz/src/common/mythread.h
index 4495e017b290..10ea2d42c24d 100644
--- a/contrib/xz/src/common/mythread.h
+++ b/contrib/xz/src/common/mythread.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file mythread.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef MYTHREAD_H
@@ -112,6 +111,25 @@ mythread_sigmask(int how, const sigset_t *restrict set,
# include <sys/time.h>
#endif
+// MinGW-w64 with winpthreads:
+//
+// NOTE: Typical builds with MinGW-w64 don't use this code (MYTHREAD_POSIX).
+// Instead, native Windows threading APIs are used (MYTHREAD_VISTA or
+// MYTHREAD_WIN95).
+//
+// MinGW-w64 has _sigset_t (an integer type) in <sys/types.h>.
+// If _POSIX was #defined, the header would add the alias sigset_t too.
+// Let's keep this working even without _POSIX.
+//
+// There are no functions that actually do something with sigset_t
+// because signals barely exist on Windows. The sigfillset macro below
+// is just to silence warnings. There is no sigfillset() in MinGW-w64.
+#ifdef __MINGW32__
+# include <sys/types.h>
+# define sigset_t _sigset_t
+# define sigfillset(set_ptr) do { *(set_ptr) = 0; } while (0)
+#endif
+
#define MYTHREAD_RET_TYPE void *
#define MYTHREAD_RET_VALUE NULL
@@ -140,11 +158,13 @@ typedef struct timespec mythread_condtime;
// Use pthread_sigmask() to set the signal mask in multi-threaded programs.
// Do nothing on OpenVMS since it lacks pthread_sigmask().
+// Do nothing on MinGW-w64 too to silence warnings (its pthread_sigmask()
+// is #defined to 0 so it's a no-op).
static inline void
mythread_sigmask(int how, const sigset_t *restrict set,
sigset_t *restrict oset)
{
-#ifdef __VMS
+#if defined(__VMS) || defined(__MINGW32__)
(void)how;
(void)set;
(void)oset;
@@ -180,7 +200,7 @@ mythread_join(mythread thread)
}
-// Initiatlizes a mutex. Returns zero on success and non-zero on error.
+// Initializes a mutex. Returns zero on success and non-zero on error.
static inline int
mythread_mutex_init(mythread_mutex *mutex)
{
diff --git a/contrib/xz/src/common/sysdefs.h b/contrib/xz/src/common/sysdefs.h
index f04e45dd2147..5f3785b5137a 100644
--- a/contrib/xz/src/common/sysdefs.h
+++ b/contrib/xz/src/common/sysdefs.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file sysdefs.h
@@ -8,9 +10,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SYSDEFS_H
@@ -159,13 +158,16 @@ typedef unsigned char _Bool;
#include <string.h>
-// As of MSVC 2013, inline and restrict are supported with
-// non-standard keywords.
-#if defined(_WIN32) && defined(_MSC_VER)
-# ifndef inline
+// Visual Studio 2013 update 2 supports only __inline, not inline.
+// MSVC v19.0 / VS 2015 and newer support both.
+//
+// MSVC v19.27 (VS 2019 version 16.7) added support for restrict.
+// Older ones support only __restrict.
+#ifdef _MSC_VER
+# if _MSC_VER < 1900 && !defined(inline)
# define inline __inline
# endif
-# ifndef restrict
+# if _MSC_VER < 1927 && !defined(restrict)
# define restrict __restrict
# endif
#endif
diff --git a/contrib/xz/src/common/tuklib_common.h b/contrib/xz/src/common/tuklib_common.h
index b1f531ea4a68..7554dfc86fb6 100644
--- a/contrib/xz/src/common/tuklib_common.h
+++ b/contrib/xz/src/common/tuklib_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_common.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_COMMON_H
@@ -57,8 +56,28 @@
# define TUKLIB_GNUC_REQ(major, minor) 0
#endif
-#if TUKLIB_GNUC_REQ(2, 5)
+// tuklib_attr_noreturn attribute is used to mark functions as non-returning.
+// We cannot use "noreturn" as the macro name because then C23 code that
+// uses [[noreturn]] would break as it would expand to [[ [[noreturn]] ]].
+//
+// tuklib_attr_noreturn must be used at the beginning of function declaration
+// to work in all cases. The [[noreturn]] syntax is the most limiting, it
+// must be even before any GNU C's __attribute__ keywords:
+//
+// tuklib_attr_noreturn
+// __attribute__((nonnull(1)))
+// extern void foo(const char *s);
+//
+// FIXME: Update __STDC_VERSION__ for the final C23 version. 202000 is used
+// by GCC 13 and Clang 15 with -std=c2x.
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000
+# define tuklib_attr_noreturn [[noreturn]]
+#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112
+# define tuklib_attr_noreturn _Noreturn
+#elif TUKLIB_GNUC_REQ(2, 5)
# define tuklib_attr_noreturn __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+# define tuklib_attr_noreturn __declspec(noreturn)
#else
# define tuklib_attr_noreturn
#endif
diff --git a/contrib/xz/src/common/tuklib_config.h b/contrib/xz/src/common/tuklib_config.h
index 9d470ba732f1..b27251dc2765 100644
--- a/contrib/xz/src/common/tuklib_config.h
+++ b/contrib/xz/src/common/tuklib_config.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
// If config.h isn't available, assume that the headers required by
// tuklib_common.h are available. This is required by crc32_tablegen.c.
#ifdef HAVE_CONFIG_H
diff --git a/contrib/xz/src/common/tuklib_cpucores.c b/contrib/xz/src/common/tuklib_cpucores.c
index bb3f2f752b1b..c4a781ac387c 100644
--- a/contrib/xz/src/common/tuklib_cpucores.c
+++ b/contrib/xz/src/common/tuklib_cpucores.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_cpucores.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_cpucores.h"
diff --git a/contrib/xz/src/common/tuklib_cpucores.h b/contrib/xz/src/common/tuklib_cpucores.h
index be1ce1c175ae..edff9395e41c 100644
--- a/contrib/xz/src/common/tuklib_cpucores.h
+++ b/contrib/xz/src/common/tuklib_cpucores.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_cpucores.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_CPUCORES_H
diff --git a/contrib/xz/src/common/tuklib_exit.c b/contrib/xz/src/common/tuklib_exit.c
index aa55620ec563..c84e0f679a64 100644
--- a/contrib/xz/src/common/tuklib_exit.c
+++ b/contrib/xz/src/common/tuklib_exit.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_exit.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_common.h"
diff --git a/contrib/xz/src/common/tuklib_exit.h b/contrib/xz/src/common/tuklib_exit.h
index b11776f0e5bf..d4e6b4a7e832 100644
--- a/contrib/xz/src/common/tuklib_exit.h
+++ b/contrib/xz/src/common/tuklib_exit.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_exit.h
@@ -6,9 +8,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_EXIT_H
@@ -18,8 +17,8 @@
TUKLIB_DECLS_BEGIN
#define tuklib_exit TUKLIB_SYMBOL(tuklib_exit)
-extern void tuklib_exit(int status, int err_status, int show_error)
- tuklib_attr_noreturn;
+tuklib_attr_noreturn
+extern void tuklib_exit(int status, int err_status, int show_error);
TUKLIB_DECLS_END
#endif
diff --git a/contrib/xz/src/common/tuklib_gettext.h b/contrib/xz/src/common/tuklib_gettext.h
index ff1890407125..3ef5cb7292b5 100644
--- a/contrib/xz/src/common/tuklib_gettext.h
+++ b/contrib/xz/src/common/tuklib_gettext.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_gettext.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_GETTEXT_H
diff --git a/contrib/xz/src/common/tuklib_integer.h b/contrib/xz/src/common/tuklib_integer.h
index e22aa8ad83b2..fbd5fb2369a2 100644
--- a/contrib/xz/src/common/tuklib_integer.h
+++ b/contrib/xz/src/common/tuklib_integer.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_integer.h
@@ -14,7 +16,7 @@
///
/// Endianness-converting integer operations (these can be macros!)
/// (XX = 16, 32, or 64; Y = b or l):
-/// - Byte swapping: bswapXX(num)
+/// - Byte swapping: byteswapXX(num)
/// - Byte order conversions to/from native (byteswaps if Y isn't
/// the native endianness): convXXYe(num)
/// - Unaligned reads: readXXYe(ptr)
@@ -37,9 +39,6 @@
// Authors: Lasse Collin
// Joachim Henke
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_INTEGER_H
@@ -67,38 +66,41 @@
#if defined(HAVE___BUILTIN_BSWAPXX)
// GCC >= 4.8 and Clang
-# define bswap16(n) __builtin_bswap16(n)
-# define bswap32(n) __builtin_bswap32(n)
-# define bswap64(n) __builtin_bswap64(n)
+# define byteswap16(num) __builtin_bswap16(num)
+# define byteswap32(num) __builtin_bswap32(num)
+# define byteswap64(num) __builtin_bswap64(num)
#elif defined(HAVE_BYTESWAP_H)
// glibc, uClibc, dietlibc
# include <byteswap.h>
# ifdef HAVE_BSWAP_16
-# define bswap16(num) bswap_16(num)
+# define byteswap16(num) bswap_16(num)
# endif
# ifdef HAVE_BSWAP_32
-# define bswap32(num) bswap_32(num)
+# define byteswap32(num) bswap_32(num)
# endif
# ifdef HAVE_BSWAP_64
-# define bswap64(num) bswap_64(num)
+# define byteswap64(num) bswap_64(num)
# endif
#elif defined(HAVE_SYS_ENDIAN_H)
// *BSDs and Darwin
# include <sys/endian.h>
+# define byteswap16(num) bswap16(num)
+# define byteswap32(num) bswap32(num)
+# define byteswap64(num) bswap64(num)
#elif defined(HAVE_SYS_BYTEORDER_H)
// Solaris
# include <sys/byteorder.h>
# ifdef BSWAP_16
-# define bswap16(num) BSWAP_16(num)
+# define byteswap16(num) BSWAP_16(num)
# endif
# ifdef BSWAP_32
-# define bswap32(num) BSWAP_32(num)
+# define byteswap32(num) BSWAP_32(num)
# endif
# ifdef BSWAP_64
-# define bswap64(num) BSWAP_64(num)
+# define byteswap64(num) BSWAP_64(num)
# endif
# ifdef BE_16
# define conv16be(num) BE_16(num)
@@ -120,15 +122,15 @@
# endif
#endif
-#ifndef bswap16
-# define bswap16(n) (uint16_t)( \
+#ifndef byteswap16
+# define byteswap16(n) (uint16_t)( \
(((n) & 0x00FFU) << 8) \
| (((n) & 0xFF00U) >> 8) \
)
#endif
-#ifndef bswap32
-# define bswap32(n) (uint32_t)( \
+#ifndef byteswap32
+# define byteswap32(n) (uint32_t)( \
(((n) & UINT32_C(0x000000FF)) << 24) \
| (((n) & UINT32_C(0x0000FF00)) << 8) \
| (((n) & UINT32_C(0x00FF0000)) >> 8) \
@@ -136,8 +138,8 @@
)
#endif
-#ifndef bswap64
-# define bswap64(n) (uint64_t)( \
+#ifndef byteswap64
+# define byteswap64(n) (uint64_t)( \
(((n) & UINT64_C(0x00000000000000FF)) << 56) \
| (((n) & UINT64_C(0x000000000000FF00)) << 40) \
| (((n) & UINT64_C(0x0000000000FF0000)) << 24) \
@@ -161,23 +163,23 @@
# define conv64be(num) ((uint64_t)(num))
# endif
# ifndef conv16le
-# define conv16le(num) bswap16(num)
+# define conv16le(num) byteswap16(num)
# endif
# ifndef conv32le
-# define conv32le(num) bswap32(num)
+# define conv32le(num) byteswap32(num)
# endif
# ifndef conv64le
-# define conv64le(num) bswap64(num)
+# define conv64le(num) byteswap64(num)
# endif
#else
# ifndef conv16be
-# define conv16be(num) bswap16(num)
+# define conv16be(num) byteswap16(num)
# endif
# ifndef conv32be
-# define conv32be(num) bswap32(num)
+# define conv32be(num) byteswap32(num)
# endif
# ifndef conv64be
-# define conv64be(num) bswap64(num)
+# define conv64be(num) byteswap64(num)
# endif
# ifndef conv16le
# define conv16le(num) ((uint16_t)(num))
@@ -251,7 +253,7 @@
// was one instruction longer.
//
// Conclusion: At least in case of GCC and Clang, byte-by-byte code is
-// the best choise for strict-align archs to do unaligned access.
+// the best choice for strict-align archs to do unaligned access.
//
// See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111502
//
@@ -625,7 +627,7 @@ write64le(uint8_t *buf, uint64_t num)
// aligned but some compilers have language extensions to do that. With
// such language extensions the memcpy() method gives excellent results.
//
-// What to do on a strict-align system when no known language extentensions
+// What to do on a strict-align system when no known language extensions
// are available? Falling back to byte-by-byte access would be safe but ruin
// optimizations that have been made specifically with aligned access in mind.
// As a compromise, aligned reads will fall back to non-compliant type punning
diff --git a/contrib/xz/src/common/tuklib_mbstr.h b/contrib/xz/src/common/tuklib_mbstr.h
index dde9305f0a1c..4c8eeb7e3700 100644
--- a/contrib/xz/src/common/tuklib_mbstr.h
+++ b/contrib/xz/src/common/tuklib_mbstr.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mbstr.h
@@ -10,9 +12,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_MBSTR_H
diff --git a/contrib/xz/src/common/tuklib_mbstr_fw.c b/contrib/xz/src/common/tuklib_mbstr_fw.c
index 64c9ad5ae372..22d883b569fe 100644
--- a/contrib/xz/src/common/tuklib_mbstr_fw.c
+++ b/contrib/xz/src/common/tuklib_mbstr_fw.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mbstr_fw.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_mbstr.h"
diff --git a/contrib/xz/src/common/tuklib_mbstr_width.c b/contrib/xz/src/common/tuklib_mbstr_width.c
index 69d159e0bbcc..7a8bf0707518 100644
--- a/contrib/xz/src/common/tuklib_mbstr_width.c
+++ b/contrib/xz/src/common/tuklib_mbstr_width.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_mbstr_width.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_mbstr.h"
diff --git a/contrib/xz/src/common/tuklib_open_stdxxx.c b/contrib/xz/src/common/tuklib_open_stdxxx.c
index 26702a6afab0..b93e61d3b688 100644
--- a/contrib/xz/src/common/tuklib_open_stdxxx.c
+++ b/contrib/xz/src/common/tuklib_open_stdxxx.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_open_stdxxx.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_open_stdxxx.h"
diff --git a/contrib/xz/src/common/tuklib_open_stdxxx.h b/contrib/xz/src/common/tuklib_open_stdxxx.h
index b91161609ee6..3ee3ade35527 100644
--- a/contrib/xz/src/common/tuklib_open_stdxxx.h
+++ b/contrib/xz/src/common/tuklib_open_stdxxx.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_open_stdxxx.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_OPEN_STDXXX_H
diff --git a/contrib/xz/src/common/tuklib_physmem.c b/contrib/xz/src/common/tuklib_physmem.c
index 69f6fd4c8663..1009df14d9d1 100644
--- a/contrib/xz/src/common/tuklib_physmem.c
+++ b/contrib/xz/src/common/tuklib_physmem.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_physmem.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_physmem.h"
@@ -73,23 +72,20 @@
#endif
-// With GCC >= 8.1 with -Wextra and Clang >= 13 with -Wcast-function-type
-// will warn about the Windows-specific code.
-#if defined(__has_warning)
-# if __has_warning("-Wcast-function-type")
-# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
-# endif
-#elif TUKLIB_GNUC_REQ(8,1)
-# define CAN_DISABLE_WCAST_FUNCTION_TYPE 1
-#endif
-
-
extern uint64_t
tuklib_physmem(void)
{
uint64_t ret = 0;
#if defined(_WIN32) || defined(__CYGWIN__)
+ // This requires Windows 2000 or later.
+ MEMORYSTATUSEX meminfo;
+ meminfo.dwLength = sizeof(meminfo);
+ if (GlobalMemoryStatusEx(&meminfo))
+ ret = meminfo.ullTotalPhys;
+
+/*
+ // Old version that is compatible with even Win95:
if ((GetVersion() & 0xFF) >= 5) {
// Windows 2000 and later have GlobalMemoryStatusEx() which
// supports reporting values greater than 4 GiB. To keep the
@@ -125,6 +121,7 @@ tuklib_physmem(void)
GlobalMemoryStatus(&meminfo);
ret = meminfo.dwTotalPhys;
}
+*/
#elif defined(__OS2__)
unsigned long mem;
diff --git a/contrib/xz/src/common/tuklib_physmem.h b/contrib/xz/src/common/tuklib_physmem.h
index 09e2a51338ae..f35bfbab9c16 100644
--- a/contrib/xz/src/common/tuklib_physmem.h
+++ b/contrib/xz/src/common/tuklib_physmem.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_physmem.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_PHYSMEM_H
diff --git a/contrib/xz/src/common/tuklib_progname.c b/contrib/xz/src/common/tuklib_progname.c
index e2ef4e555f35..959c1270ce32 100644
--- a/contrib/xz/src/common/tuklib_progname.c
+++ b/contrib/xz/src/common/tuklib_progname.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_progname.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "tuklib_progname.h"
diff --git a/contrib/xz/src/common/tuklib_progname.h b/contrib/xz/src/common/tuklib_progname.h
index bb80f25e0381..a3d90cb1f21a 100644
--- a/contrib/xz/src/common/tuklib_progname.h
+++ b/contrib/xz/src/common/tuklib_progname.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file tuklib_progname.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef TUKLIB_PROGNAME_H
diff --git a/contrib/xz/src/liblzma/api/lzma.h b/contrib/xz/src/liblzma/api/lzma.h
index de12f225859f..6ca6e503d8a6 100644
--- a/contrib/xz/src/liblzma/api/lzma.h
+++ b/contrib/xz/src/liblzma/api/lzma.h
@@ -1,31 +1,30 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file api/lzma.h
* \brief The public API of liblzma data compression library
* \mainpage
*
- * liblzma is a public domain general-purpose data compression library with
- * a zlib-like API. The native file format is .xz, but also the old .lzma
- * format and raw (no headers) streams are supported. Multiple compression
- * algorithms (filters) are supported. Currently LZMA2 is the primary filter.
+ * liblzma is a general-purpose data compression library with a zlib-like API.
+ * The native file format is .xz, but also the old .lzma format and raw (no
+ * headers) streams are supported. Multiple compression algorithms (filters)
+ * are supported. Currently LZMA2 is the primary filter.
+ *
+ * liblzma is part of XZ Utils <https://tukaani.org/xz/>. XZ Utils
+ * includes a gzip-like command line tool named xz and some other tools.
+ * XZ Utils is developed and maintained by Lasse Collin.
*
- * liblzma is part of XZ Utils <https://tukaani.org/xz/>. XZ Utils includes
- * a gzip-like command line tool named xz and some other tools. XZ Utils
- * is developed and maintained by Lasse Collin and Jia Tan.
+ * Major parts of liblzma are based on code written by Igor Pavlov,
+ * specifically the LZMA SDK <https://7-zip.org/sdk.html>.
*
- * Major parts of liblzma are based on Igor Pavlov's public domain LZMA SDK
- * <https://7-zip.org/sdk.html>.
+ * The SHA-256 implementation in liblzma is based on code written by
+ * Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
*
- * The SHA-256 implementation is based on the public domain code found from
- * 7-Zip <https://7-zip.org/>, which has a modified version of the public
- * domain SHA-256 code found from Crypto++ <https://www.cryptopp.com/>.
- * The SHA-256 code in Crypto++ was written by Kevin Springle and Wei Dai.
+ * liblzma is distributed under the BSD Zero Clause License (0BSD).
*/
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H
diff --git a/contrib/xz/src/liblzma/api/lzma/base.h b/contrib/xz/src/liblzma/api/lzma/base.h
index 75cdd72acf20..590e1d22bb0f 100644
--- a/contrib/xz/src/liblzma/api/lzma/base.h
+++ b/contrib/xz/src/liblzma/api/lzma/base.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/base.h
* \brief Data types and functions used in many places in liblzma API
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -21,8 +20,8 @@
*
* This is here because C89 doesn't have stdbool.h. To set a value for
* variables having type lzma_bool, you can use
- * - C99's `true' and `false' from stdbool.h;
- * - C++'s internal `true' and `false'; or
+ * - C99's 'true' and 'false' from stdbool.h;
+ * - C++'s internal 'true' and 'false'; or
* - integers one (true) and zero (false).
*/
typedef unsigned char lzma_bool;
@@ -258,7 +257,7 @@ typedef enum {
*/
/*
- * These eumerations may be used internally by liblzma
+ * These enumerations may be used internally by liblzma
* but they will never be returned to applications.
*/
LZMA_RET_INTERNAL1 = 101,
@@ -273,13 +272,13 @@ typedef enum {
/**
- * \brief The `action' argument for lzma_code()
+ * \brief The 'action' argument for lzma_code()
*
* After the first use of LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, LZMA_FULL_BARRIER,
- * or LZMA_FINISH, the same `action' must be used until lzma_code() returns
+ * or LZMA_FINISH, the same 'action' must be used until lzma_code() returns
* LZMA_STREAM_END. Also, the amount of input (that is, strm->avail_in) must
* not be modified by the application until lzma_code() returns
- * LZMA_STREAM_END. Changing the `action' or modifying the amount of input
+ * LZMA_STREAM_END. Changing the 'action' or modifying the amount of input
* will make lzma_code() return LZMA_PROG_ERROR.
*/
typedef enum {
@@ -393,8 +392,8 @@ typedef enum {
* Single-threaded mode only: liblzma doesn't make an internal copy of
* lzma_allocator. Thus, it is OK to change these function pointers in
* the middle of the coding process, but obviously it must be done
- * carefully to make sure that the replacement `free' can deallocate
- * memory allocated by the earlier `alloc' function(s).
+ * carefully to make sure that the replacement 'free' can deallocate
+ * memory allocated by the earlier 'alloc' function(s).
*
* Multithreaded mode: liblzma might internally store pointers to the
* lzma_allocator given via the lzma_stream structure. The application
@@ -422,7 +421,7 @@ typedef struct {
* liblzma never sets this to zero.
*
* \return Pointer to the beginning of a memory block of
- * `size' bytes, or NULL if allocation fails
+ * 'size' bytes, or NULL if allocation fails
* for some reason. When allocation fails, functions
* of liblzma return LZMA_MEM_ERROR.
*
@@ -622,7 +621,7 @@ typedef struct {
* to and get output from liblzma.
*
* See the description of the coder-specific initialization function to find
- * out what `action' values are supported by the coder.
+ * out what 'action' values are supported by the coder.
*
* \param strm Pointer to lzma_stream that is at least initialized
* with LZMA_STREAM_INIT.
diff --git a/contrib/xz/src/liblzma/api/lzma/bcj.h b/contrib/xz/src/liblzma/api/lzma/bcj.h
index 0c84e0cff901..7f6611feb325 100644
--- a/contrib/xz/src/liblzma/api/lzma/bcj.h
+++ b/contrib/xz/src/liblzma/api/lzma/bcj.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/bcj.h
* \brief Branch/Call/Jump conversion filters
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -53,6 +52,11 @@
*/
#define LZMA_FILTER_ARM64 LZMA_VLI_C(0x0A)
+/**
+ * \brief Filter for RISC-V binaries
+ */
+#define LZMA_FILTER_RISCV LZMA_VLI_C(0x0B)
+
/**
* \brief Options for BCJ filters
diff --git a/contrib/xz/src/liblzma/api/lzma/block.h b/contrib/xz/src/liblzma/api/lzma/block.h
index ec5e77a69ae9..05b77e59aabb 100644
--- a/contrib/xz/src/liblzma/api/lzma/block.h
+++ b/contrib/xz/src/liblzma/api/lzma/block.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/block.h
* \brief .xz Block handling
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/check.h b/contrib/xz/src/liblzma/api/lzma/check.h
index b37197d2c7f7..e7a50ed3a3c3 100644
--- a/contrib/xz/src/liblzma/api/lzma/check.h
+++ b/contrib/xz/src/liblzma/api/lzma/check.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/check.h
* \brief Integrity checks
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/container.h b/contrib/xz/src/liblzma/api/lzma/container.h
index 4cbb1b7bf7b4..8e4af420389b 100644
--- a/contrib/xz/src/liblzma/api/lzma/container.h
+++ b/contrib/xz/src/liblzma/api/lzma/container.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/container.h
* \brief File formats
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -297,7 +296,7 @@ extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
* to call lzma_end() after failed initialization.
*
* If initialization succeeds, use lzma_code() to do the actual encoding.
- * Valid values for `action' (the second argument of lzma_code()) are
+ * Valid values for 'action' (the second argument of lzma_code()) are
* LZMA_RUN, LZMA_SYNC_FLUSH, LZMA_FULL_FLUSH, and LZMA_FINISH. In future,
* there may be compression levels or flags that don't support LZMA_SYNC_FLUSH.
*
@@ -679,13 +678,13 @@ extern LZMA_API(lzma_ret) lzma_microlzma_encoder(
* supported by liblzma, only the .xz and .lz formats allow concatenated
* files. Concatenated files are not allowed with the legacy .lzma format.
*
- * This flag also affects the usage of the `action' argument for lzma_code().
+ * This flag also affects the usage of the 'action' argument for lzma_code().
* When LZMA_CONCATENATED is used, lzma_code() won't return LZMA_STREAM_END
- * unless LZMA_FINISH is used as `action'. Thus, the application has to set
+ * unless LZMA_FINISH is used as 'action'. Thus, the application has to set
* LZMA_FINISH in the same way as it does when encoding.
*
* If LZMA_CONCATENATED is not used, the decoders still accept LZMA_FINISH
- * as `action' for lzma_code(), but the usage of LZMA_FINISH isn't required.
+ * as 'action' for lzma_code(), but the usage of LZMA_FINISH isn't required.
*/
#define LZMA_CONCATENATED UINT32_C(0x08)
@@ -793,7 +792,7 @@ extern LZMA_API(lzma_ret) lzma_stream_decoder_mt(
* as it doesn't support any decoder flags. It will return LZMA_STREAM_END
* after one .lzma stream.)
*
- * \param strm Pointer to lzma_stream that is at least initialized
+ * \param strm Pointer to lzma_stream that is at least initialized
* with LZMA_STREAM_INIT.
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
* to effectively disable the limiter. liblzma
@@ -819,7 +818,7 @@ extern LZMA_API(lzma_ret) lzma_auto_decoder(
/**
* \brief Initialize .lzma decoder (legacy file format)
*
- * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
+ * Valid 'action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
* There is no need to use LZMA_FINISH, but it's allowed because it may
* simplify certain types of applications.
*
diff --git a/contrib/xz/src/liblzma/api/lzma/delta.h b/contrib/xz/src/liblzma/api/lzma/delta.h
index 7a725bc40742..5ebacef81584 100644
--- a/contrib/xz/src/liblzma/api/lzma/delta.h
+++ b/contrib/xz/src/liblzma/api/lzma/delta.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/delta.h
* \brief Delta filter
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/filter.h b/contrib/xz/src/liblzma/api/lzma/filter.h
index 1d887b4f2f43..e86809c4e395 100644
--- a/contrib/xz/src/liblzma/api/lzma/filter.h
+++ b/contrib/xz/src/liblzma/api/lzma/filter.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/filter.h
* \brief Common filter related types and functions
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -43,7 +42,7 @@ typedef struct {
/**
* \brief Filter ID
*
- * Use constants whose name begin with `LZMA_FILTER_' to specify
+ * Use constants whose name begin with 'LZMA_FILTER_' to specify
* different filters. In an array of lzma_filter structures, use
* LZMA_VLI_UNKNOWN to indicate end of filters.
*
@@ -199,7 +198,7 @@ extern LZMA_API(uint64_t) lzma_raw_decoder_memusage(const lzma_filter *filters)
*
* This function may be useful when implementing custom file formats.
*
- * The `action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the
+ * The 'action' with lzma_code() can be LZMA_RUN, LZMA_SYNC_FLUSH (if the
* filter chain supports it), or LZMA_FINISH.
*
* \param strm Pointer to lzma_stream that is at least
@@ -223,7 +222,7 @@ extern LZMA_API(lzma_ret) lzma_raw_encoder(
*
* The initialization of raw decoder goes similarly to raw encoder.
*
- * The `action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using
+ * The 'action' with lzma_code() can be LZMA_RUN or LZMA_FINISH. Using
* LZMA_FINISH is not required, it is supported just for convenience.
*
* \param strm Pointer to lzma_stream that is at least
diff --git a/contrib/xz/src/liblzma/api/lzma/hardware.h b/contrib/xz/src/liblzma/api/lzma/hardware.h
index f34897d8740f..7a1a84fcccfc 100644
--- a/contrib/xz/src/liblzma/api/lzma/hardware.h
+++ b/contrib/xz/src/liblzma/api/lzma/hardware.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/hardware.h
* \brief Hardware information
@@ -23,9 +25,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/index.h b/contrib/xz/src/liblzma/api/lzma/index.h
index 6eee4d68137d..b17025e3d901 100644
--- a/contrib/xz/src/liblzma/api/lzma/index.h
+++ b/contrib/xz/src/liblzma/api/lzma/index.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/index.h
* \brief Handling of .xz Index and related information
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -234,7 +233,7 @@ typedef struct {
} block;
/**
- * \private Internal struct.
+ * \private Internal data
*
* Internal data which is used to store the state of the iterator.
* The exact format may vary between liblzma versions, so don't
@@ -302,6 +301,28 @@ typedef enum {
/**
+ * \brief Mask for return value from lzma_index_checks() for check none
+ *
+ * \note This and the other CHECK_MASK macros were added in 5.5.1alpha.
+ */
+#define LZMA_INDEX_CHECK_MASK_NONE (UINT32_C(1) << LZMA_CHECK_NONE)
+
+/**
+ * \brief Mask for return value from lzma_index_checks() for check CRC32
+ */
+#define LZMA_INDEX_CHECK_MASK_CRC32 (UINT32_C(1) << LZMA_CHECK_CRC32)
+
+/**
+ * \brief Mask for return value from lzma_index_checks() for check CRC64
+ */
+#define LZMA_INDEX_CHECK_MASK_CRC64 (UINT32_C(1) << LZMA_CHECK_CRC64)
+
+/**
+ * \brief Mask for return value from lzma_index_checks() for check SHA256
+ */
+#define LZMA_INDEX_CHECK_MASK_SHA256 (UINT32_C(1) << LZMA_CHECK_SHA256)
+
+/**
* \brief Calculate memory usage of lzma_index
*
* On disk, the size of the Index field depends on both the number of Records
@@ -431,6 +452,7 @@ extern LZMA_API(lzma_ret) lzma_index_stream_flags(
* showing the Check types to the user.
*
* The bitmask is 1 << check_id, e.g. CRC32 is 1 << 1 and SHA-256 is 1 << 10.
+ * These masks are defined for convenience as LZMA_INDEX_CHECK_MASK_XXX
*
* \param i Pointer to lzma_index structure
*
@@ -651,7 +673,7 @@ extern LZMA_API(lzma_bool) lzma_index_iter_locate(
* function succeeds, the memory allocated for src
* is freed or moved to be part of dest, and all
* iterators pointing to src will become invalid.
-* \param allocator lzma_allocator for custom allocator functions.
+ * \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
*
* \return Possible lzma_ret values:
@@ -686,7 +708,7 @@ extern LZMA_API(lzma_index *) lzma_index_dup(
* \param strm Pointer to properly prepared lzma_stream
* \param i Pointer to lzma_index which should be encoded.
*
- * The valid `action' values for lzma_code() are LZMA_RUN and LZMA_FINISH.
+ * The valid 'action' values for lzma_code() are LZMA_RUN and LZMA_FINISH.
* It is enough to use only one of them (you can choose freely).
*
* \return Possible lzma_ret values:
@@ -715,7 +737,7 @@ extern LZMA_API(lzma_ret) lzma_index_encoder(
* don't allow 0 here and return LZMA_PROG_ERROR;
* later versions treat 0 as if 1 had been specified.
*
- * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
+ * Valid 'action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
* There is no need to use LZMA_FINISH, but it's allowed because it may
* simplify certain types of applications.
*
@@ -771,7 +793,7 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i,
* lzma_index is allowed to require. The value
* pointed by this pointer is modified if and only
* if LZMA_MEMLIMIT_ERROR is returned.
- * \param allocator lzma_allocator for custom allocator functions.
+ * \param allocator lzma_allocator for custom allocator functions.
* Set to NULL to use malloc() and free().
* \param in Beginning of the input buffer
* \param in_pos The next byte will be read from in[*in_pos].
@@ -819,10 +841,10 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_decode(lzma_index **i,
* expect to see the same exact value for the same file if you change the
* input buffer size or switch to a different liblzma version.
*
- * Valid `action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
+ * Valid 'action' arguments to lzma_code() are LZMA_RUN and LZMA_FINISH.
* You only need to use LZMA_RUN; LZMA_FINISH is only supported because it
* might be convenient for some applications. If you use LZMA_FINISH and if
- * lzma_code() asks the application to seek, remember to reset `action' back
+ * lzma_code() asks the application to seek, remember to reset 'action' back
* to LZMA_RUN unless you hit the end of the file again.
*
* Possible return values from lzma_code():
diff --git a/contrib/xz/src/liblzma/api/lzma/index_hash.h b/contrib/xz/src/liblzma/api/lzma/index_hash.h
index a2d4c4845b7c..68f9024eb3bc 100644
--- a/contrib/xz/src/liblzma/api/lzma/index_hash.h
+++ b/contrib/xz/src/liblzma/api/lzma/index_hash.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/index_hash.h
* \brief Validate Index by using a hash function
@@ -9,9 +11,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/lzma12.h b/contrib/xz/src/liblzma/api/lzma/lzma12.h
index 8ef6ea5b5010..05f5b66eb56a 100644
--- a/contrib/xz/src/liblzma/api/lzma/lzma12.h
+++ b/contrib/xz/src/liblzma/api/lzma/lzma12.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/lzma12.h
* \brief LZMA1 and LZMA2 filters
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -289,7 +288,7 @@ typedef struct {
* \brief Number of literal context bits
*
* How many of the highest bits of the previous uncompressed
- * eight-bit byte (also known as `literal') are taken into
+ * eight-bit byte (also known as 'literal') are taken into
* account when predicting the bits of the next literal.
*
* E.g. in typical English text, an upper-case letter is
diff --git a/contrib/xz/src/liblzma/api/lzma/stream_flags.h b/contrib/xz/src/liblzma/api/lzma/stream_flags.h
index 7622a62120e3..a33fe4683760 100644
--- a/contrib/xz/src/liblzma/api/lzma/stream_flags.h
+++ b/contrib/xz/src/liblzma/api/lzma/stream_flags.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/stream_flags.h
* \brief .xz Stream Header and Stream Footer encoder and decoder
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
diff --git a/contrib/xz/src/liblzma/api/lzma/version.h b/contrib/xz/src/liblzma/api/lzma/version.h
index 8dac38297273..53526b992c95 100644
--- a/contrib/xz/src/liblzma/api/lzma/version.h
+++ b/contrib/xz/src/liblzma/api/lzma/version.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/version.h
* \brief Version number
@@ -6,9 +8,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -20,10 +19,10 @@
#define LZMA_VERSION_MAJOR 5
/** \brief Minor version number of the liblzma release. */
-#define LZMA_VERSION_MINOR 4
+#define LZMA_VERSION_MINOR 6
/** \brief Patch version number of the liblzma release. */
-#define LZMA_VERSION_PATCH 5
+#define LZMA_VERSION_PATCH 2
/**
* \brief Version stability marker
diff --git a/contrib/xz/src/liblzma/api/lzma/vli.h b/contrib/xz/src/liblzma/api/lzma/vli.h
index f9ad15500dfe..6b049021b909 100644
--- a/contrib/xz/src/liblzma/api/lzma/vli.h
+++ b/contrib/xz/src/liblzma/api/lzma/vli.h
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/**
* \file lzma/vli.h
* \brief Variable-length integer handling
@@ -17,9 +19,6 @@
/*
* Author: Lasse Collin
- *
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
*/
#ifndef LZMA_H_INTERNAL
@@ -68,9 +67,8 @@ typedef uint64_t lzma_vli;
* This is useful to test that application has given acceptable values
* for example in the uncompressed_size and compressed_size variables.
*
- * \return True if the integer is representable as VLI or if it
- * indicates unknown value. False if the integer cannot be
- * represented as VLI.
+ * \return True if the integer is representable as a VLI or if it
+ * indicates an unknown value. False otherwise.
*/
#define lzma_vli_is_valid(vli) \
((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
diff --git a/contrib/xz/src/liblzma/check/check.c b/contrib/xz/src/liblzma/check/check.c
index 428ddaeb7798..7734ace1856e 100644
--- a/contrib/xz/src/liblzma/check/check.c
+++ b/contrib/xz/src/liblzma/check/check.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file check.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
diff --git a/contrib/xz/src/liblzma/check/check.h b/contrib/xz/src/liblzma/check/check.h
index 8ae95d59019f..f0eb1172d907 100644
--- a/contrib/xz/src/liblzma/check/check.h
+++ b/contrib/xz/src/liblzma/check/check.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file check.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_CHECK_H
diff --git a/contrib/xz/src/liblzma/check/crc32_arm64.h b/contrib/xz/src/liblzma/check/crc32_arm64.h
new file mode 100644
index 000000000000..39c1c63ec0ec
--- /dev/null
+++ b/contrib/xz/src/liblzma/check/crc32_arm64.h
@@ -0,0 +1,122 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file crc32_arm64.h
+/// \brief CRC32 calculation with ARM64 optimization
+//
+// Authors: Chenxi Mao
+// Jia Tan
+// Hans Jansen
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef LZMA_CRC32_ARM64_H
+#define LZMA_CRC32_ARM64_H
+
+// MSVC always has the CRC intrinsics available when building for ARM64
+// there is no need to include any header files.
+#ifndef _MSC_VER
+# include <arm_acle.h>
+#endif
+
+// If both versions are going to be built, we need runtime detection
+// to check if the instructions are supported.
+#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
+# if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
+# include <sys/auxv.h>
+# elif defined(_WIN32)
+# include <processthreadsapi.h>
+# elif defined(__APPLE__) && defined(HAVE_SYSCTLBYNAME)
+# include <sys/sysctl.h>
+# endif
+#endif
+
+// Some EDG-based compilers support ARM64 and define __GNUC__
+// (such as Nvidia's nvcc), but do not support function attributes.
+//
+// NOTE: Build systems check for this too, keep them in sync with this.
+#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
+# define crc_attr_target __attribute__((__target__("+crc")))
+#else
+# define crc_attr_target
+#endif
+
+
+crc_attr_target
+static uint32_t
+crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
+{
+ crc = ~crc;
+
+ // Align the input buffer because this was shown to be
+ // significantly faster than unaligned accesses.
+ const size_t align_amount = my_min(size, (0U - (uintptr_t)buf) & 7);
+
+ for (const uint8_t *limit = buf + align_amount; buf < limit; ++buf)
+ crc = __crc32b(crc, *buf);
+
+ size -= align_amount;
+
+ // Process 8 bytes at a time. The end point is determined by
+ // ignoring the least significant three bits of size to ensure
+ // we do not process past the bounds of the buffer. This guarantees
+ // that limit is a multiple of 8 and is strictly less than size.
+ for (const uint8_t *limit = buf + (size & ~(size_t)7);
+ buf < limit; buf += 8)
+ crc = __crc32d(crc, aligned_read64le(buf));
+
+ // Process the remaining bytes that are not 8 byte aligned.
+ for (const uint8_t *limit = buf + (size & 7); buf < limit; ++buf)
+ crc = __crc32b(crc, *buf);
+
+ return ~crc;
+}
+
+
+#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
+static inline bool
+is_arch_extension_supported(void)
+{
+#if defined(HAVE_GETAUXVAL)
+ return (getauxval(AT_HWCAP) & HWCAP_CRC32) != 0;
+
+#elif defined(HAVE_ELF_AUX_INFO)
+ unsigned long feature_flags;
+
+ if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0)
+ return false;
+
+ return (feature_flags & HWCAP_CRC32) != 0;
+
+#elif defined(_WIN32)
+ return IsProcessorFeaturePresent(
+ PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
+
+#elif defined(__APPLE__) && defined(HAVE_SYSCTLBYNAME)
+ int has_crc32 = 0;
+ size_t size = sizeof(has_crc32);
+
+ // The sysctlbyname() function requires a string identifier for the
+ // CPU feature it tests. The Apple documentation lists the string
+ // "hw.optional.armv8_crc32", which can be found here:
+ // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619
+ if (sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
+ &size, NULL, 0) != 0)
+ return false;
+
+ return has_crc32;
+
+#else
+ // If a runtime detection method cannot be found, then this must
+ // be a compile time error. The checks in crc_common.h should ensure
+ // a runtime detection method is always found if this function is
+ // built. It would be possible to just return false here, but this
+ // is inefficient for binary size and runtime since only the generic
+ // method could ever be used.
+# error Runtime detection method unavailable.
+#endif
+}
+#endif
+
+#endif // LZMA_CRC32_ARM64_H
diff --git a/contrib/xz/src/liblzma/check/crc32_fast.c b/contrib/xz/src/liblzma/check/crc32_fast.c
index eed7350582e4..16dbb7467513 100644
--- a/contrib/xz/src/liblzma/check/crc32_fast.c
+++ b/contrib/xz/src/liblzma/check/crc32_fast.c
@@ -1,35 +1,40 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32.c
/// \brief CRC32 calculation
-///
-/// Calculate the CRC32 using the slice-by-eight algorithm.
-/// It is explained in this document:
-/// http://www.intel.com/technology/comms/perfnet/download/CRC_generators.pdf
-/// The code in this file is not the same as in Intel's paper, but
-/// the basic principle is identical.
-//
-// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Ilya Kurdyukov
+// Hans Jansen
//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
-#include "crc_macros.h"
+#include "crc_common.h"
+
+#if defined(CRC_X86_CLMUL)
+# define BUILDING_CRC32_CLMUL
+# include "crc_x86_clmul.h"
+#elif defined(CRC32_ARM64)
+# include "crc32_arm64.h"
+#endif
-// If you make any changes, do some benchmarking! Seemingly unrelated
-// changes can very easily ruin the performance (and very probably is
-// very compiler dependent).
-extern LZMA_API(uint32_t)
-lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
+#ifdef CRC32_GENERIC
+
+///////////////////
+// Generic CRC32 //
+///////////////////
+
+static uint32_t
+crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
{
crc = ~crc;
#ifdef WORDS_BIGENDIAN
- crc = bswap32(crc);
+ crc = byteswap32(crc);
#endif
if (size > 8) {
@@ -75,8 +80,125 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc);
#ifdef WORDS_BIGENDIAN
- crc = bswap32(crc);
+ crc = byteswap32(crc);
#endif
return ~crc;
}
+#endif
+
+
+#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
+
+//////////////////////////
+// Function dispatching //
+//////////////////////////
+
+// If both the generic and arch-optimized implementations are built, then
+// the function to use is selected at runtime because the system running
+// the binary might not have the arch-specific instruction set extension(s)
+// available. The dispatch methods in order of priority:
+//
+// 1. Constructor. This method uses __attribute__((__constructor__)) to
+// set crc32_func at load time. This avoids extra computation (and any
+// unlikely threading bugs) on the first call to lzma_crc32() to decide
+// which implementation should be used.
+//
+// 2. First Call Resolution. On the very first call to lzma_crc32(), the
+// call will be directed to crc32_dispatch() instead. This will set the
+// appropriate implementation function and will not be called again.
+// This method does not use any kind of locking but is safe because if
+// multiple threads run the dispatcher simultaneously then they will all
+// set crc32_func to the same value.
+
+typedef uint32_t (*crc32_func_type)(
+ const uint8_t *buf, size_t size, uint32_t crc);
+
+// This resolver is shared between all dispatch methods.
+static crc32_func_type
+crc32_resolve(void)
+{
+ return is_arch_extension_supported()
+ ? &crc32_arch_optimized : &crc32_generic;
+}
+
+
+#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
+// Constructor method.
+# define CRC32_SET_FUNC_ATTR __attribute__((__constructor__))
+static crc32_func_type crc32_func;
+#else
+// First Call Resolution method.
+# define CRC32_SET_FUNC_ATTR
+static uint32_t crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc);
+static crc32_func_type crc32_func = &crc32_dispatch;
+#endif
+
+CRC32_SET_FUNC_ATTR
+static void
+crc32_set_func(void)
+{
+ crc32_func = crc32_resolve();
+ return;
+}
+
+#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
+static uint32_t
+crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc)
+{
+ // When __attribute__((__constructor__)) isn't supported, set the
+ // function pointer without any locking. If multiple threads run
+ // the detection code in parallel, they will all end up setting
+ // the pointer to the same value. This avoids the use of
+ // mythread_once() on every call to lzma_crc32() but this likely
+ // isn't strictly standards compliant. Let's change it if it breaks.
+ crc32_set_func();
+ return crc32_func(buf, size, crc);
+}
+
+#endif
+#endif
+
+
+extern LZMA_API(uint32_t)
+lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
+{
+#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
+ // On x86-64, if CLMUL is available, it is the best for non-tiny
+ // inputs, being over twice as fast as the generic slice-by-four
+ // version. However, for size <= 16 it's different. In the extreme
+ // case of size == 1 the generic version can be five times faster.
+ // At size >= 8 the CLMUL starts to become reasonable. It
+ // varies depending on the alignment of buf too.
+ //
+ // The above doesn't include the overhead of mythread_once().
+ // At least on x86-64 GNU/Linux, pthread_once() is very fast but
+ // it still makes lzma_crc32(buf, 1, crc) 50-100 % slower. When
+ // size reaches 12-16 bytes the overhead becomes negligible.
+ //
+ // So using the generic version for size <= 16 may give better
+ // performance with tiny inputs but if such inputs happen rarely
+ // it's not so obvious because then the lookup table of the
+ // generic version may not be in the processor cache.
+#ifdef CRC_USE_GENERIC_FOR_SMALL_INPUTS
+ if (size <= 16)
+ return crc32_generic(buf, size, crc);
+#endif
+
+/*
+#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
+ // See crc32_dispatch(). This would be the alternative which uses
+ // locking and doesn't use crc32_dispatch(). Note that on Windows
+ // this method needs Vista threads.
+ mythread_once(crc64_set_func);
+#endif
+*/
+ return crc32_func(buf, size, crc);
+
+#elif defined(CRC32_ARCH_OPTIMIZED)
+ return crc32_arch_optimized(buf, size, crc);
+
+#else
+ return crc32_generic(buf, size, crc);
+#endif
+}
diff --git a/contrib/xz/src/liblzma/check/crc32_small.c b/contrib/xz/src/liblzma/check/crc32_small.c
index 186966e99216..6a1bd66185ea 100644
--- a/contrib/xz/src/liblzma/check/crc32_small.c
+++ b/contrib/xz/src/liblzma/check/crc32_small.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32_small.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
diff --git a/contrib/xz/src/liblzma/check/crc32_table.c b/contrib/xz/src/liblzma/check/crc32_table.c
index b11762ae0ac7..c141cefe5a40 100644
--- a/contrib/xz/src/liblzma/check/crc32_table.c
+++ b/contrib/xz/src/liblzma/check/crc32_table.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32_table.c
@@ -5,18 +7,36 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
+
+// FIXME: Compared to crc_common.h this has to check for __x86_64__ too
+// so that in 32-bit builds crc32_x86.S won't break due to a missing table.
+#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
+ && defined(__SSE4_1__) && defined(__PCLMUL__)) \
+ || (defined(__e2k__) && __iset__ >= 6))
+# define NO_CRC32_TABLE
+
+#elif defined(HAVE_ARM64_CRC32) \
+ && !defined(WORDS_BIGENDIAN) \
+ && defined(__ARM_FEATURE_CRC32)
+# define NO_CRC32_TABLE
+#endif
+
+
+#if !defined(HAVE_ENCODERS) && defined(NO_CRC32_TABLE)
+// No table needed. Use a typedef to avoid an empty translation unit.
+typedef void lzma_crc32_dummy;
+
+#else
// Having the declaration here silences clang -Wmissing-variable-declarations.
extern const uint32_t lzma_crc32_table[8][256];
-#ifdef WORDS_BIGENDIAN
-# include "crc32_table_be.h"
-#else
-# include "crc32_table_le.h"
+# ifdef WORDS_BIGENDIAN
+# include "crc32_table_be.h"
+# else
+# include "crc32_table_le.h"
+# endif
#endif
diff --git a/contrib/xz/src/liblzma/check/crc32_table_be.h b/contrib/xz/src/liblzma/check/crc32_table_be.h
index c483cb670dcb..505c23074c11 100644
--- a/contrib/xz/src/liblzma/check/crc32_table_be.h
+++ b/contrib/xz/src/liblzma/check/crc32_table_be.h
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
const uint32_t lzma_crc32_table[8][256] = {
{
diff --git a/contrib/xz/src/liblzma/check/crc32_table_le.h b/contrib/xz/src/liblzma/check/crc32_table_le.h
index 25f4fc443537..e89c21a7b23d 100644
--- a/contrib/xz/src/liblzma/check/crc32_table_le.h
+++ b/contrib/xz/src/liblzma/check/crc32_table_le.h
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
const uint32_t lzma_crc32_table[8][256] = {
{
diff --git a/contrib/xz/src/liblzma/check/crc32_tablegen.c b/contrib/xz/src/liblzma/check/crc32_tablegen.c
index 31a4d2751db2..b8cf459f8e76 100644
--- a/contrib/xz/src/liblzma/check/crc32_tablegen.c
+++ b/contrib/xz/src/liblzma/check/crc32_tablegen.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32_tablegen.c
@@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -44,7 +43,7 @@ init_crc32_table(void)
#ifdef WORDS_BIGENDIAN
for (size_t s = 0; s < 8; ++s)
for (size_t b = 0; b < 256; ++b)
- crc32_table[s][b] = bswap32(crc32_table[s][b]);
+ crc32_table[s][b] = byteswap32(crc32_table[s][b]);
#endif
return;
@@ -54,9 +53,11 @@ init_crc32_table(void)
static void
print_crc32_table(void)
{
- printf("/* This file has been automatically generated by "
- "crc32_tablegen.c. */\n\n"
- "const uint32_t lzma_crc32_table[8][256] = {\n\t{");
+ // Split the SPDX string so that it won't accidentally match
+ // when tools search for the string.
+ printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+ "// This file has been generated by crc32_tablegen.c.\n\n"
+ "const uint32_t lzma_crc32_table[8][256] = {\n\t{");
for (size_t s = 0; s < 8; ++s) {
for (size_t b = 0; b < 256; ++b) {
@@ -82,9 +83,11 @@ print_crc32_table(void)
static void
print_lz_table(void)
{
- printf("/* This file has been automatically generated by "
- "crc32_tablegen.c. */\n\n"
- "const uint32_t lzma_lz_hash_table[256] = {");
+ // Split the SPDX string so that it won't accidentally match
+ // when tools search for the string.
+ printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+ "// This file has been generated by crc32_tablegen.c.\n\n"
+ "const uint32_t lzma_lz_hash_table[256] = {");
for (size_t b = 0; b < 256; ++b) {
if ((b % 4) == 0)
diff --git a/contrib/xz/src/liblzma/check/crc32_x86.S b/contrib/xz/src/liblzma/check/crc32_x86.S
index 4f395df8122a..ddc3cee6ea5b 100644
--- a/contrib/xz/src/liblzma/check/crc32_x86.S
+++ b/contrib/xz/src/liblzma/check/crc32_x86.S
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/*
* Speed-optimized CRC32 using slicing-by-eight algorithm
*
@@ -11,9 +13,6 @@
* Authors: Igor Pavlov (original version)
* Lasse Collin (AT&T syntax, PIC support, better portability)
*
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
- *
* This code needs lzma_crc32_table, which can be created using the
* following C code:
diff --git a/contrib/xz/src/liblzma/check/crc64_fast.c b/contrib/xz/src/liblzma/check/crc64_fast.c
index 0c8622a1f367..0ce83fe4ad36 100644
--- a/contrib/xz/src/liblzma/check/crc64_fast.c
+++ b/contrib/xz/src/liblzma/check/crc64_fast.c
@@ -1,85 +1,30 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc64.c
/// \brief CRC64 calculation
-///
-/// There are two methods in this file. crc64_generic uses the
-/// the slice-by-four algorithm. This is the same idea that is
-/// used in crc32_fast.c, but for CRC64 we use only four tables
-/// instead of eight to avoid increasing CPU cache usage.
-///
-/// crc64_clmul uses 32/64-bit x86 SSSE3, SSE4.1, and CLMUL instructions.
-/// It was derived from
-/// https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf
-/// and the public domain code from https://github.com/rawrunprotected/crc
-/// (URLs were checked on 2022-11-07).
-///
-/// FIXME: Builds for 32-bit x86 use crc64_x86.S by default instead
-/// of this file and thus CLMUL version isn't available on 32-bit x86
-/// unless configured with --disable-assembler. Even then the lookup table
-/// isn't omitted in crc64_table.c since it doesn't know that assembly
-/// code has been disabled.
//
// Authors: Lasse Collin
// Ilya Kurdyukov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
+#include "crc_common.h"
-#undef CRC_GENERIC
-#undef CRC_CLMUL
-#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
-
-// If CLMUL cannot be used then only the generic slice-by-four is built.
-#if !defined(HAVE_USABLE_CLMUL)
-# define CRC_GENERIC 1
-
-// If CLMUL is allowed unconditionally in the compiler options then the
-// generic version can be omitted. Note that this doesn't work with MSVC
-// as I don't know how to detect the features here.
-//
-// NOTE: Keep this this in sync with crc64_table.c.
-#elif (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \
- || (defined(__e2k__) && __iset__ >= 6)
-# define CRC_CLMUL 1
-
-// Otherwise build both and detect at runtime which version to use.
-#else
-# define CRC_GENERIC 1
-# define CRC_CLMUL 1
-
-/*
- // The generic code is much faster with 1-8-byte inputs and has
- // similar performance up to 16 bytes at least in microbenchmarks
- // (it depends on input buffer alignment too). If both versions are
- // built, this #define will use the generic version for inputs up to
- // 16 bytes and CLMUL for bigger inputs. It saves a little in code
- // size since the special cases for 0-16-byte inputs will be omitted
- // from the CLMUL code.
-# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
-*/
-
-# if defined(_MSC_VER)
-# include <intrin.h>
-# elif defined(HAVE_CPUID_H)
-# include <cpuid.h>
-# endif
+#if defined(CRC_X86_CLMUL)
+# define BUILDING_CRC64_CLMUL
+# include "crc_x86_clmul.h"
#endif
+#ifdef CRC64_GENERIC
+
/////////////////////////////////
// Generic slice-by-four CRC64 //
/////////////////////////////////
-#ifdef CRC_GENERIC
-
-#include "crc_macros.h"
-
-
#ifdef WORDS_BIGENDIAN
# define A1(x) ((x) >> 56)
#else
@@ -94,7 +39,7 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
crc = ~crc;
#ifdef WORDS_BIGENDIAN
- crc = bswap64(crc);
+ crc = byteswap64(crc);
#endif
if (size > 4) {
@@ -128,7 +73,7 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc);
#ifdef WORDS_BIGENDIAN
- crc = bswap64(crc);
+ crc = byteswap64(crc);
#endif
return ~crc;
@@ -136,336 +81,40 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
#endif
-/////////////////////
-// x86 CLMUL CRC64 //
-/////////////////////
-
-#ifdef CRC_CLMUL
-
-#include <immintrin.h>
-
-
-/*
-// These functions were used to generate the constants
-// at the top of crc64_clmul().
-static uint64_t
-calc_lo(uint64_t poly)
-{
- uint64_t a = poly;
- uint64_t b = 0;
-
- for (unsigned i = 0; i < 64; ++i) {
- b = (b >> 1) | (a << 63);
- a = (a >> 1) ^ (a & 1 ? poly : 0);
- }
-
- return b;
-}
-
-static uint64_t
-calc_hi(uint64_t poly, uint64_t a)
-{
- for (unsigned i = 0; i < 64; ++i)
- a = (a >> 1) ^ (a & 1 ? poly : 0);
-
- return a;
-}
-*/
-
-
-#define MASK_L(in, mask, r) \
- r = _mm_shuffle_epi8(in, mask)
-
-#define MASK_H(in, mask, r) \
- r = _mm_shuffle_epi8(in, _mm_xor_si128(mask, vsign))
-
-#define MASK_LH(in, mask, low, high) \
- MASK_L(in, mask, low); \
- MASK_H(in, mask, high)
-
-
-// MSVC (VS2015 - VS2022) produces bad 32-bit x86 code from the CLMUL CRC
-// code when optimizations are enabled (release build). According to the bug
-// report, the ebx register is corrupted and the calculated result is wrong.
-// Trying to workaround the problem with "__asm mov ebx, ebx" didn't help.
-// The following pragma works and performance is still good. x86-64 builds
-// aren't affected by this problem.
-//
-// NOTE: Another pragma after the function restores the optimizations.
-// If the #if condition here is updated, the other one must be updated too.
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
- && defined(_M_IX86)
-# pragma optimize("g", off)
-#endif
-
-// EDG-based compilers (Intel's classic compiler and compiler for E2K) can
-// define __GNUC__ but the attribute must not be used with them.
-// The new Clang-based ICX needs the attribute.
-//
-// NOTE: Build systems check for this too, keep them in sync with this.
-#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
-__attribute__((__target__("ssse3,sse4.1,pclmul")))
-#endif
-// The intrinsics use 16-byte-aligned reads from buf, thus they may read
-// up to 15 bytes before or after the buffer (depending on the alignment
-// of the buf argument). The values of the extra bytes are ignored.
-// This unavoidably trips -fsanitize=address so address sanitizier has
-// to be disabled for this function.
-#if lzma_has_attribute(__no_sanitize_address__)
-__attribute__((__no_sanitize_address__))
-#endif
-static uint64_t
-crc64_clmul(const uint8_t *buf, size_t size, uint64_t crc)
-{
- // The prototypes of the intrinsics use signed types while most of
- // the values are treated as unsigned here. These warnings in this
- // function have been checked and found to be harmless so silence them.
-#if TUKLIB_GNUC_REQ(4, 6) || defined(__clang__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wsign-conversion"
-# pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
-#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS
- // The code assumes that there is at least one byte of input.
- if (size == 0)
- return crc;
-#endif
-
- // const uint64_t poly = 0xc96c5795d7870f42; // CRC polynomial
- const uint64_t p = 0x92d8af2baf0e1e85; // (poly << 1) | 1
- const uint64_t mu = 0x9c3e466c172963d5; // (calc_lo(poly) << 1) | 1
- const uint64_t k2 = 0xdabe95afc7875f40; // calc_hi(poly, 1)
- const uint64_t k1 = 0xe05dd497ca393ae4; // calc_hi(poly, k2)
- const __m128i vfold0 = _mm_set_epi64x(p, mu);
- const __m128i vfold1 = _mm_set_epi64x(k2, k1);
-
- // Create a vector with 8-bit values 0 to 15. This is used to
- // construct control masks for _mm_blendv_epi8 and _mm_shuffle_epi8.
- const __m128i vramp = _mm_setr_epi32(
- 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c);
-
- // This is used to inverse the control mask of _mm_shuffle_epi8
- // so that bytes that wouldn't be picked with the original mask
- // will be picked and vice versa.
- const __m128i vsign = _mm_set1_epi8(0x80);
-
- // Memory addresses A to D and the distances between them:
- //
- // A B C D
- // [skip_start][size][skip_end]
- // [ size2 ]
- //
- // A and D are 16-byte aligned. B and C are 1-byte aligned.
- // skip_start and skip_end are 0-15 bytes. size is at least 1 byte.
- //
- // A = aligned_buf will initially point to this address.
- // B = The address pointed by the caller-supplied buf.
- // C = buf + size == aligned_buf + size2
- // D = buf + size + skip_end == aligned_buf + size2 + skip_end
- const size_t skip_start = (size_t)((uintptr_t)buf & 15);
- const size_t skip_end = (size_t)((0U - (uintptr_t)(buf + size)) & 15);
- const __m128i *aligned_buf = (const __m128i *)(
- (uintptr_t)buf & ~(uintptr_t)15);
-
- // If size2 <= 16 then the whole input fits into a single 16-byte
- // vector. If size2 > 16 then at least two 16-byte vectors must
- // be processed. If size2 > 16 && size <= 16 then there is only
- // one 16-byte vector's worth of input but it is unaligned in memory.
- //
- // NOTE: There is no integer overflow here if the arguments are valid.
- // If this overflowed, buf + size would too.
- size_t size2 = skip_start + size;
-
- // Masks to be used with _mm_blendv_epi8 and _mm_shuffle_epi8:
- // The first skip_start or skip_end bytes in the vectors will have
- // the high bit (0x80) set. _mm_blendv_epi8 and _mm_shuffle_epi8
- // will produce zeros for these positions. (Bitwise-xor of these
- // masks with vsign will produce the opposite behavior.)
- const __m128i mask_start
- = _mm_sub_epi8(vramp, _mm_set1_epi8(skip_start));
- const __m128i mask_end = _mm_sub_epi8(vramp, _mm_set1_epi8(skip_end));
-
- // Get the first 1-16 bytes into data0. If loading less than 16 bytes,
- // the bytes are loaded to the high bits of the vector and the least
- // significant positions are filled with zeros.
- const __m128i data0 = _mm_blendv_epi8(_mm_load_si128(aligned_buf),
- _mm_setzero_si128(), mask_start);
- ++aligned_buf;
-
-#if defined(__i386__) || defined(_M_IX86)
- const __m128i initial_crc = _mm_set_epi64x(0, ~crc);
-#else
- // GCC and Clang would produce good code with _mm_set_epi64x
- // but MSVC needs _mm_cvtsi64_si128 on x86-64.
- const __m128i initial_crc = _mm_cvtsi64_si128(~crc);
-#endif
+#if defined(CRC64_GENERIC) && defined(CRC64_ARCH_OPTIMIZED)
- __m128i v0, v1, v2, v3;
-
-#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS
- if (size <= 16) {
- // Right-shift initial_crc by 1-16 bytes based on "size"
- // and store the result in v1 (high bytes) and v0 (low bytes).
- //
- // NOTE: The highest 8 bytes of initial_crc are zeros so
- // v1 will be filled with zeros if size >= 8. The highest 8
- // bytes of v1 will always become zeros.
- //
- // [ v1 ][ v0 ]
- // [ initial_crc ] size == 1
- // [ initial_crc ] size == 2
- // [ initial_crc ] size == 15
- // [ initial_crc ] size == 16 (all in v0)
- const __m128i mask_low = _mm_add_epi8(
- vramp, _mm_set1_epi8(size - 16));
- MASK_LH(initial_crc, mask_low, v0, v1);
-
- if (size2 <= 16) {
- // There are 1-16 bytes of input and it is all
- // in data0. Copy the input bytes to v3. If there
- // are fewer than 16 bytes, the low bytes in v3
- // will be filled with zeros. That is, the input
- // bytes are stored to the same position as
- // (part of) initial_crc is in v0.
- MASK_L(data0, mask_end, v3);
- } else {
- // There are 2-16 bytes of input but not all bytes
- // are in data0.
- const __m128i data1 = _mm_load_si128(aligned_buf);
-
- // Collect the 2-16 input bytes from data0 and data1
- // to v2 and v3, and bitwise-xor them with the
- // low bits of initial_crc in v0. Note that the
- // the second xor is below this else-block as it
- // is shared with the other branch.
- MASK_H(data0, mask_end, v2);
- MASK_L(data1, mask_end, v3);
- v0 = _mm_xor_si128(v0, v2);
- }
+//////////////////////////
+// Function dispatching //
+//////////////////////////
- v0 = _mm_xor_si128(v0, v3);
- v1 = _mm_alignr_epi8(v1, v0, 8);
- } else
-#endif
- {
- const __m128i data1 = _mm_load_si128(aligned_buf);
- MASK_LH(initial_crc, mask_start, v0, v1);
- v0 = _mm_xor_si128(v0, data0);
- v1 = _mm_xor_si128(v1, data1);
-
-#define FOLD \
- v1 = _mm_xor_si128(v1, _mm_clmulepi64_si128(v0, vfold1, 0x00)); \
- v0 = _mm_xor_si128(v1, _mm_clmulepi64_si128(v0, vfold1, 0x11));
-
- while (size2 > 32) {
- ++aligned_buf;
- size2 -= 16;
- FOLD
- v1 = _mm_load_si128(aligned_buf);
- }
-
- if (size2 < 32) {
- MASK_H(v0, mask_end, v2);
- MASK_L(v0, mask_end, v0);
- MASK_L(v1, mask_end, v3);
- v1 = _mm_or_si128(v2, v3);
- }
-
- FOLD
- v1 = _mm_srli_si128(v0, 8);
-#undef FOLD
- }
+// If both the generic and arch-optimized implementations are usable, then
+// the function that is used is selected at runtime. See crc32_fast.c.
- v1 = _mm_xor_si128(_mm_clmulepi64_si128(v0, vfold1, 0x10), v1);
- v0 = _mm_clmulepi64_si128(v1, vfold0, 0x00);
- v2 = _mm_clmulepi64_si128(v0, vfold0, 0x10);
- v0 = _mm_xor_si128(_mm_xor_si128(v2, _mm_slli_si128(v0, 8)), v1);
+typedef uint64_t (*crc64_func_type)(
+ const uint8_t *buf, size_t size, uint64_t crc);
-#if defined(__i386__) || defined(_M_IX86)
- return ~(((uint64_t)(uint32_t)_mm_extract_epi32(v0, 3) << 32) |
- (uint64_t)(uint32_t)_mm_extract_epi32(v0, 2));
-#else
- return ~(uint64_t)_mm_extract_epi64(v0, 1);
-#endif
-
-#if TUKLIB_GNUC_REQ(4, 6) || defined(__clang__)
-# pragma GCC diagnostic pop
-#endif
-}
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
- && defined(_M_IX86)
-# pragma optimize("", on)
-#endif
-#endif
-
-
-////////////////////////
-// Detect CPU support //
-////////////////////////
-
-#if defined(CRC_GENERIC) && defined(CRC_CLMUL)
-static inline bool
-is_clmul_supported(void)
+static crc64_func_type
+crc64_resolve(void)
{
- int success = 1;
- uint32_t r[4]; // eax, ebx, ecx, edx
-
-#if defined(_MSC_VER)
- // This needs <intrin.h> with MSVC. ICC has it as a built-in
- // on all platforms.
- __cpuid(r, 1);
-#elif defined(HAVE_CPUID_H)
- // Compared to just using __asm__ to run CPUID, this also checks
- // that CPUID is supported and saves and restores ebx as that is
- // needed with GCC < 5 with position-independent code (PIC).
- success = __get_cpuid(1, &r[0], &r[1], &r[2], &r[3]);
-#else
- // Just a fallback that shouldn't be needed.
- __asm__("cpuid\n\t"
- : "=a"(r[0]), "=b"(r[1]), "=c"(r[2]), "=d"(r[3])
- : "a"(1), "c"(0));
-#endif
-
- // Returns true if these are supported:
- // CLMUL (bit 1 in ecx)
- // SSSE3 (bit 9 in ecx)
- // SSE4.1 (bit 19 in ecx)
- const uint32_t ecx_mask = (1 << 1) | (1 << 9) | (1 << 19);
- return success && (r[2] & ecx_mask) == ecx_mask;
-
- // Alternative methods that weren't used:
- // - ICC's _may_i_use_cpu_feature: the other methods should work too.
- // - GCC >= 6 / Clang / ICX __builtin_cpu_supports("pclmul")
- //
- // CPUID decding is needed with MSVC anyway and older GCC. This keeps
- // the feature checks in the build system simpler too. The nice thing
- // about __builtin_cpu_supports would be that it generates very short
- // code as is it only reads a variable set at startup but a few bytes
- // doesn't matter here.
+ return is_arch_extension_supported()
+ ? &crc64_arch_optimized : &crc64_generic;
}
-
#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
-# define CRC64_FUNC_INIT
# define CRC64_SET_FUNC_ATTR __attribute__((__constructor__))
+static crc64_func_type crc64_func;
#else
-# define CRC64_FUNC_INIT = &crc64_dispatch
# define CRC64_SET_FUNC_ATTR
static uint64_t crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc);
+static crc64_func_type crc64_func = &crc64_dispatch;
#endif
-// Pointer to the the selected CRC64 method.
-static uint64_t (*crc64_func)(const uint8_t *buf, size_t size, uint64_t crc)
- CRC64_FUNC_INIT;
-
-
CRC64_SET_FUNC_ATTR
static void
crc64_set_func(void)
{
- crc64_func = is_clmul_supported() ? &crc64_clmul : &crc64_generic;
+ crc64_func = crc64_resolve();
return;
}
@@ -474,12 +123,6 @@ crc64_set_func(void)
static uint64_t
crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc)
{
- // When __attribute__((__constructor__)) isn't supported, set the
- // function pointer without any locking. If multiple threads run
- // the detection code in parallel, they will all end up setting
- // the pointer to the same value. This avoids the use of
- // mythread_once() on every call to lzma_crc64() but this likely
- // isn't strictly standards compliant. Let's change it if it breaks.
crc64_set_func();
return crc64_func(buf, size, crc);
}
@@ -490,47 +133,22 @@ crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc)
extern LZMA_API(uint64_t)
lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
{
-#if defined(CRC_GENERIC) && defined(CRC_CLMUL)
- // If CLMUL is available, it is the best for non-tiny inputs,
- // being over twice as fast as the generic slice-by-four version.
- // However, for size <= 16 it's different. In the extreme case
- // of size == 1 the generic version can be five times faster.
- // At size >= 8 the CLMUL starts to become reasonable. It
- // varies depending on the alignment of buf too.
- //
- // The above doesn't include the overhead of mythread_once().
- // At least on x86-64 GNU/Linux, pthread_once() is very fast but
- // it still makes lzma_crc64(buf, 1, crc) 50-100 % slower. When
- // size reaches 12-16 bytes the overhead becomes negligible.
- //
- // So using the generic version for size <= 16 may give better
- // performance with tiny inputs but if such inputs happen rarely
- // it's not so obvious because then the lookup table of the
- // generic version may not be in the processor cache.
+#if defined(CRC64_GENERIC) && defined(CRC64_ARCH_OPTIMIZED)
+
#ifdef CRC_USE_GENERIC_FOR_SMALL_INPUTS
if (size <= 16)
return crc64_generic(buf, size, crc);
#endif
-
-/*
-#ifndef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
- // See crc64_dispatch(). This would be the alternative which uses
- // locking and doesn't use crc64_dispatch(). Note that on Windows
- // this method needs Vista threads.
- mythread_once(crc64_set_func);
-#endif
-*/
-
return crc64_func(buf, size, crc);
-#elif defined(CRC_CLMUL)
- // If CLMUL is used unconditionally without runtime CPU detection
- // then omitting the generic version and its 8 KiB lookup table
- // makes the library smaller.
+#elif defined(CRC64_ARCH_OPTIMIZED)
+ // If arch-optimized version is used unconditionally without runtime
+ // CPU detection then omitting the generic version and its 8 KiB
+ // lookup table makes the library smaller.
//
// FIXME: Lookup table isn't currently omitted on 32-bit x86,
// see crc64_table.c.
- return crc64_clmul(buf, size, crc);
+ return crc64_arch_optimized(buf, size, crc);
#else
return crc64_generic(buf, size, crc);
diff --git a/contrib/xz/src/liblzma/check/crc64_small.c b/contrib/xz/src/liblzma/check/crc64_small.c
index 420f7cfbb475..ee4ea26f67d0 100644
--- a/contrib/xz/src/liblzma/check/crc64_small.c
+++ b/contrib/xz/src/liblzma/check/crc64_small.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc64_small.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "check.h"
diff --git a/contrib/xz/src/liblzma/check/crc64_table.c b/contrib/xz/src/liblzma/check/crc64_table.c
index 688e527b0fd1..78e427597ce6 100644
--- a/contrib/xz/src/liblzma/check/crc64_table.c
+++ b/contrib/xz/src/liblzma/check/crc64_table.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc64_table.c
@@ -5,19 +7,21 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
-// FIXME: Compared to crc64_fast.c this has to check for __x86_64__ too
+// FIXME: Compared to crc_common.h this has to check for __x86_64__ too
// so that in 32-bit builds crc64_x86.S won't break due to a missing table.
-#if (defined(__x86_64__) && defined(__SSSE3__) \
+#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
- || (defined(__e2k__) && __iset__ >= 6)
+ || (defined(__e2k__) && __iset__ >= 6))
+# define NO_CRC64_TABLE
+#endif
+
+
+#ifdef NO_CRC64_TABLE
// No table needed. Use a typedef to avoid an empty translation unit.
typedef void lzma_crc64_dummy;
diff --git a/contrib/xz/src/liblzma/check/crc64_table_be.h b/contrib/xz/src/liblzma/check/crc64_table_be.h
index ea074f397a70..db76cc70e07c 100644
--- a/contrib/xz/src/liblzma/check/crc64_table_be.h
+++ b/contrib/xz/src/liblzma/check/crc64_table_be.h
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc64_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc64_tablegen.c.
const uint64_t lzma_crc64_table[4][256] = {
{
diff --git a/contrib/xz/src/liblzma/check/crc64_table_le.h b/contrib/xz/src/liblzma/check/crc64_table_le.h
index 1196b31e1323..e40a8c82105e 100644
--- a/contrib/xz/src/liblzma/check/crc64_table_le.h
+++ b/contrib/xz/src/liblzma/check/crc64_table_le.h
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc64_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc64_tablegen.c.
const uint64_t lzma_crc64_table[4][256] = {
{
diff --git a/contrib/xz/src/liblzma/check/crc64_tablegen.c b/contrib/xz/src/liblzma/check/crc64_tablegen.c
index fddaa7ed1400..2035127a1123 100644
--- a/contrib/xz/src/liblzma/check/crc64_tablegen.c
+++ b/contrib/xz/src/liblzma/check/crc64_tablegen.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc64_tablegen.c
@@ -8,9 +10,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
@@ -43,7 +42,7 @@ init_crc64_table(void)
#ifdef WORDS_BIGENDIAN
for (size_t s = 0; s < 4; ++s)
for (size_t b = 0; b < 256; ++b)
- crc64_table[s][b] = bswap64(crc64_table[s][b]);
+ crc64_table[s][b] = byteswap64(crc64_table[s][b]);
#endif
return;
@@ -53,9 +52,11 @@ init_crc64_table(void)
static void
print_crc64_table(void)
{
- printf("/* This file has been automatically generated by "
- "crc64_tablegen.c. */\n\n"
- "const uint64_t lzma_crc64_table[4][256] = {\n\t{");
+ // Split the SPDX string so that it won't accidentally match
+ // when tools search for the string.
+ printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+ "// This file has been generated by crc64_tablegen.c.\n\n"
+ "const uint64_t lzma_crc64_table[4][256] = {\n\t{");
for (size_t s = 0; s < 4; ++s) {
for (size_t b = 0; b < 256; ++b) {
diff --git a/contrib/xz/src/liblzma/check/crc64_x86.S b/contrib/xz/src/liblzma/check/crc64_x86.S
index 9aecf5865455..47f608181ea8 100644
--- a/contrib/xz/src/liblzma/check/crc64_x86.S
+++ b/contrib/xz/src/liblzma/check/crc64_x86.S
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
/*
* Speed-optimized CRC64 using slicing-by-four algorithm
*
@@ -7,9 +9,6 @@
* Authors: Igor Pavlov (original CRC32 assembly code)
* Lasse Collin (CRC64 adaptation of the modified CRC32 code)
*
- * This file has been put into the public domain.
- * You can do whatever you want with this file.
- *
* This code needs lzma_crc64_table, which can be created using the
* following C code:
diff --git a/contrib/xz/src/liblzma/check/crc_common.h b/contrib/xz/src/liblzma/check/crc_common.h
new file mode 100644
index 000000000000..63a7b5cefebf
--- /dev/null
+++ b/contrib/xz/src/liblzma/check/crc_common.h
@@ -0,0 +1,137 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file crc_common.h
+/// \brief Some functions and macros for CRC32 and CRC64
+//
+// Authors: Lasse Collin
+// Ilya Kurdyukov
+// Hans Jansen
+// Jia Tan
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef LZMA_CRC_COMMON_H
+#define LZMA_CRC_COMMON_H
+
+#include "common.h"
+
+
+#ifdef WORDS_BIGENDIAN
+# define A(x) ((x) >> 24)
+# define B(x) (((x) >> 16) & 0xFF)
+# define C(x) (((x) >> 8) & 0xFF)
+# define D(x) ((x) & 0xFF)
+
+# define S8(x) ((x) << 8)
+# define S32(x) ((x) << 32)
+
+#else
+# define A(x) ((x) & 0xFF)
+# define B(x) (((x) >> 8) & 0xFF)
+# define C(x) (((x) >> 16) & 0xFF)
+# define D(x) ((x) >> 24)
+
+# define S8(x) ((x) >> 8)
+# define S32(x) ((x) >> 32)
+#endif
+
+
+// CRC CLMUL code needs this because accessing input buffers that aren't
+// aligned to the vector size will inherently trip the address sanitizer.
+#if lzma_has_attribute(__no_sanitize_address__)
+# define crc_attr_no_sanitize_address \
+ __attribute__((__no_sanitize_address__))
+#else
+# define crc_attr_no_sanitize_address
+#endif
+
+// Keep this in sync with changes to crc32_arm64.h
+#if defined(_WIN32) || defined(HAVE_GETAUXVAL) \
+ || defined(HAVE_ELF_AUX_INFO) \
+ || (defined(__APPLE__) && defined(HAVE_SYSCTLBYNAME))
+# define ARM64_RUNTIME_DETECTION 1
+#endif
+
+
+#undef CRC32_GENERIC
+#undef CRC64_GENERIC
+
+#undef CRC32_ARCH_OPTIMIZED
+#undef CRC64_ARCH_OPTIMIZED
+
+// The x86 CLMUL is used for both CRC32 and CRC64.
+#undef CRC_X86_CLMUL
+
+#undef CRC32_ARM64
+#undef CRC64_ARM64_CLMUL
+
+#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
+
+// ARM64 CRC32 instruction is only useful for CRC32. Currently, only
+// little endian is supported since we were unable to test on a big
+// endian machine.
+//
+// NOTE: Keep this and the next check in sync with the macro
+// NO_CRC32_TABLE in crc32_table.c
+#if defined(HAVE_ARM64_CRC32) && !defined(WORDS_BIGENDIAN)
+// Allow ARM64 CRC32 instruction without a runtime check if
+// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
+// proper compiler options are used.
+# if defined(__ARM_FEATURE_CRC32)
+# define CRC32_ARCH_OPTIMIZED 1
+# define CRC32_ARM64 1
+# elif defined(ARM64_RUNTIME_DETECTION)
+# define CRC32_ARCH_OPTIMIZED 1
+# define CRC32_ARM64 1
+# define CRC32_GENERIC 1
+# endif
+#endif
+
+#if defined(HAVE_USABLE_CLMUL)
+// If CLMUL is allowed unconditionally in the compiler options then the
+// generic version can be omitted. Note that this doesn't work with MSVC
+// as I don't know how to detect the features here.
+//
+// NOTE: Keep this in sync with the NO_CRC32_TABLE macro in crc32_table.c
+// and NO_CRC64_TABLE in crc64_table.c.
+# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \
+ || (defined(__e2k__) && __iset__ >= 6)
+# define CRC32_ARCH_OPTIMIZED 1
+# define CRC64_ARCH_OPTIMIZED 1
+# define CRC_X86_CLMUL 1
+# else
+# define CRC32_GENERIC 1
+# define CRC64_GENERIC 1
+# define CRC32_ARCH_OPTIMIZED 1
+# define CRC64_ARCH_OPTIMIZED 1
+# define CRC_X86_CLMUL 1
+
+/*
+ // The generic code is much faster with 1-8-byte inputs and
+ // has similar performance up to 16 bytes at least in
+ // microbenchmarks (it depends on input buffer alignment
+ // too). If both versions are built, this #define will use
+ // the generic version for inputs up to 16 bytes and CLMUL
+ // for bigger inputs. It saves a little in code size since
+ // the special cases for 0-16-byte inputs will be omitted
+ // from the CLMUL code.
+# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
+*/
+# endif
+#endif
+
+// For CRC32 use the generic slice-by-eight implementation if no optimized
+// version is available.
+#if !defined(CRC32_ARCH_OPTIMIZED) && !defined(CRC32_GENERIC)
+# define CRC32_GENERIC 1
+#endif
+
+// For CRC64 use the generic slice-by-four implementation if no optimized
+// version is available.
+#if !defined(CRC64_ARCH_OPTIMIZED) && !defined(CRC64_GENERIC)
+# define CRC64_GENERIC 1
+#endif
+
+#endif
diff --git a/contrib/xz/src/liblzma/check/crc_macros.h b/contrib/xz/src/liblzma/check/crc_macros.h
deleted file mode 100644
index a7c21b765dca..000000000000
--- a/contrib/xz/src/liblzma/check/crc_macros.h
+++ /dev/null
@@ -1,30 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-//
-/// \file crc_macros.h
-/// \brief Some endian-dependent macros for CRC32 and CRC64
-//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef WORDS_BIGENDIAN
-# define A(x) ((x) >> 24)
-# define B(x) (((x) >> 16) & 0xFF)
-# define C(x) (((x) >> 8) & 0xFF)
-# define D(x) ((x) & 0xFF)
-
-# define S8(x) ((x) << 8)
-# define S32(x) ((x) << 32)
-
-#else
-# define A(x) ((x) & 0xFF)
-# define B(x) (((x) >> 8) & 0xFF)
-# define C(x) (((x) >> 16) & 0xFF)
-# define D(x) ((x) >> 24)
-
-# define S8(x) ((x) >> 8)
-# define S32(x) ((x) >> 32)
-#endif
diff --git a/contrib/xz/src/liblzma/check/crc_x86_clmul.h b/contrib/xz/src/liblzma/check/crc_x86_clmul.h
new file mode 100644
index 000000000000..f1254ece18ed
--- /dev/null
+++ b/contrib/xz/src/liblzma/check/crc_x86_clmul.h
@@ -0,0 +1,428 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file crc_x86_clmul.h
+/// \brief CRC32 and CRC64 implementations using CLMUL instructions.
+///
+/// The CRC32 and CRC64 implementations use 32/64-bit x86 SSSE3, SSE4.1, and
+/// CLMUL instructions. This is compatible with Elbrus 2000 (E2K) too.
+///
+/// They were derived from
+/// https://www.researchgate.net/publication/263424619_Fast_CRC_computation
+/// and the public domain code from https://github.com/rawrunprotected/crc
+/// (URLs were checked on 2023-10-14).
+///
+/// While this file has both CRC32 and CRC64 implementations, only one
+/// should be built at a time to ensure that crc_simd_body() is inlined
+/// even with compilers with which lzma_always_inline expands to plain inline.
+/// The version to build is selected by defining BUILDING_CRC32_CLMUL or
+/// BUILDING_CRC64_CLMUL before including this file.
+///
+/// FIXME: Builds for 32-bit x86 use the assembly .S files by default
+/// unless configured with --disable-assembler. Even then the lookup table
+/// isn't omitted in crc64_table.c since it doesn't know that assembly
+/// code has been disabled.
+//
+// Authors: Ilya Kurdyukov
+// Hans Jansen
+// Lasse Collin
+// Jia Tan
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// This file must not be included more than once.
+#ifdef LZMA_CRC_X86_CLMUL_H
+# error crc_x86_clmul.h was included twice.
+#endif
+#define LZMA_CRC_X86_CLMUL_H
+
+#include <immintrin.h>
+
+#if defined(_MSC_VER)
+# include <intrin.h>
+#elif defined(HAVE_CPUID_H)
+# include <cpuid.h>
+#endif
+
+
+// EDG-based compilers (Intel's classic compiler and compiler for E2K) can
+// define __GNUC__ but the attribute must not be used with them.
+// The new Clang-based ICX needs the attribute.
+//
+// NOTE: Build systems check for this too, keep them in sync with this.
+#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
+# define crc_attr_target \
+ __attribute__((__target__("ssse3,sse4.1,pclmul")))
+#else
+# define crc_attr_target
+#endif
+
+
+#define MASK_L(in, mask, r) r = _mm_shuffle_epi8(in, mask)
+
+#define MASK_H(in, mask, r) \
+ r = _mm_shuffle_epi8(in, _mm_xor_si128(mask, vsign))
+
+#define MASK_LH(in, mask, low, high) \
+ MASK_L(in, mask, low); \
+ MASK_H(in, mask, high)
+
+
+crc_attr_target
+crc_attr_no_sanitize_address
+static lzma_always_inline void
+crc_simd_body(const uint8_t *buf, const size_t size, __m128i *v0, __m128i *v1,
+ const __m128i vfold16, const __m128i initial_crc)
+{
+ // Create a vector with 8-bit values 0 to 15. This is used to
+ // construct control masks for _mm_blendv_epi8 and _mm_shuffle_epi8.
+ const __m128i vramp = _mm_setr_epi32(
+ 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c);
+
+ // This is used to inverse the control mask of _mm_shuffle_epi8
+ // so that bytes that wouldn't be picked with the original mask
+ // will be picked and vice versa.
+ const __m128i vsign = _mm_set1_epi8(-0x80);
+
+ // Memory addresses A to D and the distances between them:
+ //
+ // A B C D
+ // [skip_start][size][skip_end]
+ // [ size2 ]
+ //
+ // A and D are 16-byte aligned. B and C are 1-byte aligned.
+ // skip_start and skip_end are 0-15 bytes. size is at least 1 byte.
+ //
+ // A = aligned_buf will initially point to this address.
+ // B = The address pointed by the caller-supplied buf.
+ // C = buf + size == aligned_buf + size2
+ // D = buf + size + skip_end == aligned_buf + size2 + skip_end
+ const size_t skip_start = (size_t)((uintptr_t)buf & 15);
+ const size_t skip_end = (size_t)((0U - (uintptr_t)(buf + size)) & 15);
+ const __m128i *aligned_buf = (const __m128i *)(
+ (uintptr_t)buf & ~(uintptr_t)15);
+
+ // If size2 <= 16 then the whole input fits into a single 16-byte
+ // vector. If size2 > 16 then at least two 16-byte vectors must
+ // be processed. If size2 > 16 && size <= 16 then there is only
+ // one 16-byte vector's worth of input but it is unaligned in memory.
+ //
+ // NOTE: There is no integer overflow here if the arguments
+ // are valid. If this overflowed, buf + size would too.
+ const size_t size2 = skip_start + size;
+
+ // Masks to be used with _mm_blendv_epi8 and _mm_shuffle_epi8:
+ // The first skip_start or skip_end bytes in the vectors will have
+ // the high bit (0x80) set. _mm_blendv_epi8 and _mm_shuffle_epi8
+ // will produce zeros for these positions. (Bitwise-xor of these
+ // masks with vsign will produce the opposite behavior.)
+ const __m128i mask_start
+ = _mm_sub_epi8(vramp, _mm_set1_epi8((char)skip_start));
+ const __m128i mask_end
+ = _mm_sub_epi8(vramp, _mm_set1_epi8((char)skip_end));
+
+ // Get the first 1-16 bytes into data0. If loading less than 16
+ // bytes, the bytes are loaded to the high bits of the vector and
+ // the least significant positions are filled with zeros.
+ const __m128i data0 = _mm_blendv_epi8(_mm_load_si128(aligned_buf),
+ _mm_setzero_si128(), mask_start);
+ aligned_buf++;
+
+ __m128i v2, v3;
+
+#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS
+ if (size <= 16) {
+ // Right-shift initial_crc by 1-16 bytes based on "size"
+ // and store the result in v1 (high bytes) and v0 (low bytes).
+ //
+ // NOTE: The highest 8 bytes of initial_crc are zeros so
+ // v1 will be filled with zeros if size >= 8. The highest
+ // 8 bytes of v1 will always become zeros.
+ //
+ // [ v1 ][ v0 ]
+ // [ initial_crc ] size == 1
+ // [ initial_crc ] size == 2
+ // [ initial_crc ] size == 15
+ // [ initial_crc ] size == 16 (all in v0)
+ const __m128i mask_low = _mm_add_epi8(
+ vramp, _mm_set1_epi8((char)(size - 16)));
+ MASK_LH(initial_crc, mask_low, *v0, *v1);
+
+ if (size2 <= 16) {
+ // There are 1-16 bytes of input and it is all
+ // in data0. Copy the input bytes to v3. If there
+ // are fewer than 16 bytes, the low bytes in v3
+ // will be filled with zeros. That is, the input
+ // bytes are stored to the same position as
+ // (part of) initial_crc is in v0.
+ MASK_L(data0, mask_end, v3);
+ } else {
+ // There are 2-16 bytes of input but not all bytes
+ // are in data0.
+ const __m128i data1 = _mm_load_si128(aligned_buf);
+
+ // Collect the 2-16 input bytes from data0 and data1
+ // to v2 and v3, and bitwise-xor them with the
+ // low bits of initial_crc in v0. Note that the
+ // the second xor is below this else-block as it
+ // is shared with the other branch.
+ MASK_H(data0, mask_end, v2);
+ MASK_L(data1, mask_end, v3);
+ *v0 = _mm_xor_si128(*v0, v2);
+ }
+
+ *v0 = _mm_xor_si128(*v0, v3);
+ *v1 = _mm_alignr_epi8(*v1, *v0, 8);
+ } else
+#endif
+ {
+ // There is more than 16 bytes of input.
+ const __m128i data1 = _mm_load_si128(aligned_buf);
+ const __m128i *end = (const __m128i*)(
+ (const char *)aligned_buf - 16 + size2);
+ aligned_buf++;
+
+ MASK_LH(initial_crc, mask_start, *v0, *v1);
+ *v0 = _mm_xor_si128(*v0, data0);
+ *v1 = _mm_xor_si128(*v1, data1);
+
+ while (aligned_buf < end) {
+ *v1 = _mm_xor_si128(*v1, _mm_clmulepi64_si128(
+ *v0, vfold16, 0x00));
+ *v0 = _mm_xor_si128(*v1, _mm_clmulepi64_si128(
+ *v0, vfold16, 0x11));
+ *v1 = _mm_load_si128(aligned_buf++);
+ }
+
+ if (aligned_buf != end) {
+ MASK_H(*v0, mask_end, v2);
+ MASK_L(*v0, mask_end, *v0);
+ MASK_L(*v1, mask_end, v3);
+ *v1 = _mm_or_si128(v2, v3);
+ }
+
+ *v1 = _mm_xor_si128(*v1, _mm_clmulepi64_si128(
+ *v0, vfold16, 0x00));
+ *v0 = _mm_xor_si128(*v1, _mm_clmulepi64_si128(
+ *v0, vfold16, 0x11));
+ *v1 = _mm_srli_si128(*v0, 8);
+ }
+}
+
+
+/////////////////////
+// x86 CLMUL CRC32 //
+/////////////////////
+
+/*
+// These functions were used to generate the constants
+// at the top of crc32_arch_optimized().
+static uint64_t
+calc_lo(uint64_t p, uint64_t a, int n)
+{
+ uint64_t b = 0; int i;
+ for (i = 0; i < n; i++) {
+ b = b >> 1 | (a & 1) << (n - 1);
+ a = (a >> 1) ^ ((0 - (a & 1)) & p);
+ }
+ return b;
+}
+
+// same as ~crc(&a, sizeof(a), ~0)
+static uint64_t
+calc_hi(uint64_t p, uint64_t a, int n)
+{
+ int i;
+ for (i = 0; i < n; i++)
+ a = (a >> 1) ^ ((0 - (a & 1)) & p);
+ return a;
+}
+*/
+
+#ifdef BUILDING_CRC32_CLMUL
+
+crc_attr_target
+crc_attr_no_sanitize_address
+static uint32_t
+crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
+{
+#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS
+ // The code assumes that there is at least one byte of input.
+ if (size == 0)
+ return crc;
+#endif
+
+ // uint32_t poly = 0xedb88320;
+ const int64_t p = 0x1db710640; // p << 1
+ const int64_t mu = 0x1f7011641; // calc_lo(p, p, 32) << 1 | 1
+ const int64_t k5 = 0x163cd6124; // calc_hi(p, p, 32) << 1
+ const int64_t k4 = 0x0ccaa009e; // calc_hi(p, p, 64) << 1
+ const int64_t k3 = 0x1751997d0; // calc_hi(p, p, 128) << 1
+
+ const __m128i vfold4 = _mm_set_epi64x(mu, p);
+ const __m128i vfold8 = _mm_set_epi64x(0, k5);
+ const __m128i vfold16 = _mm_set_epi64x(k4, k3);
+
+ __m128i v0, v1, v2;
+
+ crc_simd_body(buf, size, &v0, &v1, vfold16,
+ _mm_cvtsi32_si128((int32_t)~crc));
+
+ v1 = _mm_xor_si128(
+ _mm_clmulepi64_si128(v0, vfold16, 0x10), v1); // xxx0
+ v2 = _mm_shuffle_epi32(v1, 0xe7); // 0xx0
+ v0 = _mm_slli_epi64(v1, 32); // [0]
+ v0 = _mm_clmulepi64_si128(v0, vfold8, 0x00);
+ v0 = _mm_xor_si128(v0, v2); // [1] [2]
+ v2 = _mm_clmulepi64_si128(v0, vfold4, 0x10);
+ v2 = _mm_clmulepi64_si128(v2, vfold4, 0x00);
+ v0 = _mm_xor_si128(v0, v2); // [2]
+ return ~(uint32_t)_mm_extract_epi32(v0, 2);
+}
+#endif // BUILDING_CRC32_CLMUL
+
+
+/////////////////////
+// x86 CLMUL CRC64 //
+/////////////////////
+
+/*
+// These functions were used to generate the constants
+// at the top of crc64_arch_optimized().
+static uint64_t
+calc_lo(uint64_t poly)
+{
+ uint64_t a = poly;
+ uint64_t b = 0;
+
+ for (unsigned i = 0; i < 64; ++i) {
+ b = (b >> 1) | (a << 63);
+ a = (a >> 1) ^ (a & 1 ? poly : 0);
+ }
+
+ return b;
+}
+
+static uint64_t
+calc_hi(uint64_t poly, uint64_t a)
+{
+ for (unsigned i = 0; i < 64; ++i)
+ a = (a >> 1) ^ (a & 1 ? poly : 0);
+
+ return a;
+}
+*/
+
+#ifdef BUILDING_CRC64_CLMUL
+
+// MSVC (VS2015 - VS2022) produces bad 32-bit x86 code from the CLMUL CRC
+// code when optimizations are enabled (release build). According to the bug
+// report, the ebx register is corrupted and the calculated result is wrong.
+// Trying to workaround the problem with "__asm mov ebx, ebx" didn't help.
+// The following pragma works and performance is still good. x86-64 builds
+// and CRC32 CLMUL aren't affected by this problem. The problem does not
+// happen in crc_simd_body() either (which is shared with CRC32 CLMUL anyway).
+//
+// NOTE: Another pragma after crc64_arch_optimized() restores
+// the optimizations. If the #if condition here is updated,
+// the other one must be updated too.
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
+ && defined(_M_IX86)
+# pragma optimize("g", off)
+#endif
+
+crc_attr_target
+crc_attr_no_sanitize_address
+static uint64_t
+crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
+{
+#ifndef CRC_USE_GENERIC_FOR_SMALL_INPUTS
+ // The code assumes that there is at least one byte of input.
+ if (size == 0)
+ return crc;
+#endif
+
+ // const uint64_t poly = 0xc96c5795d7870f42; // CRC polynomial
+ const uint64_t p = 0x92d8af2baf0e1e85; // (poly << 1) | 1
+ const uint64_t mu = 0x9c3e466c172963d5; // (calc_lo(poly) << 1) | 1
+ const uint64_t k2 = 0xdabe95afc7875f40; // calc_hi(poly, 1)
+ const uint64_t k1 = 0xe05dd497ca393ae4; // calc_hi(poly, k2)
+
+ const __m128i vfold8 = _mm_set_epi64x((int64_t)p, (int64_t)mu);
+ const __m128i vfold16 = _mm_set_epi64x((int64_t)k2, (int64_t)k1);
+
+ __m128i v0, v1, v2;
+
+#if defined(__i386__) || defined(_M_IX86)
+ crc_simd_body(buf, size, &v0, &v1, vfold16,
+ _mm_set_epi64x(0, (int64_t)~crc));
+#else
+ // GCC and Clang would produce good code with _mm_set_epi64x
+ // but MSVC needs _mm_cvtsi64_si128 on x86-64.
+ crc_simd_body(buf, size, &v0, &v1, vfold16,
+ _mm_cvtsi64_si128((int64_t)~crc));
+#endif
+
+ v1 = _mm_xor_si128(_mm_clmulepi64_si128(v0, vfold16, 0x10), v1);
+ v0 = _mm_clmulepi64_si128(v1, vfold8, 0x00);
+ v2 = _mm_clmulepi64_si128(v0, vfold8, 0x10);
+ v0 = _mm_xor_si128(_mm_xor_si128(v1, _mm_slli_si128(v0, 8)), v2);
+
+#if defined(__i386__) || defined(_M_IX86)
+ return ~(((uint64_t)(uint32_t)_mm_extract_epi32(v0, 3) << 32) |
+ (uint64_t)(uint32_t)_mm_extract_epi32(v0, 2));
+#else
+ return ~(uint64_t)_mm_extract_epi64(v0, 1);
+#endif
+}
+
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
+ && defined(_M_IX86)
+# pragma optimize("", on)
+#endif
+
+#endif // BUILDING_CRC64_CLMUL
+
+
+// Inlining this function duplicates the function body in crc32_resolve() and
+// crc64_resolve(), but this is acceptable because this is a tiny function.
+static inline bool
+is_arch_extension_supported(void)
+{
+ int success = 1;
+ uint32_t r[4]; // eax, ebx, ecx, edx
+
+#if defined(_MSC_VER)
+ // This needs <intrin.h> with MSVC. ICC has it as a built-in
+ // on all platforms.
+ __cpuid(r, 1);
+#elif defined(HAVE_CPUID_H)
+ // Compared to just using __asm__ to run CPUID, this also checks
+ // that CPUID is supported and saves and restores ebx as that is
+ // needed with GCC < 5 with position-independent code (PIC).
+ success = __get_cpuid(1, &r[0], &r[1], &r[2], &r[3]);
+#else
+ // Just a fallback that shouldn't be needed.
+ __asm__("cpuid\n\t"
+ : "=a"(r[0]), "=b"(r[1]), "=c"(r[2]), "=d"(r[3])
+ : "a"(1), "c"(0));
+#endif
+
+ // Returns true if these are supported:
+ // CLMUL (bit 1 in ecx)
+ // SSSE3 (bit 9 in ecx)
+ // SSE4.1 (bit 19 in ecx)
+ const uint32_t ecx_mask = (1 << 1) | (1 << 9) | (1 << 19);
+ return success && (r[2] & ecx_mask) == ecx_mask;
+
+ // Alternative methods that weren't used:
+ // - ICC's _may_i_use_cpu_feature: the other methods should work too.
+ // - GCC >= 6 / Clang / ICX __builtin_cpu_supports("pclmul")
+ //
+ // CPUID decding is needed with MSVC anyway and older GCC. This keeps
+ // the feature checks in the build system simpler too. The nice thing
+ // about __builtin_cpu_supports would be that it generates very short
+ // code as is it only reads a variable set at startup but a few bytes
+ // doesn't matter here.
+}
diff --git a/contrib/xz/src/liblzma/common/alone_decoder.c b/contrib/xz/src/liblzma/common/alone_decoder.c
index 1dc85badf941..78af651578fc 100644
--- a/contrib/xz/src/liblzma/common/alone_decoder.c
+++ b/contrib/xz/src/liblzma/common/alone_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file alone_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "alone_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/alone_decoder.h b/contrib/xz/src/liblzma/common/alone_decoder.h
index dfa031aa77dd..61ee24d97fe4 100644
--- a/contrib/xz/src/liblzma/common/alone_decoder.h
+++ b/contrib/xz/src/liblzma/common/alone_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file alone_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_ALONE_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/alone_encoder.c b/contrib/xz/src/liblzma/common/alone_encoder.c
index 7d3812fa6ea4..21b039509ae5 100644
--- a/contrib/xz/src/liblzma/common/alone_encoder.c
+++ b/contrib/xz/src/liblzma/common/alone_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file alone_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/auto_decoder.c b/contrib/xz/src/liblzma/common/auto_decoder.c
index 2a5c0894d123..fdd520f905c5 100644
--- a/contrib/xz/src/liblzma/common/auto_decoder.c
+++ b/contrib/xz/src/liblzma/common/auto_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file auto_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/block_buffer_decoder.c b/contrib/xz/src/liblzma/common/block_buffer_decoder.c
index b0ded90ddc3e..55566cd2f2b0 100644
--- a/contrib/xz/src/liblzma/common/block_buffer_decoder.c
+++ b/contrib/xz/src/liblzma/common/block_buffer_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_buffer_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "block_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/block_buffer_encoder.c b/contrib/xz/src/liblzma/common/block_buffer_encoder.c
index fdef02de8955..df3b90e8a186 100644
--- a/contrib/xz/src/liblzma/common/block_buffer_encoder.c
+++ b/contrib/xz/src/liblzma/common/block_buffer_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_buffer_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "block_buffer_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/block_buffer_encoder.h b/contrib/xz/src/liblzma/common/block_buffer_encoder.h
index 653207f73498..5274ac40d3aa 100644
--- a/contrib/xz/src/liblzma/common/block_buffer_encoder.h
+++ b/contrib/xz/src/liblzma/common/block_buffer_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_buffer_encoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_BLOCK_BUFFER_ENCODER_H
diff --git a/contrib/xz/src/liblzma/common/block_decoder.c b/contrib/xz/src/liblzma/common/block_decoder.c
index be647d4855d4..2e369d316bdf 100644
--- a/contrib/xz/src/liblzma/common/block_decoder.c
+++ b/contrib/xz/src/liblzma/common/block_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "block_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/block_decoder.h b/contrib/xz/src/liblzma/common/block_decoder.h
index 718c5ced886c..2cbf9ba6db83 100644
--- a/contrib/xz/src/liblzma/common/block_decoder.h
+++ b/contrib/xz/src/liblzma/common/block_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_BLOCK_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/block_encoder.c b/contrib/xz/src/liblzma/common/block_encoder.c
index 4a136ef65e33..ce8c1de69442 100644
--- a/contrib/xz/src/liblzma/common/block_encoder.c
+++ b/contrib/xz/src/liblzma/common/block_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "block_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/block_encoder.h b/contrib/xz/src/liblzma/common/block_encoder.h
index bd97c186e503..b7dfe9a08417 100644
--- a/contrib/xz/src/liblzma/common/block_encoder.h
+++ b/contrib/xz/src/liblzma/common/block_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_encoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_BLOCK_ENCODER_H
diff --git a/contrib/xz/src/liblzma/common/block_header_decoder.c b/contrib/xz/src/liblzma/common/block_header_decoder.c
index c4935dcf46c1..f0b2fbe54d8d 100644
--- a/contrib/xz/src/liblzma/common/block_header_decoder.c
+++ b/contrib/xz/src/liblzma/common/block_header_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_header_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/block_header_encoder.c b/contrib/xz/src/liblzma/common/block_header_encoder.c
index 160425d27a35..45e57a26aba8 100644
--- a/contrib/xz/src/liblzma/common/block_header_encoder.c
+++ b/contrib/xz/src/liblzma/common/block_header_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_header_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/block_util.c b/contrib/xz/src/liblzma/common/block_util.c
index acb311142c21..191f6d444aa6 100644
--- a/contrib/xz/src/liblzma/common/block_util.c
+++ b/contrib/xz/src/liblzma/common/block_util.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file block_util.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/common.c b/contrib/xz/src/liblzma/common/common.c
index adb50d785d52..cc0e06a51bee 100644
--- a/contrib/xz/src/liblzma/common/common.c
+++ b/contrib/xz/src/liblzma/common/common.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file common.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/common.h b/contrib/xz/src/liblzma/common/common.h
index 378923e4012b..20af32f6d6cd 100644
--- a/contrib/xz/src/liblzma/common/common.h
+++ b/contrib/xz/src/liblzma/common/common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file common.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_COMMON_H
diff --git a/contrib/xz/src/liblzma/common/easy_buffer_encoder.c b/contrib/xz/src/liblzma/common/easy_buffer_encoder.c
index 48eb56f5cc91..da610cea6bfa 100644
--- a/contrib/xz/src/liblzma/common/easy_buffer_encoder.c
+++ b/contrib/xz/src/liblzma/common/easy_buffer_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_buffer_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
diff --git a/contrib/xz/src/liblzma/common/easy_decoder_memusage.c b/contrib/xz/src/liblzma/common/easy_decoder_memusage.c
index 20bcd5b71758..0c76f10033b6 100644
--- a/contrib/xz/src/liblzma/common/easy_decoder_memusage.c
+++ b/contrib/xz/src/liblzma/common/easy_decoder_memusage.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_decoder_memusage.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
diff --git a/contrib/xz/src/liblzma/common/easy_encoder.c b/contrib/xz/src/liblzma/common/easy_encoder.c
index 5cb492dd0681..8dfe29610f79 100644
--- a/contrib/xz/src/liblzma/common/easy_encoder.c
+++ b/contrib/xz/src/liblzma/common/easy_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
diff --git a/contrib/xz/src/liblzma/common/easy_encoder_memusage.c b/contrib/xz/src/liblzma/common/easy_encoder_memusage.c
index e91057584233..1184ac665425 100644
--- a/contrib/xz/src/liblzma/common/easy_encoder_memusage.c
+++ b/contrib/xz/src/liblzma/common/easy_encoder_memusage.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_encoder_memusage.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
diff --git a/contrib/xz/src/liblzma/common/easy_preset.c b/contrib/xz/src/liblzma/common/easy_preset.c
index 2f9859860ad7..7908a2bb73c8 100644
--- a/contrib/xz/src/liblzma/common/easy_preset.c
+++ b/contrib/xz/src/liblzma/common/easy_preset.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_preset.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h"
diff --git a/contrib/xz/src/liblzma/common/easy_preset.h b/contrib/xz/src/liblzma/common/easy_preset.h
index 382ade894066..4ef6d044ad57 100644
--- a/contrib/xz/src/liblzma/common/easy_preset.h
+++ b/contrib/xz/src/liblzma/common/easy_preset.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file easy_preset.h
@@ -5,11 +7,11 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
+#ifndef LZMA_EASY_PRESET_H
+#define LZMA_EASY_PRESET_H
+
#include "common.h"
@@ -30,3 +32,5 @@ typedef struct {
/// Set *easy to the settings given by the preset. Returns true on error,
/// false on success.
extern bool lzma_easy_preset(lzma_options_easy *easy, uint32_t preset);
+
+#endif
diff --git a/contrib/xz/src/liblzma/common/file_info.c b/contrib/xz/src/liblzma/common/file_info.c
index 799bb024fe1f..7c85084a706e 100644
--- a/contrib/xz/src/liblzma/common/file_info.c
+++ b/contrib/xz/src/liblzma/common/file_info.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file file_info.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "index_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/filter_buffer_decoder.c b/contrib/xz/src/liblzma/common/filter_buffer_decoder.c
index 6620986eea8a..cc0d88cc71c1 100644
--- a/contrib/xz/src/liblzma/common/filter_buffer_decoder.c
+++ b/contrib/xz/src/liblzma/common/filter_buffer_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_buffer_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_decoder.h"
@@ -24,7 +23,7 @@ lzma_raw_buffer_decode(
|| out_pos == NULL || *out_pos > out_size)
return LZMA_PROG_ERROR;
- // Initialize the decoer.
+ // Initialize the decoder.
lzma_next_coder next = LZMA_NEXT_CODER_INIT;
return_if_error(lzma_raw_decoder_init(&next, allocator, filters));
diff --git a/contrib/xz/src/liblzma/common/filter_buffer_encoder.c b/contrib/xz/src/liblzma/common/filter_buffer_encoder.c
index dda18e3d8e5e..7fb8922ae90e 100644
--- a/contrib/xz/src/liblzma/common/filter_buffer_encoder.c
+++ b/contrib/xz/src/liblzma/common/filter_buffer_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_buffer_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/filter_common.c b/contrib/xz/src/liblzma/common/filter_common.c
index fa0927cf9b9f..d15d9cc94f99 100644
--- a/contrib/xz/src/liblzma/common/filter_common.c
+++ b/contrib/xz/src/liblzma/common/filter_common.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_common.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_common.h"
@@ -122,6 +121,15 @@ static const struct {
.changes_size = false,
},
#endif
+#if defined(HAVE_ENCODER_RISCV) || defined(HAVE_DECODER_RISCV)
+ {
+ .id = LZMA_FILTER_RISCV,
+ .options_size = sizeof(lzma_options_bcj),
+ .non_last_ok = true,
+ .last_ok = false,
+ .changes_size = false,
+ },
+#endif
#if defined(HAVE_ENCODER_DELTA) || defined(HAVE_DECODER_DELTA)
{
.id = LZMA_FILTER_DELTA,
@@ -145,7 +153,7 @@ lzma_filters_copy(const lzma_filter *src, lzma_filter *real_dest,
return LZMA_PROG_ERROR;
// Use a temporary destination so that the real destination
- // will never be modied if an error occurs.
+ // will never be modified if an error occurs.
lzma_filter dest[LZMA_FILTERS_MAX + 1];
lzma_ret ret;
diff --git a/contrib/xz/src/liblzma/common/filter_common.h b/contrib/xz/src/liblzma/common/filter_common.h
index 2e47bb69f7f6..95f9fe27017b 100644
--- a/contrib/xz/src/liblzma/common/filter_common.h
+++ b/contrib/xz/src/liblzma/common/filter_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_common.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_FILTER_COMMON_H
diff --git a/contrib/xz/src/liblzma/common/filter_decoder.c b/contrib/xz/src/liblzma/common/filter_decoder.c
index fa53f5bdbad0..cbdeb5858f66 100644
--- a/contrib/xz/src/liblzma/common/filter_decoder.c
+++ b/contrib/xz/src/liblzma/common/filter_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_decoder.h"
@@ -121,6 +120,14 @@ static const lzma_filter_decoder decoders[] = {
.props_decode = &lzma_simple_props_decode,
},
#endif
+#ifdef HAVE_DECODER_RISCV
+ {
+ .id = LZMA_FILTER_RISCV,
+ .init = &lzma_simple_riscv_decoder_init,
+ .memusage = NULL,
+ .props_decode = &lzma_simple_props_decode,
+ },
+#endif
#ifdef HAVE_DECODER_DELTA
{
.id = LZMA_FILTER_DELTA,
@@ -143,6 +150,16 @@ decoder_find(lzma_vli id)
}
+// lzma_filter_coder begins with the same members as lzma_filter_decoder.
+// This function is a wrapper with a type that is compatible with the
+// typedef of lzma_filter_find in filter_common.h.
+static const lzma_filter_coder *
+coder_find(lzma_vli id)
+{
+ return (const lzma_filter_coder *)decoder_find(id);
+}
+
+
extern LZMA_API(lzma_bool)
lzma_filter_decoder_is_supported(lzma_vli id)
{
@@ -155,7 +172,7 @@ lzma_raw_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
const lzma_filter *options)
{
return lzma_raw_coder_init(next, allocator,
- options, (lzma_filter_find)(&decoder_find), false);
+ options, &coder_find, false);
}
@@ -174,8 +191,7 @@ lzma_raw_decoder(lzma_stream *strm, const lzma_filter *options)
extern LZMA_API(uint64_t)
lzma_raw_decoder_memusage(const lzma_filter *filters)
{
- return lzma_raw_coder_memusage(
- (lzma_filter_find)(&decoder_find), filters);
+ return lzma_raw_coder_memusage(&coder_find, filters);
}
diff --git a/contrib/xz/src/liblzma/common/filter_decoder.h b/contrib/xz/src/liblzma/common/filter_decoder.h
index 2dac60282826..e610bc1f44ec 100644
--- a/contrib/xz/src/liblzma/common/filter_decoder.h
+++ b/contrib/xz/src/liblzma/common/filter_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_FILTER_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/filter_encoder.c b/contrib/xz/src/liblzma/common/filter_encoder.c
index 0699bcee62a4..bc394448985a 100644
--- a/contrib/xz/src/liblzma/common/filter_encoder.c
+++ b/contrib/xz/src/liblzma/common/filter_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_encoder.h"
@@ -159,6 +158,16 @@ static const lzma_filter_encoder encoders[] = {
.props_encode = &lzma_simple_props_encode,
},
#endif
+#ifdef HAVE_ENCODER_RISCV
+ {
+ .id = LZMA_FILTER_RISCV,
+ .init = &lzma_simple_riscv_encoder_init,
+ .memusage = NULL,
+ .block_size = NULL,
+ .props_size_get = &lzma_simple_props_size,
+ .props_encode = &lzma_simple_props_encode,
+ },
+#endif
#ifdef HAVE_ENCODER_DELTA
{
.id = LZMA_FILTER_DELTA,
@@ -184,6 +193,16 @@ encoder_find(lzma_vli id)
}
+// lzma_filter_coder begins with the same members as lzma_filter_encoder.
+// This function is a wrapper with a type that is compatible with the
+// typedef of lzma_filter_find in filter_common.h.
+static const lzma_filter_coder *
+coder_find(lzma_vli id)
+{
+ return (const lzma_filter_coder *)encoder_find(id);
+}
+
+
extern LZMA_API(lzma_bool)
lzma_filter_encoder_is_supported(lzma_vli id)
{
@@ -220,18 +239,18 @@ lzma_filters_update(lzma_stream *strm, const lzma_filter *filters)
extern lzma_ret
lzma_raw_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
- const lzma_filter *options)
+ const lzma_filter *filters)
{
return lzma_raw_coder_init(next, allocator,
- options, (lzma_filter_find)(&encoder_find), true);
+ filters, &coder_find, true);
}
extern LZMA_API(lzma_ret)
-lzma_raw_encoder(lzma_stream *strm, const lzma_filter *options)
+lzma_raw_encoder(lzma_stream *strm, const lzma_filter *filters)
{
- lzma_next_strm_init(lzma_raw_coder_init, strm, options,
- (lzma_filter_find)(&encoder_find), true);
+ lzma_next_strm_init(lzma_raw_coder_init, strm, filters,
+ &coder_find, true);
strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
@@ -244,8 +263,7 @@ lzma_raw_encoder(lzma_stream *strm, const lzma_filter *options)
extern LZMA_API(uint64_t)
lzma_raw_encoder_memusage(const lzma_filter *filters)
{
- return lzma_raw_coder_memusage(
- (lzma_filter_find)(&encoder_find), filters);
+ return lzma_raw_coder_memusage(&coder_find, filters);
}
diff --git a/contrib/xz/src/liblzma/common/filter_encoder.h b/contrib/xz/src/liblzma/common/filter_encoder.h
index da92be8b34da..88f2dafa43b0 100644
--- a/contrib/xz/src/liblzma/common/filter_encoder.h
+++ b/contrib/xz/src/liblzma/common/filter_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_encoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_FILTER_ENCODER_H
diff --git a/contrib/xz/src/liblzma/common/filter_flags_decoder.c b/contrib/xz/src/liblzma/common/filter_flags_decoder.c
index ddfb085943d0..0f5d204d474e 100644
--- a/contrib/xz/src/liblzma/common/filter_flags_decoder.c
+++ b/contrib/xz/src/liblzma/common/filter_flags_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_flags_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/filter_flags_encoder.c b/contrib/xz/src/liblzma/common/filter_flags_encoder.c
index b57b9fd80b06..e1d65884fb0b 100644
--- a/contrib/xz/src/liblzma/common/filter_flags_encoder.c
+++ b/contrib/xz/src/liblzma/common/filter_flags_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file filter_flags_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/hardware_cputhreads.c b/contrib/xz/src/liblzma/common/hardware_cputhreads.c
index 5d246d2cc083..4ce852b42c3d 100644
--- a/contrib/xz/src/liblzma/common/hardware_cputhreads.c
+++ b/contrib/xz/src/liblzma/common/hardware_cputhreads.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file hardware_cputhreads.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/hardware_physmem.c b/contrib/xz/src/liblzma/common/hardware_physmem.c
index a2bbbe29d4b4..1bc34864e849 100644
--- a/contrib/xz/src/liblzma/common/hardware_physmem.c
+++ b/contrib/xz/src/liblzma/common/hardware_physmem.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file hardware_physmem.c
@@ -5,9 +7,6 @@
//
// Author: Jonathan Nieder
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/index.c b/contrib/xz/src/liblzma/common/index.c
index 8a35f4398dbe..6add6a683502 100644
--- a/contrib/xz/src/liblzma/common/index.c
+++ b/contrib/xz/src/liblzma/common/index.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/index.h b/contrib/xz/src/liblzma/common/index.h
index 7b27d7004cfa..007e1188f259 100644
--- a/contrib/xz/src/liblzma/common/index.h
+++ b/contrib/xz/src/liblzma/common/index.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index.h
@@ -12,9 +14,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_INDEX_H
diff --git a/contrib/xz/src/liblzma/common/index_decoder.c b/contrib/xz/src/liblzma/common/index_decoder.c
index 19a31b3e944c..4bcb30692115 100644
--- a/contrib/xz/src/liblzma/common/index_decoder.c
+++ b/contrib/xz/src/liblzma/common/index_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "index_decoder.h"
@@ -306,6 +305,12 @@ lzma_index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
extern LZMA_API(lzma_ret)
lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit)
{
+ // If i isn't NULL, *i must always be initialized due to
+ // the wording in the API docs. This way it is initialized
+ // if we return LZMA_PROG_ERROR due to strm == NULL.
+ if (i != NULL)
+ *i = NULL;
+
lzma_next_strm_init(lzma_index_decoder_init, strm, i, memlimit);
strm->internal->supported_actions[LZMA_RUN] = true;
@@ -320,6 +325,11 @@ lzma_index_buffer_decode(lzma_index **i, uint64_t *memlimit,
const lzma_allocator *allocator,
const uint8_t *in, size_t *in_pos, size_t in_size)
{
+ // If i isn't NULL, *i must always be initialized due to
+ // the wording in the API docs.
+ if (i != NULL)
+ *i = NULL;
+
// Sanity checks
if (i == NULL || memlimit == NULL
|| in == NULL || in_pos == NULL || *in_pos > in_size)
diff --git a/contrib/xz/src/liblzma/common/index_decoder.h b/contrib/xz/src/liblzma/common/index_decoder.h
index 3fec483331a6..5351d2f0dfa4 100644
--- a/contrib/xz/src/liblzma/common/index_decoder.h
+++ b/contrib/xz/src/liblzma/common/index_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_INDEX_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/index_encoder.c b/contrib/xz/src/liblzma/common/index_encoder.c
index 204490cc19d4..ecc299c0159f 100644
--- a/contrib/xz/src/liblzma/common/index_encoder.c
+++ b/contrib/xz/src/liblzma/common/index_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "index_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/index_encoder.h b/contrib/xz/src/liblzma/common/index_encoder.h
index 4d55cd104785..29ba11066963 100644
--- a/contrib/xz/src/liblzma/common/index_encoder.h
+++ b/contrib/xz/src/liblzma/common/index_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index_encoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_INDEX_ENCODER_H
diff --git a/contrib/xz/src/liblzma/common/index_hash.c b/contrib/xz/src/liblzma/common/index_hash.c
index 52c3d6507771..caa5967ca496 100644
--- a/contrib/xz/src/liblzma/common/index_hash.c
+++ b/contrib/xz/src/liblzma/common/index_hash.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file index_hash.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/lzip_decoder.c b/contrib/xz/src/liblzma/common/lzip_decoder.c
index 88cc7ffd236b..651a0ae712c8 100644
--- a/contrib/xz/src/liblzma/common/lzip_decoder.c
+++ b/contrib/xz/src/liblzma/common/lzip_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzip_decoder.c
@@ -6,9 +8,6 @@
// Author: Michał Górny
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzip_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/lzip_decoder.h b/contrib/xz/src/liblzma/common/lzip_decoder.h
index 33a01c352ce3..0e1f7bebd45b 100644
--- a/contrib/xz/src/liblzma/common/lzip_decoder.h
+++ b/contrib/xz/src/liblzma/common/lzip_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzip_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Michał Górny
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZIP_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/memcmplen.h b/contrib/xz/src/liblzma/common/memcmplen.h
index 99d9c519cc0d..394a4856dd6a 100644
--- a/contrib/xz/src/liblzma/common/memcmplen.h
+++ b/contrib/xz/src/liblzma/common/memcmplen.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file memcmplen.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_MEMCMPLEN_H
@@ -24,7 +23,8 @@
// can use the intrinsics without the header file.
#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \
&& defined(_MSC_VER) \
- && defined(_M_X64) \
+ && (defined(_M_X64) \
+ || defined(_M_ARM64) || defined(_M_ARM64EC)) \
&& !defined(__INTEL_COMPILER)
# include <intrin.h>
#endif
@@ -57,20 +57,35 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
assert(limit <= UINT32_MAX / 2);
#if defined(TUKLIB_FAST_UNALIGNED_ACCESS) \
- && ((TUKLIB_GNUC_REQ(3, 4) && defined(__x86_64__)) \
+ && (((TUKLIB_GNUC_REQ(3, 4) || defined(__clang__)) \
+ && (defined(__x86_64__) \
+ || defined(__aarch64__))) \
|| (defined(__INTEL_COMPILER) && defined(__x86_64__)) \
|| (defined(__INTEL_COMPILER) && defined(_M_X64)) \
- || (defined(_MSC_VER) && defined(_M_X64)))
- // I keep this x86-64 only for now since that's where I know this
- // to be a good method. This may be fine on other 64-bit CPUs too.
- // On big endian one should use xor instead of subtraction and switch
- // to __builtin_clzll().
+ || (defined(_MSC_VER) && (defined(_M_X64) \
+ || defined(_M_ARM64) || defined(_M_ARM64EC))))
+ // 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
+ // 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
while (len < limit) {
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
if (x != 0) {
// MSVC or Intel C compiler on Windows
-# if (defined(_MSC_VER) || defined(__INTEL_COMPILER)) && defined(_M_X64)
+# if defined(_MSC_VER) || defined(__INTEL_COMPILER)
unsigned long tmp;
_BitScanForward64(&tmp, x);
len += (uint32_t)tmp >> 3;
diff --git a/contrib/xz/src/liblzma/common/microlzma_decoder.c b/contrib/xz/src/liblzma/common/microlzma_decoder.c
index e473373daaae..882cb2c808d1 100644
--- a/contrib/xz/src/liblzma/common/microlzma_decoder.c
+++ b/contrib/xz/src/liblzma/common/microlzma_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file microlzma_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/microlzma_encoder.c b/contrib/xz/src/liblzma/common/microlzma_encoder.c
index a787ca25b839..45ec0b12f45d 100644
--- a/contrib/xz/src/liblzma/common/microlzma_encoder.c
+++ b/contrib/xz/src/liblzma/common/microlzma_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file microlzma_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/outqueue.c b/contrib/xz/src/liblzma/common/outqueue.c
index 71e8648a294d..eb018eb42b26 100644
--- a/contrib/xz/src/liblzma/common/outqueue.c
+++ b/contrib/xz/src/liblzma/common/outqueue.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file outqueue.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "outqueue.h"
diff --git a/contrib/xz/src/liblzma/common/outqueue.h b/contrib/xz/src/liblzma/common/outqueue.h
index 596911e95ee1..25f071977a8f 100644
--- a/contrib/xz/src/liblzma/common/outqueue.h
+++ b/contrib/xz/src/liblzma/common/outqueue.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file outqueue.h
@@ -5,11 +7,11 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
+#ifndef LZMA_OUTQUEUE_H
+#define LZMA_OUTQUEUE_H
+
#include "common.h"
@@ -252,3 +254,5 @@ lzma_outq_outbuf_memusage(size_t buf_size)
assert(buf_size <= SIZE_MAX - sizeof(lzma_outbuf));
return sizeof(lzma_outbuf) + buf_size;
}
+
+#endif
diff --git a/contrib/xz/src/liblzma/common/stream_buffer_decoder.c b/contrib/xz/src/liblzma/common/stream_buffer_decoder.c
index b9745b5dbe18..c4f91fb49839 100644
--- a/contrib/xz/src/liblzma/common/stream_buffer_decoder.c
+++ b/contrib/xz/src/liblzma/common/stream_buffer_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_buffer_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/stream_buffer_encoder.c b/contrib/xz/src/liblzma/common/stream_buffer_encoder.c
index 73157590e6f4..04d586959469 100644
--- a/contrib/xz/src/liblzma/common/stream_buffer_encoder.c
+++ b/contrib/xz/src/liblzma/common/stream_buffer_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_buffer_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/stream_decoder.c b/contrib/xz/src/liblzma/common/stream_decoder.c
index 64283812f29a..7f426841366a 100644
--- a/contrib/xz/src/liblzma/common/stream_decoder.c
+++ b/contrib/xz/src/liblzma/common/stream_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_decoder.h"
diff --git a/contrib/xz/src/liblzma/common/stream_decoder.h b/contrib/xz/src/liblzma/common/stream_decoder.h
index c13c6ba12706..5803715374d6 100644
--- a/contrib/xz/src/liblzma/common/stream_decoder.h
+++ b/contrib/xz/src/liblzma/common/stream_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_STREAM_DECODER_H
diff --git a/contrib/xz/src/liblzma/common/stream_decoder_mt.c b/contrib/xz/src/liblzma/common/stream_decoder_mt.c
index 76212b46da32..244624a47900 100644
--- a/contrib/xz/src/liblzma/common/stream_decoder_mt.c
+++ b/contrib/xz/src/liblzma/common/stream_decoder_mt.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_decoder_mt.c
@@ -6,9 +8,6 @@
// Authors: Sebastian Andrzej Siewior
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/stream_encoder.c b/contrib/xz/src/liblzma/common/stream_encoder.c
index ee9204601856..e7e5b3fce7e0 100644
--- a/contrib/xz/src/liblzma/common/stream_encoder.c
+++ b/contrib/xz/src/liblzma/common/stream_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "block_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/stream_encoder_mt.c b/contrib/xz/src/liblzma/common/stream_encoder_mt.c
index 64de526b6a17..f0fef1523318 100644
--- a/contrib/xz/src/liblzma/common/stream_encoder_mt.c
+++ b/contrib/xz/src/liblzma/common/stream_encoder_mt.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_encoder_mt.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_encoder.h"
diff --git a/contrib/xz/src/liblzma/common/stream_flags_common.c b/contrib/xz/src/liblzma/common/stream_flags_common.c
index fbe8eb8abda2..41b8dcb70d74 100644
--- a/contrib/xz/src/liblzma/common/stream_flags_common.c
+++ b/contrib/xz/src/liblzma/common/stream_flags_common.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_flags_common.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_flags_common.h"
diff --git a/contrib/xz/src/liblzma/common/stream_flags_common.h b/contrib/xz/src/liblzma/common/stream_flags_common.h
index 84e96ba1ff66..28729dbcb6f2 100644
--- a/contrib/xz/src/liblzma/common/stream_flags_common.h
+++ b/contrib/xz/src/liblzma/common/stream_flags_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_flags_common.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_STREAM_FLAGS_COMMON_H
diff --git a/contrib/xz/src/liblzma/common/stream_flags_decoder.c b/contrib/xz/src/liblzma/common/stream_flags_decoder.c
index b8d263ba4429..522c98b6fd5c 100644
--- a/contrib/xz/src/liblzma/common/stream_flags_decoder.c
+++ b/contrib/xz/src/liblzma/common/stream_flags_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_flags_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_flags_common.h"
diff --git a/contrib/xz/src/liblzma/common/stream_flags_encoder.c b/contrib/xz/src/liblzma/common/stream_flags_encoder.c
index b98ab17c456c..f94b5cd0a237 100644
--- a/contrib/xz/src/liblzma/common/stream_flags_encoder.c
+++ b/contrib/xz/src/liblzma/common/stream_flags_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_flags_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "stream_flags_common.h"
diff --git a/contrib/xz/src/liblzma/common/string_conversion.c b/contrib/xz/src/liblzma/common/string_conversion.c
index d2c1e80936b2..c899783c642a 100644
--- a/contrib/xz/src/liblzma/common/string_conversion.c
+++ b/contrib/xz/src/liblzma/common/string_conversion.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file string_conversion.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "filter_common.h"
@@ -218,12 +217,14 @@ typedef struct {
uint16_t offset;
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 {
uint32_t min;
uint32_t max;
} range;
-
- const name_value_map *map;
} u;
} option_map;
@@ -250,7 +251,9 @@ static const char *parse_options(const char **const str, const char *str_end,
|| defined(HAVE_ENCODER_IA64) \
|| defined(HAVE_DECODER_IA64) \
|| defined(HAVE_ENCODER_SPARC) \
- || defined(HAVE_DECODER_SPARC)
+ || defined(HAVE_DECODER_SPARC) \
+ || defined(HAVE_ENCODER_RISCV) \
+ || defined(HAVE_DECODER_RISCV)
static const option_map bcj_optmap[] = {
{
.name = "start",
@@ -509,6 +512,11 @@ static const struct {
&parse_bcj, bcj_optmap, 1, 1, true },
#endif
+#if defined(HAVE_ENCODER_RISCV) || defined(HAVE_DECODER_RISCV)
+ { "riscv", sizeof(lzma_options_bcj), LZMA_FILTER_RISCV,
+ &parse_bcj, bcj_optmap, 1, 1, true },
+#endif
+
#if defined(HAVE_ENCODER_POWERPC) || defined(HAVE_DECODER_POWERPC)
{ "powerpc", sizeof(lzma_options_bcj), LZMA_FILTER_POWERPC,
&parse_bcj, bcj_optmap, 1, 1, true },
@@ -994,6 +1002,12 @@ extern LZMA_API(const char *)
lzma_str_to_filters(const char *str, int *error_pos, lzma_filter *filters,
uint32_t flags, const lzma_allocator *allocator)
{
+ // If error_pos isn't NULL, *error_pos must always be set.
+ // liblzma <= 5.4.6 and <= 5.6.1 have a bug and don't do this
+ // when str == NULL or filters == NULL or flags are unsupported.
+ if (error_pos != NULL)
+ *error_pos = 0;
+
if (str == NULL || filters == NULL)
return "Unexpected NULL pointer argument(s) "
"to lzma_str_to_filters()";
diff --git a/contrib/xz/src/liblzma/common/vli_decoder.c b/contrib/xz/src/liblzma/common/vli_decoder.c
index af2799d1fb90..3254ccc35bde 100644
--- a/contrib/xz/src/liblzma/common/vli_decoder.c
+++ b/contrib/xz/src/liblzma/common/vli_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file vli_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/vli_encoder.c b/contrib/xz/src/liblzma/common/vli_encoder.c
index f8642694e291..3859006a94f1 100644
--- a/contrib/xz/src/liblzma/common/vli_encoder.c
+++ b/contrib/xz/src/liblzma/common/vli_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file vli_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/common/vli_size.c b/contrib/xz/src/liblzma/common/vli_size.c
index ec1b4fa488b6..c8cb2ec10ade 100644
--- a/contrib/xz/src/liblzma/common/vli_size.c
+++ b/contrib/xz/src/liblzma/common/vli_size.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file vli_size.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/delta/delta_common.c b/contrib/xz/src/liblzma/delta/delta_common.c
index 4768201d1a9f..5dbe253b4b3a 100644
--- a/contrib/xz/src/liblzma/delta/delta_common.c
+++ b/contrib/xz/src/liblzma/delta/delta_common.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_common.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "delta_common.h"
diff --git a/contrib/xz/src/liblzma/delta/delta_common.h b/contrib/xz/src/liblzma/delta/delta_common.h
index 7e7e1baaf680..bd0912769724 100644
--- a/contrib/xz/src/liblzma/delta/delta_common.h
+++ b/contrib/xz/src/liblzma/delta/delta_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_common.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_DELTA_COMMON_H
diff --git a/contrib/xz/src/liblzma/delta/delta_decoder.c b/contrib/xz/src/liblzma/delta/delta_decoder.c
index 77cf65cc76d8..9f0d49ca415a 100644
--- a/contrib/xz/src/liblzma/delta/delta_decoder.c
+++ b/contrib/xz/src/liblzma/delta/delta_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "delta_decoder.h"
@@ -26,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
delta_decode(void *coder_ptr, const lzma_allocator *allocator,
const uint8_t *restrict in, size_t *restrict in_pos,
diff --git a/contrib/xz/src/liblzma/delta/delta_decoder.h b/contrib/xz/src/liblzma/delta/delta_decoder.h
index ad89cc659764..e2268ed44e72 100644
--- a/contrib/xz/src/liblzma/delta/delta_decoder.h
+++ b/contrib/xz/src/liblzma/delta/delta_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_DELTA_DECODER_H
diff --git a/contrib/xz/src/liblzma/delta/delta_encoder.c b/contrib/xz/src/liblzma/delta/delta_encoder.c
index 056bf7468ea3..ba4a50b1f42d 100644
--- a/contrib/xz/src/liblzma/delta/delta_encoder.c
+++ b/contrib/xz/src/liblzma/delta/delta_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "delta_encoder.h"
diff --git a/contrib/xz/src/liblzma/delta/delta_encoder.h b/contrib/xz/src/liblzma/delta/delta_encoder.h
index 4ab984785171..735f0ed0091b 100644
--- a/contrib/xz/src/liblzma/delta/delta_encoder.h
+++ b/contrib/xz/src/liblzma/delta/delta_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_encoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_DELTA_ENCODER_H
diff --git a/contrib/xz/src/liblzma/delta/delta_private.h b/contrib/xz/src/liblzma/delta/delta_private.h
index 0d6cb3866115..e54721a84665 100644
--- a/contrib/xz/src/liblzma/delta/delta_private.h
+++ b/contrib/xz/src/liblzma/delta/delta_private.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file delta_private.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_DELTA_PRIVATE_H
diff --git a/contrib/xz/src/liblzma/liblzma.pc.in b/contrib/xz/src/liblzma/liblzma.pc.in
index d077cb77135a..a432992b7072 100644
--- a/contrib/xz/src/liblzma/liblzma.pc.in
+++ b/contrib/xz/src/liblzma/liblzma.pc.in
@@ -1,9 +1,5 @@
-#
+# SPDX-License-Identifier: 0BSD
# Author: Lasse Collin
-#
-# This file has been put into the public domain.
-# You can do whatever you want with this file.
-#
prefix=@prefix@
exec_prefix=@exec_prefix@
diff --git a/contrib/xz/src/liblzma/liblzma_generic.map b/contrib/xz/src/liblzma/liblzma_generic.map
index b251d366e15c..f74c15484559 100644
--- a/contrib/xz/src/liblzma/liblzma_generic.map
+++ b/contrib/xz/src/liblzma/liblzma_generic.map
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
XZ_5.0 {
global:
lzma_alone_decoder;
@@ -120,7 +122,7 @@ global:
lzma_str_to_filters;
} XZ_5.2;
-XZ_5.5.0alpha {
+XZ_5.6.0 {
global:
lzma_mt_block_size;
} XZ_5.4;
diff --git a/contrib/xz/src/liblzma/liblzma_linux.map b/contrib/xz/src/liblzma/liblzma_linux.map
index 25b393883693..7e4b25e17620 100644
--- a/contrib/xz/src/liblzma/liblzma_linux.map
+++ b/contrib/xz/src/liblzma/liblzma_linux.map
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: 0BSD */
+
XZ_5.0 {
global:
lzma_alone_decoder;
@@ -135,7 +137,7 @@ global:
lzma_str_to_filters;
} XZ_5.2;
-XZ_5.5.0alpha {
+XZ_5.6.0 {
global:
lzma_mt_block_size;
} XZ_5.4;
diff --git a/contrib/xz/src/liblzma/lz/lz_decoder.c b/contrib/xz/src/liblzma/lz/lz_decoder.c
index 06c95c1137df..92913f225a0d 100644
--- a/contrib/xz/src/liblzma/lz/lz_decoder.c
+++ b/contrib/xz/src/liblzma/lz/lz_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_decoder.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
// liblzma supports multiple LZ77-based filters. The LZ part is shared
@@ -54,9 +53,10 @@ typedef struct {
static void
lz_decoder_reset(lzma_coder *coder)
{
- coder->dict.pos = 0;
+ coder->dict.pos = 2 * LZ_DICT_REPEAT_MAX;
coder->dict.full = 0;
- coder->dict.buf[coder->dict.size - 1] = '\0';
+ coder->dict.buf[2 * LZ_DICT_REPEAT_MAX - 1] = '\0';
+ coder->dict.has_wrapped = false;
coder->dict.need_reset = false;
return;
}
@@ -70,8 +70,15 @@ decode_buffer(lzma_coder *coder,
{
while (true) {
// Wrap the dictionary if needed.
- if (coder->dict.pos == coder->dict.size)
- coder->dict.pos = 0;
+ if (coder->dict.pos == coder->dict.size) {
+ // See the comment of #define LZ_DICT_REPEAT_MAX.
+ coder->dict.pos = LZ_DICT_REPEAT_MAX;
+ coder->dict.has_wrapped = true;
+ memcpy(coder->dict.buf, coder->dict.buf
+ + coder->dict.size
+ - LZ_DICT_REPEAT_MAX,
+ LZ_DICT_REPEAT_MAX);
+ }
// Store the current dictionary position. It is needed to know
// where to start copying to the out[] buffer.
@@ -253,21 +260,31 @@ lzma_lz_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
// dictionary to the output buffer, since applications are
// recommended to give aligned buffers to liblzma.
//
+ // Reserve 2 * LZ_DICT_REPEAT_MAX bytes of extra space which is
+ // needed for alloc_size.
+ //
// Avoid integer overflow.
- if (lz_options.dict_size > SIZE_MAX - 15)
+ if (lz_options.dict_size > SIZE_MAX - 15 - 2 * LZ_DICT_REPEAT_MAX)
return LZMA_MEM_ERROR;
lz_options.dict_size = (lz_options.dict_size + 15) & ~((size_t)(15));
+ // Reserve extra space as explained in the comment
+ // of #define LZ_DICT_REPEAT_MAX.
+ const size_t alloc_size
+ = lz_options.dict_size + 2 * LZ_DICT_REPEAT_MAX;
+
// Allocate and initialize the dictionary.
- if (coder->dict.size != lz_options.dict_size) {
+ if (coder->dict.size != alloc_size) {
lzma_free(coder->dict.buf, allocator);
- coder->dict.buf
- = lzma_alloc(lz_options.dict_size, allocator);
+ coder->dict.buf = lzma_alloc(alloc_size, allocator);
if (coder->dict.buf == NULL)
return LZMA_MEM_ERROR;
- coder->dict.size = lz_options.dict_size;
+ // NOTE: Yes, alloc_size, not lz_options.dict_size. The way
+ // coder->dict.full is updated will take care that we will
+ // still reject distances larger than lz_options.dict_size.
+ coder->dict.size = alloc_size;
}
lz_decoder_reset(next->coder);
@@ -280,9 +297,12 @@ lzma_lz_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
const size_t copy_size = my_min(lz_options.preset_dict_size,
lz_options.dict_size);
const size_t offset = lz_options.preset_dict_size - copy_size;
- memcpy(coder->dict.buf, lz_options.preset_dict + offset,
+ memcpy(coder->dict.buf + coder->dict.pos,
+ lz_options.preset_dict + offset,
copy_size);
- coder->dict.pos = copy_size;
+
+ // dict.pos isn't zero after lz_decoder_reset().
+ coder->dict.pos += copy_size;
coder->dict.full = copy_size;
}
diff --git a/contrib/xz/src/liblzma/lz/lz_decoder.h b/contrib/xz/src/liblzma/lz/lz_decoder.h
index ad80d4dd0d14..cb61b6e24c78 100644
--- a/contrib/xz/src/liblzma/lz/lz_decoder.h
+++ b/contrib/xz/src/liblzma/lz/lz_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_decoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZ_DECODER_H
@@ -17,10 +16,28 @@
#include "common.h"
+/// Maximum length of a match rounded up to a nice power of 2 which is
+/// a good size for aligned memcpy(). The allocated dictionary buffer will
+/// be 2 * LZ_DICT_REPEAT_MAX bytes larger than the actual dictionary size:
+///
+/// (1) Every time the decoder reaches the end of the dictionary buffer,
+/// the last LZ_DICT_REPEAT_MAX bytes will be copied to the beginning.
+/// This way dict_repeat() will only need to copy from one place,
+/// never from both the end and beginning of the buffer.
+///
+/// (2) The other LZ_DICT_REPEAT_MAX bytes is kept as a buffer between
+/// the oldest byte still in the dictionary and the current write
+/// position. This way dict_repeat(dict, dict->size - 1, &len)
+/// won't need memmove() as the copying cannot overlap.
+///
+/// Note that memcpy() still cannot be used if distance < len.
+///
+/// LZMA's longest match length is 273 so pick a multiple of 16 above that.
+#define LZ_DICT_REPEAT_MAX 288
+
+
typedef struct {
- /// Pointer to the dictionary buffer. It can be an allocated buffer
- /// internal to liblzma, or it can a be a buffer given by the
- /// application when in single-call mode (not implemented yet).
+ /// Pointer to the dictionary buffer.
uint8_t *buf;
/// Write position in dictionary. The next byte will be written to
@@ -35,9 +52,16 @@ typedef struct {
/// Write limit
size_t limit;
- /// Size of the dictionary
+ /// Allocated size of buf. This is 2 * LZ_DICT_REPEAT_MAX bytes
+ /// larger than the actual dictionary size. This is enforced by
+ /// how the value for "full" is set; it can be at most
+ /// "size - 2 * LZ_DICT_REPEAT_MAX".
size_t size;
+ /// True once the dictionary has become full and the writing position
+ /// has been wrapped in decode_buffer() in lz_decoder.c.
+ bool has_wrapped;
+
/// True when dictionary should be reset before decoding more data.
bool need_reset;
@@ -103,7 +127,16 @@ static inline uint8_t
dict_get(const lzma_dict *const dict, const uint32_t distance)
{
return dict->buf[dict->pos - distance - 1
- + (distance < dict->pos ? 0 : dict->size)];
+ + (distance < dict->pos
+ ? 0 : dict->size - LZ_DICT_REPEAT_MAX)];
+}
+
+
+/// Optimized version of dict_get(dict, 0)
+static inline uint8_t
+dict_get0(const lzma_dict *const dict)
+{
+ return dict->buf[dict->pos - 1];
}
@@ -132,68 +165,51 @@ dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len)
uint32_t left = my_min(dict_avail, *len);
*len -= left;
+ size_t back = dict->pos - distance - 1;
+ if (distance >= dict->pos)
+ back += dict->size - LZ_DICT_REPEAT_MAX;
+
// Repeat a block of data from the history. Because memcpy() is faster
// than copying byte by byte in a loop, the copying process gets split
- // into three cases.
+ // into two cases.
if (distance < left) {
// Source and target areas overlap, thus we can't use
// memcpy() nor even memmove() safely.
do {
- dict->buf[dict->pos] = dict_get(dict, distance);
- ++dict->pos;
+ dict->buf[dict->pos++] = dict->buf[back++];
} while (--left > 0);
-
- } else if (distance < dict->pos) {
- // The easiest and fastest case
- memcpy(dict->buf + dict->pos,
- dict->buf + dict->pos - distance - 1,
- left);
- dict->pos += left;
-
} else {
- // The bigger the dictionary, the more rare this
- // case occurs. We need to "wrap" the dict, thus
- // we might need two memcpy() to copy all the data.
- assert(dict->full == dict->size);
- const uint32_t copy_pos
- = dict->pos - distance - 1 + dict->size;
- uint32_t copy_size = dict->size - copy_pos;
-
- if (copy_size < left) {
- memmove(dict->buf + dict->pos, dict->buf + copy_pos,
- copy_size);
- dict->pos += copy_size;
- copy_size = left - copy_size;
- memcpy(dict->buf + dict->pos, dict->buf, copy_size);
- dict->pos += copy_size;
- } else {
- memmove(dict->buf + dict->pos, dict->buf + copy_pos,
- left);
- dict->pos += left;
- }
+ memcpy(dict->buf + dict->pos, dict->buf + back, left);
+ dict->pos += left;
}
// Update how full the dictionary is.
- if (dict->full < dict->pos)
- dict->full = dict->pos;
+ if (!dict->has_wrapped)
+ dict->full = dict->pos - 2 * LZ_DICT_REPEAT_MAX;
- return unlikely(*len != 0);
+ return *len != 0;
+}
+
+
+static inline void
+dict_put(lzma_dict *dict, uint8_t byte)
+{
+ dict->buf[dict->pos++] = byte;
+
+ if (!dict->has_wrapped)
+ dict->full = dict->pos - 2 * LZ_DICT_REPEAT_MAX;
}
/// Puts one byte into the dictionary. Returns true if the dictionary was
/// already full and the byte couldn't be added.
static inline bool
-dict_put(lzma_dict *dict, uint8_t byte)
+dict_put_safe(lzma_dict *dict, uint8_t byte)
{
if (unlikely(dict->pos == dict->limit))
return true;
- dict->buf[dict->pos++] = byte;
-
- if (dict->pos > dict->full)
- dict->full = dict->pos;
-
+ dict_put(dict, byte);
return false;
}
@@ -217,8 +233,8 @@ dict_write(lzma_dict *restrict dict, const uint8_t *restrict in,
*left -= lzma_bufcpy(in, in_pos, in_size,
dict->buf, &dict->pos, dict->limit);
- if (dict->pos > dict->full)
- dict->full = dict->pos;
+ if (!dict->has_wrapped)
+ dict->full = dict->pos - 2 * LZ_DICT_REPEAT_MAX;
return;
}
diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.c b/contrib/xz/src/liblzma/lz/lz_encoder.c
index 8e724a035a13..4af23e14c423 100644
--- a/contrib/xz/src/liblzma/lz/lz_encoder.c
+++ b/contrib/xz/src/liblzma/lz/lz_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_encoder.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lz_encoder.h"
@@ -547,7 +546,7 @@ lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
lzma_lz_options *lz_options))
{
#if defined(HAVE_SMALL) && !defined(HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR)
- // We need that the CRC32 table has been initialized.
+ // The CRC32 table must be initialized.
lzma_crc32_init();
#endif
@@ -567,6 +566,8 @@ lzma_lz_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
coder->lz.coder = NULL;
coder->lz.code = NULL;
coder->lz.end = NULL;
+ coder->lz.options_update = NULL;
+ coder->lz.set_out_limit = NULL;
// mf.size is initialized to silence Valgrind
// when used on optimized binaries (GCC may reorder
diff --git a/contrib/xz/src/liblzma/lz/lz_encoder.h b/contrib/xz/src/liblzma/lz/lz_encoder.h
index b71f11805e50..eb197c6b6cd8 100644
--- a/contrib/xz/src/liblzma/lz/lz_encoder.h
+++ b/contrib/xz/src/liblzma/lz/lz_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_encoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZ_ENCODER_H
@@ -22,7 +21,7 @@
// changing this check.
#define IS_ENC_DICT_SIZE_VALID(size) \
((size) >= LZMA_DICT_SIZE_MIN \
- && (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29))
+ && (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29))
/// A table of these is used by the LZ-based encoder to hold
@@ -161,9 +160,13 @@ typedef struct {
/// Maximum search depth
uint32_t depth;
- /// TODO: Comment
+ /// Initial dictionary for the match finder to search.
const uint8_t *preset_dict;
+ /// If the preset dictionary is NULL, this value is ignored.
+ /// Otherwise this member must indicate the preset dictionary's
+ /// buffer size. If this size is larger than dict_size, then only
+ /// the dict_size sized tail of the preset_dict will be used.
uint32_t preset_dict_size;
} lzma_lz_options;
@@ -225,7 +228,7 @@ typedef struct {
// 3. The literals and matches are encoded using e.g. LZMA.
//
// The bytes that have been ran through the match finder, but not encoded yet,
-// are called `read ahead'.
+// are called 'read ahead'.
/// Get how many bytes the match finder hashes in its initial step.
diff --git a/contrib/xz/src/liblzma/lz/lz_encoder_hash.h b/contrib/xz/src/liblzma/lz/lz_encoder_hash.h
index 4d9971ae6a5d..8ace82b04c51 100644
--- a/contrib/xz/src/liblzma/lz/lz_encoder_hash.h
+++ b/contrib/xz/src/liblzma/lz/lz_encoder_hash.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_encoder_hash.h
@@ -5,9 +7,6 @@
//
// Author: Igor Pavlov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZ_ENCODER_HASH_H
diff --git a/contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h b/contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h
index 8c51717d704f..2b3a60e43e80 100644
--- a/contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h
+++ b/contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by crc32_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by crc32_tablegen.c.
const uint32_t lzma_lz_hash_table[256] = {
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,
diff --git a/contrib/xz/src/liblzma/lz/lz_encoder_mf.c b/contrib/xz/src/liblzma/lz/lz_encoder_mf.c
index 1fdc2d794909..557c2612f2a2 100644
--- a/contrib/xz/src/liblzma/lz/lz_encoder_mf.c
+++ b/contrib/xz/src/liblzma/lz/lz_encoder_mf.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lz_encoder_mf.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lz_encoder.h"
diff --git a/contrib/xz/src/liblzma/lzma/fastpos.h b/contrib/xz/src/liblzma/lzma/fastpos.h
index dbeb16f7e31a..d3969a753fac 100644
--- a/contrib/xz/src/liblzma/lzma/fastpos.h
+++ b/contrib/xz/src/liblzma/lzma/fastpos.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file fastpos.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_FASTPOS_H
diff --git a/contrib/xz/src/liblzma/lzma/fastpos_table.c b/contrib/xz/src/liblzma/lzma/fastpos_table.c
index 6a3ceac0e90a..4e10e3795e29 100644
--- a/contrib/xz/src/liblzma/lzma/fastpos_table.c
+++ b/contrib/xz/src/liblzma/lzma/fastpos_table.c
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by fastpos_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by fastpos_tablegen.c.
#include "common.h"
#include "fastpos.h"
diff --git a/contrib/xz/src/liblzma/lzma/fastpos_tablegen.c b/contrib/xz/src/liblzma/lzma/fastpos_tablegen.c
index 57ed15039b27..957ccb7a6436 100644
--- a/contrib/xz/src/liblzma/lzma/fastpos_tablegen.c
+++ b/contrib/xz/src/liblzma/lzma/fastpos_tablegen.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file fastpos_tablegen.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include <inttypes.h>
@@ -35,11 +34,13 @@ main(void)
fastpos[c] = slot_fast;
}
- printf("/* This file has been automatically generated "
- "by fastpos_tablegen.c. */\n\n"
- "#include \"common.h\"\n"
- "#include \"fastpos.h\"\n\n"
- "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {");
+ // Split the SPDX string so that it won't accidentally match
+ // when tools search for the string.
+ printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+ "// This file has been generated by fastpos_tablegen.c.\n\n"
+ "#include \"common.h\"\n"
+ "#include \"fastpos.h\"\n\n"
+ "const uint8_t lzma_fastpos[1 << FASTPOS_BITS] = {");
for (size_t i = 0; i < (1 << FASTPOS_BITS); ++i) {
if (i % 16 == 0)
diff --git a/contrib/xz/src/liblzma/lzma/lzma2_decoder.c b/contrib/xz/src/liblzma/lzma/lzma2_decoder.c
index 567df490ca5b..37ab253f5b0a 100644
--- a/contrib/xz/src/liblzma/lzma/lzma2_decoder.c
+++ b/contrib/xz/src/liblzma/lzma/lzma2_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma2_decoder.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma2_decoder.h"
diff --git a/contrib/xz/src/liblzma/lzma/lzma2_decoder.h b/contrib/xz/src/liblzma/lzma/lzma2_decoder.h
index ef2dcbfa76f0..cdd8b463abfd 100644
--- a/contrib/xz/src/liblzma/lzma/lzma2_decoder.h
+++ b/contrib/xz/src/liblzma/lzma/lzma2_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma2_decoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA2_DECODER_H
diff --git a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c
index 5043a07e0fdf..e20b75b30037 100644
--- a/contrib/xz/src/liblzma/lzma/lzma2_encoder.c
+++ b/contrib/xz/src/liblzma/lzma/lzma2_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma2_encoder.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lz_encoder.h"
diff --git a/contrib/xz/src/liblzma/lzma/lzma2_encoder.h b/contrib/xz/src/liblzma/lzma/lzma2_encoder.h
index 515f1839347a..29966a66d237 100644
--- a/contrib/xz/src/liblzma/lzma/lzma2_encoder.h
+++ b/contrib/xz/src/liblzma/lzma/lzma2_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma2_encoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA2_ENCODER_H
diff --git a/contrib/xz/src/liblzma/lzma/lzma_common.h b/contrib/xz/src/liblzma/lzma/lzma_common.h
index 9d040d95bb2f..c3c587f090ec 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_common.h
+++ b/contrib/xz/src/liblzma/lzma/lzma_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_common.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA_COMMON_H
@@ -84,6 +83,20 @@ typedef enum {
? (state) - 3 \
: (state) - 6))
+/// Like update_literal(state) but when it is already known that
+/// is_literal_state(state) is true.
+#define update_literal_normal(state) \
+ state = ((state) <= STATE_SHORTREP_LIT_LIT \
+ ? STATE_LIT_LIT \
+ : (state) - 3);
+
+/// Like update_literal(state) but when it is already known that
+/// is_literal_state(state) is false.
+#define update_literal_matched(state) \
+ state = ((state) <= STATE_LIT_SHORTREP \
+ ? (state) - 3 \
+ : (state) - 6);
+
/// Indicate that the latest state was a match.
#define update_match(state) \
state = ((state) < LIT_STATES ? STATE_LIT_MATCH : STATE_NONLIT_MATCH)
@@ -112,31 +125,33 @@ typedef enum {
///
/// Match byte is used when the previous LZMA symbol was something else than
/// a literal (that is, it was some kind of match).
-#define LITERAL_CODER_SIZE 0x300
+#define LITERAL_CODER_SIZE UINT32_C(0x300)
/// Maximum number of literal coders
#define LITERAL_CODERS_MAX (1 << LZMA_LCLP_MAX)
+/// Calculates the literal_mask that literal_subcoder() needs.
+#define literal_mask_calc(lc, lp) \
+ ((UINT32_C(0x100) << (lp)) - (UINT32_C(0x100) >> (lc)))
+
/// Locate the literal coder for the next literal byte. The choice depends on
/// - the lowest literal_pos_bits bits of the position of the current
/// byte; and
/// - the highest literal_context_bits bits of the previous byte.
-#define literal_subcoder(probs, lc, lp_mask, pos, prev_byte) \
- ((probs)[(((pos) & (lp_mask)) << (lc)) \
- + ((uint32_t)(prev_byte) >> (8U - (lc)))])
+#define literal_subcoder(probs, lc, literal_mask, pos, prev_byte) \
+ ((probs) + UINT32_C(3) * \
+ (((((pos) << 8) + (prev_byte)) & (literal_mask)) << (lc)))
static inline void
-literal_init(probability (*probs)[LITERAL_CODER_SIZE],
- uint32_t lc, uint32_t lp)
+literal_init(probability *probs, uint32_t lc, uint32_t lp)
{
assert(lc + lp <= LZMA_LCLP_MAX);
- const uint32_t coders = 1U << (lc + lp);
+ const size_t coders = LITERAL_CODER_SIZE << (lc + lp);
- for (uint32_t i = 0; i < coders; ++i)
- for (uint32_t j = 0; j < LITERAL_CODER_SIZE; ++j)
- bit_reset(probs[i][j]);
+ for (size_t i = 0; i < coders; ++i)
+ bit_reset(probs[i]);
return;
}
diff --git a/contrib/xz/src/liblzma/lzma/lzma_decoder.c b/contrib/xz/src/liblzma/lzma/lzma_decoder.c
index 26c148a95e25..0abed02b8154 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_decoder.c
+++ b/contrib/xz/src/liblzma/lzma/lzma_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_decoder.c
@@ -5,9 +7,7 @@
///
// Authors: Igor Pavlov
// Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
@@ -22,25 +22,20 @@
# pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
#endif
+// Minimum number of input bytes to safely decode one LZMA symbol.
+// The worst case is that we decode 22 bits using probabilities and 26
+// direct bits. This may decode at maximum 20 bytes of input.
+#define LZMA_IN_REQUIRED 20
-#ifdef HAVE_SMALL
// Macros for (somewhat) size-optimized code.
-#define seq_4(seq) seq
-
-#define seq_6(seq) seq
-
-#define seq_8(seq) seq
-
-#define seq_len(seq) \
- seq ## _CHOICE, \
- seq ## _CHOICE2, \
- seq ## _BITTREE
-
+// This is used to decode the match length (how many bytes must be repeated
+// from the dictionary). This version is used in the Resumable mode and
+// does not unroll any loops.
#define len_decode(target, ld, pos_state, seq) \
do { \
case seq ## _CHOICE: \
- rc_if_0(ld.choice, seq ## _CHOICE) { \
+ rc_if_0_safe(ld.choice, seq ## _CHOICE) { \
rc_update_0(ld.choice); \
probs = ld.low[pos_state];\
limit = LEN_LOW_SYMBOLS; \
@@ -48,7 +43,7 @@ case seq ## _CHOICE: \
} else { \
rc_update_1(ld.choice); \
case seq ## _CHOICE2: \
- rc_if_0(ld.choice2, seq ## _CHOICE2) { \
+ rc_if_0_safe(ld.choice2, seq ## _CHOICE2) { \
rc_update_0(ld.choice2); \
probs = ld.mid[pos_state]; \
limit = LEN_MID_SYMBOLS; \
@@ -64,98 +59,39 @@ case seq ## _CHOICE2: \
symbol = 1; \
case seq ## _BITTREE: \
do { \
- rc_bit(probs[symbol], , , seq ## _BITTREE); \
+ rc_bit_safe(probs[symbol], , , seq ## _BITTREE); \
} while (symbol < limit); \
target += symbol - limit; \
} while (0)
-#else // HAVE_SMALL
-
-// Unrolled versions
-#define seq_4(seq) \
- seq ## 0, \
- seq ## 1, \
- seq ## 2, \
- seq ## 3
-
-#define seq_6(seq) \
- seq ## 0, \
- seq ## 1, \
- seq ## 2, \
- seq ## 3, \
- seq ## 4, \
- seq ## 5
-
-#define seq_8(seq) \
- seq ## 0, \
- seq ## 1, \
- seq ## 2, \
- seq ## 3, \
- seq ## 4, \
- seq ## 5, \
- seq ## 6, \
- seq ## 7
-
-#define seq_len(seq) \
- seq ## _CHOICE, \
- seq ## _LOW0, \
- seq ## _LOW1, \
- seq ## _LOW2, \
- seq ## _CHOICE2, \
- seq ## _MID0, \
- seq ## _MID1, \
- seq ## _MID2, \
- seq ## _HIGH0, \
- seq ## _HIGH1, \
- seq ## _HIGH2, \
- seq ## _HIGH3, \
- seq ## _HIGH4, \
- seq ## _HIGH5, \
- seq ## _HIGH6, \
- seq ## _HIGH7
-#define len_decode(target, ld, pos_state, seq) \
+// This is the faster version of the match length decoder that does not
+// worry about being resumable. It unrolls the bittree decoding loop.
+#define len_decode_fast(target, ld, pos_state) \
do { \
symbol = 1; \
-case seq ## _CHOICE: \
- rc_if_0(ld.choice, seq ## _CHOICE) { \
+ rc_if_0(ld.choice) { \
rc_update_0(ld.choice); \
- rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW0); \
- rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW1); \
- rc_bit_case(ld.low[pos_state][symbol], , , seq ## _LOW2); \
- target = symbol - LEN_LOW_SYMBOLS + MATCH_LEN_MIN; \
+ rc_bittree3(ld.low[pos_state], \
+ -LEN_LOW_SYMBOLS + MATCH_LEN_MIN); \
+ target = symbol; \
} else { \
rc_update_1(ld.choice); \
-case seq ## _CHOICE2: \
- rc_if_0(ld.choice2, seq ## _CHOICE2) { \
+ rc_if_0(ld.choice2) { \
rc_update_0(ld.choice2); \
- rc_bit_case(ld.mid[pos_state][symbol], , , \
- seq ## _MID0); \
- rc_bit_case(ld.mid[pos_state][symbol], , , \
- seq ## _MID1); \
- rc_bit_case(ld.mid[pos_state][symbol], , , \
- seq ## _MID2); \
- target = symbol - LEN_MID_SYMBOLS \
- + MATCH_LEN_MIN + LEN_LOW_SYMBOLS; \
+ rc_bittree3(ld.mid[pos_state], -LEN_MID_SYMBOLS \
+ + MATCH_LEN_MIN + LEN_LOW_SYMBOLS); \
+ target = symbol; \
} else { \
rc_update_1(ld.choice2); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH0); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH1); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH2); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH3); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH4); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH5); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH6); \
- rc_bit_case(ld.high[symbol], , , seq ## _HIGH7); \
- target = symbol - LEN_HIGH_SYMBOLS \
+ rc_bittree8(ld.high, -LEN_HIGH_SYMBOLS \
+ MATCH_LEN_MIN \
- + LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS; \
+ + LEN_LOW_SYMBOLS + LEN_MID_SYMBOLS); \
+ target = symbol; \
} \
} \
} while (0)
-#endif // HAVE_SMALL
-
/// Length decoder probabilities; see comments in lzma_common.h.
typedef struct {
@@ -173,7 +109,7 @@ typedef struct {
///////////////////
/// Literals; see comments in lzma_common.h.
- probability literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE];
+ probability literal[LITERAL_CODERS_MAX * LITERAL_CODER_SIZE];
/// If 1, it's a match. Otherwise it's a single 8-bit literal.
probability is_match[STATES][POS_STATES_MAX];
@@ -232,7 +168,7 @@ typedef struct {
uint32_t pos_mask; // (1U << pb) - 1
uint32_t literal_context_bits;
- uint32_t literal_pos_mask;
+ uint32_t literal_mask;
/// Uncompressed size as bytes, or LZMA_VLI_UNKNOWN if end of
/// payload marker is expected.
@@ -251,22 +187,26 @@ typedef struct {
enum {
SEQ_NORMALIZE,
SEQ_IS_MATCH,
- seq_8(SEQ_LITERAL),
- seq_8(SEQ_LITERAL_MATCHED),
+ SEQ_LITERAL,
+ SEQ_LITERAL_MATCHED,
SEQ_LITERAL_WRITE,
SEQ_IS_REP,
- seq_len(SEQ_MATCH_LEN),
- seq_6(SEQ_DIST_SLOT),
+ SEQ_MATCH_LEN_CHOICE,
+ SEQ_MATCH_LEN_CHOICE2,
+ SEQ_MATCH_LEN_BITTREE,
+ SEQ_DIST_SLOT,
SEQ_DIST_MODEL,
SEQ_DIRECT,
- seq_4(SEQ_ALIGN),
+ SEQ_ALIGN,
SEQ_EOPM,
SEQ_IS_REP0,
SEQ_SHORTREP,
SEQ_IS_REP0_LONG,
SEQ_IS_REP1,
SEQ_IS_REP2,
- seq_len(SEQ_REP_LEN),
+ SEQ_REP_LEN_CHOICE,
+ SEQ_REP_LEN_CHOICE2,
+ SEQ_REP_LEN_BITTREE,
SEQ_COPY,
} sequence;
@@ -321,7 +261,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
const size_t dict_start = dict.pos;
// Range decoder
- rc_to_local(coder->rc, *in_pos);
+ rc_to_local(coder->rc, *in_pos, LZMA_IN_REQUIRED);
// State
uint32_t state = coder->state;
@@ -340,7 +280,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
uint32_t offset = coder->offset;
uint32_t len = coder->len;
- const uint32_t literal_pos_mask = coder->literal_pos_mask;
+ const uint32_t literal_mask = coder->literal_mask;
const uint32_t literal_context_bits = coder->literal_context_bits;
// Temporary variables
@@ -367,8 +307,24 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
might_finish_without_eopm = true;
}
- // The main decoder loop. The "switch" is used to restart the decoder at
- // correct location. Once restarted, the "switch" is no longer used.
+ // The main decoder loop. The "switch" is used to resume the decoder at
+ // correct location. Once resumed, the "switch" is no longer used.
+ // The decoder loops is split into two modes:
+ //
+ // 1 - Non-resumable mode (fast). This is used when it is guaranteed
+ // there is enough input to decode the next symbol. If the output
+ // limit is reached, then the decoder loop will save the place
+ // for the resumable mode to continue. This mode is not used if
+ // HAVE_SMALL is defined. This is faster than Resumable mode
+ // because it reduces the number of branches needed and allows
+ // for more compiler optimizations.
+ //
+ // 2 - Resumable mode (slow). This is used when a previous decoder
+ // loop did not have enough space in the input or output buffers
+ // to complete. It uses sequence enum values to set remind
+ // coder->sequence where to resume in the decoder loop. This
+ // is the only mode used when HAVE_SMALL is defined.
+
switch (coder->sequence)
while (true) {
// Calculate new pos_state. This is skipped on the first loop
@@ -376,13 +332,339 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// variables.
pos_state = dict.pos & pos_mask;
+#ifndef HAVE_SMALL
+
+ ///////////////////////////////
+ // Non-resumable Mode (fast) //
+ ///////////////////////////////
+
+ // Go to Resumable mode (1) if there is not enough input to
+ // safely decode any possible LZMA symbol or (2) if the
+ // dictionary is full, which may need special checks that
+ // are only done in the Resumable mode.
+ if (unlikely(!rc_is_fast_allowed()
+ || dict.pos == dict.limit))
+ goto slow;
+
+ // Decode the first bit from the next LZMA symbol.
+ // If the bit is a 0, then we handle it as a literal.
+ // If the bit is a 1, then it is a match of previously
+ // decoded data.
+ rc_if_0(coder->is_match[state][pos_state]) {
+ /////////////////////
+ // Decode literal. //
+ /////////////////////
+
+ // Update the RC that we have decoded a 0.
+ rc_update_0(coder->is_match[state][pos_state]);
+
+ // Get the correct probability array from lp and
+ // lc params.
+ probs = literal_subcoder(coder->literal,
+ literal_context_bits, literal_mask,
+ dict.pos, dict_get0(&dict));
+
+ if (is_literal_state(state)) {
+ update_literal_normal(state);
+
+ // Decode literal without match byte.
+ rc_bittree8(probs, 0);
+ } else {
+ update_literal_matched(state);
+
+ // Decode literal with match byte.
+ rc_matched_literal(probs,
+ dict_get(&dict, rep0));
+ }
+
+ // Write decoded literal to dictionary
+ dict_put(&dict, symbol);
+ continue;
+ }
+
+ ///////////////////
+ // Decode match. //
+ ///////////////////
+
+ // Instead of a new byte we are going to decode a
+ // distance-length pair. The distance represents how far
+ // back in the dictionary to begin copying. The length
+ // represents how many bytes to copy.
+
+ rc_update_1(coder->is_match[state][pos_state]);
+
+ rc_if_0(coder->is_rep[state]) {
+ ///////////////////
+ // Simple match. //
+ ///////////////////
+
+ // Not a repeated match. In this case,
+ // the length (how many bytes to copy) must be
+ // decoded first. Then, the distance (where to
+ // start copying) is decoded.
+ //
+ // This is also how we know when we are done
+ // decoding. If the distance decodes to UINT32_MAX,
+ // then we know to stop decoding (end of payload
+ // marker).
+
+ rc_update_0(coder->is_rep[state]);
+ update_match(state);
+
+ // The latest three match distances are kept in
+ // memory in case there are repeated matches.
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+
+ // Decode the length of the match.
+ len_decode_fast(len, coder->match_len_decoder,
+ pos_state);
+
+ // Next, decode the distance into rep0.
+
+ // The next 6 bits determine how to decode the
+ // rest of the distance.
+ probs = coder->dist_slot[get_dist_state(len)];
+
+ rc_bittree6(probs, -DIST_SLOTS);
+ assert(symbol <= 63);
+
+ if (symbol < DIST_MODEL_START) {
+ // If the decoded symbol is < DIST_MODEL_START
+ // then we use its value directly as the
+ // match distance. No other bits are needed.
+ // The only possible distance values
+ // are [0, 3].
+ rep0 = symbol;
+ } else {
+ // Use the first two bits of symbol as the
+ // highest bits of the match distance.
+
+ // "limit" represents the number of low bits
+ // to decode.
+ limit = (symbol >> 1) - 1;
+ assert(limit >= 1 && limit <= 30);
+ rep0 = 2 + (symbol & 1);
+
+ if (symbol < DIST_MODEL_END) {
+ // When symbol is > DIST_MODEL_START,
+ // but symbol < DIST_MODEL_END, then
+ // it can decode distances between
+ // [4, 127].
+ assert(limit <= 5);
+ rep0 <<= limit;
+ assert(rep0 <= 96);
+
+ // -1 is fine, because we start
+ // decoding at probs[1], not probs[0].
+ // NOTE: This violates the C standard,
+ // since we are doing pointer
+ // arithmetic past the beginning of
+ // the array.
+ assert((int32_t)(rep0 - symbol - 1)
+ >= -1);
+ assert((int32_t)(rep0 - symbol - 1)
+ <= 82);
+ probs = coder->pos_special + rep0
+ - symbol - 1;
+ symbol = 1;
+ offset = 1;
+
+ // Variable number (1-5) of bits
+ // from a reverse bittree. This
+ // isn't worth manual unrolling.
+ //
+ // NOTE: Making one or many of the
+ // variables (probs, symbol, offset,
+ // or limit) local here (instead of
+ // using those declared outside the
+ // main loop) can affect code size
+ // and performance which isn't a
+ // surprise but it's not so clear
+ // what is the best.
+ do {
+ rc_bit_add_if_1(probs,
+ rep0, offset);
+ offset <<= 1;
+ } while (--limit > 0);
+ } else {
+ // The distance is >= 128. Decode the
+ // lower bits without probabilities
+ // except the lowest four bits.
+ assert(symbol >= 14);
+ assert(limit >= 6);
+
+ limit -= ALIGN_BITS;
+ assert(limit >= 2);
+
+ rc_direct(rep0, limit);
+
+ // Decode the lowest four bits using
+ // probabilities.
+ rep0 <<= ALIGN_BITS;
+ rc_bittree_rev4(coder->pos_align);
+ rep0 += symbol;
+
+ // If the end of payload marker (EOPM)
+ // is detected, jump to the safe code.
+ // The EOPM handling isn't speed
+ // critical at all.
+ //
+ // A final normalization is needed
+ // after the EOPM (there can be a
+ // dummy byte to read in some cases).
+ // If the normalization was done here
+ // in the fast code, it would need to
+ // be taken into account in the value
+ // of LZMA_IN_REQUIRED. Using the
+ // safe code allows keeping
+ // LZMA_IN_REQUIRED as 20 instead of
+ // 21.
+ if (rep0 == UINT32_MAX)
+ goto eopm;
+ }
+ }
+
+ // Validate the distance we just decoded.
+ if (unlikely(!dict_is_distance_valid(&dict, rep0))) {
+ ret = LZMA_DATA_ERROR;
+ goto out;
+ }
+
+ } else {
+ rc_update_1(coder->is_rep[state]);
+
+ /////////////////////
+ // Repeated match. //
+ /////////////////////
+
+ // The match distance is a value that we have decoded
+ // recently. The latest four match distances are
+ // available as rep0, rep1, rep2 and rep3. We will
+ // now decode which of them is the new distance.
+ //
+ // There cannot be a match if we haven't produced
+ // any output, so check that first.
+ if (unlikely(!dict_is_distance_valid(&dict, 0))) {
+ ret = LZMA_DATA_ERROR;
+ goto out;
+ }
+
+ rc_if_0(coder->is_rep0[state]) {
+ rc_update_0(coder->is_rep0[state]);
+ // The distance is rep0.
+
+ // Decode the next bit to determine if 1 byte
+ // should be copied from rep0 distance or
+ // if the number of bytes needs to be decoded.
+
+ // If the next bit is 0, then it is a
+ // "Short Rep Match" and only 1 bit is copied.
+ // Otherwise, the length of the match is
+ // decoded after the "else" statement.
+ rc_if_0(coder->is_rep0_long[state][pos_state]) {
+ rc_update_0(coder->is_rep0_long[
+ state][pos_state]);
+
+ update_short_rep(state);
+ dict_put(&dict, dict_get(&dict, rep0));
+ continue;
+ }
+
+ // Repeating more than one byte at
+ // distance of rep0.
+ rc_update_1(coder->is_rep0_long[
+ state][pos_state]);
+
+ } else {
+ rc_update_1(coder->is_rep0[state]);
+
+ // The distance is rep1, rep2 or rep3. Once
+ // we find out which one of these three, it
+ // is stored to rep0 and rep1, rep2 and rep3
+ // are updated accordingly. There is no
+ // "Short Rep Match" option, so the length
+ // of the match must always be decoded next.
+ rc_if_0(coder->is_rep1[state]) {
+ // The distance is rep1.
+ rc_update_0(coder->is_rep1[state]);
+
+ const uint32_t distance = rep1;
+ rep1 = rep0;
+ rep0 = distance;
+
+ } else {
+ rc_update_1(coder->is_rep1[state]);
+
+ rc_if_0(coder->is_rep2[state]) {
+ // The distance is rep2.
+ rc_update_0(coder->is_rep2[
+ state]);
+
+ const uint32_t distance = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = distance;
+
+ } else {
+ // The distance is rep3.
+ rc_update_1(coder->is_rep2[
+ state]);
+
+ const uint32_t distance = rep3;
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ }
+ }
+
+ update_long_rep(state);
+
+ // Decode the length of the repeated match.
+ len_decode_fast(len, coder->rep_len_decoder,
+ pos_state);
+ }
+
+ /////////////////////////////////
+ // Repeat from history buffer. //
+ /////////////////////////////////
+
+ // The length is always between these limits. There is no way
+ // to trigger the algorithm to set len outside this range.
+ assert(len >= MATCH_LEN_MIN);
+ assert(len <= MATCH_LEN_MAX);
+
+ // Repeat len bytes from distance of rep0.
+ if (unlikely(dict_repeat(&dict, rep0, &len))) {
+ coder->sequence = SEQ_COPY;
+ goto out;
+ }
+
+ continue;
+
+slow:
+#endif
+ ///////////////////////////
+ // Resumable Mode (slow) //
+ ///////////////////////////
+
+ // This is very similar to Non-resumable Mode, so most of the
+ // comments are not repeated. The main differences are:
+ // - case labels are used to resume at the correct location.
+ // - Loops are not unrolled.
+ // - Range coder macros take an extra sequence argument
+ // so they can save to coder->sequence the location to
+ // resume in case there is not enough input.
case SEQ_NORMALIZE:
case SEQ_IS_MATCH:
if (unlikely(might_finish_without_eopm
&& dict.pos == dict.limit)) {
// In rare cases there is a useless byte that needs
// to be read anyway.
- rc_normalize(SEQ_NORMALIZE);
+ rc_normalize_safe(SEQ_NORMALIZE);
// If the range decoder state is such that we can
// be at the end of the LZMA stream, then the
@@ -405,49 +687,37 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
eopm_is_valid = true;
}
- rc_if_0(coder->is_match[state][pos_state], SEQ_IS_MATCH) {
- rc_update_0(coder->is_match[state][pos_state]);
+ rc_if_0_safe(coder->is_match[state][pos_state], SEQ_IS_MATCH) {
+ /////////////////////
+ // Decode literal. //
+ /////////////////////
- // It's a literal i.e. a single 8-bit byte.
+ rc_update_0(coder->is_match[state][pos_state]);
probs = literal_subcoder(coder->literal,
- literal_context_bits, literal_pos_mask,
- dict.pos, dict_get(&dict, 0));
+ literal_context_bits, literal_mask,
+ dict.pos, dict_get0(&dict));
symbol = 1;
if (is_literal_state(state)) {
+ update_literal_normal(state);
+
// Decode literal without match byte.
-#ifdef HAVE_SMALL
+ // The "slow" version does not unroll
+ // the loop.
case SEQ_LITERAL:
do {
- rc_bit(probs[symbol], , , SEQ_LITERAL);
+ rc_bit_safe(probs[symbol], , ,
+ SEQ_LITERAL);
} while (symbol < (1 << 8));
-#else
- rc_bit_case(probs[symbol], , , SEQ_LITERAL0);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL1);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL2);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL3);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL4);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL5);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL6);
- rc_bit_case(probs[symbol], , , SEQ_LITERAL7);
-#endif
} else {
+ update_literal_matched(state);
+
// Decode literal with match byte.
- //
- // We store the byte we compare against
- // ("match byte") to "len" to minimize the
- // number of variables we need to store
- // between decoder calls.
len = (uint32_t)(dict_get(&dict, rep0)) << 1;
- // The usage of "offset" allows omitting some
- // branches, which should give tiny speed
- // improvement on some CPUs. "offset" gets
- // set to zero if match_bit didn't match.
offset = 0x100;
-#ifdef HAVE_SMALL
case SEQ_LITERAL_MATCHED:
do {
const uint32_t match_bit
@@ -456,7 +726,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
= offset + match_bit
+ symbol;
- rc_bit(probs[subcoder_index],
+ rc_bit_safe(probs[subcoder_index],
offset &= ~match_bit,
offset &= match_bit,
SEQ_LITERAL_MATCHED);
@@ -469,61 +739,10 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
len <<= 1;
} while (symbol < (1 << 8));
-#else
- // Unroll the loop.
- uint32_t match_bit;
- uint32_t subcoder_index;
-
-# define d(seq) \
- case seq: \
- match_bit = len & offset; \
- subcoder_index = offset + match_bit + symbol; \
- rc_bit(probs[subcoder_index], \
- offset &= ~match_bit, \
- offset &= match_bit, \
- seq)
-
- d(SEQ_LITERAL_MATCHED0);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED1);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED2);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED3);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED4);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED5);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED6);
- len <<= 1;
- d(SEQ_LITERAL_MATCHED7);
-# undef d
-#endif
}
- //update_literal(state);
- // Use a lookup table to update to literal state,
- // since compared to other state updates, this would
- // need two branches.
- static const lzma_lzma_state next_state[] = {
- STATE_LIT_LIT,
- STATE_LIT_LIT,
- STATE_LIT_LIT,
- STATE_LIT_LIT,
- STATE_MATCH_LIT_LIT,
- STATE_REP_LIT_LIT,
- STATE_SHORTREP_LIT_LIT,
- STATE_MATCH_LIT,
- STATE_REP_LIT,
- STATE_SHORTREP_LIT,
- STATE_MATCH_LIT,
- STATE_REP_LIT
- };
- state = next_state[state];
-
case SEQ_LITERAL_WRITE:
- if (unlikely(dict_put(&dict, symbol))) {
+ if (dict_put_safe(&dict, symbol)) {
coder->sequence = SEQ_LITERAL_WRITE;
goto out;
}
@@ -531,64 +750,47 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
continue;
}
- // Instead of a new byte we are going to get a byte range
- // (distance and length) which will be repeated from our
- // output history.
+ ///////////////////
+ // Decode match. //
+ ///////////////////
rc_update_1(coder->is_match[state][pos_state]);
case SEQ_IS_REP:
- rc_if_0(coder->is_rep[state], SEQ_IS_REP) {
- // Not a repeated match
+ rc_if_0_safe(coder->is_rep[state], SEQ_IS_REP) {
+ ///////////////////
+ // Simple match. //
+ ///////////////////
+
rc_update_0(coder->is_rep[state]);
update_match(state);
- // The latest three match distances are kept in
- // memory in case there are repeated matches.
rep3 = rep2;
rep2 = rep1;
rep1 = rep0;
- // Decode the length of the match.
len_decode(len, coder->match_len_decoder,
pos_state, SEQ_MATCH_LEN);
- // Prepare to decode the highest two bits of the
- // match distance.
probs = coder->dist_slot[get_dist_state(len)];
symbol = 1;
-#ifdef HAVE_SMALL
case SEQ_DIST_SLOT:
do {
- rc_bit(probs[symbol], , , SEQ_DIST_SLOT);
+ rc_bit_safe(probs[symbol], , , SEQ_DIST_SLOT);
} while (symbol < DIST_SLOTS);
-#else
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT0);
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT1);
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT2);
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT3);
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT4);
- rc_bit_case(probs[symbol], , , SEQ_DIST_SLOT5);
-#endif
- // Get rid of the highest bit that was needed for
- // indexing of the probability array.
+
symbol -= DIST_SLOTS;
assert(symbol <= 63);
if (symbol < DIST_MODEL_START) {
- // Match distances [0, 3] have only two bits.
rep0 = symbol;
} else {
- // Decode the lowest [1, 29] bits of
- // the match distance.
limit = (symbol >> 1) - 1;
assert(limit >= 1 && limit <= 30);
rep0 = 2 + (symbol & 1);
if (symbol < DIST_MODEL_END) {
- // Prepare to decode the low bits for
- // a distance of [4, 127].
assert(limit <= 5);
rep0 <<= limit;
assert(rep0 <= 96);
@@ -607,95 +809,36 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
symbol = 1;
offset = 0;
case SEQ_DIST_MODEL:
-#ifdef HAVE_SMALL
do {
- rc_bit(probs[symbol], ,
+ rc_bit_safe(probs[symbol], ,
rep0 += 1U << offset,
SEQ_DIST_MODEL);
} while (++offset < limit);
-#else
- switch (limit) {
- case 5:
- assert(offset == 0);
- rc_bit(probs[symbol], ,
- rep0 += 1U,
- SEQ_DIST_MODEL);
- ++offset;
- --limit;
- case 4:
- rc_bit(probs[symbol], ,
- rep0 += 1U << offset,
- SEQ_DIST_MODEL);
- ++offset;
- --limit;
- case 3:
- rc_bit(probs[symbol], ,
- rep0 += 1U << offset,
- SEQ_DIST_MODEL);
- ++offset;
- --limit;
- case 2:
- rc_bit(probs[symbol], ,
- rep0 += 1U << offset,
- SEQ_DIST_MODEL);
- ++offset;
- --limit;
- case 1:
- // We need "symbol" only for
- // indexing the probability
- // array, thus we can use
- // rc_bit_last() here to omit
- // the unneeded updating of
- // "symbol".
- rc_bit_last(probs[symbol], ,
- rep0 += 1U << offset,
- SEQ_DIST_MODEL);
- }
-#endif
} else {
- // The distance is >= 128. Decode the
- // lower bits without probabilities
- // except the lowest four bits.
assert(symbol >= 14);
assert(limit >= 6);
limit -= ALIGN_BITS;
assert(limit >= 2);
case SEQ_DIRECT:
- // Not worth manual unrolling
- do {
- rc_direct(rep0, SEQ_DIRECT);
- } while (--limit > 0);
+ rc_direct_safe(rep0, limit,
+ SEQ_DIRECT);
- // Decode the lowest four bits using
- // probabilities.
rep0 <<= ALIGN_BITS;
- symbol = 1;
-#ifdef HAVE_SMALL
- offset = 0;
+ symbol = 0;
+ offset = 1;
case SEQ_ALIGN:
do {
- rc_bit(coder->pos_align[
- symbol], ,
- rep0 += 1U << offset,
+ rc_bit_last_safe(
+ coder->pos_align[
+ offset
+ + symbol],
+ ,
+ symbol += offset,
SEQ_ALIGN);
- } while (++offset < ALIGN_BITS);
-#else
- case SEQ_ALIGN0:
- rc_bit(coder->pos_align[symbol], ,
- rep0 += 1, SEQ_ALIGN0);
- case SEQ_ALIGN1:
- rc_bit(coder->pos_align[symbol], ,
- rep0 += 2, SEQ_ALIGN1);
- case SEQ_ALIGN2:
- rc_bit(coder->pos_align[symbol], ,
- rep0 += 4, SEQ_ALIGN2);
- case SEQ_ALIGN3:
- // Like in SEQ_DIST_MODEL, we don't
- // need "symbol" for anything else
- // than indexing the probability array.
- rc_bit_last(coder->pos_align[symbol], ,
- rep0 += 8, SEQ_ALIGN3);
-#endif
+ offset <<= 1;
+ } while (offset < ALIGN_SIZE);
+
+ rep0 += symbol;
if (rep0 == UINT32_MAX) {
// End of payload marker was
@@ -710,6 +853,9 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// that EOPM might be used
// (it's not allowed in
// LZMA2).
+#ifndef HAVE_SMALL
+eopm:
+#endif
if (!eopm_is_valid) {
ret = LZMA_DATA_ERROR;
goto out;
@@ -718,7 +864,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
case SEQ_EOPM:
// LZMA1 stream with
// end-of-payload marker.
- rc_normalize(SEQ_EOPM);
+ rc_normalize_safe(SEQ_EOPM);
ret = rc_is_finished(rc)
? LZMA_STREAM_END
: LZMA_DATA_ERROR;
@@ -727,36 +873,30 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
}
}
- // Validate the distance we just decoded.
if (unlikely(!dict_is_distance_valid(&dict, rep0))) {
ret = LZMA_DATA_ERROR;
goto out;
}
} else {
+ /////////////////////
+ // Repeated match. //
+ /////////////////////
+
rc_update_1(coder->is_rep[state]);
- // Repeated match
- //
- // The match distance is a value that we have had
- // earlier. The latest four match distances are
- // available as rep0, rep1, rep2 and rep3. We will
- // now decode which of them is the new distance.
- //
- // There cannot be a match if we haven't produced
- // any output, so check that first.
if (unlikely(!dict_is_distance_valid(&dict, 0))) {
ret = LZMA_DATA_ERROR;
goto out;
}
case SEQ_IS_REP0:
- rc_if_0(coder->is_rep0[state], SEQ_IS_REP0) {
+ rc_if_0_safe(coder->is_rep0[state], SEQ_IS_REP0) {
rc_update_0(coder->is_rep0[state]);
- // The distance is rep0.
case SEQ_IS_REP0_LONG:
- rc_if_0(coder->is_rep0_long[state][pos_state],
+ rc_if_0_safe(coder->is_rep0_long
+ [state][pos_state],
SEQ_IS_REP0_LONG) {
rc_update_0(coder->is_rep0_long[
state][pos_state]);
@@ -764,8 +904,9 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
update_short_rep(state);
case SEQ_SHORTREP:
- if (unlikely(dict_put(&dict, dict_get(
- &dict, rep0)))) {
+ if (dict_put_safe(&dict,
+ dict_get(&dict,
+ rep0))) {
coder->sequence = SEQ_SHORTREP;
goto out;
}
@@ -773,8 +914,6 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
continue;
}
- // Repeating more than one byte at
- // distance of rep0.
rc_update_1(coder->is_rep0_long[
state][pos_state]);
@@ -782,11 +921,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
rc_update_1(coder->is_rep0[state]);
case SEQ_IS_REP1:
- // The distance is rep1, rep2 or rep3. Once
- // we find out which one of these three, it
- // is stored to rep0 and rep1, rep2 and rep3
- // are updated accordingly.
- rc_if_0(coder->is_rep1[state], SEQ_IS_REP1) {
+ rc_if_0_safe(coder->is_rep1[state], SEQ_IS_REP1) {
rc_update_0(coder->is_rep1[state]);
const uint32_t distance = rep1;
@@ -796,7 +931,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
} else {
rc_update_1(coder->is_rep1[state]);
case SEQ_IS_REP2:
- rc_if_0(coder->is_rep2[state],
+ rc_if_0_safe(coder->is_rep2[state],
SEQ_IS_REP2) {
rc_update_0(coder->is_rep2[
state]);
@@ -821,7 +956,6 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
update_long_rep(state);
- // Decode the length of the repeated match.
len_decode(len, coder->rep_len_decoder,
pos_state, SEQ_REP_LEN);
}
@@ -830,13 +964,10 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// Repeat from history buffer. //
/////////////////////////////////
- // The length is always between these limits. There is no way
- // to trigger the algorithm to set len outside this range.
assert(len >= MATCH_LEN_MIN);
assert(len <= MATCH_LEN_MAX);
case SEQ_COPY:
- // Repeat len bytes from distance of rep0.
if (unlikely(dict_repeat(&dict, rep0, &len))) {
coder->sequence = SEQ_COPY;
goto out;
@@ -890,7 +1021,6 @@ out:
}
-
static void
lzma_decoder_uncompressed(void *coder_ptr, lzma_vli uncompressed_size,
bool allow_eopm)
@@ -917,7 +1047,7 @@ lzma_decoder_reset(void *coder_ptr, const void *opt)
literal_init(coder->literal, options->lc, options->lp);
coder->literal_context_bits = options->lc;
- coder->literal_pos_mask = (1U << options->lp) - 1;
+ coder->literal_mask = literal_mask_calc(options->lc, options->lp);
// State
coder->state = STATE_LIT_LIT;
diff --git a/contrib/xz/src/liblzma/lzma/lzma_decoder.h b/contrib/xz/src/liblzma/lzma/lzma_decoder.h
index 1427bc2461f4..9730f56fc268 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_decoder.h
+++ b/contrib/xz/src/liblzma/lzma/lzma_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_decoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA_DECODER_H
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder.c b/contrib/xz/src/liblzma/lzma/lzma_encoder.c
index 559c63eda1d2..543ca321c3c2 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder.c
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma2_encoder.h"
@@ -49,24 +48,24 @@ literal(lzma_lzma1_encoder *coder, lzma_mf *mf, uint32_t position)
const uint8_t cur_byte = mf->buffer[
mf->read_pos - mf->read_ahead];
probability *subcoder = literal_subcoder(coder->literal,
- coder->literal_context_bits, coder->literal_pos_mask,
+ coder->literal_context_bits, coder->literal_mask,
position, mf->buffer[mf->read_pos - mf->read_ahead - 1]);
if (is_literal_state(coder->state)) {
// Previous LZMA-symbol was a literal. Encode a normal
// literal without a match byte.
+ update_literal_normal(coder->state);
rc_bittree(&coder->rc, subcoder, 8, cur_byte);
} else {
// Previous LZMA-symbol was a match. Use the last byte of
// the match as a "match byte". That is, compare the bits
// of the current literal and the match byte.
+ update_literal_matched(coder->state);
const uint8_t match_byte = mf->buffer[
mf->read_pos - coder->reps[0] - 1
- mf->read_ahead];
literal_matched(&coder->rc, subcoder, match_byte, cur_byte);
}
-
- update_literal(coder->state);
}
@@ -283,7 +282,7 @@ encode_init(lzma_lzma1_encoder *coder, lzma_mf *mf)
mf_skip(mf, 1);
mf->read_ahead = 0;
rc_bit(&coder->rc, &coder->is_match[0][0], 0);
- rc_bittree(&coder->rc, coder->literal[0], 8, mf->buffer[0]);
+ rc_bittree(&coder->rc, coder->literal + 0, 8, mf->buffer[0]);
++coder->uncomp_size;
}
@@ -535,7 +534,7 @@ lzma_lzma_encoder_reset(lzma_lzma1_encoder *coder,
coder->pos_mask = (1U << options->pb) - 1;
coder->literal_context_bits = options->lc;
- coder->literal_pos_mask = (1U << options->lp) - 1;
+ coder->literal_mask = literal_mask_calc(options->lc, options->lp);
// Range coder
rc_reset(&coder->rc);
@@ -712,6 +711,9 @@ static lzma_ret
lzma_encoder_init(lzma_lz_encoder *lz, const lzma_allocator *allocator,
lzma_vli id, const void *options, lzma_lz_options *lz_options)
{
+ if (options == NULL)
+ return LZMA_PROG_ERROR;
+
lz->code = &lzma_encode;
lz->set_out_limit = &lzma_lzma_set_out_limit;
return lzma_lzma_encoder_create(
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder.h b/contrib/xz/src/liblzma/lzma/lzma_encoder.h
index 84d8c9163f2d..e8ae8079306c 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder.h
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA_ENCODER_H
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c b/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
index 6c53d2bd0082..0f063d5be7a5 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c
@@ -1,12 +1,11 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder_optimum_fast.c
//
// Author: Igor Pavlov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma_encoder_private.h"
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c b/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
index 101c8d479008..a6c0398f3af3 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c
@@ -1,12 +1,11 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder_optimum_normal.c
//
// Author: Igor Pavlov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "lzma_encoder_private.h"
@@ -24,7 +23,7 @@ get_literal_price(const lzma_lzma1_encoder *const coder, const uint32_t pos,
uint32_t match_byte, uint32_t symbol)
{
const probability *const subcoder = literal_subcoder(coder->literal,
- coder->literal_context_bits, coder->literal_pos_mask,
+ coder->literal_context_bits, coder->literal_mask,
pos, prev_byte);
uint32_t price = 0;
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c b/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c
index 711df0255296..e53483f99582 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder_presets.c
@@ -6,9 +8,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "common.h"
diff --git a/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h b/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h
index b228c5776173..eeea5e9c1289 100644
--- a/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h
+++ b/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzma_encoder_private.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_LZMA_ENCODER_PRIVATE_H
@@ -116,10 +115,10 @@ struct lzma_lzma1_encoder_s {
uint32_t pos_mask; ///< (1 << pos_bits) - 1
uint32_t literal_context_bits;
- uint32_t literal_pos_mask;
+ uint32_t literal_mask;
// These are the same as in lzma_decoder.c. See comments there.
- probability literal[LITERAL_CODERS_MAX][LITERAL_CODER_SIZE];
+ probability literal[LITERAL_CODERS_MAX * LITERAL_CODER_SIZE];
probability is_match[STATES][POS_STATES_MAX];
probability is_rep[STATES];
probability is_rep0[STATES];
diff --git a/contrib/xz/src/liblzma/rangecoder/price.h b/contrib/xz/src/liblzma/rangecoder/price.h
index 45dbbbb20cef..cce6bdae5f93 100644
--- a/contrib/xz/src/liblzma/rangecoder/price.h
+++ b/contrib/xz/src/liblzma/rangecoder/price.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file price.h
@@ -5,9 +7,6 @@
//
// Author: Igor Pavlov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_PRICE_H
diff --git a/contrib/xz/src/liblzma/rangecoder/price_table.c b/contrib/xz/src/liblzma/rangecoder/price_table.c
index ac64bf62c767..c33433f718ca 100644
--- a/contrib/xz/src/liblzma/rangecoder/price_table.c
+++ b/contrib/xz/src/liblzma/rangecoder/price_table.c
@@ -1,4 +1,6 @@
-/* This file has been automatically generated by price_tablegen.c. */
+// SPDX-License-Identifier: 0BSD
+
+// This file has been generated by price_tablegen.c.
#include "range_encoder.h"
diff --git a/contrib/xz/src/liblzma/rangecoder/price_tablegen.c b/contrib/xz/src/liblzma/rangecoder/price_tablegen.c
index bf08ce39d7e5..4b6ca37efadf 100644
--- a/contrib/xz/src/liblzma/rangecoder/price_tablegen.c
+++ b/contrib/xz/src/liblzma/rangecoder/price_tablegen.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file price_tablegen.c
@@ -8,13 +10,15 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include <inttypes.h>
#include <stdio.h>
+
+// Make it compile without common.h.
+#define BUILDING_PRICE_TABLEGEN
+#define lzma_attr_visibility_hidden
+
#include "range_common.h"
#include "price.h"
@@ -54,11 +58,13 @@ init_price_table(void)
static void
print_price_table(void)
{
- printf("/* This file has been automatically generated by "
- "price_tablegen.c. */\n\n"
- "#include \"range_encoder.h\"\n\n"
- "const uint8_t lzma_rc_prices["
- "RC_PRICE_TABLE_SIZE] = {");
+ // Split the SPDX string so that it won't accidentally match
+ // when tools search for the string.
+ printf("// SPDX" "-License-Identifier" ": 0BSD\n\n"
+ "// This file has been generated by price_tablegen.c.\n\n"
+ "#include \"range_encoder.h\"\n\n"
+ "const uint8_t lzma_rc_prices["
+ "RC_PRICE_TABLE_SIZE] = {");
const size_t array_size = sizeof(lzma_rc_prices)
/ sizeof(lzma_rc_prices[0]);
diff --git a/contrib/xz/src/liblzma/rangecoder/range_common.h b/contrib/xz/src/liblzma/rangecoder/range_common.h
index 2c74dc1537c8..ac4dbe196f50 100644
--- a/contrib/xz/src/liblzma/rangecoder/range_common.h
+++ b/contrib/xz/src/liblzma/rangecoder/range_common.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file range_common.h
@@ -6,15 +8,15 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_RANGE_COMMON_H
#define LZMA_RANGE_COMMON_H
-#include "common.h"
+// Skip common.h if building price_tablegen.c.
+#ifndef BUILDING_PRICE_TABLEGEN
+# include "common.h"
+#endif
///////////////
@@ -66,6 +68,10 @@
///
/// I will be sticking to uint16_t unless some specific architectures
/// are *much* faster (20-50 %) with uint32_t.
+///
+/// Update in 2024: The branchless C and x86-64 assembly was written so that
+/// probability is assumed to be uint16_t. (In contrast, LZMA SDK 23.01
+/// assembly supports both types.)
typedef uint16_t probability;
#endif
diff --git a/contrib/xz/src/liblzma/rangecoder/range_decoder.h b/contrib/xz/src/liblzma/rangecoder/range_decoder.h
index e0b051fac2d2..31a58d1ffbed 100644
--- a/contrib/xz/src/liblzma/rangecoder/range_decoder.h
+++ b/contrib/xz/src/liblzma/rangecoder/range_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file range_decoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_RANGE_DECODER_H
@@ -17,6 +16,55 @@
#include "range_common.h"
+// Choose the range decoder variants to use using a bitmask.
+// If no bits are set, only the basic version is used.
+// If more than one version is selected for the same feature,
+// the last one on the list below is used.
+//
+// Bitwise-or of the following enable branchless C versions:
+// 0x01 normal bittrees
+// 0x02 fixed-sized reverse bittrees
+// 0x04 variable-sized reverse bittrees (not faster)
+// 0x08 matched literal (not faster)
+//
+// GCC & Clang compatible x86-64 inline assembly:
+// 0x010 normal bittrees
+// 0x020 fixed-sized reverse bittrees
+// 0x040 variable-sized reverse bittrees
+// 0x080 matched literal
+// 0x100 direct bits
+//
+// The default can be overridden at build time by defining
+// LZMA_RANGE_DECODER_CONFIG to the desired mask.
+//
+// 2024-02-22: Feedback from benchmarks:
+// - Brancless C (0x003) can be better than basic on x86-64 but often it's
+// slightly worse on other archs. Since asm is much better on x86-64,
+// branchless C is not used at all.
+// - With x86-64 asm, there are slight differences between GCC and Clang
+// and different processors. Overall 0x1F0 seems to be the best choice.
+#ifndef LZMA_RANGE_DECODER_CONFIG
+# if defined(__x86_64__) && !defined(__ILP32__) \
+ && !defined(__NVCOMPILER) \
+ && (defined(__GNUC__) || defined(__clang__))
+# define LZMA_RANGE_DECODER_CONFIG 0x1F0
+# else
+# define LZMA_RANGE_DECODER_CONFIG 0
+# endif
+#endif
+
+
+// Negative RC_BIT_MODEL_TOTAL but the lowest RC_MOVE_BITS are flipped.
+// This is useful for updating probability variables in branchless decoding:
+//
+// uint32_t decoded_bit = ...;
+// probability tmp = RC_BIT_MODEL_OFFSET;
+// tmp &= decoded_bit - 1;
+// prob -= (prob + tmp) >> RC_MOVE_BITS;
+#define RC_BIT_MODEL_OFFSET \
+ ((UINT32_C(1) << RC_MOVE_BITS) - 1 - RC_BIT_MODEL_TOTAL)
+
+
typedef struct {
uint32_t range;
uint32_t code;
@@ -50,18 +98,28 @@ rc_read_init(lzma_range_decoder *rc, const uint8_t *restrict in,
/// Makes local copies of range decoder and *in_pos variables. Doing this
/// improves speed significantly. The range decoder macros expect also
-/// variables `in' and `in_size' to be defined.
-#define rc_to_local(range_decoder, in_pos) \
+/// variables 'in' and 'in_size' to be defined.
+#define rc_to_local(range_decoder, in_pos, fast_mode_in_required) \
lzma_range_decoder rc = range_decoder; \
- size_t rc_in_pos = (in_pos); \
+ const uint8_t *rc_in_ptr = in + (in_pos); \
+ const uint8_t *rc_in_end = in + in_size; \
+ const uint8_t *rc_in_fast_end \
+ = (rc_in_end - rc_in_ptr) <= (fast_mode_in_required) \
+ ? rc_in_ptr \
+ : rc_in_end - (fast_mode_in_required); \
+ (void)rc_in_fast_end; /* Silence a warning with HAVE_SMALL. */ \
uint32_t rc_bound
+/// Evaluates to true if there is enough input remaining to use fast mode.
+#define rc_is_fast_allowed() (rc_in_ptr < rc_in_fast_end)
+
+
/// Stores the local copes back to the range decoder structure.
#define rc_from_local(range_decoder, in_pos) \
do { \
range_decoder = rc; \
- in_pos = rc_in_pos; \
+ in_pos = (size_t)(rc_in_ptr - in); \
} while (0)
@@ -81,18 +139,30 @@ do { \
((range_decoder).code == 0)
-/// Read the next input byte if needed. If more input is needed but there is
+// Read the next input byte if needed.
+#define rc_normalize() \
+do { \
+ if (rc.range < RC_TOP_VALUE) { \
+ rc.range <<= RC_SHIFT_BITS; \
+ rc.code = (rc.code << RC_SHIFT_BITS) | *rc_in_ptr++; \
+ } \
+} while (0)
+
+
+/// If more input is needed but there is
/// no more input available, "goto out" is used to jump out of the main
-/// decoder loop.
-#define rc_normalize(seq) \
+/// decoder loop. The "_safe" macros are used in the Resumable decoder
+/// mode in order to save the sequence to continue decoding from that
+/// point later.
+#define rc_normalize_safe(seq) \
do { \
if (rc.range < RC_TOP_VALUE) { \
- if (unlikely(rc_in_pos == in_size)) { \
+ if (rc_in_ptr == rc_in_end) { \
coder->sequence = seq; \
goto out; \
} \
rc.range <<= RC_SHIFT_BITS; \
- rc.code = (rc.code << RC_SHIFT_BITS) | in[rc_in_pos++]; \
+ rc.code = (rc.code << RC_SHIFT_BITS) | *rc_in_ptr++; \
} \
} while (0)
@@ -100,7 +170,7 @@ do { \
/// Start decoding a bit. This must be used together with rc_update_0()
/// and rc_update_1():
///
-/// rc_if_0(prob, seq) {
+/// rc_if_0(prob) {
/// rc_update_0(prob);
/// // Do something
/// } else {
@@ -108,18 +178,28 @@ do { \
/// // Do something else
/// }
///
-#define rc_if_0(prob, seq) \
- rc_normalize(seq); \
+#define rc_if_0(prob) \
+ rc_normalize(); \
+ rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob); \
+ if (rc.code < rc_bound)
+
+
+#define rc_if_0_safe(prob, seq) \
+ rc_normalize_safe(seq); \
rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob); \
if (rc.code < rc_bound)
/// Update the range decoder state and the used probability variable to
/// match a decoded bit of 0.
+///
+/// The x86-64 assembly uses the commented method but it seems that,
+/// at least on x86-64, the first version is slightly faster as C code.
#define rc_update_0(prob) \
do { \
rc.range = rc_bound; \
prob += (RC_BIT_MODEL_TOTAL - (prob)) >> RC_MOVE_BITS; \
+ /* prob -= ((prob) + RC_BIT_MODEL_OFFSET) >> RC_MOVE_BITS; */ \
} while (0)
@@ -137,9 +217,21 @@ do { \
/// This macro is used as the last step in bittree reverse decoders since
/// those don't use "symbol" for anything else than indexing the probability
/// arrays.
-#define rc_bit_last(prob, action0, action1, seq) \
+#define rc_bit_last(prob, action0, action1) \
+do { \
+ rc_if_0(prob) { \
+ rc_update_0(prob); \
+ action0; \
+ } else { \
+ rc_update_1(prob); \
+ action1; \
+ } \
+} while (0)
+
+
+#define rc_bit_last_safe(prob, action0, action1, seq) \
do { \
- rc_if_0(prob, seq) { \
+ rc_if_0_safe(prob, seq) { \
rc_update_0(prob); \
action0; \
} else { \
@@ -151,35 +243,724 @@ do { \
/// Decodes one bit, updates "symbol", and runs action0 or action1 depending
/// on the decoded bit.
-#define rc_bit(prob, action0, action1, seq) \
+#define rc_bit(prob, action0, action1) \
rc_bit_last(prob, \
symbol <<= 1; action0, \
+ symbol = (symbol << 1) + 1; action1);
+
+
+#define rc_bit_safe(prob, action0, action1, seq) \
+ rc_bit_last_safe(prob, \
+ symbol <<= 1; action0, \
symbol = (symbol << 1) + 1; action1, \
seq);
+// Unroll fixed-sized bittree decoding.
+//
+// A compile-time constant in final_add can be used to get rid of the high bit
+// from symbol that is used for the array indexing (1U << bittree_bits).
+// final_add may also be used to add offset to the result (LZMA length
+// decoder does that).
+//
+// The reason to have final_add here is that in the asm code the addition
+// can be done for free: in x86-64 there is SBB instruction with -1 as
+// the immediate value, and final_add is combined with that value.
+#define rc_bittree_bit(prob) \
+ rc_bit(prob, , )
+
+#define rc_bittree3(probs, final_add) \
+do { \
+ symbol = 1; \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ symbol += (uint32_t)(final_add); \
+} while (0)
-/// Like rc_bit() but add "case seq:" as a prefix. This makes the unrolled
-/// loops more readable because the code isn't littered with "case"
-/// statements. On the other hand this also makes it less readable, since
-/// spotting the places where the decoder loop may be restarted is less
-/// obvious.
-#define rc_bit_case(prob, action0, action1, seq) \
- case seq: rc_bit(prob, action0, action1, seq)
+#define rc_bittree6(probs, final_add) \
+do { \
+ symbol = 1; \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ symbol += (uint32_t)(final_add); \
+} while (0)
+
+#define rc_bittree8(probs, final_add) \
+do { \
+ symbol = 1; \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ rc_bittree_bit(probs[symbol]); \
+ symbol += (uint32_t)(final_add); \
+} while (0)
+
+
+// Fixed-sized reverse bittree
+#define rc_bittree_rev4(probs) \
+do { \
+ symbol = 0; \
+ rc_bit_last(probs[symbol + 1], , symbol += 1); \
+ rc_bit_last(probs[symbol + 2], , symbol += 2); \
+ rc_bit_last(probs[symbol + 4], , symbol += 4); \
+ rc_bit_last(probs[symbol + 8], , symbol += 8); \
+} while (0)
+
+
+// Decode one bit from variable-sized reverse bittree. The loop is done
+// in the code that uses this macro. This could be changed if the assembly
+// version benefited from having the loop done in assembly but it didn't
+// seem so in early 2024.
+//
+// Also, if the loop was done here, the loop counter would likely be local
+// to the macro so that it wouldn't modify yet another input variable.
+// If a _safe version of a macro with a loop was done then a modifiable
+// input variable couldn't be avoided though.
+#define rc_bit_add_if_1(probs, dest, value_to_add_if_1) \
+ rc_bit(probs[symbol], \
+ , \
+ dest += value_to_add_if_1);
+
+
+// Matched literal
+#define decode_with_match_bit \
+ t_match_byte <<= 1; \
+ t_match_bit = t_match_byte & t_offset; \
+ t_subcoder_index = t_offset + t_match_bit + symbol; \
+ rc_bit(probs[t_subcoder_index], \
+ t_offset &= ~t_match_bit, \
+ t_offset &= t_match_bit)
+
+#define rc_matched_literal(probs_base_var, match_byte) \
+do { \
+ uint32_t t_match_byte = (match_byte); \
+ uint32_t t_match_bit; \
+ uint32_t t_subcoder_index; \
+ uint32_t t_offset = 0x100; \
+ symbol = 1; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+ decode_with_match_bit; \
+} while (0)
/// Decode a bit without using a probability.
-#define rc_direct(dest, seq) \
+//
+// NOTE: GCC 13 and Clang/LLVM 16 can, at least on x86-64, optimize the bound
+// calculation to use an arithmetic right shift so there's no need to provide
+// the alternative code which, according to C99/C11/C23 6.3.1.3-p3 isn't
+// perfectly portable: rc_bound = (uint32_t)((int32_t)rc.code >> 31);
+#define rc_direct(dest, count_var) \
do { \
- rc_normalize(seq); \
+ dest = (dest << 1) + 1; \
+ rc_normalize(); \
+ rc.range >>= 1; \
+ rc.code -= rc.range; \
+ rc_bound = UINT32_C(0) - (rc.code >> 31); \
+ dest += rc_bound; \
+ rc.code += rc.range & rc_bound; \
+} while (--count_var > 0)
+
+
+
+#define rc_direct_safe(dest, count_var, seq) \
+do { \
+ rc_normalize_safe(seq); \
rc.range >>= 1; \
rc.code -= rc.range; \
rc_bound = UINT32_C(0) - (rc.code >> 31); \
rc.code += rc.range & rc_bound; \
dest = (dest << 1) + (rc_bound + 1); \
+} while (--count_var > 0)
+
+
+//////////////////
+// Branchless C //
+//////////////////
+
+/// Decode a bit using a branchless method. This reduces the number of
+/// mispredicted branches and thus can improve speed.
+#define rc_c_bit(prob, action_bit, action_neg) \
+do { \
+ probability *p = &(prob); \
+ rc_normalize(); \
+ rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * *p; \
+ uint32_t rc_mask = rc.code >= rc_bound; /* rc_mask = decoded bit */ \
+ action_bit; /* action when rc_mask is 0 or 1 */ \
+ /* rc_mask becomes 0 if bit is 0 and 0xFFFFFFFF if bit is 1: */ \
+ rc_mask = 0U - rc_mask; \
+ rc.range &= rc_mask; /* If bit 0: set rc.range = 0 */ \
+ rc_bound ^= rc_mask; \
+ rc_bound -= rc_mask; /* If bit 1: rc_bound = 0U - rc_bound */ \
+ rc.range += rc_bound; \
+ rc_bound &= rc_mask; \
+ rc.code += rc_bound; \
+ action_neg; /* action when rc_mask is 0 or 0xFFFFFFFF */ \
+ rc_mask = ~rc_mask; /* If bit 0: all bits are set in rc_mask */ \
+ rc_mask &= RC_BIT_MODEL_OFFSET; \
+ *p -= (*p + rc_mask) >> RC_MOVE_BITS; \
} while (0)
-// NOTE: No macros are provided for bittree decoding. It seems to be simpler
-// to just write them open in the code.
+// Testing on x86-64 give an impression that only the normal bittrees and
+// the fixed-sized reverse bittrees are worth the branchless C code.
+// It should be tested on other archs for which there isn't assembly code
+// in this file.
+
+// Using addition in "(symbol << 1) + rc_mask" allows use of x86 LEA
+// or RISC-V SH1ADD instructions. Compilers might infer it from
+// "(symbol << 1) | rc_mask" too if they see that mask is 0 or 1 but
+// the use of addition doesn't require such analysis from compilers.
+#if LZMA_RANGE_DECODER_CONFIG & 0x01
+#undef rc_bittree_bit
+#define rc_bittree_bit(prob) \
+ rc_c_bit(prob, \
+ symbol = (symbol << 1) + rc_mask, \
+ )
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x01
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x02
+#undef rc_bittree_rev4
+#define rc_bittree_rev4(probs) \
+do { \
+ symbol = 0; \
+ rc_c_bit(probs[symbol + 1], symbol += rc_mask, ); \
+ rc_c_bit(probs[symbol + 2], symbol += rc_mask << 1, ); \
+ rc_c_bit(probs[symbol + 4], symbol += rc_mask << 2, ); \
+ rc_c_bit(probs[symbol + 8], symbol += rc_mask << 3, ); \
+} while (0)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x02
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x04
+#undef rc_bit_add_if_1
+#define rc_bit_add_if_1(probs, dest, value_to_add_if_1) \
+ rc_c_bit(probs[symbol], \
+ symbol = (symbol << 1) + rc_mask, \
+ dest += (value_to_add_if_1) & rc_mask)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x04
+
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x08
+#undef decode_with_match_bit
+#define decode_with_match_bit \
+ t_match_byte <<= 1; \
+ t_match_bit = t_match_byte & t_offset; \
+ t_subcoder_index = t_offset + t_match_bit + symbol; \
+ rc_c_bit(probs[t_subcoder_index], \
+ symbol = (symbol << 1) + rc_mask, \
+ t_offset &= ~t_match_bit ^ rc_mask)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x08
+
+
+////////////
+// x86-64 //
+////////////
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x1F0
+
+// rc_asm_y and rc_asm_n are used as arguments to macros to control which
+// strings to include or omit.
+#define rc_asm_y(str) str
+#define rc_asm_n(str)
+
+// There are a few possible variations for normalization.
+// This is the smallest variant which is also used by LZMA SDK.
+//
+// - This has partial register write (the MOV from (%[in_ptr])).
+//
+// - INC saves one byte in code size over ADD. False dependency on
+// partial flags from INC shouldn't become a problem on any processor
+// because the instructions after normalization don't read the flags
+// until SUB which sets all flags.
+//
+#define rc_asm_normalize \
+ "cmp %[top_value], %[range]\n\t" \
+ "jae 1f\n\t" \
+ "shl %[shift_bits], %[code]\n\t" \
+ "mov (%[in_ptr]), %b[code]\n\t" \
+ "shl %[shift_bits], %[range]\n\t" \
+ "inc %[in_ptr]\n" \
+ "1:\n"
+
+// rc_asm_calc(prob) is roughly equivalent to the C version of rc_if_0(prob)...
+//
+// rc_bound = (rc.range >> RC_BIT_MODEL_TOTAL_BITS) * (prob);
+// if (rc.code < rc_bound)
+//
+// ...but the bound is stored in "range":
+//
+// t0 = range;
+// range = (range >> RC_BIT_MODEL_TOTAL_BITS) * (prob);
+// t0 -= range;
+// t1 = code;
+// code -= range;
+//
+// The carry flag (CF) from the last subtraction holds the negation of
+// the decoded bit (if CF==0 then the decoded bit is 1).
+// The values in t0 and t1 are needed for rc_update_0(prob) and
+// rc_update_1(prob). If the bit is 0, rc_update_0(prob)...
+//
+// rc.range = rc_bound;
+//
+// ...has already been done but the "code -= range" has to be reverted using
+// the old value stored in t1. (Also, prob needs to be updated.)
+//
+// If the bit is 1, rc_update_1(prob)...
+//
+// rc.range -= rc_bound;
+// rc.code -= rc_bound;
+//
+// ...is already done for "code" but the value for "range" needs to be taken
+// from t0. (Also, prob needs to be updated here as well.)
+//
+// The assignments from t0 and t1 can be done in a branchless manner with CMOV
+// after the instructions from this macro. The CF from SUB tells which moves
+// are needed.
+#define rc_asm_calc(prob) \
+ "mov %[range], %[t0]\n\t" \
+ "shr %[bit_model_total_bits], %[range]\n\t" \
+ "imul %[" prob "], %[range]\n\t" \
+ "sub %[range], %[t0]\n\t" \
+ "mov %[code], %[t1]\n\t" \
+ "sub %[range], %[code]\n\t"
+
+// Also, prob needs to be updated: The update math depends on the decoded bit.
+// It can be expressed in a few slightly different ways but this is fairly
+// convenient here:
+//
+// prob -= (prob + (bit ? 0 : RC_BIT_MODEL_OFFSET)) >> RC_MOVE_BITS;
+//
+// To do it in branchless way when the negation of the decoded bit is in CF,
+// both "prob" and "prob + RC_BIT_MODEL_OFFSET" are needed. Then the desired
+// value can be picked with CMOV. The addition can be done using LEA without
+// affecting CF.
+//
+// (This prob update method is a tiny bit different from LZMA SDK 23.01.
+// In the LZMA SDK a single register is reserved solely for a constant to
+// be used with CMOV when updating prob. That is fine since there are enough
+// free registers to do so. The method used here uses one fewer register,
+// which is valuable with inline assembly.)
+//
+// * * *
+//
+// In bittree decoding, each (unrolled) loop iteration decodes one bit
+// and needs one prob variable. To make it faster, the prob variable of
+// the iteration N+1 is loaded during iteration N. There are two possible
+// prob variables to choose from for N+1. Both are loaded from memory and
+// the correct one is chosen with CMOV using the same CF as is used for
+// other things described above.
+//
+// This preloading/prefetching requires an extra register. To avoid
+// useless moves from "preloaded prob register" to "current prob register",
+// the macros swap between the two registers for odd and even iterations.
+//
+// * * *
+//
+// Finally, the decoded bit has to be stored in "symbol". Since the negation
+// of the bit is in CF, this can be done with SBB: symbol -= CF - 1. That is,
+// if the decoded bit is 0 (CF==1) the operation is a no-op "symbol -= 0"
+// and when bit is 1 (CF==0) the operation is "symbol -= 0 - 1" which is
+// the same as "symbol += 1".
+//
+// The instructions for all things are intertwined for a few reasons:
+// - freeing temporary registers for new use
+// - not modifying CF too early
+// - instruction scheduling
+//
+// The first and last iterations can cheat a little. For example,
+// on the first iteration "symbol" is known to start from 1 so it
+// doesn't need to be read; it can even be immediately initialized
+// to 2 to prepare for the second iteration of the loop.
+//
+// * * *
+//
+// a = number of the current prob variable (0 or 1)
+// b = number of the next prob variable (1 or 0)
+// *_only = rc_asm_y or _n to include or exclude code marked with them
+#define rc_asm_bittree(a, b, first_only, middle_only, last_only) \
+ first_only( \
+ "movzw 2(%[probs_base]), %[prob" #a "]\n\t" \
+ "mov $2, %[symbol]\n\t" \
+ "movzw 4(%[probs_base]), %[prob" #b "]\n\t" \
+ ) \
+ middle_only( \
+ /* Note the scaling of 4 instead of 2: */ \
+ "movzw (%[probs_base], %q[symbol], 4), %[prob" #b "]\n\t" \
+ ) \
+ last_only( \
+ "add %[symbol], %[symbol]\n\t" \
+ ) \
+ \
+ rc_asm_normalize \
+ rc_asm_calc("prob" #a) \
+ \
+ "cmovae %[t0], %[range]\n\t" \
+ \
+ first_only( \
+ "movzw 6(%[probs_base]), %[t0]\n\t" \
+ "cmovae %[t0], %[prob" #b "]\n\t" \
+ ) \
+ middle_only( \
+ "movzw 2(%[probs_base], %q[symbol], 4), %[t0]\n\t" \
+ "lea (%q[symbol], %q[symbol]), %[symbol]\n\t" \
+ "cmovae %[t0], %[prob" #b "]\n\t" \
+ ) \
+ \
+ "lea %c[bit_model_offset](%q[prob" #a "]), %[t0]\n\t" \
+ "cmovb %[t1], %[code]\n\t" \
+ "mov %[symbol], %[t1]\n\t" \
+ "cmovae %[prob" #a "], %[t0]\n\t" \
+ \
+ first_only( \
+ "sbb $-1, %[symbol]\n\t" \
+ ) \
+ middle_only( \
+ "sbb $-1, %[symbol]\n\t" \
+ ) \
+ last_only( \
+ "sbb %[last_sbb], %[symbol]\n\t" \
+ ) \
+ \
+ "shr %[move_bits], %[t0]\n\t" \
+ "sub %[t0], %[prob" #a "]\n\t" \
+ /* Scaling of 1 instead of 2 because symbol <<= 1. */ \
+ "mov %w[prob" #a "], (%[probs_base], %q[t1], 1)\n\t"
+
+// NOTE: The order of variables in __asm__ can affect speed and code size.
+#define rc_asm_bittree_n(probs_base_var, final_add, asm_str) \
+do { \
+ uint32_t t0; \
+ uint32_t t1; \
+ uint32_t t_prob0; \
+ uint32_t t_prob1; \
+ \
+ __asm__( \
+ asm_str \
+ : \
+ [range] "+&r"(rc.range), \
+ [code] "+&r"(rc.code), \
+ [t0] "=&r"(t0), \
+ [t1] "=&r"(t1), \
+ [prob0] "=&r"(t_prob0), \
+ [prob1] "=&r"(t_prob1), \
+ [symbol] "=&r"(symbol), \
+ [in_ptr] "+&r"(rc_in_ptr) \
+ : \
+ [probs_base] "r"(probs_base_var), \
+ [last_sbb] "n"(-1 - (final_add)), \
+ [top_value] "n"(RC_TOP_VALUE), \
+ [shift_bits] "n"(RC_SHIFT_BITS), \
+ [bit_model_total_bits] "n"(RC_BIT_MODEL_TOTAL_BITS), \
+ [bit_model_offset] "n"(RC_BIT_MODEL_OFFSET), \
+ [move_bits] "n"(RC_MOVE_BITS) \
+ : \
+ "cc", "memory"); \
+} while (0)
+
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x010
+#undef rc_bittree3
+#define rc_bittree3(probs_base_var, final_add) \
+ rc_asm_bittree_n(probs_base_var, final_add, \
+ rc_asm_bittree(0, 1, rc_asm_y, rc_asm_n, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_n, rc_asm_y) \
+ )
+
+#undef rc_bittree6
+#define rc_bittree6(probs_base_var, final_add) \
+ rc_asm_bittree_n(probs_base_var, final_add, \
+ rc_asm_bittree(0, 1, rc_asm_y, rc_asm_n, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_n, rc_asm_y) \
+ )
+
+#undef rc_bittree8
+#define rc_bittree8(probs_base_var, final_add) \
+ rc_asm_bittree_n(probs_base_var, final_add, \
+ rc_asm_bittree(0, 1, rc_asm_y, rc_asm_n, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(0, 1, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree(1, 0, rc_asm_n, rc_asm_n, rc_asm_y) \
+ )
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x010
+
+
+// Fixed-sized reverse bittree
+//
+// This uses the indexing that constructs the final value in symbol directly.
+// add = 1, 2, 4, 8
+// dcur = -, 4, 8, 16
+// dnext0 = 4, 8, 16, -
+// dnext0 = 6, 12, 24, -
+#define rc_asm_bittree_rev(a, b, add, dcur, dnext0, dnext1, \
+ first_only, middle_only, last_only) \
+ first_only( \
+ "movzw 2(%[probs_base]), %[prob" #a "]\n\t" \
+ "xor %[symbol], %[symbol]\n\t" \
+ "movzw 4(%[probs_base]), %[prob" #b "]\n\t" \
+ ) \
+ middle_only( \
+ "movzw " #dnext0 "(%[probs_base], %q[symbol], 2), " \
+ "%[prob" #b "]\n\t" \
+ ) \
+ \
+ rc_asm_normalize \
+ rc_asm_calc("prob" #a) \
+ \
+ "cmovae %[t0], %[range]\n\t" \
+ \
+ first_only( \
+ "movzw 6(%[probs_base]), %[t0]\n\t" \
+ "cmovae %[t0], %[prob" #b "]\n\t" \
+ ) \
+ middle_only( \
+ "movzw " #dnext1 "(%[probs_base], %q[symbol], 2), %[t0]\n\t" \
+ "cmovae %[t0], %[prob" #b "]\n\t" \
+ ) \
+ \
+ "lea " #add "(%q[symbol]), %[t0]\n\t" \
+ "cmovb %[t1], %[code]\n\t" \
+ middle_only( \
+ "mov %[symbol], %[t1]\n\t" \
+ ) \
+ last_only( \
+ "mov %[symbol], %[t1]\n\t" \
+ ) \
+ "cmovae %[t0], %[symbol]\n\t" \
+ "lea %c[bit_model_offset](%q[prob" #a "]), %[t0]\n\t" \
+ "cmovae %[prob" #a "], %[t0]\n\t" \
+ \
+ "shr %[move_bits], %[t0]\n\t" \
+ "sub %[t0], %[prob" #a "]\n\t" \
+ first_only( \
+ "mov %w[prob" #a "], 2(%[probs_base])\n\t" \
+ ) \
+ middle_only( \
+ "mov %w[prob" #a "], " \
+ #dcur "(%[probs_base], %q[t1], 2)\n\t" \
+ ) \
+ last_only( \
+ "mov %w[prob" #a "], " \
+ #dcur "(%[probs_base], %q[t1], 2)\n\t" \
+ )
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x020
+#undef rc_bittree_rev4
+#define rc_bittree_rev4(probs_base_var) \
+rc_asm_bittree_n(probs_base_var, 4, \
+ rc_asm_bittree_rev(0, 1, 1, -, 4, 6, rc_asm_y, rc_asm_n, rc_asm_n) \
+ rc_asm_bittree_rev(1, 0, 2, 4, 8, 12, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree_rev(0, 1, 4, 8, 16, 24, rc_asm_n, rc_asm_y, rc_asm_n) \
+ rc_asm_bittree_rev(1, 0, 8, 16, -, -, rc_asm_n, rc_asm_n, rc_asm_y) \
+)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x020
+
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x040
+#undef rc_bit_add_if_1
+#define rc_bit_add_if_1(probs_base_var, dest_var, value_to_add_if_1) \
+do { \
+ uint32_t t0; \
+ uint32_t t1; \
+ uint32_t t2 = (value_to_add_if_1); \
+ uint32_t t_prob; \
+ uint32_t t_index; \
+ \
+ __asm__( \
+ "movzw (%[probs_base], %q[symbol], 2), %[prob]\n\t" \
+ "mov %[symbol], %[index]\n\t" \
+ \
+ "add %[dest], %[t2]\n\t" \
+ "add %[symbol], %[symbol]\n\t" \
+ \
+ rc_asm_normalize \
+ rc_asm_calc("prob") \
+ \
+ "cmovae %[t0], %[range]\n\t" \
+ "lea %c[bit_model_offset](%q[prob]), %[t0]\n\t" \
+ "cmovb %[t1], %[code]\n\t" \
+ "cmovae %[prob], %[t0]\n\t" \
+ \
+ "cmovae %[t2], %[dest]\n\t" \
+ "sbb $-1, %[symbol]\n\t" \
+ \
+ "sar %[move_bits], %[t0]\n\t" \
+ "sub %[t0], %[prob]\n\t" \
+ "mov %w[prob], (%[probs_base], %q[index], 2)" \
+ : \
+ [range] "+&r"(rc.range), \
+ [code] "+&r"(rc.code), \
+ [t0] "=&r"(t0), \
+ [t1] "=&r"(t1), \
+ [prob] "=&r"(t_prob), \
+ [index] "=&r"(t_index), \
+ [symbol] "+&r"(symbol), \
+ [t2] "+&r"(t2), \
+ [dest] "+&r"(dest_var), \
+ [in_ptr] "+&r"(rc_in_ptr) \
+ : \
+ [probs_base] "r"(probs_base_var), \
+ [top_value] "n"(RC_TOP_VALUE), \
+ [shift_bits] "n"(RC_SHIFT_BITS), \
+ [bit_model_total_bits] "n"(RC_BIT_MODEL_TOTAL_BITS), \
+ [bit_model_offset] "n"(RC_BIT_MODEL_OFFSET), \
+ [move_bits] "n"(RC_MOVE_BITS) \
+ : \
+ "cc", "memory"); \
+} while (0)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x040
+
+
+// Literal decoding uses a normal 8-bit bittree but literal with match byte
+// is more complex in picking the probability variable from the correct
+// subtree. This doesn't use preloading/prefetching of the next prob because
+// there are four choices instead of two.
+//
+// FIXME? The first iteration starts with symbol = 1 so it could be optimized
+// by a tiny amount.
+#define rc_asm_matched_literal(nonlast_only) \
+ "add %[offset], %[symbol]\n\t" \
+ "and %[offset], %[match_bit]\n\t" \
+ "add %[match_bit], %[symbol]\n\t" \
+ \
+ "movzw (%[probs_base], %q[symbol], 2), %[prob]\n\t" \
+ \
+ "add %[symbol], %[symbol]\n\t" \
+ \
+ nonlast_only( \
+ "xor %[match_bit], %[offset]\n\t" \
+ "add %[match_byte], %[match_byte]\n\t" \
+ ) \
+ \
+ rc_asm_normalize \
+ rc_asm_calc("prob") \
+ \
+ "cmovae %[t0], %[range]\n\t" \
+ "lea %c[bit_model_offset](%q[prob]), %[t0]\n\t" \
+ "cmovb %[t1], %[code]\n\t" \
+ "mov %[symbol], %[t1]\n\t" \
+ "cmovae %[prob], %[t0]\n\t" \
+ \
+ nonlast_only( \
+ "cmovae %[match_bit], %[offset]\n\t" \
+ "mov %[match_byte], %[match_bit]\n\t" \
+ ) \
+ \
+ "sbb $-1, %[symbol]\n\t" \
+ \
+ "shr %[move_bits], %[t0]\n\t" \
+ /* Undo symbol += match_bit + offset: */ \
+ "and $0x1FF, %[symbol]\n\t" \
+ "sub %[t0], %[prob]\n\t" \
+ \
+ /* Scaling of 1 instead of 2 because symbol <<= 1. */ \
+ "mov %w[prob], (%[probs_base], %q[t1], 1)\n\t"
+
+
+#if LZMA_RANGE_DECODER_CONFIG & 0x080
+#undef rc_matched_literal
+#define rc_matched_literal(probs_base_var, match_byte_value) \
+do { \
+ uint32_t t0; \
+ uint32_t t1; \
+ uint32_t t_prob; \
+ uint32_t t_match_byte = (uint32_t)(match_byte_value) << 1; \
+ uint32_t t_match_bit = t_match_byte; \
+ uint32_t t_offset = 0x100; \
+ symbol = 1; \
+ \
+ __asm__( \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_y) \
+ rc_asm_matched_literal(rc_asm_n) \
+ : \
+ [range] "+&r"(rc.range), \
+ [code] "+&r"(rc.code), \
+ [t0] "=&r"(t0), \
+ [t1] "=&r"(t1), \
+ [prob] "=&r"(t_prob), \
+ [match_bit] "+&r"(t_match_bit), \
+ [symbol] "+&r"(symbol), \
+ [match_byte] "+&r"(t_match_byte), \
+ [offset] "+&r"(t_offset), \
+ [in_ptr] "+&r"(rc_in_ptr) \
+ : \
+ [probs_base] "r"(probs_base_var), \
+ [top_value] "n"(RC_TOP_VALUE), \
+ [shift_bits] "n"(RC_SHIFT_BITS), \
+ [bit_model_total_bits] "n"(RC_BIT_MODEL_TOTAL_BITS), \
+ [bit_model_offset] "n"(RC_BIT_MODEL_OFFSET), \
+ [move_bits] "n"(RC_MOVE_BITS) \
+ : \
+ "cc", "memory"); \
+} while (0)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x080
+
+
+// Doing the loop in asm instead of C seems to help a little.
+#if LZMA_RANGE_DECODER_CONFIG & 0x100
+#undef rc_direct
+#define rc_direct(dest_var, count_var) \
+do { \
+ uint32_t t0; \
+ uint32_t t1; \
+ \
+ __asm__( \
+ "2:\n\t" \
+ "add %[dest], %[dest]\n\t" \
+ "lea 1(%q[dest]), %[t1]\n\t" \
+ \
+ rc_asm_normalize \
+ \
+ "shr $1, %[range]\n\t" \
+ "mov %[code], %[t0]\n\t" \
+ "sub %[range], %[code]\n\t" \
+ "cmovns %[t1], %[dest]\n\t" \
+ "cmovs %[t0], %[code]\n\t" \
+ "dec %[count]\n\t" \
+ "jnz 2b\n\t" \
+ : \
+ [range] "+&r"(rc.range), \
+ [code] "+&r"(rc.code), \
+ [t0] "=&r"(t0), \
+ [t1] "=&r"(t1), \
+ [dest] "+&r"(dest_var), \
+ [count] "+&r"(count_var), \
+ [in_ptr] "+&r"(rc_in_ptr) \
+ : \
+ [top_value] "n"(RC_TOP_VALUE), \
+ [shift_bits] "n"(RC_SHIFT_BITS) \
+ : \
+ "cc", "memory"); \
+} while (0)
+#endif // LZMA_RANGE_DECODER_CONFIG & 0x100
+
+#endif // x86_64
#endif
diff --git a/contrib/xz/src/liblzma/rangecoder/range_encoder.h b/contrib/xz/src/liblzma/rangecoder/range_encoder.h
index d794eabbccea..8f62a47ac0a6 100644
--- a/contrib/xz/src/liblzma/rangecoder/range_encoder.h
+++ b/contrib/xz/src/liblzma/rangecoder/range_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file range_encoder.h
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_RANGE_ENCODER_H
diff --git a/contrib/xz/src/liblzma/simple/arm.c b/contrib/xz/src/liblzma/simple/arm.c
index 6e53970d2f27..58acb2d11adf 100644
--- a/contrib/xz/src/liblzma/simple/arm.c
+++ b/contrib/xz/src/liblzma/simple/arm.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file arm.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/arm64.c b/contrib/xz/src/liblzma/simple/arm64.c
index 0fe0824eb931..0a73f6c8bf2d 100644
--- a/contrib/xz/src/liblzma/simple/arm64.c
+++ b/contrib/xz/src/liblzma/simple/arm64.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file arm64.c
@@ -16,9 +18,6 @@
// Jia Tan
// Igor Pavlov
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/armthumb.c b/contrib/xz/src/liblzma/simple/armthumb.c
index 25d8dbd4f36e..f1eeca9b80f1 100644
--- a/contrib/xz/src/liblzma/simple/armthumb.c
+++ b/contrib/xz/src/liblzma/simple/armthumb.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file armthumb.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/ia64.c b/contrib/xz/src/liblzma/simple/ia64.c
index 692b0a295ef2..502501409977 100644
--- a/contrib/xz/src/liblzma/simple/ia64.c
+++ b/contrib/xz/src/liblzma/simple/ia64.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file ia64.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/powerpc.c b/contrib/xz/src/liblzma/simple/powerpc.c
index 3a340fd171a5..ba6cfbef3ab6 100644
--- a/contrib/xz/src/liblzma/simple/powerpc.c
+++ b/contrib/xz/src/liblzma/simple/powerpc.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file powerpc.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/riscv.c b/contrib/xz/src/liblzma/simple/riscv.c
new file mode 100644
index 000000000000..b18df8b637d0
--- /dev/null
+++ b/contrib/xz/src/liblzma/simple/riscv.c
@@ -0,0 +1,755 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file riscv.c
+/// \brief Filter for 32-bit/64-bit little/big endian RISC-V binaries
+///
+/// This converts program counter relative addresses in function calls
+/// (JAL, AUIPC+JALR), address calculation of functions and global
+/// variables (AUIPC+ADDI), loads (AUIPC+load), and stores (AUIPC+store).
+///
+/// For AUIPC+inst2 pairs, the paired instruction checking is fairly relaxed.
+/// The paired instruction opcode must only have its lowest two bits set,
+/// meaning it will convert any paired instruction that is not a 16-bit
+/// compressed instruction. This was shown to be enough to keep the number
+/// of false matches low while improving code size and speed.
+//
+// Authors: Lasse Collin
+// Jia Tan
+//
+// Special thanks:
+//
+// - Chien Wong <m@xv97.com> provided a few early versions of RISC-V
+// filter variants along with test files and benchmark results.
+//
+// - Igor Pavlov helped a lot in the filter design, getting it both
+// faster and smaller. The implementation here is still independently
+// written, not based on LZMA SDK.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+/*
+
+RISC-V filtering
+================
+
+ RV32I and RV64I, possibly combined with extensions C, Zfh, F, D,
+ and Q, are identical enough that the same filter works for both.
+
+ The instruction encoding is always little endian, even on systems
+ with big endian data access. Thus the same filter works for both
+ endiannesses.
+
+ The following instructions have program counter relative
+ (pc-relative) behavior:
+
+JAL
+---
+
+ JAL is used for function calls (including tail calls) and
+ unconditional jumps within functions. Jumps within functions
+ aren't useful to filter because the absolute addresses often
+ appear only once or at most a few times. Tail calls and jumps
+ within functions look the same to a simple filter so neither
+ are filtered, that is, JAL x0 is ignored (the ABI name of the
+ register x0 is "zero").
+
+ Almost all calls store the return address to register x1 (ra)
+ or x5 (t0). To reduce false matches when the filter is applied
+ to non-code data, only the JAL instructions that use x1 or x5
+ are converted. JAL has pc-relative range of +/-1 MiB so longer
+ calls and jumps need another method (AUIPC+JALR).
+
+C.J and C.JAL
+-------------
+
+ C.J and C.JAL have pc-relative range of +/-2 KiB.
+
+ C.J is for tail calls and jumps within functions and isn't
+ filtered for the reasons mentioned for JAL x0.
+
+ C.JAL is an RV32C-only instruction. Its encoding overlaps with
+ RV64C-only C.ADDIW which is a common instruction. So if filtering
+ C.JAL was useful (it wasn't tested) then a separate filter would
+ be needed for RV32 and RV64. Also, false positives would be a
+ significant problem when the filter is applied to non-code data
+ because C.JAL needs only five bits to match. Thus, this filter
+ doesn't modify C.JAL instructions.
+
+BEQ, BNE, BLT, BGE, BLTU, BGEU, C.BEQZ, and C.BNEZ
+--------------------------------------------------
+
+ These are conditional branches with pc-relative range
+ of +/-4 KiB (+/-256 B for C.*). The absolute addresses often
+ appear only once and very short distances are the most common,
+ so filtering these instructions would make compression worse.
+
+AUIPC with rd != x0
+-------------------
+
+ AUIPC is paired with a second instruction (inst2) to do
+ pc-relative jumps, calls, loads, stores, and for taking
+ an address of a symbol. AUIPC has a 20-bit immediate and
+ the possible inst2 choices have a 12-bit immediate.
+
+ AUIPC stores pc + 20-bit signed immediate to a register.
+ The immediate encodes a multiple of 4 KiB so AUIPC itself
+ has a pc-relative range of +/-2 GiB. AUIPC does *NOT* set
+ the lowest 12 bits of the result to zero! This means that
+ the 12-bit immediate in inst2 cannot just include the lowest
+ 12 bits of the absolute address as is; the immediate has to
+ compensate for the lowest 12 bits that AUIPC copies from the
+ program counter. This means that a good filter has to convert
+ not only AUIPC but also the paired inst2.
+
+ A strict filter would focus on filtering the following
+ AUIPC+inst2 pairs:
+
+ - AUIPC+JALR: Function calls, including tail calls.
+
+ - AUIPC+ADDI: Calculating the address of a function
+ or a global variable.
+
+ - AUIPC+load/store from the base instruction sets
+ (RV32I, RV64I) or from the floating point extensions
+ Zfh, F, D, and Q:
+ * RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
+ * RV64I has also: LD, LWU, SD
+ * Zfh: FLH, FSH
+ * F: FLW, FSW
+ * D: FLD, FSD
+ * Q: FLQ, FSQ
+
+ NOTE: AUIPC+inst2 can only be a pair if AUIPC's rd specifies
+ the same register as inst2's rs1.
+
+ Instead of strictly accepting only the above instructions as inst2,
+ this filter uses a much simpler condition: the lowest two bits of
+ inst2 must be set, that is, inst2 must not be a 16-bit compressed
+ instruction. So this will accept all 32-bit and possible future
+ extended instructions as a pair to AUIPC if the bits in AUIPC's
+ rd [11:7] match the bits [19:15] in inst2 (the bits that I-type and
+ S-type instructions use for rs1). Testing showed that this relaxed
+ condition for inst2 did not consistently or significantly affect
+ compression ratio but it reduced code size and improved speed.
+
+ Additionally, the paired instruction is always treated as an I-type
+ instruction. The S-type instructions used by stores (SB, SH, SW,
+ etc.) place the lowest 5 bits of the immediate in a different
+ location than I-type instructions. AUIPC+store pairs are less
+ common than other pairs, and testing showed that the extra
+ code required to handle S-type instructions was not worth the
+ compression ratio gained.
+
+ AUIPC+inst2 don't necessarily appear sequentially next to each
+ other although very often they do. Especially AUIPC+JALR are
+ sequential as that may allow instruction fusion in processors
+ (and perhaps help branch prediction as a fused AUIPC+JALR is
+ a direct branch while JALR alone is an indirect branch).
+
+ Clang 16 can generate code where AUIPC+inst2 is split:
+
+ - AUIPC is outside a loop and inst2 (load/store) is inside
+ the loop. This way the AUIPC instruction needs to be
+ executed only once.
+
+ - Load-modify-store may have AUIPC for the load and the same
+ AUIPC-result is used for the store too. This may get combined
+ with AUIPC being outside the loop.
+
+ - AUIPC is before a conditional branch and inst2 is hundreds
+ of bytes away at the branch target.
+
+ - Inner and outer pair:
+
+ auipc a1,0x2f
+ auipc a2,0x3d
+ ld a2,-500(a2)
+ addi a1,a1,-233
+
+ - Many split pairs with an untaken conditional branch between:
+
+ auipc s9,0x1613 # Pair 1
+ auipc s4,0x1613 # Pair 2
+ auipc s6,0x1613 # Pair 3
+ auipc s10,0x1613 # Pair 4
+ beqz a5,a3baae
+ ld a0,0(a6)
+ ld a6,246(s9) # Pair 1
+ ld a1,250(s4) # Pair 2
+ ld a3,254(s6) # Pair 3
+ ld a4,258(s10) # Pair 4
+
+ It's not possible to find all split pairs in a filter like this.
+ At least in 2024, simple sequential pairs are 99 % of AUIPC uses
+ so filtering only such pairs gives good results and makes the
+ filter simpler. However, it's possible that future compilers will
+ produce different code where sequential pairs aren't as common.
+
+ This filter doesn't convert AUIPC instructions alone because:
+
+ (1) The conversion would be off-by-one (or off-by-4096) half the
+ time because the lowest 12 bits from inst2 (inst2_imm12)
+ aren't known. We only know that the absolute address is
+ pc + AUIPC_imm20 + [-2048, +2047] but there is no way to
+ know the exact 4096-byte multiple (or 4096 * n + 2048):
+ there are always two possibilities because AUIPC copies
+ the 12 lowest bits from pc instead of zeroing them.
+
+ NOTE: The sign-extension of inst2_imm12 adds a tiny bit
+ of extra complexity to AUIPC math in general but it's not
+ the reason for this problem. The sign-extension only changes
+ the relative position of the pc-relative 4096-byte window.
+
+ (2) Matching AUIPC instruction alone requires only seven bits.
+ When the filter is applied to non-code data, that leads
+ to many false positives which make compression worse.
+ As long as most AUIPC+inst2 pairs appear as two consecutive
+ instructions, converting only such pairs gives better results.
+
+ In assembly, AUIPC+inst2 tend to look like this:
+
+ # Call:
+ auipc ra, 0x12345
+ jalr ra, -42(ra)
+
+ # Tail call:
+ auipc t1, 0x12345
+ jalr zero, -42(t1)
+
+ # Getting the absolute address:
+ auipc a0, 0x12345
+ addi a0, a0, -42
+
+ # rd of inst2 isn't necessarily the same as rs1 even
+ # in cases where there is no reason to preserve rs1.
+ auipc a0, 0x12345
+ addi a1, a0, -42
+
+ As of 2024, 16-bit instructions from the C extension don't
+ appear as inst2. The RISC-V psABI doesn't list AUIPC+C.* as
+ a linker relaxation type explicitly but it's not disallowed
+ either. Usefulness is limited as most of the time the lowest
+ 12 bits won't fit in a C instruction. This filter doesn't
+ support AUIPC+C.* combinations because this makes the filter
+ simpler, there are no test files, and it hopefully will never
+ be needed anyway.
+
+ (Compare AUIPC to ARM64 where ADRP does set the lowest 12 bits
+ to zero. The paired instruction has the lowest 12 bits of the
+ absolute address as is in a zero-extended immediate. Thus the
+ ARM64 filter doesn't need to care about the instructions that
+ are paired with ADRP. An off-by-4096 issue can still occur if
+ the code section isn't aligned with the filter's start offset.
+ It's not a problem with standalone ELF files but Windows PE
+ files need start_offset=3072 for best results. Also, a .tar
+ stores files with 512-byte alignment so most of the time it
+ won't be the best for ARM64.)
+
+AUIPC with rd == x0
+-------------------
+
+ AUIPC instructions with rd=x0 are reserved for HINTs in the base
+ instruction set. Such AUIPC instructions are never filtered.
+
+ As of January 2024, it seems likely that AUIPC with rd=x0 will
+ be used for landing pads (pseudoinstruction LPAD). LPAD is used
+ to mark valid targets for indirect jumps (for JALR), for example,
+ beginnings of functions. The 20-bit immediate in LPAD instruction
+ is a label, not a pc-relative address. Thus it would be
+ counterproductive to convert AUIPC instructions with rd=x0.
+
+ Often the next instruction after LPAD won't have rs1=x0 and thus
+ the filtering would be skipped for that reason alone. However,
+ it's not good to rely on this. For example, consider a function
+ that begins like this:
+
+ int foo(int i)
+ {
+ if (i <= 234) {
+ ...
+ }
+
+ A compiler may generate something like this:
+
+ lpad 0x54321
+ li a5, 234
+ bgt a0, a5, .L2
+
+ Converting the pseudoinstructions to raw instructions:
+
+ auipc x0, 0x54321
+ addi x15, x0, 234
+ blt x15, x10, .L2
+
+ In this case the filter would undesirably convert the AUIPC+ADDI
+ pair if the filter didn't explicitly skip AUIPC instructions
+ that have rd=x0.
+
+*/
+
+
+#include "simple_private.h"
+
+
+// This checks two conditions at once:
+// - AUIPC rd == inst2 rs1.
+// - inst2 opcode has the lowest two bits set.
+//
+// The 8 bit left shift aligns the rd of AUIPC with the rs1 of inst2.
+// By XORing the registers, any non-zero value in those bits indicates the
+// registers are not equal and thus not an AUIPC pair. Subtracting 3 from
+// inst2 will zero out the first two opcode bits only when they are set.
+// The mask tests if any of the register or opcode bits are set (and thus
+// not an AUIPC pair).
+//
+// Alternative expression: (((((auipc) << 8) ^ (inst2)) & 0xF8003) != 3)
+#define NOT_AUIPC_PAIR(auipc, inst2) \
+ ((((auipc) << 8) ^ ((inst2) - 3)) & 0xF8003)
+
+// This macro checks multiple conditions:
+// (1) AUIPC rd [11:7] == x2 (special rd value).
+// (2) AUIPC bits 12 and 13 set (the lowest two opcode bits of packed inst2).
+// (3) inst2_rs1 doesn't equal x0 or x2 because the opposite
+// conversion is only done when
+// auipc_rd != x0 &&
+// auipc_rd != x2 &&
+// auipc_rd == inst2_rs1.
+//
+// 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 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 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
+// ensures that any non-zero result will be larger than any possible result
+// from the right-hand side of the comparison. The cast ensures that the
+// left-hand side didn't get promoted to a larger type than uint32_t.
+//
+// On the right-hand side, inst2_rs1 & 0x1D will be non-zero as long as
+// inst2_rs1 is not x0 or x2.
+//
+// The final '>=' comparison will make the expression true if:
+// - The subtraction caused any bits to be set (special AUIPC rd value not
+// used or inst2 opcode bits not set). (non-zero >= non-zero or 0)
+// - The subtraction did not cause any bits to be set but inst2_rs1 was
+// x0 or x2. (0 >= 0)
+#define NOT_SPECIAL_AUIPC(auipc, inst2_rs1) \
+ ((uint32_t)(((auipc) - 0x3117) << 18) >= ((inst2_rs1) & 0x1D))
+
+
+// The encode and decode functions are split for this filter because of the
+// AUIPC+inst2 filtering. This filter design allows a decoder-only
+// implementation to be smaller than alternative designs.
+
+#ifdef HAVE_ENCODER_RISCV
+static size_t
+riscv_encode(void *simple lzma_attribute((__unused__)),
+ uint32_t now_pos,
+ bool is_encoder lzma_attribute((__unused__)),
+ uint8_t *buffer, size_t size)
+{
+ // Avoid using i + 8 <= size in the loop condition.
+ //
+ // NOTE: If there is a JAL in the last six bytes of the stream, it
+ // won't be converted. This is intentional to keep the code simpler.
+ if (size < 8)
+ return 0;
+
+ size -= 8;
+
+ size_t i;
+
+ // The loop is advanced by 2 bytes every iteration since the
+ // instruction stream may include 16-bit instructions (C extension).
+ for (i = 0; i <= size; i += 2) {
+ uint32_t inst = buffer[i];
+
+ if (inst == 0xEF) {
+ // JAL
+ const uint32_t b1 = buffer[i + 1];
+
+ // Only filter rd=x1(ra) and rd=x5(t0).
+ if ((b1 & 0x0D) != 0)
+ continue;
+
+ // The 20-bit immediate is in four pieces.
+ // The encoder stores it in big endian form
+ // since it improves compression slightly.
+ const uint32_t b2 = buffer[i + 2];
+ const uint32_t b3 = buffer[i + 3];
+ const uint32_t pc = now_pos + (uint32_t)i;
+
+// The following chart shows the highest three bytes of JAL, focusing on
+// the 20-bit immediate field [31:12]. The first row of numbers is the
+// bit position in a 32-bit little endian instruction. The second row of
+// numbers shows the order of the immediate field in a J-type instruction.
+// The last row is the bit number in each byte.
+//
+// To determine the amount to shift each bit, subtract the value in
+// the last row from the value in the second last row. If the number
+// is positive, shift left. If negative, shift right.
+//
+// For example, at the rightmost side of the chart, the bit 4 in b1 is
+// the bit 12 of the address. Thus that bit needs to be shifted left
+// by 12 - 4 = 8 bits to put it in the right place in the addr variable.
+//
+// NOTE: The immediate of a J-type instruction holds bits [20:1] of
+// the address. The bit [0] is always 0 and not part of the immediate.
+//
+// | b3 | b2 | b1 |
+// | 31 30 29 28 27 26 25 24 | 23 22 21 20 19 18 17 16 | 15 14 13 12 x x x x |
+// | 20 10 9 8 7 6 5 4 | 3 2 1 11 19 18 17 16 | 15 14 13 12 x x x x |
+// | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 x x x x |
+
+ uint32_t addr = ((b1 & 0xF0) << 8)
+ | ((b2 & 0x0F) << 16)
+ | ((b2 & 0x10) << 7)
+ | ((b2 & 0xE0) >> 4)
+ | ((b3 & 0x7F) << 4)
+ | ((b3 & 0x80) << 13);
+
+ addr += pc;
+
+ buffer[i + 1] = (uint8_t)((b1 & 0x0F)
+ | ((addr >> 13) & 0xF0));
+
+ buffer[i + 2] = (uint8_t)(addr >> 9);
+ buffer[i + 3] = (uint8_t)(addr >> 1);
+
+ // The "-2" is included because the for-loop will
+ // always increment by 2. In this case, we want to
+ // skip an extra 2 bytes since we used 4 bytes
+ // of input.
+ i += 4 - 2;
+
+ } else if ((inst & 0x7F) == 0x17) {
+ // AUIPC
+ inst |= (uint32_t)buffer[i + 1] << 8;
+ inst |= (uint32_t)buffer[i + 2] << 16;
+ inst |= (uint32_t)buffer[i + 3] << 24;
+
+ // Branch based on AUIPC's rd. The bitmask test does
+ // the same thing as this:
+ //
+ // const uint32_t auipc_rd = (inst >> 7) & 0x1F;
+ // if (auipc_rd != 0 && auipc_rd != 2) {
+ if (inst & 0xE80) {
+ // AUIPC's rd doesn't equal x0 or x2.
+
+ // Check if AUIPC+inst2 are a pair.
+ uint32_t inst2 = read32le(buffer + i + 4);
+
+ if (NOT_AUIPC_PAIR(inst, inst2)) {
+ // The NOT_AUIPC_PAIR macro allows
+ // a false AUIPC+AUIPC pair if the
+ // bits [19:15] (where rs1 would be)
+ // in the second AUIPC match the rd
+ // of the first AUIPC.
+ //
+ // We must skip enough forward so
+ // that the first two bytes of the
+ // second AUIPC cannot get converted.
+ // Such a conversion could make the
+ // current pair become a valid pair
+ // which would desync the decoder.
+ //
+ // Skipping six bytes is enough even
+ // though the above condition looks
+ // at the lowest four bits of the
+ // buffer[i + 6] too. This is safe
+ // because this filter never changes
+ // those bits if a conversion at
+ // that position is done.
+ i += 6 - 2;
+ continue;
+ }
+
+ // Convert AUIPC+inst2 to a special format:
+ //
+ // - The lowest 7 bits [6:0] retain the
+ // AUIPC opcode.
+ //
+ // - The rd [11:7] is set to x2(sp). x2 is
+ // used as the stack pointer so AUIPC with
+ // rd=x2 should be very rare in real-world
+ // executables.
+ //
+ // - The remaining 20 bits [31:12] (that
+ // normally hold the pc-relative immediate)
+ // are used to store the lowest 20 bits of
+ // inst2. That is, the 12-bit immediate of
+ // inst2 is not included.
+ //
+ // - The location of the original inst2 is
+ // used to store the 32-bit absolute
+ // address in big endian format. Compared
+ // to the 20+12-bit split encoding, this
+ // results in a longer uninterrupted
+ // sequence of identical common bytes
+ // when the same address is referred
+ // with different instruction pairs
+ // (like AUIPC+LD vs. AUIPC+ADDI) or
+ // when the occurrences of the same
+ // pair use different registers. When
+ // referring to adjacent memory locations
+ // (like function calls that go via the
+ // ELF PLT), in big endian order only the
+ // last 1-2 bytes differ; in little endian
+ // the differing 1-2 bytes would be in the
+ // middle of the 8-byte sequence.
+ //
+ // When reversing the transformation, the
+ // original rd of AUIPC can be restored
+ // from inst2's rs1 as they are required to
+ // be the same.
+
+ // Arithmetic right shift makes sign extension
+ // trivial but (1) it's implementation-defined
+ // behavior (C99/C11/C23 6.5.7-p5) and so is
+ // (2) casting unsigned to signed (6.3.1.3-p3).
+ //
+ // One can check for (1) with
+ //
+ // if ((-1 >> 1) == -1) ...
+ //
+ // but (2) has to be checked from the
+ // compiler docs. GCC promises that (1)
+ // and (2) behave in the common expected
+ // way and thus
+ //
+ // addr += (uint32_t)(
+ // (int32_t)inst2 >> 20);
+ //
+ // does the same as the code below. But since
+ // the 100 % portable way is only a few bytes
+ // bigger code and there is no real speed
+ // difference, let's just use that, especially
+ // since the decoder doesn't need this at all.
+ uint32_t addr = inst & 0xFFFFF000;
+ addr += (inst2 >> 20)
+ - ((inst2 >> 19) & 0x1000);
+
+ addr += now_pos + (uint32_t)i;
+
+ // Construct the first 32 bits:
+ // [6:0] AUIPC opcode
+ // [11:7] Special AUIPC rd = x2
+ // [31:12] The lowest 20 bits of inst2
+ inst = 0x17 | (2 << 7) | (inst2 << 12);
+
+ write32le(buffer + i, inst);
+
+ // The second 32 bits store the absolute
+ // address in big endian order.
+ write32be(buffer + i + 4, addr);
+ } else {
+ // AUIPC's rd equals x0 or x2.
+ //
+ // x0 indicates a landing pad (LPAD).
+ // It's always skipped.
+ //
+ // AUIPC with rd == x2 is used for the special
+ // format as explained above. When the input
+ // contains a byte sequence that matches the
+ // special format, "fake" decoding must be
+ // done to keep the filter bijective (that
+ // is, safe to apply on arbitrary data).
+ //
+ // See the "x0 or x2" section in riscv_decode()
+ // for how the "real" decoding is done. The
+ // "fake" decoding is a simplified version
+ // of "real" decoding with the following
+ // differences (these reduce code size of
+ // the decoder):
+ // (1) The lowest 12 bits aren't sign-extended.
+ // (2) No address conversion is done.
+ // (3) Big endian format isn't used (the fake
+ // address is in little endian order).
+
+ // Check if inst matches the special format.
+ const uint32_t fake_rs1 = inst >> 27;
+
+ if (NOT_SPECIAL_AUIPC(inst, fake_rs1)) {
+ i += 4 - 2;
+ continue;
+ }
+
+ const uint32_t fake_addr =
+ read32le(buffer + i + 4);
+
+ // Construct the second 32 bits:
+ // [19:0] Upper 20 bits from AUIPC
+ // [31:20] The lowest 12 bits of fake_addr
+ const uint32_t fake_inst2 = (inst >> 12)
+ | (fake_addr << 20);
+
+ // Construct new first 32 bits from:
+ // [6:0] AUIPC opcode
+ // [11:7] Fake AUIPC rd = fake_rs1
+ // [31:12] The highest 20 bits of fake_addr
+ inst = 0x17 | (fake_rs1 << 7)
+ | (fake_addr & 0xFFFFF000);
+
+ write32le(buffer + i, inst);
+ write32le(buffer + i + 4, fake_inst2);
+ }
+
+ i += 8 - 2;
+ }
+ }
+
+ return i;
+}
+
+
+extern lzma_ret
+lzma_simple_riscv_encoder_init(lzma_next_coder *next,
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters)
+{
+ return lzma_simple_coder_init(next, allocator, filters,
+ &riscv_encode, 0, 8, 2, true);
+}
+#endif
+
+
+#ifdef HAVE_DECODER_RISCV
+static size_t
+riscv_decode(void *simple lzma_attribute((__unused__)),
+ uint32_t now_pos,
+ bool is_encoder lzma_attribute((__unused__)),
+ uint8_t *buffer, size_t size)
+{
+ if (size < 8)
+ return 0;
+
+ size -= 8;
+
+ size_t i;
+ for (i = 0; i <= size; i += 2) {
+ uint32_t inst = buffer[i];
+
+ if (inst == 0xEF) {
+ // JAL
+ const uint32_t b1 = buffer[i + 1];
+
+ // Only filter rd=x1(ra) and rd=x5(t0).
+ if ((b1 & 0x0D) != 0)
+ continue;
+
+ const uint32_t b2 = buffer[i + 2];
+ const uint32_t b3 = buffer[i + 3];
+ const uint32_t pc = now_pos + (uint32_t)i;
+
+// | b3 | b2 | b1 |
+// | 31 30 29 28 27 26 25 24 | 23 22 21 20 19 18 17 16 | 15 14 13 12 x x x x |
+// | 20 10 9 8 7 6 5 4 | 3 2 1 11 19 18 17 16 | 15 14 13 12 x x x x |
+// | 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 | 7 6 5 4 x x x x |
+
+ uint32_t addr = ((b1 & 0xF0) << 13)
+ | (b2 << 9) | (b3 << 1);
+
+ addr -= pc;
+
+ buffer[i + 1] = (uint8_t)((b1 & 0x0F)
+ | ((addr >> 8) & 0xF0));
+
+ buffer[i + 2] = (uint8_t)(((addr >> 16) & 0x0F)
+ | ((addr >> 7) & 0x10)
+ | ((addr << 4) & 0xE0));
+
+ buffer[i + 3] = (uint8_t)(((addr >> 4) & 0x7F)
+ | ((addr >> 13) & 0x80));
+
+ i += 4 - 2;
+
+ } else if ((inst & 0x7F) == 0x17) {
+ // AUIPC
+ uint32_t inst2;
+
+ inst |= (uint32_t)buffer[i + 1] << 8;
+ inst |= (uint32_t)buffer[i + 2] << 16;
+ inst |= (uint32_t)buffer[i + 3] << 24;
+
+ if (inst & 0xE80) {
+ // AUIPC's rd doesn't equal x0 or x2.
+
+ // Check if it is a "fake" AUIPC+inst2 pair.
+ inst2 = read32le(buffer + i + 4);
+
+ if (NOT_AUIPC_PAIR(inst, inst2)) {
+ i += 6 - 2;
+ continue;
+ }
+
+ // Decode (or more like re-encode) the "fake"
+ // pair. The "fake" format doesn't do
+ // sign-extension, address conversion, or
+ // use big endian. (The use of little endian
+ // allows sharing the write32le() calls in
+ // the decoder to reduce code size when
+ // unaligned access isn't supported.)
+ uint32_t addr = inst & 0xFFFFF000;
+ addr += inst2 >> 20;
+
+ inst = 0x17 | (2 << 7) | (inst2 << 12);
+ inst2 = addr;
+ } else {
+ // AUIPC's rd equals x0 or x2.
+
+ // Check if inst matches the special format
+ // used by the encoder.
+ const uint32_t inst2_rs1 = inst >> 27;
+
+ if (NOT_SPECIAL_AUIPC(inst, inst2_rs1)) {
+ i += 4 - 2;
+ continue;
+ }
+
+ // Decode the "real" pair.
+ uint32_t addr = read32be(buffer + i + 4);
+
+ addr -= now_pos + (uint32_t)i;
+
+ // The second instruction:
+ // - Get the lowest 20 bits from inst.
+ // - Add the lowest 12 bits of the address
+ // as the immediate field.
+ inst2 = (inst >> 12) | (addr << 20);
+
+ // AUIPC:
+ // - rd is the same as inst2_rs1.
+ // - The sign extension of the lowest 12 bits
+ // must be taken into account.
+ inst = 0x17 | (inst2_rs1 << 7)
+ | ((addr + 0x800) & 0xFFFFF000);
+ }
+
+ // Both decoder branches write in little endian order.
+ write32le(buffer + i, inst);
+ write32le(buffer + i + 4, inst2);
+
+ i += 8 - 2;
+ }
+ }
+
+ return i;
+}
+
+
+extern lzma_ret
+lzma_simple_riscv_decoder_init(lzma_next_coder *next,
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters)
+{
+ return lzma_simple_coder_init(next, allocator, filters,
+ &riscv_decode, 0, 8, 2, false);
+}
+#endif
diff --git a/contrib/xz/src/liblzma/simple/simple_coder.c b/contrib/xz/src/liblzma/simple/simple_coder.c
index ed2d7fb02cca..5cbfa8227047 100644
--- a/contrib/xz/src/liblzma/simple/simple_coder.c
+++ b/contrib/xz/src/liblzma/simple/simple_coder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_coder.c
@@ -8,9 +10,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/simple_coder.h b/contrib/xz/src/liblzma/simple/simple_coder.h
index 668a5092ad5e..2b762d50071d 100644
--- a/contrib/xz/src/liblzma/simple/simple_coder.h
+++ b/contrib/xz/src/liblzma/simple/simple_coder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_coder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SIMPLE_CODER_H
@@ -62,12 +61,12 @@ extern lzma_ret lzma_simple_armthumb_decoder_init(lzma_next_coder *next,
extern lzma_ret lzma_simple_arm64_encoder_init(lzma_next_coder *next,
- const lzma_allocator *allocator,
- const lzma_filter_info *filters);
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters);
extern lzma_ret lzma_simple_arm64_decoder_init(lzma_next_coder *next,
- const lzma_allocator *allocator,
- const lzma_filter_info *filters);
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters);
extern lzma_ret lzma_simple_sparc_encoder_init(lzma_next_coder *next,
@@ -78,4 +77,13 @@ extern lzma_ret lzma_simple_sparc_decoder_init(lzma_next_coder *next,
const lzma_allocator *allocator,
const lzma_filter_info *filters);
+
+extern lzma_ret lzma_simple_riscv_encoder_init(lzma_next_coder *next,
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters);
+
+extern lzma_ret lzma_simple_riscv_decoder_init(lzma_next_coder *next,
+ const lzma_allocator *allocator,
+ const lzma_filter_info *filters);
+
#endif
diff --git a/contrib/xz/src/liblzma/simple/simple_decoder.c b/contrib/xz/src/liblzma/simple/simple_decoder.c
index dc4d24151101..d9820ee8ed23 100644
--- a/contrib/xz/src/liblzma/simple/simple_decoder.c
+++ b/contrib/xz/src/liblzma/simple/simple_decoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_decoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_decoder.h"
diff --git a/contrib/xz/src/liblzma/simple/simple_decoder.h b/contrib/xz/src/liblzma/simple/simple_decoder.h
index bed8d37a9653..2ae87bb86328 100644
--- a/contrib/xz/src/liblzma/simple/simple_decoder.h
+++ b/contrib/xz/src/liblzma/simple/simple_decoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_decoder.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SIMPLE_DECODER_H
diff --git a/contrib/xz/src/liblzma/simple/simple_encoder.c b/contrib/xz/src/liblzma/simple/simple_encoder.c
index d2cc03e58b81..d1f35096e2ae 100644
--- a/contrib/xz/src/liblzma/simple/simple_encoder.c
+++ b/contrib/xz/src/liblzma/simple/simple_encoder.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_encoder.h"
diff --git a/contrib/xz/src/liblzma/simple/simple_encoder.h b/contrib/xz/src/liblzma/simple/simple_encoder.h
index 1cee4823a4ed..bf5edbb1c3f4 100644
--- a/contrib/xz/src/liblzma/simple/simple_encoder.h
+++ b/contrib/xz/src/liblzma/simple/simple_encoder.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_encoder.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SIMPLE_ENCODER_H
diff --git a/contrib/xz/src/liblzma/simple/simple_private.h b/contrib/xz/src/liblzma/simple/simple_private.h
index 9d2c0fdd7618..7aa360ff49e8 100644
--- a/contrib/xz/src/liblzma/simple/simple_private.h
+++ b/contrib/xz/src/liblzma/simple/simple_private.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file simple_private.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_SIMPLE_PRIVATE_H
diff --git a/contrib/xz/src/liblzma/simple/sparc.c b/contrib/xz/src/liblzma/simple/sparc.c
index bad8492ebc06..e8ad285a1927 100644
--- a/contrib/xz/src/liblzma/simple/sparc.c
+++ b/contrib/xz/src/liblzma/simple/sparc.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file sparc.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
diff --git a/contrib/xz/src/liblzma/simple/x86.c b/contrib/xz/src/liblzma/simple/x86.c
index 232b29542e66..f216231f2d12 100644
--- a/contrib/xz/src/liblzma/simple/x86.c
+++ b/contrib/xz/src/liblzma/simple/x86.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file x86.c
@@ -6,9 +8,6 @@
// Authors: Igor Pavlov
// Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "simple_private.h"
@@ -27,11 +26,7 @@ static size_t
x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
uint8_t *buffer, size_t size)
{
- static const bool MASK_TO_ALLOWED_STATUS[8]
- = { true, true, true, false, true, false, false, false };
-
- static const uint32_t MASK_TO_BIT_NUMBER[8]
- = { 0, 1, 2, 2, 3, 3, 3, 3 };
+ static const uint32_t MASK_TO_BIT_NUMBER[5] = { 0, 1, 2, 2, 3 };
lzma_simple_x86 *simple = simple_ptr;
uint32_t prev_mask = simple->prev_mask;
@@ -68,9 +63,8 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
b = buffer[buffer_pos + 4];
- if (Test86MSByte(b)
- && MASK_TO_ALLOWED_STATUS[(prev_mask >> 1) & 0x7]
- && (prev_mask >> 1) < 0x10) {
+ if (Test86MSByte(b) && (prev_mask >> 1) <= 4
+ && (prev_mask >> 1) != 3) {
uint32_t src = ((uint32_t)(b) << 24)
| ((uint32_t)(buffer[buffer_pos + 3]) << 16)
diff --git a/contrib/xz/src/liblzma/validate_map.sh b/contrib/xz/src/liblzma/validate_map.sh
index 2bf6f8b98cbb..dd1589d236e7 100644
--- a/contrib/xz/src/liblzma/validate_map.sh
+++ b/contrib/xz/src/liblzma/validate_map.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: 0BSD
###############################################################################
#
@@ -78,9 +79,6 @@
#
# Author: Lasse Collin
#
-# This file has been put into the public domain.
-# You can do whatever you want with this file.
-#
###############################################################################
LC_ALL=C
@@ -124,7 +122,7 @@ DUPS=$(sort liblzma_generic.map | sed '/^$/d;/^global:$/d' | uniq -d)
# ignored (@XZ_5.1.2alpha or @XZ_5.2.2 won't be added at all when
# the #define HAVE_SYMBOL_VERSIONS_LINUX isn't used).
IN_SYNC=
-if ! sed '109,123d' liblzma_linux.map \
+if ! sed '111,125d' liblzma_linux.map \
| cmp -s - liblzma_generic.map; then
IN_SYNC=no
fi
diff --git a/contrib/xz/src/lzmainfo/lzmainfo.1 b/contrib/xz/src/lzmainfo/lzmainfo.1
index ce38eee50324..114e0f30ca6e 100644
--- a/contrib/xz/src/lzmainfo/lzmainfo.1
+++ b/contrib/xz/src/lzmainfo/lzmainfo.1
@@ -1,9 +1,7 @@
+.\" SPDX-License-Identifier: 0BSD
.\"
.\" Author: Lasse Collin
.\"
-.\" This file has been put into the public domain.
-.\" You can do whatever you want with this file.
-.\"
.TH LZMAINFO 1 "2013-06-30" "Tukaani" "XZ Utils"
.SH NAME
lzmainfo \- show information stored in the .lzma file header
diff --git a/contrib/xz/src/lzmainfo/lzmainfo.c b/contrib/xz/src/lzmainfo/lzmainfo.c
index 71e62958ad67..2550b1f1127b 100644
--- a/contrib/xz/src/lzmainfo/lzmainfo.c
+++ b/contrib/xz/src/lzmainfo/lzmainfo.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file lzmainfo.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
diff --git a/contrib/xz/src/xz/args.c b/contrib/xz/src/xz/args.c
index 17e778c5db79..eba1b97dc464 100644
--- a/contrib/xz/src/xz/args.c
+++ b/contrib/xz/src/xz/args.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file args.c
@@ -5,10 +7,8 @@
///
/// \note Filter-specific options parsing is in options.c.
//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
@@ -83,14 +83,20 @@ parse_block_list(const char *str_const)
++count;
// Prevent an unlikely integer overflow.
- if (count > SIZE_MAX / sizeof(uint64_t) - 1)
+ if (count > SIZE_MAX / sizeof(block_list_entry) - 1)
message_fatal(_("%s: Too many arguments to --block-list"),
str);
// Allocate memory to hold all the sizes specified.
// If --block-list was specified already, its value is forgotten.
free(opt_block_list);
- opt_block_list = xmalloc((count + 1) * sizeof(uint64_t));
+ opt_block_list = xmalloc((count + 1) * sizeof(block_list_entry));
+
+ // Clear the bitmask of filter chains in use.
+ block_list_chain_mask = 0;
+
+ // Reset the largest Block size found in --block-list.
+ block_list_largest = 0;
for (size_t i = 0; i < count; ++i) {
// Locate the next comma and replace it with \0.
@@ -98,6 +104,43 @@ parse_block_list(const char *str_const)
if (p != NULL)
*p = '\0';
+ // Use the default filter chain unless overridden.
+ opt_block_list[i].chain_num = 0;
+
+ // To specify a filter chain, the block list entry may be
+ // prepended with "[filter-chain-number]:". The size is
+ // still required for every block.
+ // For instance:
+ // --block-list=2:10MiB,1:5MiB,,8MiB,0:0
+ //
+ // Translates to:
+ // 1. Block of 10 MiB using filter chain 2
+ // 2. Block of 5 MiB using filter chain 1
+ // 3. Block of 5 MiB using filter chain 1
+ // 4. Block of 8 MiB using the default filter chain
+ // 5. The last block uses the default filter chain
+ //
+ // The block list:
+ // --block-list=2:MiB,1:,0
+ //
+ // Is not allowed because the second block does not specify
+ // the block size, only the filter chain.
+ if (str[0] >= '0' && str[0] <= '9' && str[1] == ':') {
+ if (str[2] == '\0')
+ message_fatal(_("In --block-list, block "
+ "size is missing after "
+ "filter chain number '%c:'"),
+ str[0]);
+
+ const unsigned chain_num = (unsigned)(str[0] - '0');
+ opt_block_list[i].chain_num = chain_num;
+ block_list_chain_mask |= 1U << chain_num;
+ str += 2;
+ } else {
+ // This Block uses the default filter chain.
+ block_list_chain_mask |= 1U << 0;
+ }
+
if (str[0] == '\0') {
// There is no string, that is, a comma follows
// another comma. Use the previous value.
@@ -107,25 +150,39 @@ parse_block_list(const char *str_const)
assert(i > 0);
opt_block_list[i] = opt_block_list[i - 1];
} else {
- opt_block_list[i] = str_to_uint64("block-list", str,
- 0, UINT64_MAX);
+ opt_block_list[i].size = str_to_uint64("block-list",
+ str, 0, UINT64_MAX);
// Zero indicates no more new Blocks.
- if (opt_block_list[i] == 0) {
+ if (opt_block_list[i].size == 0) {
if (i + 1 != count)
message_fatal(_("0 can only be used "
"as the last element "
"in --block-list"));
- opt_block_list[i] = UINT64_MAX;
+ opt_block_list[i].size = UINT64_MAX;
}
+
+ // Remember the largest Block size in the list.
+ //
+ // NOTE: Do this after handling the special value 0
+ // because when 0 is used, we don't want to reduce
+ // the Block size of the multithreaded encoder.
+ if (block_list_largest < opt_block_list[i].size)
+ block_list_largest = opt_block_list[i].size;
}
- str = p + 1;
+ // Be standards compliant: p + 1 is undefined behavior
+ // if p == NULL. That occurs on the last iteration of
+ // the loop when we won't care about the value of str
+ // anymore anyway. That is, this is done conditionally
+ // solely for standard conformance reasons.
+ if (p != NULL)
+ str = p + 1;
}
// Terminate the array.
- opt_block_list[count] = 0;
+ opt_block_list[count].size = 0;
free(str_start);
return;
@@ -136,13 +193,26 @@ static void
parse_real(args_info *args, int argc, char **argv)
{
enum {
- OPT_X86 = INT_MIN,
+ OPT_FILTERS = INT_MIN,
+ OPT_FILTERS1,
+ OPT_FILTERS2,
+ OPT_FILTERS3,
+ OPT_FILTERS4,
+ OPT_FILTERS5,
+ OPT_FILTERS6,
+ OPT_FILTERS7,
+ OPT_FILTERS8,
+ OPT_FILTERS9,
+ OPT_FILTERS_HELP,
+
+ OPT_X86,
OPT_POWERPC,
OPT_IA64,
OPT_ARM,
OPT_ARMTHUMB,
OPT_ARM64,
OPT_SPARC,
+ OPT_RISCV,
OPT_DELTA,
OPT_LZMA1,
OPT_LZMA2,
@@ -191,7 +261,7 @@ parse_real(args_info *args, int argc, char **argv)
{ "check", required_argument, NULL, 'C' },
{ "ignore-check", no_argument, NULL, OPT_IGNORE_CHECK },
{ "block-size", required_argument, NULL, OPT_BLOCK_SIZE },
- { "block-list", required_argument, NULL, OPT_BLOCK_LIST },
+ { "block-list", required_argument, NULL, OPT_BLOCK_LIST },
{ "memlimit-compress", required_argument, NULL, OPT_MEM_COMPRESS },
{ "memlimit-decompress", required_argument, NULL, OPT_MEM_DECOMPRESS },
{ "memlimit-mt-decompress", required_argument, NULL, OPT_MEM_MT_DECOMPRESS },
@@ -206,6 +276,18 @@ parse_real(args_info *args, int argc, char **argv)
{ "best", no_argument, NULL, '9' },
// Filters
+ { "filters", optional_argument, NULL, OPT_FILTERS},
+ { "filters1", optional_argument, NULL, OPT_FILTERS1},
+ { "filters2", optional_argument, NULL, OPT_FILTERS2},
+ { "filters3", optional_argument, NULL, OPT_FILTERS3},
+ { "filters4", optional_argument, NULL, OPT_FILTERS4},
+ { "filters5", optional_argument, NULL, OPT_FILTERS5},
+ { "filters6", optional_argument, NULL, OPT_FILTERS6},
+ { "filters7", optional_argument, NULL, OPT_FILTERS7},
+ { "filters8", optional_argument, NULL, OPT_FILTERS8},
+ { "filters9", optional_argument, NULL, OPT_FILTERS9},
+ { "filters-help", optional_argument, NULL, OPT_FILTERS_HELP},
+
{ "lzma1", optional_argument, NULL, OPT_LZMA1 },
{ "lzma2", optional_argument, NULL, OPT_LZMA2 },
{ "x86", optional_argument, NULL, OPT_X86 },
@@ -215,6 +297,7 @@ parse_real(args_info *args, int argc, char **argv)
{ "armthumb", optional_argument, NULL, OPT_ARMTHUMB },
{ "arm64", optional_argument, NULL, OPT_ARM64 },
{ "sparc", optional_argument, NULL, OPT_SPARC },
+ { "riscv", optional_argument, NULL, OPT_RISCV },
{ "delta", optional_argument, NULL, OPT_DELTA },
// Other options
@@ -372,7 +455,30 @@ parse_real(args_info *args, int argc, char **argv)
opt_mode = MODE_COMPRESS;
break;
- // Filter setup
+ // --filters
+ case OPT_FILTERS:
+ coder_add_filters_from_str(optarg);
+ break;
+
+ // --filters1...--filters9
+ case OPT_FILTERS1:
+ case OPT_FILTERS2:
+ case OPT_FILTERS3:
+ case OPT_FILTERS4:
+ case OPT_FILTERS5:
+ case OPT_FILTERS6:
+ case OPT_FILTERS7:
+ case OPT_FILTERS8:
+ case OPT_FILTERS9:
+ coder_add_block_filters(optarg,
+ (size_t)(c - OPT_FILTERS));
+ break;
+
+ // --filters-help
+ case OPT_FILTERS_HELP:
+ // This doesn't return.
+ message_filters_help();
+ break;
case OPT_X86:
coder_add_filter(LZMA_FILTER_X86,
@@ -409,6 +515,11 @@ parse_real(args_info *args, int argc, char **argv)
options_bcj(optarg));
break;
+ case OPT_RISCV:
+ coder_add_filter(LZMA_FILTER_RISCV,
+ options_bcj(optarg));
+ break;
+
case OPT_DELTA:
coder_add_filter(LZMA_FILTER_DELTA,
options_delta(optarg));
@@ -516,8 +627,8 @@ parse_real(args_info *args, int argc, char **argv)
case OPT_FILES0:
if (args->files_name != NULL)
message_fatal(_("Only one file can be "
- "specified with `--files' "
- "or `--files0'."));
+ "specified with '--files' "
+ "or '--files0'."));
if (optarg == NULL) {
args->files_name = stdin_filename;
@@ -718,6 +829,39 @@ args_parse(args_info *args, int argc, char **argv)
if (opt_mode == MODE_COMPRESS && opt_format == FORMAT_AUTO)
opt_format = FORMAT_XZ;
+ // Set opt_block_list to NULL if we are not compressing to the .xz
+ // format. This option cannot be used outside of this case, and
+ // simplifies the implementation later.
+ if ((opt_mode != MODE_COMPRESS || opt_format != FORMAT_XZ)
+ && opt_block_list != NULL) {
+ message(V_WARNING, _("--block-list is ignored unless "
+ "compressing to the .xz format"));
+ free(opt_block_list);
+ opt_block_list = NULL;
+ }
+
+ // If raw format is used and a custom suffix is not provided,
+ // then only stdout mode can be used when compressing or
+ // decompressing.
+ if (opt_format == FORMAT_RAW && !suffix_is_set() && !opt_stdout
+ && (opt_mode == MODE_COMPRESS
+ || opt_mode == MODE_DECOMPRESS)) {
+ if (args->files_name != NULL)
+ message_fatal(_("With --format=raw, "
+ "--suffix=.SUF is required "
+ "unless writing to stdout"));
+
+ // If all of the filenames provided are "-" (more than one
+ // "-" could be specified) or no filenames are provided,
+ // then we are only going to be writing to standard out.
+ for (int i = optind; i < argc; i++) {
+ if (strcmp(argv[i], "-") != 0)
+ message_fatal(_("With --format=raw, "
+ "--suffix=.SUF is required "
+ "unless writing to stdout"));
+ }
+ }
+
// Compression settings need to be validated (options themselves and
// their memory usage) when compressing to any file format. It has to
// be done also when uncompressing raw data, since for raw decoding
@@ -727,14 +871,6 @@ args_parse(args_info *args, int argc, char **argv)
&& opt_mode != MODE_LIST))
coder_set_compression_settings();
- // If raw format is used and a custom suffix is not provided,
- // then only stdout mode can be used when compressing or decompressing.
- if (opt_format == FORMAT_RAW && !suffix_is_set() && !opt_stdout
- && (opt_mode == MODE_COMPRESS
- || opt_mode == MODE_DECOMPRESS))
- message_fatal(_("With --format=raw, --suffix=.SUF is "
- "required unless writing to stdout"));
-
// If no filenames are given, use stdin.
if (argv[optind] == NULL && args->files_name == NULL) {
// We don't modify or free() the "-" constant. The caller
diff --git a/contrib/xz/src/xz/args.h b/contrib/xz/src/xz/args.h
index a1a5930ae5b1..e693ecd62280 100644
--- a/contrib/xz/src/xz/args.h
+++ b/contrib/xz/src/xz/args.h
@@ -1,12 +1,12 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file args.h
/// \brief Argument parsing
//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
diff --git a/contrib/xz/src/xz/coder.c b/contrib/xz/src/xz/coder.c
index 91d40ed2bb7b..5e41f0df6802 100644
--- a/contrib/xz/src/xz/coder.c
+++ b/contrib/xz/src/xz/coder.c
@@ -1,16 +1,17 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file coder.c
/// \brief Compresses or uncompresses a file
//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
+#include "tuklib_integer.h"
/// Return value type for coder_init().
@@ -26,25 +27,47 @@ enum format_type opt_format = FORMAT_AUTO;
bool opt_auto_adjust = true;
bool opt_single_stream = false;
uint64_t opt_block_size = 0;
-uint64_t *opt_block_list = NULL;
-
+block_list_entry *opt_block_list = NULL;
+uint64_t block_list_largest;
+uint32_t block_list_chain_mask;
/// Stream used to communicate with liblzma
static lzma_stream strm = LZMA_STREAM_INIT;
-/// Filters needed for all encoding all formats, and also decoding in raw data
-static lzma_filter filters[LZMA_FILTERS_MAX + 1];
+/// Maximum number of filter chains. The first filter chain is the default,
+/// and 9 other filter chains can be specified with --filtersX.
+#define NUM_FILTER_CHAIN_MAX 10
+
+/// The default filter chain is in chains[0]. It is used for encoding
+/// in all supported formats and also for decdoing raw streams. The other
+/// filter chains are set by --filtersX to support changing filters with
+/// the --block-list option.
+static lzma_filter chains[NUM_FILTER_CHAIN_MAX][LZMA_FILTERS_MAX + 1];
+
+/// Bitmask indicating which filter chains are actually used when encoding
+/// in the .xz format. This is needed since the filter chains specified using
+/// --filtersX (or the default filter chain) might in reality be unneeded
+/// if they are never used in --block-list. When --block-list isn't
+/// specified, only the default filter chain is used, thus the initial
+/// value of this variable is 1U << 0 (the number of the default chain is 0).
+static uint32_t chains_used_mask = 1U << 0;
/// Input and output buffers
static io_buf in_buf;
static io_buf out_buf;
-/// Number of filters. Zero indicates that we are using a preset.
+/// Number of filters in the default filter chain. Zero indicates that
+/// we are using a preset.
static uint32_t filters_count = 0;
/// Number of the preset (0-9)
static uint32_t preset_number = LZMA_PRESET_DEFAULT;
+/// True if the current default filter chain was set using the --filters
+/// option. The filter chain is reset if a preset option (like -9) or an
+/// old-style filter option (like --lzma2) is used after a --filters option.
+static bool string_to_filter_used = false;
+
/// Integrity check type
static lzma_check check;
@@ -60,7 +83,6 @@ static bool allow_trailing_input;
static lzma_mt mt_options = {
.flags = 0,
.timeout = 300,
- .filters = filters,
};
#endif
@@ -77,14 +99,14 @@ coder_set_check(lzma_check new_check)
static void
forget_filter_chain(void)
{
- // Setting a preset makes us forget a possibly defined custom
- // filter chain.
- while (filters_count > 0) {
- --filters_count;
- free(filters[filters_count].options);
- filters[filters_count].options = NULL;
+ // Setting a preset or using --filters makes us forget
+ // the earlier custom filter chain (if any).
+ if (filters_count > 0) {
+ lzma_filters_free(chains[0], NULL);
+ filters_count = 0;
}
+ string_to_filter_used = false;
return;
}
@@ -114,9 +136,15 @@ coder_add_filter(lzma_vli id, void *options)
if (filters_count == LZMA_FILTERS_MAX)
message_fatal(_("Maximum number of filters is four"));
- filters[filters_count].id = id;
- filters[filters_count].options = options;
- ++filters_count;
+ if (string_to_filter_used)
+ forget_filter_chain();
+
+ chains[0][filters_count].id = id;
+ chains[0][filters_count].options = options;
+
+ // Terminate the filter chain with LZMA_VLI_UNKNOWN to simplify
+ // implementation of forget_filter_chain().
+ chains[0][++filters_count].id = LZMA_VLI_UNKNOWN;
// Setting a custom filter chain makes us forget the preset options.
// This makes a difference if one specifies e.g. "xz -9 --lzma2 -e"
@@ -128,6 +156,69 @@ coder_add_filter(lzma_vli id, void *options)
}
+static void
+str_to_filters(const char *str, uint32_t index, uint32_t flags)
+{
+ int error_pos;
+ const char *err = lzma_str_to_filters(str, &error_pos,
+ chains[index], flags, NULL);
+
+ if (err != NULL) {
+ char filter_num[2] = "";
+ if (index > 0)
+ filter_num[0] = '0' + index;
+
+ // FIXME? The message in err isn't translated.
+ // Including the translations in the xz translations is
+ // slightly ugly but possible. Creating a new domain for
+ // liblzma might not be worth it especially since on some
+ // OSes it adds extra dependencies to translation libraries.
+ message(V_ERROR, _("Error in --filters%s=FILTERS option:"),
+ filter_num);
+ message(V_ERROR, "%s", str);
+ message(V_ERROR, "%*s^", error_pos, "");
+ message_fatal("%s", err);
+ }
+}
+
+
+extern void
+coder_add_filters_from_str(const char *filter_str)
+{
+ // Forget presets and previously defined filter chain. See
+ // coder_add_filter() above for why preset_number must be reset too.
+ forget_filter_chain();
+ preset_number = LZMA_PRESET_DEFAULT;
+
+ string_to_filter_used = true;
+
+ // Include LZMA_STR_ALL_FILTERS so this can be used with --format=raw.
+ str_to_filters(filter_str, 0, LZMA_STR_ALL_FILTERS);
+
+ // Set the filters_count to be the number of filters converted from
+ // the string.
+ for (filters_count = 0; chains[0][filters_count].id
+ != LZMA_VLI_UNKNOWN;
+ ++filters_count) ;
+
+ assert(filters_count > 0);
+ return;
+}
+
+
+extern void
+coder_add_block_filters(const char *str, size_t slot)
+{
+ // Free old filters first, if they were previously allocated.
+ if (chains_used_mask & (1U << slot))
+ lzma_filters_free(chains[slot], NULL);
+
+ str_to_filters(str, slot, 0);
+
+ chains_used_mask |= 1U << slot;
+}
+
+
tuklib_attr_noreturn
static void
memlimit_too_small(uint64_t memory_usage)
@@ -139,6 +230,67 @@ memlimit_too_small(uint64_t memory_usage)
}
+#ifdef HAVE_ENCODERS
+/// \brief Calculate the memory usage of each filter chain.
+///
+/// \param chains_memusages If non-NULL, the memusage of the encoder
+/// or decoder for each chain is stored in
+/// this array.
+/// \param mt If non-NULL, calculate memory usage of
+/// multithreaded encoder.
+/// \param encode Whether to calculate encoder or decoder
+/// memory usage. This must be true if
+/// mt != NULL.
+///
+/// \return Return the highest memory usage of all of the filter chains.
+static uint64_t
+get_chains_memusage(uint64_t *chains_memusages, const lzma_mt *mt, bool encode)
+{
+ uint64_t max_memusage = 0;
+
+#ifdef MYTHREAD_ENABLED
+ // Copy multithreading options to a temporary struct since the
+ // "filters" member needs to be changed.
+ lzma_mt mt_local;
+ if (mt != NULL)
+ mt_local = *mt;
+#else
+ (void)mt;
+#endif
+
+ for (uint32_t i = 0; i < ARRAY_SIZE(chains); i++) {
+ if (!(chains_used_mask & (1U << i)))
+ continue;
+
+ uint64_t memusage = UINT64_MAX;
+#ifdef MYTHREAD_ENABLED
+ if (mt != NULL) {
+ assert(encode);
+ mt_local.filters = chains[i];
+ memusage = lzma_stream_encoder_mt_memusage(&mt_local);
+ } else
+#endif
+ if (encode) {
+ memusage = lzma_raw_encoder_memusage(chains[i]);
+ }
+#ifdef HAVE_DECODERS
+ else {
+ memusage = lzma_raw_decoder_memusage(chains[i]);
+ }
+#endif
+
+ if (chains_memusages != NULL)
+ chains_memusages[i] = memusage;
+
+ if (memusage > max_memusage)
+ max_memusage = memusage;
+ }
+
+ return max_memusage;
+}
+#endif
+
+
extern void
coder_set_compression_settings(void)
{
@@ -156,10 +308,56 @@ coder_set_compression_settings(void)
check = LZMA_CHECK_CRC32;
}
+#ifdef HAVE_ENCODERS
+ if (opt_block_list != NULL) {
+ // args.c ensures these.
+ assert(opt_mode == MODE_COMPRESS);
+ assert(opt_format == FORMAT_XZ);
+
+ // Find out if block_list_chain_mask has a bit set that
+ // isn't set in chains_used_mask.
+ const uint32_t missing_chains_mask
+ = (block_list_chain_mask ^ chains_used_mask)
+ & block_list_chain_mask;
+
+ // If a filter chain was specified in --block-list but no
+ // matching --filtersX option was used, exit with an error.
+ if (missing_chains_mask != 0) {
+ // Get the number of the first missing filter chain
+ // and show it in the error message.
+ const unsigned first_missing
+ = (unsigned)ctz32(missing_chains_mask);
+
+ message_fatal(_("filter chain %u used by "
+ "--block-list but not specified "
+ "with --filters%u="),
+ first_missing, first_missing);
+ }
+
+ // Omit the unused filter chains from mask of used chains.
+ //
+ // (FIXME? When built with debugging, coder_free() will free()
+ // the filter chains (except the default chain) which makes
+ // Valgrind show fewer reachable allocations. But coder_free()
+ // uses this mask to determine which chains to free. Thus it
+ // won't free the ones that are cleared here from the mask.
+ // In practice this doesn't matter.)
+ chains_used_mask &= block_list_chain_mask;
+ } else {
+ // Reset filters used mask in case --block-list is not
+ // used, but --filtersX is used.
+ chains_used_mask = 1U << 0;
+ }
+#endif
+
// Options for LZMA1 or LZMA2 in case we are using a preset.
static lzma_options_lzma opt_lzma;
- if (filters_count == 0) {
+ // The first filter in the chains[] array is for the default
+ // filter chain.
+ lzma_filter *default_filters = chains[0];
+
+ if (filters_count == 0 && chains_used_mask & 1) {
// We are using a preset. This is not a good idea in raw mode
// except when playing around with things. Different versions
// of this software may use different options in presets, and
@@ -179,46 +377,61 @@ coder_set_compression_settings(void)
message_bug();
// Use LZMA2 except with --format=lzma we use LZMA1.
- filters[0].id = opt_format == FORMAT_LZMA
+ default_filters[0].id = opt_format == FORMAT_LZMA
? LZMA_FILTER_LZMA1 : LZMA_FILTER_LZMA2;
- filters[0].options = &opt_lzma;
+ default_filters[0].options = &opt_lzma;
+
filters_count = 1;
- }
- // Terminate the filter options array.
- filters[filters_count].id = LZMA_VLI_UNKNOWN;
+ // Terminate the filter options array.
+ default_filters[1].id = LZMA_VLI_UNKNOWN;
+ }
// If we are using the .lzma format, allow exactly one filter
- // which has to be LZMA1.
+ // which has to be LZMA1. There is no need to check if the default
+ // filter chain is being used since it can only be disabled if
+ // --block-list is used, which is incompatible with FORMAT_LZMA.
if (opt_format == FORMAT_LZMA && (filters_count != 1
- || filters[0].id != LZMA_FILTER_LZMA1))
+ || default_filters[0].id != LZMA_FILTER_LZMA1))
message_fatal(_("The .lzma format supports only "
"the LZMA1 filter"));
// If we are using the .xz format, make sure that there is no LZMA1
- // filter to prevent LZMA_PROG_ERROR.
- if (opt_format == FORMAT_XZ)
+ // filter to prevent LZMA_PROG_ERROR. With the chains from --filtersX
+ // we have already ensured this by calling lzma_str_to_filters()
+ // without setting the flags that would allow non-.xz filters.
+ if (opt_format == FORMAT_XZ && chains_used_mask & 1)
for (size_t i = 0; i < filters_count; ++i)
- if (filters[i].id == LZMA_FILTER_LZMA1)
+ if (default_filters[i].id == LZMA_FILTER_LZMA1)
message_fatal(_("LZMA1 cannot be used "
"with the .xz format"));
- // Print the selected filter chain.
- message_filters_show(V_DEBUG, filters);
+ if (chains_used_mask & 1) {
+ // Print the selected default filter chain.
+ message_filters_show(V_DEBUG, default_filters);
+ }
// The --flush-timeout option requires LZMA_SYNC_FLUSH support
- // from the filter chain. Currently threaded encoder doesn't support
- // LZMA_SYNC_FLUSH so single-threaded mode must be used.
+ // from the filter chain. Currently the threaded encoder doesn't
+ // support LZMA_SYNC_FLUSH so single-threaded mode must be used.
if (opt_mode == MODE_COMPRESS && opt_flush_timeout != 0) {
- for (size_t i = 0; i < filters_count; ++i) {
- switch (filters[i].id) {
- case LZMA_FILTER_LZMA2:
- case LZMA_FILTER_DELTA:
- break;
+ for (unsigned i = 0; i < ARRAY_SIZE(chains); ++i) {
+ if (!(chains_used_mask & (1U << i)))
+ continue;
+
+ const lzma_filter *fc = chains[i];
+ for (size_t j = 0; fc[j].id != LZMA_VLI_UNKNOWN; j++) {
+ switch (fc[j].id) {
+ case LZMA_FILTER_LZMA2:
+ case LZMA_FILTER_DELTA:
+ break;
- default:
- message_fatal(_("The filter chain is "
- "incompatible with --flush-timeout"));
+ default:
+ message_fatal(_("Filter chain %u is "
+ "incompatible with "
+ "--flush-timeout"),
+ i);
+ }
}
}
@@ -229,23 +442,72 @@ coder_set_compression_settings(void)
}
}
- // Get the memory usage. Note that if --format=raw was used,
- // we can be decompressing.
+ // Get memory limit and the memory usage of the used filter chains.
+ // Note that if --format=raw was used, we can be decompressing
+ // using the default filter chain.
//
- // If multithreaded .xz compression is done, this value will be
- // replaced.
+ // If multithreaded .xz compression is done, the memory limit
+ // will be replaced.
uint64_t memory_limit = hardware_memlimit_get(opt_mode);
uint64_t memory_usage = UINT64_MAX;
+
+#ifdef HAVE_ENCODERS
+ // Memory usage for each encoder filter chain (default
+ // or --filtersX). The encoder options may need to be
+ // scaled down depending on the memory usage limit.
+ uint64_t encoder_memusages[ARRAY_SIZE(chains)];
+#endif
+
if (opt_mode == MODE_COMPRESS) {
#ifdef HAVE_ENCODERS
# ifdef MYTHREAD_ENABLED
if (opt_format == FORMAT_XZ && hardware_threads_is_mt()) {
memory_limit = hardware_memlimit_mtenc_get();
mt_options.threads = hardware_threads_get();
- mt_options.block_size = opt_block_size;
+
+ uint64_t block_size = opt_block_size;
+
+ // If opt_block_size is not set, find the maximum
+ // recommended Block size based on the filter chains
+ if (block_size == 0) {
+ for (unsigned i = 0; i < ARRAY_SIZE(chains);
+ i++) {
+ if (!(chains_used_mask & (1U << i)))
+ continue;
+
+ uint64_t size = lzma_mt_block_size(
+ chains[i]);
+
+ // If this returns an error, then one
+ // of the filter chains in use is
+ // invalid, so there is no point in
+ // progressing further.
+ if (size == UINT64_MAX)
+ message_fatal(_("Unsupported "
+ "options in filter "
+ "chain %u"), i);
+
+ if (size > block_size)
+ block_size = size;
+ }
+
+ // If --block-list was used and our current
+ // Block size exceeds the largest size
+ // in --block-list, reduce the Block size of
+ // the multithreaded encoder. The extra size
+ // would only be a waste of RAM. With a
+ // smaller Block size we might even be able
+ // to use more threads in some cases.
+ if (block_list_largest > 0 && block_size
+ > block_list_largest)
+ block_size = block_list_largest;
+ }
+
+ mt_options.block_size = block_size;
mt_options.check = check;
- memory_usage = lzma_stream_encoder_mt_memusage(
- &mt_options);
+
+ memory_usage = get_chains_memusage(encoder_memusages,
+ &mt_options, true);
if (memory_usage != UINT64_MAX)
message(V_DEBUG, _("Using up to %" PRIu32
" threads."),
@@ -253,12 +515,13 @@ coder_set_compression_settings(void)
} else
# endif
{
- memory_usage = lzma_raw_encoder_memusage(filters);
+ memory_usage = get_chains_memusage(encoder_memusages,
+ NULL, true);
}
#endif
} else {
#ifdef HAVE_DECODERS
- memory_usage = lzma_raw_decoder_memusage(filters);
+ memory_usage = lzma_raw_decoder_memusage(default_filters);
#endif
}
@@ -268,12 +531,13 @@ coder_set_compression_settings(void)
// Print memory usage info before possible dictionary
// size auto-adjusting.
//
- // NOTE: If only encoder support was built, we cannot show the
+ // NOTE: If only encoder support was built, we cannot show
// what the decoder memory usage will be.
message_mem_needed(V_DEBUG, memory_usage);
-#ifdef HAVE_DECODERS
- if (opt_mode == MODE_COMPRESS) {
- const uint64_t decmem = lzma_raw_decoder_memusage(filters);
+
+#if defined(HAVE_ENCODERS) && defined(HAVE_DECODERS)
+ if (opt_mode == MODE_COMPRESS && message_verbosity_get() >= V_DEBUG) {
+ const uint64_t decmem = get_chains_memusage(NULL, NULL, false);
if (decmem != UINT64_MAX)
message(V_DEBUG, _("Decompression will need "
"%s MiB of memory."), uint64_to_str(
@@ -300,14 +564,21 @@ coder_set_compression_settings(void)
// Reduce the number of threads by one and check
// the memory usage.
--mt_options.threads;
- memory_usage = lzma_stream_encoder_mt_memusage(
- &mt_options);
+ memory_usage = get_chains_memusage(encoder_memusages,
+ &mt_options, true);
if (memory_usage == UINT64_MAX)
message_bug();
if (memory_usage <= memory_limit) {
// 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 "
"the memory usage limit of %s MiB"),
uint64_to_str(
@@ -326,8 +597,11 @@ coder_set_compression_settings(void)
// 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
// 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()) {
- message(V_WARNING, _("Reduced the number of threads "
+ message(V_DEBUG, _("Reduced the number of threads "
"from %s to one. The automatic memory usage "
"limit of %s MiB is still being exceeded. "
"%s MiB of memory is required. "
@@ -353,7 +627,8 @@ coder_set_compression_settings(void)
// the multithreaded mode but the output
// is also different.
hardware_threads_set(1);
- memory_usage = lzma_raw_encoder_memusage(filters);
+ memory_usage = get_chains_memusage(encoder_memusages,
+ NULL, true);
message(V_WARNING, _("Switching to single-threaded mode "
"to not exceed the memory usage limit of %s MiB"),
uint64_to_str(round_up_to_mib(memory_limit), 0));
@@ -368,55 +643,85 @@ coder_set_compression_settings(void)
if (!opt_auto_adjust)
memlimit_too_small(memory_usage);
- // Look for the last filter if it is LZMA2 or LZMA1, so we can make
- // it use less RAM. With other filters we don't know what to do.
- size_t i = 0;
- while (filters[i].id != LZMA_FILTER_LZMA2
- && filters[i].id != LZMA_FILTER_LZMA1) {
- if (filters[i].id == LZMA_VLI_UNKNOWN)
- memlimit_too_small(memory_usage);
+ // Adjust each filter chain that is exceeding the memory usage limit.
+ for (unsigned i = 0; i < ARRAY_SIZE(chains); i++) {
+ // Skip unused chains.
+ if (!(chains_used_mask & (1U << i)))
+ continue;
+
+ // Skip chains that already meet the memory usage limit.
+ if (encoder_memusages[i] <= memory_limit)
+ continue;
+
+ // Look for the last filter if it is LZMA2 or LZMA1, so we
+ // can make it use less RAM. We cannot adjust other filters.
+ unsigned j = 0;
+ while (chains[i][j].id != LZMA_FILTER_LZMA2
+ && chains[i][j].id != LZMA_FILTER_LZMA1) {
+ // NOTE: This displays the too high limit of this
+ // particular filter chain. If multiple chains are
+ // specified and another one would need more then
+ // this message could be confusing. As long as LZMA2
+ // is the only memory hungry filter in .xz this
+ // doesn't matter at all in practice.
+ //
+ // FIXME? However, it's sort of odd still if we had
+ // switched from multithreaded mode to single-threaded
+ // mode because single-threaded produces different
+ // output. So the messages could perhaps be clearer.
+ // Another case of this is a few lines below.
+ if (chains[i][j].id == LZMA_VLI_UNKNOWN)
+ memlimit_too_small(encoder_memusages[i]);
+
+ ++j;
+ }
- ++i;
- }
+ // Decrease the dictionary size until we meet the memory
+ // usage limit. First round down to full mebibytes.
+ lzma_options_lzma *opt = chains[i][j].options;
+ const uint32_t orig_dict_size = opt->dict_size;
+ opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
- // Decrease the dictionary size until we meet the memory
- // usage limit. First round down to full mebibytes.
- lzma_options_lzma *opt = filters[i].options;
- const uint32_t orig_dict_size = opt->dict_size;
- opt->dict_size &= ~((UINT32_C(1) << 20) - 1);
- while (true) {
- // If it is below 1 MiB, auto-adjusting failed. We could be
- // more sophisticated and scale it down even more, but let's
- // see if many complain about this version.
- //
- // FIXME: Displays the scaled memory usage instead
- // of the original.
- if (opt->dict_size < (UINT32_C(1) << 20))
- memlimit_too_small(memory_usage);
+ while (true) {
+ // If it is below 1 MiB, auto-adjusting failed.
+ //
+ // FIXME? See the FIXME a few lines above.
+ if (opt->dict_size < (UINT32_C(1) << 20))
+ memlimit_too_small(encoder_memusages[i]);
- memory_usage = lzma_raw_encoder_memusage(filters);
- if (memory_usage == UINT64_MAX)
- message_bug();
+ encoder_memusages[i]
+ = lzma_raw_encoder_memusage(chains[i]);
+ if (encoder_memusages[i] == UINT64_MAX)
+ message_bug();
- // Accept it if it is low enough.
- if (memory_usage <= memory_limit)
- break;
+ // Accept it if it is low enough.
+ if (encoder_memusages[i] <= memory_limit)
+ break;
- // Otherwise 1 MiB down and try again. I hope this
- // isn't too slow method for cases where the original
- // dict_size is very big.
- opt->dict_size -= UINT32_C(1) << 20;
- }
+ // Otherwise adjust it 1 MiB down and try again.
+ opt->dict_size -= UINT32_C(1) << 20;
+ }
- // Tell the user that we decreased the dictionary size.
- message(V_WARNING, _("Adjusted LZMA%c dictionary size "
- "from %s MiB to %s MiB to not exceed "
- "the memory usage limit of %s MiB"),
- filters[i].id == LZMA_FILTER_LZMA2
- ? '2' : '1',
- uint64_to_str(orig_dict_size >> 20, 0),
- uint64_to_str(opt->dict_size >> 20, 1),
- uint64_to_str(round_up_to_mib(memory_limit), 2));
+ // Tell the user that we decreased the dictionary size.
+ // The message is slightly different between the default
+ // filter chain (0) or and chains from --filtersX.
+ const char lzma_num = chains[i][j].id == LZMA_FILTER_LZMA2
+ ? '2' : '1';
+ const char *from_size = uint64_to_str(orig_dict_size >> 20, 0);
+ const char *to_size = uint64_to_str(opt->dict_size >> 20, 1);
+ const char *limit_size = uint64_to_str(round_up_to_mib(
+ memory_limit), 2);
+ if (i == 0)
+ message(V_WARNING, _("Adjusted LZMA%c dictionary "
+ "size from %s MiB to %s MiB to not exceed the "
+ "memory usage limit of %s MiB"),
+ lzma_num, from_size, to_size, limit_size);
+ else
+ message(V_WARNING, _("Adjusted LZMA%c dictionary size "
+ "for --filters%u from %s MiB to %s MiB to not "
+ "exceed the memory usage limit of %s MiB"),
+ lzma_num, i, from_size, to_size, limit_size);
+ }
#endif
return;
@@ -512,6 +817,13 @@ coder_init(file_pair *pair)
// These will be handled later in this function.
allow_trailing_input = false;
+ // Set the first filter chain. If the --block-list option is not
+ // used then use the default filter chain (chains[0]).
+ // Otherwise, use first filter chain from the block list.
+ lzma_filter *active_filters = opt_block_list == NULL
+ ? chains[0]
+ : chains[opt_block_list[0].chain_num];
+
if (opt_mode == MODE_COMPRESS) {
#ifdef HAVE_ENCODERS
switch (opt_format) {
@@ -522,17 +834,19 @@ coder_init(file_pair *pair)
case FORMAT_XZ:
# ifdef MYTHREAD_ENABLED
+ mt_options.filters = active_filters;
if (hardware_threads_is_mt())
ret = lzma_stream_encoder_mt(
&strm, &mt_options);
else
# endif
ret = lzma_stream_encoder(
- &strm, filters, check);
+ &strm, active_filters, check);
break;
case FORMAT_LZMA:
- ret = lzma_alone_encoder(&strm, filters[0].options);
+ ret = lzma_alone_encoder(&strm,
+ active_filters[0].options);
break;
# ifdef HAVE_LZIP_DECODER
@@ -544,7 +858,7 @@ coder_init(file_pair *pair)
# endif
case FORMAT_RAW:
- ret = lzma_raw_encoder(&strm, filters);
+ ret = lzma_raw_encoder(&strm, active_filters);
break;
}
#endif
@@ -668,7 +982,7 @@ coder_init(file_pair *pair)
case FORMAT_RAW:
// Memory usage has already been checked in
// coder_set_compression_settings().
- ret = lzma_raw_decoder(&strm, filters);
+ ret = lzma_raw_decoder(&strm, active_filters);
break;
}
@@ -716,6 +1030,7 @@ coder_init(file_pair *pair)
}
+#ifdef HAVE_ENCODERS
/// Resolve conflicts between opt_block_size and opt_block_list in single
/// threaded mode. We want to default to opt_block_list, except when it is
/// larger than opt_block_size. If this is the case for the current Block
@@ -746,12 +1061,39 @@ split_block(uint64_t *block_remaining,
} else {
// The Block at *list_pos has been finished. Go to the next
- // entry in the list. If the end of the list has been reached,
- // reuse the size of the last Block.
- if (opt_block_list[*list_pos + 1] != 0)
+ // entry in the list. If the end of the list has been
+ // reached, reuse the size and filters of the last Block.
+ if (opt_block_list[*list_pos + 1].size != 0) {
++*list_pos;
- *block_remaining = opt_block_list[*list_pos];
+ // Update the filters if needed.
+ if (opt_block_list[*list_pos - 1].chain_num
+ != opt_block_list[*list_pos].chain_num) {
+ const unsigned chain_num
+ = opt_block_list[*list_pos].chain_num;
+ const lzma_filter *next = chains[chain_num];
+ const lzma_ret ret = lzma_filters_update(
+ &strm, next);
+
+ if (ret != LZMA_OK) {
+ // This message is only possible if
+ // the filter chain has unsupported
+ // options since the filter chain is
+ // validated using
+ // lzma_raw_encoder_memusage() or
+ // lzma_stream_encoder_mt_memusage().
+ // Some options are not validated until
+ // the encoders are initialized.
+ message_fatal(
+ _("Error changing to "
+ "filter chain %u: %s"),
+ chain_num,
+ message_strm(ret));
+ }
+ }
+ }
+
+ *block_remaining = opt_block_list[*list_pos].size;
// If in single-threaded mode, split up the Block if needed.
// This is not needed in multi-threaded mode because liblzma
@@ -764,6 +1106,7 @@ split_block(uint64_t *block_remaining,
}
}
}
+#endif
static bool
@@ -796,6 +1139,7 @@ coder_normal(file_pair *pair)
// Assume that something goes wrong.
bool success = false;
+#ifdef HAVE_ENCODERS
// block_remaining indicates how many input bytes to encode before
// finishing the current .xz Block. The Block size is set with
// --block-size=SIZE and --block-list. They have an effect only when
@@ -829,15 +1173,18 @@ coder_normal(file_pair *pair)
// output is still not identical because in single-threaded
// mode the size info isn't written into Block Headers.
if (opt_block_list != NULL) {
- if (block_remaining < opt_block_list[list_pos]) {
+ if (block_remaining < opt_block_list[list_pos].size) {
assert(!hardware_threads_is_mt());
- next_block_remaining = opt_block_list[list_pos]
+ next_block_remaining =
+ opt_block_list[list_pos].size
- block_remaining;
} else {
- block_remaining = opt_block_list[list_pos];
+ block_remaining =
+ opt_block_list[list_pos].size;
}
}
}
+#endif
strm.next_out = out_buf.u8;
strm.avail_out = IO_BUFFER_SIZE;
@@ -847,17 +1194,22 @@ coder_normal(file_pair *pair)
// flushing or finishing.
if (strm.avail_in == 0 && action == LZMA_RUN) {
strm.next_in = in_buf.u8;
- strm.avail_in = io_read(pair, &in_buf,
- my_min(block_remaining,
- IO_BUFFER_SIZE));
+#ifdef HAVE_ENCODERS
+ const size_t read_size = my_min(block_remaining,
+ IO_BUFFER_SIZE);
+#else
+ const size_t read_size = IO_BUFFER_SIZE;
+#endif
+ strm.avail_in = io_read(pair, &in_buf, read_size);
if (strm.avail_in == SIZE_MAX)
break;
if (pair->src_eof) {
action = LZMA_FINISH;
-
- } else if (block_remaining != UINT64_MAX) {
+ }
+#ifdef HAVE_ENCODERS
+ else if (block_remaining != UINT64_MAX) {
// Start a new Block after every
// opt_block_size bytes of input.
block_remaining -= strm.avail_in;
@@ -867,6 +1219,7 @@ coder_normal(file_pair *pair)
if (action == LZMA_RUN && pair->flush_needed)
action = LZMA_SYNC_FLUSH;
+#endif
}
// Let liblzma do the actual work.
@@ -878,6 +1231,7 @@ coder_normal(file_pair *pair)
break;
}
+#ifdef HAVE_ENCODERS
if (ret == LZMA_STREAM_END && (action == LZMA_SYNC_FLUSH
|| action == LZMA_FULL_BARRIER)) {
if (action == LZMA_SYNC_FLUSH) {
@@ -907,8 +1261,9 @@ coder_normal(file_pair *pair)
// Start a new Block after LZMA_FULL_FLUSH or continue
// the same block after LZMA_SYNC_FLUSH.
action = LZMA_RUN;
-
- } else if (ret != LZMA_OK) {
+ } else
+#endif
+ if (ret != LZMA_OK) {
// Determine if the return value indicates that we
// won't continue coding. LZMA_NO_CHECK would be
// here too if LZMA_TELL_ANY_CHECK was used.
@@ -1103,6 +1458,16 @@ coder_run(const char *filename)
extern void
coder_free(void)
{
+ // Free starting from the second filter chain since the default
+ // filter chain may have its options set from a static variable
+ // in coder_set_compression_settings(). Since this is only run in
+ // debug mode and will be freed when the process ends anyway, we
+ // don't worry about freeing it.
+ for (uint32_t i = 1; i < ARRAY_SIZE(chains); i++) {
+ if (chains_used_mask & (1U << i))
+ lzma_filters_free(chains[i], NULL);
+ }
+
lzma_end(&strm);
return;
}
diff --git a/contrib/xz/src/xz/coder.h b/contrib/xz/src/xz/coder.h
index b4f43a2bf21c..96755f30d106 100644
--- a/contrib/xz/src/xz/coder.h
+++ b/contrib/xz/src/xz/coder.h
@@ -1,12 +1,12 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file coder.h
/// \brief Compresses or uncompresses a file
//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
@@ -30,6 +30,16 @@ enum format_type {
};
+/// Array of these hold the entries specified with --block-list.
+typedef struct {
+ /// Uncompressed size of the Block
+ uint64_t size;
+
+ /// Filter chain to use for this Block (chains[chain_num])
+ unsigned chain_num;
+} block_list_entry;
+
+
/// Operation mode of the command line tool. This is set in args.c and read
/// in several files.
extern enum operation_mode opt_mode;
@@ -50,9 +60,21 @@ extern bool opt_single_stream;
/// of input. This has an effect only when compressing to the .xz format.
extern uint64_t opt_block_size;
-/// This is non-NULL if --block-list was used. This contains the Block sizes
-/// as an array that is terminated with 0.
-extern uint64_t *opt_block_list;
+/// List of block size and filter chain pointer pairs.
+extern block_list_entry *opt_block_list;
+
+/// Size of the largest Block that was specified in --block-list.
+/// This is used to limit the block_size option of multithreaded encoder.
+/// It's waste of memory to specify a too large block_size and reducing
+/// it might even allow using more threads in some cases.
+///
+/// NOTE: If the last entry in --block-list is the special value of 0
+/// (which gets converted to UINT64_MAX), it counts here as UINT64_MAX too.
+/// This way the multithreaded encoder's Block size won't be reduced.
+extern uint64_t block_list_largest;
+
+/// Bitmask indicating which filter chains we specified in --block-list.
+extern uint32_t block_list_chain_mask;
/// Set the integrity check type used when compressing
extern void coder_set_check(lzma_check check);
@@ -77,3 +99,9 @@ extern void coder_run(const char *filename);
/// Free the memory allocated for the coder and kill the worker threads.
extern void coder_free(void);
#endif
+
+/// Create filter chain from string
+extern void coder_add_filters_from_str(const char *filter_str);
+
+/// Add or overwrite a filter that can be used by the block-list.
+extern void coder_add_block_filters(const char *str, size_t slot);
diff --git a/contrib/xz/src/xz/file_io.c b/contrib/xz/src/xz/file_io.c
index 28280293ef39..678a9a5ca860 100644
--- a/contrib/xz/src/xz/file_io.c
+++ b/contrib/xz/src/xz/file_io.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file file_io.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -29,15 +28,33 @@ static bool warn_fchown;
# include <utime.h>
#endif
-#ifdef HAVE_CAPSICUM
-# ifdef HAVE_SYS_CAPSICUM_H
-# include <sys/capsicum.h>
+#include "tuklib_open_stdxxx.h"
+
+#ifdef _MSC_VER
+# ifdef _WIN64
+ typedef __int64 ssize_t;
# else
-# include <sys/capability.h>
+ typedef int ssize_t;
# endif
-#endif
-#include "tuklib_open_stdxxx.h"
+ typedef int mode_t;
+# define S_IRUSR _S_IREAD
+# define S_IWUSR _S_IWRITE
+
+# define setmode _setmode
+# define open _open
+# define close _close
+# define lseek _lseeki64
+# define unlink _unlink
+
+ // The casts are to silence warnings.
+ // The sizes are known to be small enough.
+# define read(fd, buf, size) _read(fd, buf, (unsigned int)(size))
+# define write(fd, buf, size) _write(fd, buf, (unsigned int)(size))
+
+# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
+# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#endif
#ifndef O_BINARY
# define O_BINARY 0
@@ -66,11 +83,6 @@ typedef enum {
/// If true, try to create sparse files when decompressing.
static bool try_sparse = true;
-#ifdef ENABLE_SANDBOX
-/// True if the conditions for sandboxing (described in main()) have been met.
-static bool sandbox_allowed = false;
-#endif
-
#ifndef TUKLIB_DOSLIKE
/// File status flags of standard input. This is used by io_open_src()
/// and io_close_src().
@@ -155,105 +167,6 @@ io_no_sparse(void)
}
-#ifdef ENABLE_SANDBOX
-extern void
-io_allow_sandbox(void)
-{
- sandbox_allowed = true;
- return;
-}
-
-
-/// Enables operating-system-specific sandbox if it is possible.
-/// src_fd is the file descriptor of the input file.
-static void
-io_sandbox_enter(int src_fd)
-{
- if (!sandbox_allowed) {
- // This message is more often annoying than useful so
- // it's commented out. It can be useful when developing
- // the sandboxing code.
- //message(V_DEBUG, _("Sandbox is disabled due "
- // "to incompatible command line arguments"));
- return;
- }
-
- const char dummy_str[] = "x";
-
- // Try to ensure that both libc and xz locale files have been
- // loaded when NLS is enabled.
- snprintf(NULL, 0, "%s%s", _(dummy_str), strerror(EINVAL));
-
- // Try to ensure that iconv data files needed for handling multibyte
- // characters have been loaded. This is needed at least with glibc.
- tuklib_mbstr_width(dummy_str, NULL);
-
-#ifdef HAVE_CAPSICUM
- // Capsicum needs FreeBSD 10.0 or later.
- cap_rights_t rights;
-
- if (cap_enter())
- goto error;
-
- if (cap_rights_limit(src_fd, cap_rights_init(&rights,
- CAP_EVENT, CAP_FCNTL, CAP_LOOKUP, CAP_READ, CAP_SEEK)))
- goto error;
-
- if (src_fd != STDIN_FILENO && cap_rights_limit(
- STDIN_FILENO, cap_rights_clear(&rights)))
- goto error;
-
- if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,
- CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_LOOKUP,
- CAP_WRITE, CAP_SEEK)))
- goto error;
-
- if (cap_rights_limit(STDERR_FILENO, cap_rights_init(&rights,
- CAP_WRITE)))
- goto error;
-
- if (cap_rights_limit(user_abort_pipe[0], cap_rights_init(&rights,
- CAP_EVENT)))
- goto error;
-
- if (cap_rights_limit(user_abort_pipe[1], cap_rights_init(&rights,
- CAP_WRITE)))
- goto error;
-
-#elif defined(HAVE_PLEDGE)
- // pledge() was introduced in OpenBSD 5.9.
- //
- // main() unconditionally calls pledge() with fairly relaxed
- // promises which work in all situations. Here we make the
- // sandbox more strict.
- if (pledge("stdio", ""))
- goto error;
-
- (void)src_fd;
-
-#else
-# error ENABLE_SANDBOX is defined but no sandboxing method was found.
-#endif
-
- // This message is annoying in xz -lvv.
- //message(V_DEBUG, _("Sandbox was successfully enabled"));
- return;
-
-error:
-#ifdef HAVE_CAPSICUM
- // If a kernel is configured without capability mode support or
- // used in an emulator that does not implement the capability
- // system calls, then the Capsicum system calls will fail and set
- // errno to ENOSYS. In that case xz will silently run without
- // the sandbox.
- if (errno == ENOSYS)
- return;
-#endif
- message_fatal(_("Failed to enable the sandbox"));
-}
-#endif // ENABLE_SANDBOX
-
-
#ifndef TUKLIB_DOSLIKE
/// \brief Waits for input or output to become available or for a signal
///
@@ -407,7 +320,7 @@ io_copy_attrs(const file_pair *pair)
message_warning(_("%s: Cannot set the file group: %s"),
pair->dest_name, strerror(errno));
// We can still safely copy some additional permissions:
- // `group' must be at least as strict as `other' and
+ // 'group' must be at least as strict as 'other' and
// also vice versa.
//
// NOTE: After this, the owner of the source file may
@@ -809,7 +722,8 @@ io_open_src(const char *src_name)
#ifdef ENABLE_SANDBOX
if (!error)
- io_sandbox_enter(pair.src_fd);
+ sandbox_enable_strict_if_allowed(pair.src_fd,
+ user_abort_pipe[0], user_abort_pipe[1]);
#endif
return error ? NULL : &pair;
diff --git a/contrib/xz/src/xz/file_io.h b/contrib/xz/src/xz/file_io.h
index 6992efa4f86c..ae7e2f38f520 100644
--- a/contrib/xz/src/xz/file_io.h
+++ b/contrib/xz/src/xz/file_io.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file file_io.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
// Some systems have suboptimal BUFSIZ. Use a bit bigger value on them.
@@ -18,6 +17,16 @@
# define IO_BUFFER_SIZE (BUFSIZ & ~7U)
#endif
+#ifdef _MSC_VER
+ // The first one renames both "struct stat" -> "struct _stat64"
+ // and stat() -> _stat64(). The documentation mentions only
+ // "struct __stat64", not "struct _stat64", but the latter
+ // works too.
+# define stat _stat64
+# define fstat _fstat64
+# define off_t __int64
+#endif
+
/// is_sparse() accesses the buffer as uint64_t for maximum speed.
/// The u32 and u64 members must only be access through this union
@@ -90,12 +99,6 @@ extern void io_write_to_user_abort_pipe(void);
extern void io_no_sparse(void);
-#ifdef ENABLE_SANDBOX
-/// \brief main() calls this if conditions for sandboxing have been met.
-extern void io_allow_sandbox(void);
-#endif
-
-
/// \brief Open the source file
extern file_pair *io_open_src(const char *src_name);
diff --git a/contrib/xz/src/xz/hardware.c b/contrib/xz/src/xz/hardware.c
index c6948821862a..952652fecb8d 100644
--- a/contrib/xz/src/xz/hardware.c
+++ b/contrib/xz/src/xz/hardware.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file hardware.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -15,7 +14,7 @@
/// Maximum number of worker threads. This can be set with
/// the --threads=NUM command line option.
-static uint32_t threads_max = 1;
+static uint32_t threads_max;
/// True when the number of threads is automatically determined based
/// on the available hardware threads.
@@ -334,5 +333,9 @@ hardware_init(void)
memlimit_mt_default = mem_ceiling;
#endif
+ // Enable threaded mode by default. xz 5.4.x and older
+ // used single-threaded mode by default.
+ hardware_threads_set(0);
+
return;
}
diff --git a/contrib/xz/src/xz/hardware.h b/contrib/xz/src/xz/hardware.h
index a67b26efecb8..25b351e32b19 100644
--- a/contrib/xz/src/xz/hardware.h
+++ b/contrib/xz/src/xz/hardware.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file hardware.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// Initialize some hardware-specific variables, which are needed by other
diff --git a/contrib/xz/src/xz/list.c b/contrib/xz/src/xz/list.c
index 86c3a762f560..ca9cf03e85b0 100644
--- a/contrib/xz/src/xz/list.c
+++ b/contrib/xz/src/xz/list.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file list.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -544,11 +543,21 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
xfi->memusage_max = bhi->memusage;
// Determine the minimum XZ Utils version that supports this Block.
+ // - RISC-V filter needs 5.6.0.
//
// - ARM64 filter needs 5.4.0.
//
// - 5.0.0 doesn't support empty LZMA2 streams and thus empty
// Blocks that use LZMA2. This decoder bug was fixed in 5.0.2.
+ if (xfi->min_version < 50060002U) {
+ for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
+ if (filters[i].id == LZMA_FILTER_RISCV) {
+ xfi->min_version = 50060002U;
+ break;
+ }
+ }
+ }
+
if (xfi->min_version < 50040002U) {
for (size_t i = 0; filters[i].id != LZMA_VLI_UNKNOWN; ++i) {
if (filters[i].id == LZMA_FILTER_ARM64) {
@@ -1266,10 +1275,22 @@ list_totals(void)
extern void
list_file(const char *filename)
{
- if (opt_format != FORMAT_XZ && opt_format != FORMAT_AUTO)
- message_fatal(_("--list works only on .xz files "
+ if (opt_format != FORMAT_XZ && opt_format != FORMAT_AUTO) {
+ // The 'lzmainfo' message is printed only when --format=lzma
+ // is used (it is implied if using "lzma" as the command
+ // name). Thus instead of using message_fatal(), print
+ // the messages separately and then call tuklib_exit()
+ // like message_fatal() does.
+ message(V_ERROR, _("--list works only on .xz files "
"(--format=xz or --format=auto)"));
+ if (opt_format == FORMAT_LZMA)
+ message(V_ERROR,
+ _("Try 'lzmainfo' with .lzma files."));
+
+ tuklib_exit(E_ERROR, E_ERROR, false);
+ }
+
message_filename(filename);
if (filename == stdin_filename) {
diff --git a/contrib/xz/src/xz/list.h b/contrib/xz/src/xz/list.h
index a4c6ec7dc429..805880de4095 100644
--- a/contrib/xz/src/xz/list.h
+++ b/contrib/xz/src/xz/list.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file list.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// \brief List information about the given .xz file
diff --git a/contrib/xz/src/xz/main.c b/contrib/xz/src/xz/main.c
index c9c3deca2bf8..71b5ef7b7001 100644
--- a/contrib/xz/src/xz/main.c
+++ b/contrib/xz/src/xz/main.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file main.c
@@ -5,14 +7,12 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
#include <ctype.h>
+
/// Exit status to use. This can be changed with set_exit_status().
static enum exit_status_type exit_status = E_SUCCESS;
@@ -119,8 +119,8 @@ read_name(const args_info *args)
// newlines.
message_error(_("%s: Null character found when "
"reading filenames; maybe you meant "
- "to use `--files0' instead "
- "of `--files'?"), args->files_name);
+ "to use '--files0' instead "
+ "of '--files'?"), args->files_name);
return NULL;
}
@@ -142,35 +142,38 @@ read_name(const args_info *args)
int
main(int argc, char **argv)
{
-#ifdef HAVE_PLEDGE
- // OpenBSD's pledge(2) sandbox
- //
- // Unconditionally enable sandboxing with fairly relaxed promises.
- // This is still way better than having no sandbox at all. :-)
- // More strict promises will be made later in file_io.c if possible.
- if (pledge("stdio rpath wpath cpath fattr", "")) {
- // Don't translate the string or use message_fatal() as
- // those haven't been initialized yet.
- fprintf(stderr, "%s: Failed to enable the sandbox\n", argv[0]);
- return E_ERROR;
- }
-#endif
-
#if defined(_WIN32) && !defined(__CYGWIN__)
InitializeCriticalSection(&exit_status_cs);
#endif
- // Set up the progname variable.
+ // Set up the progname variable needed for messages.
tuklib_progname_init(argv);
// Initialize the file I/O. This makes sure that
// stdin, stdout, and stderr are something valid.
+ // This must be done before we might open any files
+ // even indirectly like locale and gettext initializations.
io_init();
+#ifdef ENABLE_SANDBOX
+ // Enable such sandboxing that can always be enabled.
+ // This requires that progname has been set up.
+ // It's also good that io_init() has been called because it
+ // might need to do things that the initial sandbox won't allow.
+ // Otherwise this should be called as early as possible.
+ //
+ // NOTE: Calling this before tuklib_gettext_init() means that
+ // translated error message won't be available if sandbox
+ // initialization fails. However, sandbox_init() shouldn't
+ // fail and this order simply feels better.
+ sandbox_init();
+#endif
+
// Set up the locale and message translations.
tuklib_gettext_init(PACKAGE, LOCALEDIR);
- // Initialize handling of error/warning/other messages.
+ // Initialize progress message handling. It's not always needed
+ // but it's simpler to do this unconditionally.
message_init();
// Set hardware-dependent default values. These can be overridden
@@ -220,21 +223,41 @@ main(int argc, char **argv)
signals_init();
#ifdef ENABLE_SANDBOX
- // Set a flag that sandboxing is allowed if all these are true:
- // - --files or --files0 wasn't used.
- // - There is exactly one input file or we are reading from stdin.
- // - We won't create any files: output goes to stdout or --test
- // or --list was used. Note that --test implies opt_stdout = true
- // but --list doesn't.
+ // Read-only sandbox can be enabled if we won't create or delete
+ // any files:
//
- // This is obviously not ideal but it was easy to implement and
- // it covers the most common use cases.
+ // - --stdout, --test, or --list was used. Note that --test
+ // implies opt_stdout = true but --list doesn't.
//
- // TODO: Make sandboxing work for other situations too.
- if (args.files_name == NULL && args.arg_count == 1
- && (opt_stdout || strcmp("-", args.arg_names[0]) == 0
- || opt_mode == MODE_LIST))
- io_allow_sandbox();
+ // - Output goes to stdout because --files or --files0 wasn't used
+ // and no arguments were given on the command line or the
+ // arguments are all "-" (indicating standard input).
+ bool to_stdout_only = opt_stdout || opt_mode == MODE_LIST;
+ if (!to_stdout_only && args.files_name == NULL) {
+ // If all of the filenames provided are "-" (more than one
+ // "-" could be specified), then we are only going to be
+ // writing to standard output. Note that if no filename args
+ // were provided, args.c puts a single "-" in arg_names[0].
+ to_stdout_only = true;
+
+ for (unsigned i = 0; i < args.arg_count; ++i) {
+ if (strcmp("-", args.arg_names[i]) != 0) {
+ to_stdout_only = false;
+ break;
+ }
+ }
+ }
+
+ if (to_stdout_only) {
+ sandbox_enable_read_only();
+
+ // Allow strict sandboxing if we are processing exactly one
+ // file to standard output. This requires that --files or
+ // --files0 wasn't specified (an unknown number of filenames
+ // could be provided that way).
+ if (args.files_name == NULL && args.arg_count == 1)
+ sandbox_allow_strict();
+ }
#endif
// coder_run() handles compression, decompression, and testing.
diff --git a/contrib/xz/src/xz/main.h b/contrib/xz/src/xz/main.h
index 323f2f7d09cd..a8a1b457760a 100644
--- a/contrib/xz/src/xz/main.h
+++ b/contrib/xz/src/xz/main.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file main.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// Possible exit status values. These are the same as used by gzip and bzip2.
diff --git a/contrib/xz/src/xz/message.c b/contrib/xz/src/xz/message.c
index abf30adcc26c..deafdb438320 100644
--- a/contrib/xz/src/xz/message.c
+++ b/contrib/xz/src/xz/message.c
@@ -1,12 +1,12 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file message.c
/// \brief Printing messages
//
-// Author: Lasse Collin
-//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
+// Authors: Lasse Collin
+// Jia Tan
//
///////////////////////////////////////////////////////////////////////////////
@@ -42,7 +42,7 @@ static bool current_filename_printed = false;
/// True if we should print progress indicator and update it automatically
/// if also verbose >= V_VERBOSE.
-static bool progress_automatic;
+static bool progress_automatic = false;
/// True if message_progress_start() has been called but
/// message_progress_end() hasn't been called yet.
@@ -119,26 +119,7 @@ message_init(void)
// exception, even if --verbose was not used, user can send SIGALRM
// to make us print progress information once without automatic
// updating.
- progress_automatic = isatty(STDERR_FILENO);
-
- // Commented out because COLUMNS is rarely exported to environment.
- // Most users have at least 80 columns anyway, let's think something
- // fancy here if enough people complain.
-/*
- if (progress_automatic) {
- // stderr is a terminal. Check the COLUMNS environment
- // variable to see if the terminal is wide enough. If COLUMNS
- // doesn't exist or it has some unparsable value, we assume
- // that the terminal is wide enough.
- const char *columns_str = getenv("COLUMNS");
- if (columns_str != NULL) {
- char *endptr;
- const long columns = strtol(columns_str, &endptr, 10);
- if (*endptr != '\0' || columns < 80)
- progress_automatic = false;
- }
- }
-*/
+ progress_automatic = is_tty(STDERR_FILENO);
#ifdef SIGALRM
// Establish the signal handlers which set a flag to tell us that
@@ -932,7 +913,7 @@ message_try_help(void)
{
// Print this with V_WARNING instead of V_ERROR to prevent it from
// showing up when --quiet has been specified.
- message(V_WARNING, _("Try `%s --help' for more information."),
+ message(V_WARNING, _("Try '%s --help' for more information."),
progname);
return;
}
@@ -994,7 +975,7 @@ message_help(bool long_help)
" ignore possible remaining input data"));
puts(_(
" --no-sparse do not create sparse files when decompressing\n"
-" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
+" -S, --suffix=.SUF use the suffix '.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
@@ -1005,9 +986,9 @@ message_help(bool long_help)
puts(_("\n Basic file format and compression options:\n"));
puts(_(
" -F, --format=FMT file format to encode or decode; possible values are\n"
-" `auto' (default), `xz', `lzma', `lzip', and `raw'\n"
-" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
-" `crc32', `crc64' (default), or `sha256'"));
+" 'auto' (default), 'xz', 'lzma', 'lzip', and 'raw'\n"
+" -C, --check=CHECK integrity check type: 'none' (use with caution),\n"
+" 'crc32', 'crc64' (default), or 'sha256'"));
puts(_(
" --ignore-check don't verify the integrity check when decompressing"));
}
@@ -1021,8 +1002,8 @@ message_help(bool long_help)
" does not affect decompressor memory requirements"));
puts(_(
-" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
-" to use as many threads as there are processor cores"));
+" -T, --threads=NUM use at most NUM threads; the default is 0 which uses\n"
+" as many threads as there are processor cores"));
if (long_help) {
puts(_(
@@ -1030,9 +1011,11 @@ message_help(bool long_help)
" start a new .xz block after every SIZE bytes of input;\n"
" use this to set the block size for threaded compression"));
puts(_(
-" --block-list=SIZES\n"
+" --block-list=BLOCKS\n"
" start a new .xz block after the given comma-separated\n"
-" intervals of uncompressed data"));
+" intervals of uncompressed data; optionally, specify a\n"
+" filter chain number (0-9) followed by a ':' before the\n"
+" uncompressed data size"));
puts(_(
" --flush-timeout=TIMEOUT\n"
" when compressing, if more than TIMEOUT milliseconds has\n"
@@ -1057,6 +1040,23 @@ message_help(bool long_help)
puts(_(
"\n Custom filter chain for compression (alternative for using presets):"));
+ puts(_(
+"\n"
+" --filters=FILTERS set the filter chain using the liblzma filter string\n"
+" syntax; use --filters-help for more information"
+ ));
+
+ puts(_(
+" --filters1=FILTERS ... --filters9=FILTERS\n"
+" set additional filter chains using the liblzma filter\n"
+" string syntax to use with --block-list"
+ ));
+
+ puts(_(
+" --filters-help display more information about the liblzma filter string\n"
+" syntax and exit."
+ ));
+
#if defined(HAVE_ENCODER_LZMA1) || defined(HAVE_DECODER_LZMA1) \
|| defined(HAVE_ENCODER_LZMA2) || defined(HAVE_DECODER_LZMA2)
// TRANSLATORS: The word "literal" in "literal context bits"
@@ -1087,6 +1087,7 @@ message_help(bool long_help)
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
+" --riscv[=OPTS] RISC-V BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"));
@@ -1144,3 +1145,28 @@ message_help(bool long_help)
tuklib_exit(E_SUCCESS, E_ERROR, verbosity != V_SILENT);
}
+
+
+extern void
+message_filters_help(void)
+{
+ char *encoder_options;
+ if (lzma_str_list_filters(&encoder_options, LZMA_VLI_UNKNOWN,
+ LZMA_STR_ENCODER, NULL) != LZMA_OK)
+ message_bug();
+
+ if (!opt_robot) {
+ puts(_(
+"Filter chains are set using the --filters=FILTERS or\n"
+"--filters1=FILTERS ... --filters9=FILTERS options. Each filter in the chain\n"
+"can be separated by spaces or '--'. Alternatively a preset <0-9>[e] can be\n"
+"specified instead of a filter chain.\n"
+ ));
+
+ puts(_("The supported filters and their options are:"));
+ }
+
+ puts(encoder_options);
+
+ tuklib_exit(E_SUCCESS, E_ERROR, verbosity != V_SILENT);
+}
diff --git a/contrib/xz/src/xz/message.h b/contrib/xz/src/xz/message.h
index f608ec75dffa..3f6e183585f7 100644
--- a/contrib/xz/src/xz/message.h
+++ b/contrib/xz/src/xz/message.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file message.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// Verbosity levels
@@ -24,7 +23,10 @@ enum message_verbosity {
extern const int message_progress_sigs[];
-/// \brief Initializes the message functions
+/// \brief Initializes the progress message functions
+///
+/// message_fatal() and such can be called even before message_init()
+/// has been called.
///
/// If an error occurs, this function doesn't return.
///
@@ -111,6 +113,12 @@ tuklib_attr_noreturn
extern void message_help(bool long_help);
+/// Prints a help message specifically for using the --filters and
+/// --filtersX command line options.
+tuklib_attr_noreturn
+extern void message_filters_help(void);
+
+
/// \brief Set the total number of files to be processed
///
/// Standard input is counted as a file here. This is used when printing
diff --git a/contrib/xz/src/xz/mytime.c b/contrib/xz/src/xz/mytime.c
index 7e8a074961f4..7d9a27d58b56 100644
--- a/contrib/xz/src/xz/mytime.c
+++ b/contrib/xz/src/xz/mytime.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file mytime.c
@@ -5,14 +7,14 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC)
+#if defined(MYTHREAD_VISTA) || defined(_MSC_VER)
+ // Nothing
+#elif defined(HAVE_CLOCK_GETTIME) \
+ && (!defined(__MINGW32__) || defined(MYTHREAD_POSIX))
# include <time.h>
#else
# include <sys/time.h>
@@ -20,7 +22,22 @@
uint64_t opt_flush_timeout = 0;
+// start_time holds the time when the (de)compression was started.
+// It's from mytime_now() and thus only useful for calculating relative
+// time differences (elapsed time). start_time is initialized by calling
+// mytime_set_start_time() and modified by mytime_sigtstp_handler().
+//
+// When mytime_sigtstp_handler() is used, start_time is made volatile.
+// I'm not sure if that is really required since access to it is guarded
+// by signals_block()/signals_unblock() since accessing an uint64_t isn't
+// atomic on all systems. But since the variable isn't accessed very
+// frequently making it volatile doesn't hurt.
+#ifdef USE_SIGTSTP_HANDLER
+static volatile uint64_t start_time;
+#else
static uint64_t start_time;
+#endif
+
static uint64_t next_flush;
@@ -30,16 +47,41 @@ static uint64_t next_flush;
static uint64_t
mytime_now(void)
{
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC)
+#if defined(MYTHREAD_VISTA) || defined(_MSC_VER)
+ // Since there is no SIGALRM on Windows, this function gets
+ // called frequently when the progress indicator is in use.
+ // Progress indicator doesn't need high-resolution time.
+ // GetTickCount64() has very low overhead but needs at least WinVista.
+ //
+ // MinGW-w64 provides the POSIX functions clock_gettime() and
+ // gettimeofday() in a manner that allow xz to run on older
+ // than WinVista. If the threading method needs WinVista anyway,
+ // there's no reason to avoid a WinVista API here either.
+ return GetTickCount64();
+
+#elif defined(HAVE_CLOCK_GETTIME) \
+ && (!defined(__MINGW32__) || defined(MYTHREAD_POSIX))
+ // MinGW-w64: clock_gettime() is defined in winpthreads but we need
+ // nothing else from winpthreads (unless, for some odd reason, POSIX
+ // threading has been selected). By avoiding clock_gettime(), we
+ // avoid the dependency on libwinpthread-1.dll or the need to link
+ // against the static version. The downside is that the fallback
+ // method, gettimeofday(), doesn't provide monotonic time.
+ struct timespec tv;
+
+# ifdef HAVE_CLOCK_MONOTONIC
// If CLOCK_MONOTONIC was available at compile time but for some
// reason isn't at runtime, fallback to CLOCK_REALTIME which
// according to POSIX is mandatory for all implementations.
static clockid_t clk_id = CLOCK_MONOTONIC;
- struct timespec tv;
while (clock_gettime(clk_id, &tv))
clk_id = CLOCK_REALTIME;
+# else
+ clock_gettime(CLOCK_REALTIME, &tv);
+# endif
return (uint64_t)tv.tv_sec * 1000 + (uint64_t)(tv.tv_nsec / 1000000);
+
#else
struct timeval tv;
gettimeofday(&tv, NULL);
@@ -48,10 +90,49 @@ mytime_now(void)
}
+#ifdef USE_SIGTSTP_HANDLER
+extern void
+mytime_sigtstp_handler(int sig lzma_attribute((__unused__)))
+{
+ // Measure how long the process stays in the stopped state and add
+ // that amount to start_time. This way the the progress indicator
+ // won't count the stopped time as elapsed time and the estimated
+ // remaining time won't be confused by the time spent in the
+ // stopped state.
+ //
+ // FIXME? Is raising SIGSTOP the correct thing to do? POSIX.1-2017
+ // says that orphan processes shouldn't stop on SIGTSTP. So perhaps
+ // the most correct thing to do could be to revert to the default
+ // handler for SIGTSTP, unblock SIGTSTP, and then raise(SIGTSTP).
+ // It's quite a bit more complicated than just raising SIGSTOP though.
+ //
+ // The difference between raising SIGTSTP vs. SIGSTOP can be seen on
+ // the shell command line too by running "echo $?" after stopping
+ // a process but perhaps that doesn't matter.
+ const uint64_t t = mytime_now();
+ raise(SIGSTOP);
+ start_time += mytime_now() - t;
+ return;
+}
+#endif
+
+
extern void
mytime_set_start_time(void)
{
+#ifdef USE_SIGTSTP_HANDLER
+ // Block the signals when accessing start_time so that we cannot
+ // end up with a garbage value. start_time is volatile but access
+ // to it isn't atomic at least on 32-bit systems.
+ signals_block();
+#endif
+
start_time = mytime_now();
+
+#ifdef USE_SIGTSTP_HANDLER
+ signals_unblock();
+#endif
+
return;
}
@@ -59,7 +140,17 @@ mytime_set_start_time(void)
extern uint64_t
mytime_get_elapsed(void)
{
- return mytime_now() - start_time;
+#ifdef USE_SIGTSTP_HANDLER
+ signals_block();
+#endif
+
+ const uint64_t t = mytime_now() - start_time;
+
+#ifdef USE_SIGTSTP_HANDLER
+ signals_unblock();
+#endif
+
+ return t;
}
diff --git a/contrib/xz/src/xz/mytime.h b/contrib/xz/src/xz/mytime.h
index a7be2aa7ca62..6dfaeae9b683 100644
--- a/contrib/xz/src/xz/mytime.h
+++ b/contrib/xz/src/xz/mytime.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file mytime.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
@@ -21,6 +20,12 @@
extern uint64_t opt_flush_timeout;
+#ifdef USE_SIGTSTP_HANDLER
+/// \brief Signal handler for SIGTSTP
+extern void mytime_sigtstp_handler(int sig);
+#endif
+
+
/// \brief Store the time when (de)compression was started
///
/// The start time is also stored as the time of the first flush.
diff --git a/contrib/xz/src/xz/options.c b/contrib/xz/src/xz/options.c
index 4d5e899ccdc1..bc8bc1a6c36c 100644
--- a/contrib/xz/src/xz/options.c
+++ b/contrib/xz/src/xz/options.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file options.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -83,7 +82,7 @@ parse_options(const char *str, const option_map *opts,
*value++ = '\0';
if (value == NULL || value[0] == '\0')
- message_fatal(_("%s: Options must be `name=value' "
+ message_fatal(_("%s: Options must be 'name=value' "
"pairs separated with commas"), str);
// Look for the option name from the option map.
diff --git a/contrib/xz/src/xz/options.h b/contrib/xz/src/xz/options.h
index 61ec8d58a145..4a1314db26f0 100644
--- a/contrib/xz/src/xz/options.h
+++ b/contrib/xz/src/xz/options.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file options.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// \brief Parser for Delta options
diff --git a/contrib/xz/src/xz/private.h b/contrib/xz/src/xz/private.h
index 6414bdb5081c..b370472e32c8 100644
--- a/contrib/xz/src/xz/private.h
+++ b/contrib/xz/src/xz/private.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file private.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
@@ -21,7 +20,10 @@
#include <signal.h>
#include <locale.h>
#include <stdio.h>
-#include <unistd.h>
+
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
#include "tuklib_gettext.h"
#include "tuklib_progname.h"
@@ -33,6 +35,10 @@
# include <windows.h>
#endif
+#ifdef _MSC_VER
+# define fileno _fileno
+#endif
+
#ifndef STDIN_FILENO
# define STDIN_FILENO (fileno(stdin))
#endif
@@ -45,8 +51,15 @@
# define STDERR_FILENO (fileno(stderr))
#endif
-#if defined(HAVE_CAPSICUM) || defined(HAVE_PLEDGE)
-# define ENABLE_SANDBOX 1
+// Handling SIGTSTP keeps time-keeping for progress indicator correct
+// if xz is stopped. It requires use of clock_gettime() as that is
+// async-signal safe in POSIX. Require also SIGALRM support since
+// on systems where SIGALRM isn't available, progress indicator code
+// polls the time and the SIGTSTP handling adds slight overhead to
+// that code. Most (all?) systems that have SIGTSTP also have SIGALRM
+// so this requirement won't exclude many systems.
+#if defined(HAVE_CLOCK_GETTIME) && defined(SIGTSTP) && defined(SIGALRM)
+# define USE_SIGTSTP_HANDLER 1
#endif
#include "main.h"
@@ -57,6 +70,7 @@
#include "hardware.h"
#include "file_io.h"
#include "options.h"
+#include "sandbox.h"
#include "signals.h"
#include "suffix.h"
#include "util.h"
diff --git a/contrib/xz/src/xz/sandbox.c b/contrib/xz/src/xz/sandbox.c
new file mode 100644
index 000000000000..5bd227370751
--- /dev/null
+++ b/contrib/xz/src/xz/sandbox.c
@@ -0,0 +1,355 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file sandbox.c
+/// \brief Sandbox support
+//
+// Author: Lasse Collin
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include "private.h"
+
+
+#ifndef ENABLE_SANDBOX
+
+// Prevent an empty translation unit when no sandboxing is supported.
+typedef int dummy;
+
+#else
+
+/// If the conditions for strict sandboxing (described in main())
+/// have been met, sandbox_allow_strict() can be called to set this
+/// variable to true.
+static bool strict_sandbox_allowed = false;
+
+
+extern void
+sandbox_allow_strict(void)
+{
+ strict_sandbox_allowed = true;
+ return;
+}
+
+
+// Strict sandboxing prevents opening any files. This *tries* to ensure
+// that any auxiliary files that might be required are already open.
+//
+// Returns true if strict sandboxing is allowed, false otherwise.
+static bool
+prepare_for_strict_sandbox(void)
+{
+ if (!strict_sandbox_allowed)
+ return false;
+
+ const char dummy_str[] = "x";
+
+ // Try to ensure that both libc and xz locale files have been
+ // loaded when NLS is enabled.
+ snprintf(NULL, 0, "%s%s", _(dummy_str), strerror(EINVAL));
+
+ // Try to ensure that iconv data files needed for handling multibyte
+ // characters have been loaded. This is needed at least with glibc.
+ tuklib_mbstr_width(dummy_str, NULL);
+
+ return true;
+}
+
+#endif
+
+
+#if defined(HAVE_PLEDGE)
+
+///////////////
+// pledge(2) //
+///////////////
+
+#include <unistd.h>
+
+
+extern void
+sandbox_init(void)
+{
+ if (pledge("stdio rpath wpath cpath fattr", "")) {
+ // gettext hasn't been initialized yet so
+ // there's no point to call it here.
+ message_fatal("Failed to enable the sandbox");
+ }
+
+ return;
+}
+
+
+extern void
+sandbox_enable_read_only(void)
+{
+ // We will be opening files for reading but
+ // won't create or remove any files.
+ if (pledge("stdio rpath", ""))
+ message_fatal(_("Failed to enable the sandbox"));
+
+ return;
+}
+
+
+extern void
+sandbox_enable_strict_if_allowed(int src_fd lzma_attribute((__unused__)),
+ int pipe_event_fd lzma_attribute((__unused__)),
+ int pipe_write_fd lzma_attribute((__unused__)))
+{
+ if (!prepare_for_strict_sandbox())
+ return;
+
+ // All files that need to be opened have already been opened.
+ if (pledge("stdio", ""))
+ message_fatal(_("Failed to enable the sandbox"));
+
+ return;
+}
+
+
+#elif defined(HAVE_LINUX_LANDLOCK)
+
+//////////////
+// Landlock //
+//////////////
+
+#include <linux/landlock.h>
+#include <sys/syscall.h>
+#include <sys/prctl.h>
+
+
+// Highest Landlock ABI version supported by this file:
+// - For ABI versions 1-3 we don't need anything from <linux/landlock.h>
+// that isn't part of version 1.
+// - For ABI version 4 we need the larger struct landlock_ruleset_attr
+// with the handled_access_net member. That is bundled with the macros
+// LANDLOCK_ACCESS_NET_BIND_TCP and LANDLOCK_ACCESS_NET_CONNECT_TCP.
+#ifdef LANDLOCK_ACCESS_NET_BIND_TCP
+# define LANDLOCK_ABI_MAX 4
+#else
+# define LANDLOCK_ABI_MAX 3
+#endif
+
+
+/// Landlock ABI version supported by the kernel
+static int landlock_abi;
+
+
+// The required_rights should have those bits set that must not be restricted.
+// This function will then bitwise-and ~required_rights with a mask matching
+// the Landlock ABI version, leaving only those bits set that are supported
+// by the ABI and allowed to be restricted by the function argument.
+static void
+enable_landlock(uint64_t required_rights)
+{
+ assert(landlock_abi <= LANDLOCK_ABI_MAX);
+
+ if (landlock_abi <= 0)
+ return;
+
+ // We want to set all supported flags in handled_access_fs.
+ // This way the ruleset will initially forbid access to all
+ // actions that the available Landlock ABI version supports.
+ // Exceptions can be added using landlock_add_rule(2) to
+ // allow certain actions on certain files or directories.
+ //
+ // The same flag values are used on all archs. ABI v2 and v3
+ // both add one new flag.
+ //
+ // First in ABI v1: LANDLOCK_ACCESS_FS_EXECUTE = 1ULL << 0
+ // Last in ABI v1: LANDLOCK_ACCESS_FS_MAKE_SYM = 1ULL << 12
+ // Last in ABI v2: LANDLOCK_ACCESS_FS_REFER = 1ULL << 13
+ // Last in ABI v3: LANDLOCK_ACCESS_FS_TRUNCATE = 1ULL << 14
+ //
+ // This makes it simple to set the mask based on the ABI
+ // version and we don't need to care which flags are #defined
+ // in the installed <linux/landlock.h> for ABI versions 1-3.
+ const struct landlock_ruleset_attr attr = {
+ .handled_access_fs = ~required_rights
+ & ((1ULL << (12 + my_min(3, landlock_abi))) - 1),
+#if LANDLOCK_ABI_MAX >= 4
+ .handled_access_net = landlock_abi < 4 ? 0 :
+ (LANDLOCK_ACCESS_NET_BIND_TCP
+ | LANDLOCK_ACCESS_NET_CONNECT_TCP),
+#endif
+ };
+
+ const int ruleset_fd = syscall(SYS_landlock_create_ruleset,
+ &attr, sizeof(attr), 0U);
+ if (ruleset_fd < 0)
+ message_fatal(_("Failed to enable the sandbox"));
+
+ // All files we need should have already been opened. Thus,
+ // we don't need to add any rules using landlock_add_rule(2)
+ // before activating the sandbox.
+ //
+ // NOTE: It's possible that the hack prepare_for_strict_sandbox()
+ // isn't be good enough. It tries to get translations and
+ // libc-specific files loaded but if it's not good enough
+ // then perhaps a Landlock rule to allow reading from /usr
+ // and/or the xz installation prefix would be needed.
+ //
+ // prctl(PR_SET_NO_NEW_PRIVS, ...) was already called in
+ // sandbox_init() so we don't do it here again.
+ if (syscall(SYS_landlock_restrict_self, ruleset_fd, 0U) != 0)
+ message_fatal(_("Failed to enable the sandbox"));
+
+ return;
+}
+
+
+extern void
+sandbox_init(void)
+{
+ // Prevent the process from gaining new privileges. This must be done
+ // before landlock_restrict_self(2) but since we will never need new
+ // privileges, this call can be done here already.
+ //
+ // This is supported since Linux 3.5. Ignore the return value to
+ // keep compatibility with old kernels. landlock_restrict_self(2)
+ // will fail if the no_new_privs attribute isn't set, thus if prctl()
+ // fails here the error will still be detected when it matters.
+ (void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
+
+ // Get the highest Landlock ABI version supported by the kernel.
+ landlock_abi = syscall(SYS_landlock_create_ruleset,
+ (void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
+
+ // The kernel might support a newer ABI than this file.
+ if (landlock_abi > LANDLOCK_ABI_MAX)
+ landlock_abi = LANDLOCK_ABI_MAX;
+
+ // These are all in ABI version 1 already. We don't need truncate
+ // rights because files are created with open() using O_EXCL and
+ // without O_TRUNC.
+ //
+ // LANDLOCK_ACCESS_FS_READ_DIR is included here to get a clear error
+ // message if xz is given a directory name. Without this permission
+ // the message would be "Permission denied" but with this permission
+ // it's "Is a directory, skipping". It could be worked around with
+ // stat()/lstat() but just giving this permission is simpler and
+ // shouldn't make the sandbox much weaker in practice.
+ const uint64_t required_rights
+ = LANDLOCK_ACCESS_FS_WRITE_FILE
+ | LANDLOCK_ACCESS_FS_READ_FILE
+ | LANDLOCK_ACCESS_FS_READ_DIR
+ | LANDLOCK_ACCESS_FS_REMOVE_FILE
+ | LANDLOCK_ACCESS_FS_MAKE_REG;
+
+ enable_landlock(required_rights);
+ return;
+}
+
+
+extern void
+sandbox_enable_read_only(void)
+{
+ // We will be opening files for reading but
+ // won't create or remove any files.
+ const uint64_t required_rights
+ = LANDLOCK_ACCESS_FS_READ_FILE
+ | LANDLOCK_ACCESS_FS_READ_DIR;
+ enable_landlock(required_rights);
+ return;
+}
+
+
+extern void
+sandbox_enable_strict_if_allowed(int src_fd lzma_attribute((__unused__)),
+ int pipe_event_fd lzma_attribute((__unused__)),
+ int pipe_write_fd lzma_attribute((__unused__)))
+{
+ if (!prepare_for_strict_sandbox())
+ return;
+
+ // Allow all restrictions that the kernel supports with the
+ // highest Landlock ABI version that the kernel or xz supports.
+ //
+ // NOTE: LANDLOCK_ACCESS_FS_READ_DIR isn't needed here because
+ // the only input file has already been opened.
+ enable_landlock(0);
+ return;
+}
+
+
+#elif defined(HAVE_CAP_RIGHTS_LIMIT)
+
+//////////////
+// Capsicum //
+//////////////
+
+#include <sys/capsicum.h>
+
+
+extern void
+sandbox_init(void)
+{
+ // Nothing to do.
+ return;
+}
+
+
+extern void
+sandbox_enable_read_only(void)
+{
+ // Nothing to do.
+ return;
+}
+
+
+extern void
+sandbox_enable_strict_if_allowed(
+ int src_fd, int pipe_event_fd, int pipe_write_fd)
+{
+ if (!prepare_for_strict_sandbox())
+ return;
+
+ // Capsicum needs FreeBSD 10.2 or later.
+ cap_rights_t rights;
+
+ if (cap_enter())
+ goto error;
+
+ if (cap_rights_limit(src_fd, cap_rights_init(&rights,
+ CAP_EVENT, CAP_FCNTL, CAP_LOOKUP, CAP_READ, CAP_SEEK)))
+ goto error;
+
+ // If not reading from stdin, remove all capabilities from it.
+ if (src_fd != STDIN_FILENO && cap_rights_limit(
+ STDIN_FILENO, cap_rights_clear(&rights)))
+ goto error;
+
+ if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,
+ CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_LOOKUP,
+ CAP_WRITE, CAP_SEEK)))
+ goto error;
+
+ if (cap_rights_limit(STDERR_FILENO, cap_rights_init(&rights,
+ CAP_WRITE)))
+ goto error;
+
+ if (cap_rights_limit(pipe_event_fd, cap_rights_init(&rights,
+ CAP_EVENT)))
+ goto error;
+
+ if (cap_rights_limit(pipe_write_fd, cap_rights_init(&rights,
+ CAP_WRITE)))
+ goto error;
+
+ return;
+
+error:
+ // If a kernel is configured without capability mode support or
+ // used in an emulator that does not implement the capability
+ // system calls, then the Capsicum system calls will fail and set
+ // errno to ENOSYS. In that case xz will silently run without
+ // the sandbox.
+ if (errno == ENOSYS)
+ return;
+
+ message_fatal(_("Failed to enable the sandbox"));
+}
+
+#endif
diff --git a/contrib/xz/src/xz/sandbox.h b/contrib/xz/src/xz/sandbox.h
new file mode 100644
index 000000000000..98b9862a1c0a
--- /dev/null
+++ b/contrib/xz/src/xz/sandbox.h
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: 0BSD
+
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file sandbox.h
+/// \brief Sandbox support
+//
+// Author: Lasse Collin
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#if defined(HAVE_PLEDGE) || defined(HAVE_LINUX_LANDLOCK) \
+ || defined(HAVE_CAP_RIGHTS_LIMIT)
+# define ENABLE_SANDBOX 1
+#endif
+
+
+/// \brief Enables early sandboxing that can always be enabled
+///
+/// This requires that tuklib_progname() and io_init() have been called.
+extern void sandbox_init(void);
+
+
+/// \brief Enable sandboxing that only allows opening files for reading
+extern void sandbox_enable_read_only(void);
+
+
+/// \brief Tell sandboxing code that strict sandboxing can be used
+///
+/// This function only sets a flag which will be read by
+/// sandbox_enable_strict_if_allowed().
+extern void sandbox_allow_strict(void);
+
+
+/// \brief Enable sandboxing that allows reading from one file
+///
+/// This does nothing if sandbox_allow_strict() hasn't been called.
+///
+/// \param src_fd File descriptor open for reading
+/// \param pipe_event_fd user_abort_pipe[0] from file_io.c
+/// \param pipe_write_fd user_abort_pipe[1] from file_io.c
+extern void sandbox_enable_strict_if_allowed(
+ int src_fd, int pipe_event_fd, int pipe_write_fd);
diff --git a/contrib/xz/src/xz/signals.c b/contrib/xz/src/xz/signals.c
index 7aef463c7570..20f03beee8a5 100644
--- a/contrib/xz/src/xz/signals.c
+++ b/contrib/xz/src/xz/signals.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file signals.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -50,6 +49,10 @@ signal_handler(int sig)
}
+#ifdef __APPLE__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wsign-conversion"
+#endif
extern void
signals_init(void)
{
@@ -82,6 +85,11 @@ signals_init(void)
sigaddset(&hooked_signals, message_progress_sigs[i]);
#endif
+#ifdef USE_SIGTSTP_HANDLER
+ // Add the SIGTSTP handler from mytime.c to hooked_signals.
+ sigaddset(&hooked_signals, SIGTSTP);
+#endif
+
// Using "my_sa" because "sa" may conflict with a sockaddr variable
// from system headers on Solaris.
struct sigaction my_sa;
@@ -96,10 +104,11 @@ signals_init(void)
my_sa.sa_flags = 0;
my_sa.sa_handler = &signal_handler;
+ struct sigaction old;
+
for (size_t i = 0; i < ARRAY_SIZE(sigs); ++i) {
// If the parent process has left some signals ignored,
// we don't unignore them.
- struct sigaction old;
if (sigaction(sigs[i], NULL, &old) == 0
&& old.sa_handler == SIG_IGN)
continue;
@@ -109,10 +118,22 @@ signals_init(void)
message_signal_handler();
}
+#ifdef USE_SIGTSTP_HANDLER
+ if (!(sigaction(SIGTSTP, NULL, &old) == 0
+ && old.sa_handler == SIG_IGN)) {
+ my_sa.sa_handler = &mytime_sigtstp_handler;
+ if (sigaction(SIGTSTP, &my_sa, NULL))
+ message_signal_handler();
+ }
+#endif
+
signals_are_initialized = true;
return;
}
+#ifdef __APPLE__
+# pragma GCC diagnostic pop
+#endif
#ifndef __VMS
diff --git a/contrib/xz/src/xz/signals.h b/contrib/xz/src/xz/signals.h
index 5b125e0f0d7b..629335d4c96b 100644
--- a/contrib/xz/src/xz/signals.h
+++ b/contrib/xz/src/xz/signals.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file signals.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// If this is true, we will clean up the possibly incomplete output file,
diff --git a/contrib/xz/src/xz/suffix.c b/contrib/xz/src/xz/suffix.c
index 6ce978783f78..1d548e485b8c 100644
--- a/contrib/xz/src/xz/suffix.c
+++ b/contrib/xz/src/xz/suffix.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file suffix.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -21,7 +20,13 @@
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
-# define strcmp strcasecmp
+# ifdef _MSC_VER
+# define suffix_strcmp _stricmp
+# else
+# define suffix_strcmp strcasecmp
+# endif
+#else
+# define suffix_strcmp strcmp
#endif
@@ -98,7 +103,7 @@ test_suffix(const char *suffix, const char *src_name, size_t src_len)
|| is_dir_sep(src_name[src_len - suffix_len - 1]))
return 0;
- if (strcmp(suffix, src_name + src_len - suffix_len) == 0)
+ if (suffix_strcmp(suffix, src_name + src_len - suffix_len) == 0)
return src_len - suffix_len;
return 0;
@@ -178,7 +183,7 @@ uncompressed_name(const char *src_name, const size_t src_len)
static void
msg_suffix(const char *src_name, const char *suffix)
{
- message_warning(_("%s: File already has `%s' suffix, skipping"),
+ message_warning(_("%s: File already has '%s' suffix, skipping"),
src_name, suffix);
return;
}
diff --git a/contrib/xz/src/xz/suffix.h b/contrib/xz/src/xz/suffix.h
index 135e905688b0..f59e3123ca8d 100644
--- a/contrib/xz/src/xz/suffix.h
+++ b/contrib/xz/src/xz/suffix.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file suffix.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// \brief Get the name of the destination file
diff --git a/contrib/xz/src/xz/util.c b/contrib/xz/src/xz/util.c
index 6ab4c2d776ce..0d339aede675 100644
--- a/contrib/xz/src/xz/util.c
+++ b/contrib/xz/src/xz/util.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file util.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "private.h"
@@ -148,8 +147,8 @@ str_to_uint64(const char *name, const char *value, uint64_t min, uint64_t max)
if (multiplier == 0) {
message(V_ERROR, _("%s: Invalid multiplier suffix"),
value - 1);
- message_fatal(_("Valid suffixes are `KiB' (2^10), "
- "`MiB' (2^20), and `GiB' (2^30)."));
+ message_fatal(_("Valid suffixes are 'KiB' (2^10), "
+ "'MiB' (2^20), and 'GiB' (2^30)."));
}
// Don't overflow here either.
@@ -165,7 +164,7 @@ str_to_uint64(const char *name, const char *value, uint64_t min, uint64_t max)
return result;
error:
- message_fatal(_("Value of the option `%s' must be in the range "
+ message_fatal(_("Value of the option '%s' must be in the range "
"[%" PRIu64 ", %" PRIu64 "]"),
name, min, max);
}
@@ -262,9 +261,30 @@ my_snprintf(char **pos, size_t *left, const char *fmt, ...)
extern bool
+is_tty(int fd)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ // There is no need to check if handle == INVALID_HANDLE_VALUE
+ // because it will return false anyway when used in GetConsoleMode().
+ // The resulting HANDLE is owned by the file descriptor.
+ // The HANDLE must not be closed here.
+ intptr_t handle = _get_osfhandle(fd);
+ DWORD mode;
+
+ // GetConsoleMode() is an easy way to tell if the HANDLE is a
+ // console or not. We do not care about the value of mode since we
+ // do not plan to use any further Windows console functions.
+ return GetConsoleMode((HANDLE)handle, &mode);
+#else
+ return isatty(fd);
+#endif
+}
+
+
+extern bool
is_tty_stdin(void)
{
- const bool ret = isatty(STDIN_FILENO);
+ const bool ret = is_tty(STDIN_FILENO);
if (ret)
message_error(_("Compressed data cannot be read from "
@@ -277,7 +297,7 @@ is_tty_stdin(void)
extern bool
is_tty_stdout(void)
{
- const bool ret = isatty(STDOUT_FILENO);
+ const bool ret = is_tty(STDOUT_FILENO);
if (ret)
message_error(_("Compressed data cannot be written to "
diff --git a/contrib/xz/src/xz/util.h b/contrib/xz/src/xz/util.h
index 6d7e1481863b..a2fdd0593372 100644
--- a/contrib/xz/src/xz/util.h
+++ b/contrib/xz/src/xz/util.h
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file util.h
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
/// \brief Safe malloc() that never returns NULL
@@ -105,6 +104,20 @@ lzma_attribute((__format__(__printf__, 3, 4)))
extern void my_snprintf(char **pos, size_t *left, const char *fmt, ...);
+/// \brief Test if file descriptor is a terminal
+///
+/// For POSIX systems, this is a simple wrapper around isatty(). However on
+/// Windows, isatty() returns true for all character devices, not just
+/// terminals.
+///
+/// \param fd File descriptor to test
+///
+/// \return bool:
+/// - true if file descriptor is a terminal
+/// - false otherwise
+extern bool is_tty(int fd);
+
+
/// \brief Test if stdin is a terminal
///
/// If stdin is a terminal, an error message is printed and exit status set
diff --git a/contrib/xz/src/xz/xz.1 b/contrib/xz/src/xz/xz.1
index 73ca6efd6aff..5b880e81e8c2 100644
--- a/contrib/xz/src/xz/xz.1
+++ b/contrib/xz/src/xz/xz.1
@@ -1,12 +1,10 @@
'\" t
+.\" SPDX-License-Identifier: 0BSD
.\"
.\" Authors: Lasse Collin
.\" Jia Tan
.\"
-.\" This file has been put into the public domain.
-.\" You can do whatever you want with this file.
-.\"
-.TH XZ 1 "2023-07-17" "Tukaani" "XZ Utils"
+.TH XZ 1 "2024-04-08" "Tukaani" "XZ Utils"
.
.SH NAME
xz, unxz, xzcat, lzma, unlzma, lzcat \- Compress or decompress .xz and .lzma files
@@ -801,8 +799,6 @@ in the single-threaded mode.
It may vary slightly between
.B xz
versions.
-Memory requirements of some of the future multithreaded modes may
-be dramatically higher than that of the single-threaded mode.
.IP \(bu 3
DecMem contains the decompressor memory requirements.
That is, the compression settings determine
@@ -811,6 +807,15 @@ The exact decompressor memory usage is slightly more than
the LZMA2 dictionary size, but the values in the table
have been rounded up to the next full MiB.
.RE
+.IP ""
+Memory requirements of the multi-threaded mode are
+significantly higher than that of the single-threaded mode.
+With the default value of
+.BR \-\-block\-size ,
+each thread needs 3*3*DictSize plus CompMem or DecMem.
+For example, four threads with preset
+.B \-6
+needs 660\(en670\ MiB of memory.
.TP
.BR \-e ", " \-\-extreme
Use a slower variant of the selected compression preset level
@@ -902,50 +907,90 @@ Using
.I size
less than the LZMA2 dictionary size is waste of RAM
because then the LZMA2 dictionary buffer will never get fully used.
-The sizes of the blocks are stored in the block headers,
-which a future version of
-.B xz
-will use for multi-threaded decompression.
+In multi-threaded mode,
+the sizes of the blocks are stored in the block headers.
+This size information is required for multi-threaded decompression.
.IP ""
In single-threaded mode no block splitting is done by default.
Setting this option doesn't affect memory usage.
No size information is stored in block headers,
thus files created in single-threaded mode
won't be identical to files created in multi-threaded mode.
-The lack of size information also means that a future version of
+The lack of size information also means that
.B xz
won't be able decompress the files in multi-threaded mode.
.TP
-.BI \-\-block\-list= sizes
+.BI \-\-block\-list= items
When compressing to the
.B .xz
-format, start a new block after
+format, start a new block with an optional custom filter chain after
the given intervals of uncompressed data.
.IP ""
-The uncompressed
-.I sizes
-of the blocks are specified as a comma-separated list.
-Omitting a size (two or more consecutive commas) is a shorthand
-to use the size of the previous block.
+The
+.I items
+are a comma-separated list.
+Each item consists of an optional filter chain number
+between 0 and 9 followed by a colon
+.RB ( : )
+and a required size of uncompressed data.
+Omitting an item (two or more consecutive commas) is a
+shorthand to use the size and filters of the previous item.
.IP ""
If the input file is bigger than the sum of
-.IR sizes ,
-the last value in
-.I sizes
-is repeated until the end of the file.
+the sizes in
+.IR items ,
+the last item is repeated until the end of the file.
A special value of
.B 0
-may be used as the last value to indicate that
+may be used as the last size to indicate that
the rest of the file should be encoded as a single block.
.IP ""
-If one specifies
-.I sizes
-that exceed the encoder's block size
+An alternative filter chain for each block can be
+specified in combination with the
+.BI \-\-filters1= filters
+\&...\&
+.BI \-\-filters9= filters
+options.
+These options define filter chains with an identifier
+between 1\(en9.
+Filter chain 0 can be used to refer to the default filter chain,
+which is the same as not specifying a filter chain.
+The filter chain identifier can be used before the uncompressed
+size, followed by a colon
+.RB ( : ).
+For example, if one specifies
+.B \-\-block\-list=1:2MiB,3:2MiB,2:4MiB,,2MiB,0:4MiB
+then blocks will be created using:
+.RS
+.IP \(bu 3
+The filter chain specified by
+.B \-\-filters1
+and 2 MiB input
+.IP \(bu 3
+The filter chain specified by
+.B \-\-filters3
+and 2 MiB input
+.IP \(bu 3
+The filter chain specified by
+.B \-\-filters2
+and 4 MiB input
+.IP \(bu 3
+The filter chain specified by
+.B \-\-filters2
+and 4 MiB input
+.IP \(bu 3
+The default filter chain and 2 MiB input
+.IP \(bu 3
+The default filter chain and 4 MiB input for every block until
+end of input.
+.RE
+.IP ""
+If one specifies a size that exceeds the encoder's block size
(either the default value in threaded mode or
the value specified with \fB\-\-block\-size=\fIsize\fR),
the encoder will create additional blocks while
keeping the boundaries specified in
-.IR sizes .
+.IR items .
For example, if one specifies
.B \-\-block\-size=10MiB
.B \-\-block\-list=5MiB,10MiB,8MiB,12MiB,24MiB
@@ -1262,6 +1307,15 @@ meet this condition,
but files compressed in single-threaded mode don't even if
.BI \-\-block\-size= size
has been used.
+.IP ""
+The default value for
+.I threads
+is
+.BR 0 .
+In
+.B xz
+5.4.x and older the default is
+.BR 1 .
.
.SS "Custom compressor filter chains"
A custom filter chain allows specifying
@@ -1295,22 +1349,37 @@ in the chain.
Depending on the filter, this limitation is either inherent to
the filter design or exists to prevent security issues.
.PP
-A custom filter chain is specified by using one or more
-filter options in the order they are wanted in the filter chain.
-That is, the order of filter options is significant!
+A custom filter chain can be specified in two different ways.
+The options
+.BI \-\-filters= filters
+and
+.BI \-\-filters1= filters
+\&...\&
+.BI \-\-filters9= filters
+allow specifying an entire filter chain in one option using the
+liblzma filter string syntax.
+Alternatively, a filter chain can be specified by using one or more
+individual filter options in the order they are wanted in the filter chain.
+That is, the order of the individual filter options is significant!
When decoding raw streams
.RB ( \-\-format=raw ),
-the filter chain is specified in the same order as
+the filter chain must be specified in the same order as
it was specified when compressing.
-.PP
-Filters take filter-specific
+Any individual filter or preset options specified before the full
+chain option
+(\fB\-\-filters=\fIfilters\fR)
+will be forgotten.
+Individual filters specified after the full chain option will reset the
+filter chain.
+.PP
+Both the full and individual filter options take filter-specific
.I options
as a comma-separated list.
Extra commas in
.I options
are ignored.
-Every option has a default value, so you need to
-specify only those you want to change.
+Every option has a default value, so
+specify those you want to change.
.PP
To see the whole filter chain and
.IR options ,
@@ -1321,6 +1390,45 @@ use
twice).
This works also for viewing the filter chain options used by presets.
.TP
+.BI \-\-filters= filters
+Specify the full filter chain or a preset in a single option.
+Each filter can be separated by spaces or two dashes
+.RB ( \-\- ).
+.I filters
+may need to be quoted on the shell command line so it is
+parsed as a single option.
+To denote
+.IR options ,
+use
+.B :
+or
+.BR = .
+A preset can be prefixed with a
+.B \-
+and followed with zero or more flags.
+The only supported flag is
+.B e
+to apply the same options as
+.BR \-\-extreme .
+.TP
+\fB\-\-filters1\fR=\fIfilters\fR ... \fB\-\-filters9\fR=\fIfilters
+Specify up to nine additional filter chains that can be used with
+.BR \-\-block\-list .
+.IP ""
+For example, when compressing an archive with executable files
+followed by text files, the executable part could use a filter
+chain with a BCJ filter and the text part only the LZMA2 filter.
+.TP
+.B \-\-filters-help
+Display a help message describing how to specify presets and
+custom filter chains in the
+.B \-\-filters
+and
+.BI \-\-filters1= filters
+\&...\&
+.BI \-\-filters9= filters
+options, and exit successfully.
+.TP
\fB\-\-lzma1\fR[\fB=\fIoptions\fR]
.PD 0
.TP
@@ -1704,6 +1812,8 @@ and
\fB\-\-ia64\fR[\fB=\fIoptions\fR]
.TP
\fB\-\-sparc\fR[\fB=\fIoptions\fR]
+.TP
+\fB\-\-riscv\fR[\fB=\fIoptions\fR]
.PD
Add a branch/call/jump (BCJ) filter to the filter chain.
These filters can be used only as a non-last filter
@@ -1762,6 +1872,7 @@ ARM64;4;4096-byte alignment is best
PowerPC;4;Big endian only
IA-64;16;Itanium
SPARC;4;
+RISC-V;2;
.TE
.RE
.RE
@@ -1770,14 +1881,38 @@ Since the BCJ-filtered data is usually compressed with LZMA2,
the compression ratio may be improved slightly if
the LZMA2 options are set to match the
alignment of the selected BCJ filter.
-For example, with the IA-64 filter, it's good to set
-.B pb=4
-or even
+Examples:
+.RS
+.IP \(bu 3
+IA-64 filter has 16-byte alignment so
.B pb=4,lp=4,lc=0
+is good
with LZMA2 (2^4=16).
-The x86 filter is an exception;
-it's usually good to stick to LZMA2's default
-four-byte alignment when compressing x86 executables.
+.IP \(bu 3
+RISC-V code has 2-byte or 4-byte alignment
+depending on whether the file contains
+16-bit compressed instructions (the C extension).
+When 16-bit instructions are used,
+.B pb=2,lp=1,lc=3
+or
+.B pb=1,lp=1,lc=3
+is good.
+When 16-bit instructions aren't present,
+.B pb=2,lp=2,lc=2
+is the best.
+.B readelf \-h
+can be used to check if "RVC"
+appears on the "Flags" line.
+.IP \(bu 3
+ARM64 is always 4-byte aligned so
+.B pb=2,lp=2,lc=2
+is the best.
+.IP \(bu 3
+The x86 filter is an exception.
+It's usually good to stick to LZMA2's defaults
+.RB ( pb=2,lp=0,lc=3 )
+when compressing x86 executables.
+.RE
.IP ""
All BCJ filters support the same
.IR options :
@@ -1954,107 +2089,14 @@ easier to parse by other programs.
Currently
.B \-\-robot
is supported only together with
-.BR \-\-version ,
+.BR \-\-list ,
+.BR \-\-filters\-help ,
.BR \-\-info\-memory ,
and
-.BR \-\-list .
+.BR \-\-version .
It will be supported for compression and
decompression in the future.
.
-.SS Version
-.B "xz \-\-robot \-\-version"
-prints the version number of
-.B xz
-and liblzma in the following format:
-.PP
-.BI XZ_VERSION= XYYYZZZS
-.br
-.BI LIBLZMA_VERSION= XYYYZZZS
-.TP
-.I X
-Major version.
-.TP
-.I YYY
-Minor version.
-Even numbers are stable.
-Odd numbers are alpha or beta versions.
-.TP
-.I ZZZ
-Patch level for stable releases or
-just a counter for development releases.
-.TP
-.I S
-Stability.
-0 is alpha, 1 is beta, and 2 is stable.
-.I S
-should be always 2 when
-.I YYY
-is even.
-.PP
-.I XYYYZZZS
-are the same on both lines if
-.B xz
-and liblzma are from the same XZ Utils release.
-.PP
-Examples: 4.999.9beta is
-.B 49990091
-and
-5.0.0 is
-.BR 50000002 .
-.
-.SS "Memory limit information"
-.B "xz \-\-robot \-\-info\-memory"
-prints a single line with multiple tab-separated columns:
-.IP 1. 4
-Total amount of physical memory (RAM) in bytes.
-.IP 2. 4
-Memory usage limit for compression in bytes
-.RB ( \-\-memlimit\-compress ).
-A special value of
-.B 0
-indicates the default setting
-which for single-threaded mode is the same as no limit.
-.IP 3. 4
-Memory usage limit for decompression in bytes
-.RB ( \-\-memlimit\-decompress ).
-A special value of
-.B 0
-indicates the default setting
-which for single-threaded mode is the same as no limit.
-.IP 4. 4
-Since
-.B xz
-5.3.4alpha:
-Memory usage for multi-threaded decompression in bytes
-.RB ( \-\-memlimit\-mt\-decompress ).
-This is never zero because a system-specific default value
-shown in the column 5
-is used if no limit has been specified explicitly.
-This is also never greater than the value in the column 3
-even if a larger value has been specified with
-.BR \-\-memlimit\-mt\-decompress .
-.IP 5. 4
-Since
-.B xz
-5.3.4alpha:
-A system-specific default memory usage limit
-that is used to limit the number of threads
-when compressing with an automatic number of threads
-.RB ( \-\-threads=0 )
-and no memory usage limit has been specified
-.RB ( \-\-memlimit\-compress ).
-This is also used as the default value for
-.BR \-\-memlimit\-mt\-decompress .
-.IP 6. 4
-Since
-.B xz
-5.3.4alpha:
-Number of available processor threads.
-.PP
-In the future, the output of
-.B "xz \-\-robot \-\-info\-memory"
-may have more columns, but never more than a single line.
-.
.SS "List mode"
.B "xz \-\-robot \-\-list"
uses tab-separated output.
@@ -2339,6 +2381,127 @@ Future versions may add new line types and
new columns can be added to the existing line types,
but the existing columns won't be changed.
.
+.SS "Filters help"
+.B "xz \-\-robot \-\-filters-help"
+prints the supported filters in the following format:
+.PP
+\fIfilter\fB:\fIoption\fB=<\fIvalue\fB>,\fIoption\fB=<\fIvalue\fB>\fR...
+.TP
+.I filter
+Name of the filter
+.TP
+.I option
+Name of a filter specific option
+.TP
+.I value
+Numeric
+.I value
+ranges appear as
+\fB<\fImin\fB\-\fImax\fB>\fR.
+String
+.I value
+choices are shown within
+.B "< >"
+and separated by a
+.B |
+character.
+.PP
+Each filter is printed on its own line.
+.
+.SS "Memory limit information"
+.B "xz \-\-robot \-\-info\-memory"
+prints a single line with multiple tab-separated columns:
+.IP 1. 4
+Total amount of physical memory (RAM) in bytes.
+.IP 2. 4
+Memory usage limit for compression in bytes
+.RB ( \-\-memlimit\-compress ).
+A special value of
+.B 0
+indicates the default setting
+which for single-threaded mode is the same as no limit.
+.IP 3. 4
+Memory usage limit for decompression in bytes
+.RB ( \-\-memlimit\-decompress ).
+A special value of
+.B 0
+indicates the default setting
+which for single-threaded mode is the same as no limit.
+.IP 4. 4
+Since
+.B xz
+5.3.4alpha:
+Memory usage for multi-threaded decompression in bytes
+.RB ( \-\-memlimit\-mt\-decompress ).
+This is never zero because a system-specific default value
+shown in the column 5
+is used if no limit has been specified explicitly.
+This is also never greater than the value in the column 3
+even if a larger value has been specified with
+.BR \-\-memlimit\-mt\-decompress .
+.IP 5. 4
+Since
+.B xz
+5.3.4alpha:
+A system-specific default memory usage limit
+that is used to limit the number of threads
+when compressing with an automatic number of threads
+.RB ( \-\-threads=0 )
+and no memory usage limit has been specified
+.RB ( \-\-memlimit\-compress ).
+This is also used as the default value for
+.BR \-\-memlimit\-mt\-decompress .
+.IP 6. 4
+Since
+.B xz
+5.3.4alpha:
+Number of available processor threads.
+.PP
+In the future, the output of
+.B "xz \-\-robot \-\-info\-memory"
+may have more columns, but never more than a single line.
+.
+.SS Version
+.B "xz \-\-robot \-\-version"
+prints the version number of
+.B xz
+and liblzma in the following format:
+.PP
+.BI XZ_VERSION= XYYYZZZS
+.br
+.BI LIBLZMA_VERSION= XYYYZZZS
+.TP
+.I X
+Major version.
+.TP
+.I YYY
+Minor version.
+Even numbers are stable.
+Odd numbers are alpha or beta versions.
+.TP
+.I ZZZ
+Patch level for stable releases or
+just a counter for development releases.
+.TP
+.I S
+Stability.
+0 is alpha, 1 is beta, and 2 is stable.
+.I S
+should be always 2 when
+.I YYY
+is even.
+.PP
+.I XYYYZZZS
+are the same on both lines if
+.B xz
+and liblzma are from the same XZ Utils release.
+.PP
+Examples: 4.999.9beta is
+.B 49990091
+and
+5.0.0 is
+.BR 50000002 .
+.
.SH "EXIT STATUS"
.TP
.B 0
@@ -2391,7 +2554,7 @@ is run by a script or tool, for example, GNU
.RS
.PP
.nf
-.ft CW
+.ft CR
XZ_OPT=\-2v tar caf foo.tar.xz foo
.ft R
.fi
@@ -2411,7 +2574,7 @@ scripts one may use something like this:
.RS
.PP
.nf
-.ft CW
+.ft CR
XZ_OPT=${XZ_OPT\-"\-7e"}
export XZ_OPT
.ft R
@@ -2669,7 +2832,7 @@ if compression is successful:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz foo
.ft R
.fi
@@ -2685,7 +2848,7 @@ even if decompression is successful:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-dk bar.xz
.ft R
.fi
@@ -2703,7 +2866,7 @@ and 5\ MiB, respectively):
.RS
.PP
.nf
-.ft CW
+.ft CR
tar cf \- baz | xz \-4e > baz.tar.xz
.ft R
.fi
@@ -2714,7 +2877,7 @@ to standard output with a single command:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-dcf a.txt b.txt.xz c.txt d.txt.lzma > abcd.txt
.ft R
.fi
@@ -2729,7 +2892,7 @@ can be used to parallelize compression of many files:
.RS
.PP
.nf
-.ft CW
+.ft CR
find . \-type f \e! \-name '*.xz' \-print0 \e
| xargs \-0r \-P4 \-n16 xz \-T1
.ft R
@@ -2769,7 +2932,7 @@ after compressing multiple files:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-robot \-\-list *.xz | awk '/^totals/{print $5\-$4}'
.ft R
.fi
@@ -2789,7 +2952,7 @@ option:
.RS
.PP
.nf
-.ft CW
+.ft CR
if ! eval "$(xz \-\-robot \-\-version 2> /dev/null)" ||
[ "$XZ_VERSION" \-lt 50000002 ]; then
echo "Your xz is too old."
@@ -2805,7 +2968,7 @@ but if a limit has already been set, don't increase it:
.RS
.PP
.nf
-.ft CW
+.ft CR
NEWLIM=$((123 << 20))\ \ # 123 MiB
OLDLIM=$(xz \-\-robot \-\-info\-memory | cut \-f3)
if [ $OLDLIM \-eq 0 \-o $OLDLIM \-gt $NEWLIM ]; then
@@ -2858,7 +3021,7 @@ can be modified to use a bigger dictionary:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-lzma2=preset=1,dict=32MiB foo.tar
.ft R
.fi
@@ -2886,7 +3049,7 @@ would use:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-vv \-\-lzma2=dict=192MiB big_foo.tar
.ft R
.fi
@@ -2916,7 +3079,7 @@ using about 100\ KiB of memory.
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-check=crc32 \-\-lzma2=preset=6e,dict=64KiB foo
.ft R
.fi
@@ -2944,7 +3107,7 @@ slightly (like 0.1\ %) smaller file than
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-lzma2=preset=6e,pb=0,lc=4 source_code.tar
.ft R
.fi
@@ -2957,7 +3120,7 @@ using the x86 BCJ filter:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-x86 \-\-lzma2 libfoo.so
.ft R
.fi
@@ -2992,7 +3155,7 @@ to LZMA2 to accommodate the three-byte alignment:
.RS
.PP
.nf
-.ft CW
+.ft CR
xz \-\-delta=dist=3 \-\-lzma2=pb=0 foo.tiff
.ft R
.fi
diff --git a/contrib/xz/src/xzdec/xzdec.1 b/contrib/xz/src/xzdec/xzdec.1
index 78bc9b4a9813..5198efb4612e 100644
--- a/contrib/xz/src/xzdec/xzdec.1
+++ b/contrib/xz/src/xzdec/xzdec.1
@@ -1,10 +1,8 @@
+.\" SPDX-License-Identifier: 0BSD
.\"
.\" Author: Lasse Collin
.\"
-.\" This file has been put into the public domain.
-.\" You can do whatever you want with this file.
-.\"
-.TH XZDEC 1 "2017-04-19" "Tukaani" "XZ Utils"
+.TH XZDEC 1 "2024-04-08" "Tukaani" "XZ Utils"
.SH NAME
xzdec, lzmadec \- Small .xz and .lzma decompressors
.SH SYNOPSIS
diff --git a/contrib/xz/src/xzdec/xzdec.c b/contrib/xz/src/xzdec/xzdec.c
index 556c548d05ad..4d881748b2e4 100644
--- a/contrib/xz/src/xzdec/xzdec.c
+++ b/contrib/xz/src/xzdec/xzdec.c
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: 0BSD
+
///////////////////////////////////////////////////////////////////////////////
//
/// \file xzdec.c
@@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
-// This file has been put into the public domain.
-// You can do whatever you want with this file.
-//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"
@@ -16,7 +15,30 @@
#include <stdarg.h>
#include <errno.h>
#include <stdio.h>
-#include <unistd.h>
+
+#ifndef _MSC_VER
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_CAP_RIGHTS_LIMIT
+# include <sys/capsicum.h>
+#endif
+
+#ifdef HAVE_LINUX_LANDLOCK
+# include <linux/landlock.h>
+# include <sys/prctl.h>
+# include <sys/syscall.h>
+# ifdef LANDLOCK_ACCESS_NET_BIND_TCP
+# define LANDLOCK_ABI_MAX 4
+# else
+# define LANDLOCK_ABI_MAX 3
+# endif
+#endif
+
+#if defined(HAVE_CAP_RIGHTS_LIMIT) || defined(HAVE_PLEDGE) \
+ || defined(HAVE_LINUX_LANDLOCK)
+# define ENABLE_SANDBOX 1
+#endif
#include "getopt.h"
#include "tuklib_progname.h"
@@ -25,6 +47,10 @@
#ifdef TUKLIB_DOSLIKE
# include <fcntl.h>
# include <io.h>
+# ifdef _MSC_VER
+# define fileno _fileno
+# define setmode _setmode
+# endif
#endif
@@ -273,9 +299,123 @@ uncompress(lzma_stream *strm, FILE *file, const char *filename)
}
+#ifdef ENABLE_SANDBOX
+static void
+sandbox_enter(int src_fd)
+{
+#if defined(HAVE_CAP_RIGHTS_LIMIT)
+ // Capsicum needs FreeBSD 10.2 or later.
+ cap_rights_t rights;
+
+ if (cap_enter())
+ goto error;
+
+ if (cap_rights_limit(src_fd, cap_rights_init(&rights, CAP_READ)))
+ goto error;
+
+ // If not reading from stdin, remove all capabilities from it.
+ if (src_fd != STDIN_FILENO && cap_rights_limit(
+ STDIN_FILENO, cap_rights_clear(&rights)))
+ goto error;
+
+ if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,
+ CAP_WRITE)))
+ goto error;
+
+ if (cap_rights_limit(STDERR_FILENO, cap_rights_init(&rights,
+ CAP_WRITE)))
+ goto error;
+
+#elif defined(HAVE_PLEDGE)
+ // pledge() was introduced in OpenBSD 5.9.
+ if (pledge("stdio", ""))
+ goto error;
+
+ (void)src_fd;
+
+#elif defined(HAVE_LINUX_LANDLOCK)
+ int landlock_abi = syscall(SYS_landlock_create_ruleset,
+ (void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
+
+ if (landlock_abi > 0) {
+ if (landlock_abi > LANDLOCK_ABI_MAX)
+ landlock_abi = LANDLOCK_ABI_MAX;
+
+ const struct landlock_ruleset_attr attr = {
+ .handled_access_fs = (1ULL
+ << (12 + my_min(3, landlock_abi))) - 1,
+# if LANDLOCK_ABI_MAX >= 4
+ .handled_access_net = landlock_abi < 4 ? 0 :
+ (LANDLOCK_ACCESS_NET_BIND_TCP
+ | LANDLOCK_ACCESS_NET_CONNECT_TCP),
+# endif
+ };
+
+ const int ruleset_fd = syscall(SYS_landlock_create_ruleset,
+ &attr, sizeof(attr), 0U);
+ if (ruleset_fd < 0)
+ goto error;
+
+ // All files we need should have already been opened. Thus,
+ // we don't need to add any rules using landlock_add_rule(2)
+ // before activating the sandbox.
+ if (syscall(SYS_landlock_restrict_self, ruleset_fd, 0U) != 0)
+ goto error;
+ }
+
+ (void)src_fd;
+
+#else
+# error ENABLE_SANDBOX is defined but no sandboxing method was found.
+#endif
+
+ return;
+
+error:
+#ifdef HAVE_CAP_RIGHTS_LIMIT
+ // If a kernel is configured without capability mode support or
+ // used in an emulator that does not implement the capability
+ // system calls, then the Capsicum system calls will fail and set
+ // errno to ENOSYS. In that case xzdec will silently run without
+ // the sandbox.
+ if (errno == ENOSYS)
+ return;
+#endif
+
+ my_errorf("Failed to enable the sandbox");
+ exit(EXIT_FAILURE);
+}
+#endif
+
+
int
main(int argc, char **argv)
{
+#ifdef HAVE_PLEDGE
+ // OpenBSD's pledge(2) sandbox.
+ // Initially enable the sandbox slightly more relaxed so that
+ // the process can still open files. This allows the sandbox to
+ // be enabled when parsing command line arguments and decompressing
+ // all files (the more strict sandbox only restricts the last file
+ // that is decompressed).
+ if (pledge("stdio rpath", "")) {
+ my_errorf("Failed to enable the sandbox");
+ exit(EXIT_FAILURE);
+ }
+#endif
+
+#ifdef HAVE_LINUX_LANDLOCK
+ // Prevent the process from gaining new privileges. This must be done
+ // before landlock_restrict_self(2) but since we will never need new
+ // privileges, this call can be done here already.
+ //
+ // This is supported since Linux 3.5. Ignore the return value to
+ // keep compatibility with old kernels. landlock_restrict_self(2)
+ // will fail if the no_new_privs attribute isn't set, thus if prctl()
+ // fails here the error will still be detected when it matters.
+ (void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
+#endif
+
// Initialize progname which we will be used in error messages.
tuklib_progname_init(argv);
@@ -295,24 +435,42 @@ main(int argc, char **argv)
if (optind == argc) {
// No filenames given, decode from stdin.
+#ifdef ENABLE_SANDBOX
+ sandbox_enter(STDIN_FILENO);
+#endif
uncompress(&strm, stdin, "(stdin)");
} else {
// Loop through the filenames given on the command line.
do {
+ FILE *src_file;
+ const char *src_name;
+
// "-" indicates stdin.
if (strcmp(argv[optind], "-") == 0) {
- uncompress(&strm, stdin, "(stdin)");
+ src_file = stdin;
+ src_name = "(stdin)";
} else {
- FILE *file = fopen(argv[optind], "rb");
- if (file == NULL) {
- my_errorf("%s: %s", argv[optind],
+ src_name = argv[optind];
+ src_file = fopen(src_name, "rb");
+ if (src_file == NULL) {
+ my_errorf("%s: %s", src_name,
strerror(errno));
exit(EXIT_FAILURE);
}
-
- uncompress(&strm, file, argv[optind]);
- fclose(file);
}
+#ifdef ENABLE_SANDBOX
+ // Enable the strict sandbox for the last file.
+ // Then the process can no longer open additional
+ // files. The typical xzdec use case is to decompress
+ // a single file so this way the strictest sandboxing
+ // is used in most cases.
+ if (optind == argc - 1)
+ sandbox_enter(fileno(src_file));
+#endif
+ uncompress(&strm, src_file, src_name);
+
+ if (src_file != stdin)
+ (void)fclose(src_file);
} while (++optind < argc);
}