]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
2 years agoTests: test_check: Test corner cases of CLMUL CRC64.
Lasse Collin [Fri, 30 Dec 2022 18:10:08 +0000 (20:10 +0200)] 
Tests: test_check: Test corner cases of CLMUL CRC64.

2 years agoTests: Clarify a comment in test_lzip_decoder.c.
Lasse Collin [Fri, 30 Dec 2022 17:36:49 +0000 (19:36 +0200)] 
Tests: Clarify a comment in test_lzip_decoder.c.

2 years agoxz: Includes <time.h> and <sys/time.h> conditionally in mytime.c.
Jia Tan [Wed, 28 Dec 2022 17:55:19 +0000 (01:55 +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.

2 years agoliblzma: Includes sys/time.h conditionally in mythread
Jia Tan [Wed, 28 Dec 2022 17:15:27 +0000 (01:15 +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.

2 years agoBuild: No longer require HAVE_DECL_CLOCK_MONOTONIC to always be set.
Jia Tan [Wed, 28 Dec 2022 17:10:53 +0000 (01:10 +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.

2 years agoTranslations: Add Ukrainian translations of man pages.
Jia Tan [Tue, 27 Dec 2022 17:14:07 +0000 (01:14 +0800)] 
Translations: Add Ukrainian translations of man pages.

Thanks to Yuri Chornoivan

2 years agoCI/CD: Create initial version of CI/CD workflow.
Jia Tan [Thu, 22 Dec 2022 16:34:48 +0000 (00:34 +0800)] 
CI/CD: Create initial version of CI/CD workflow.

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.

2 years agoliblzma: Update documentation for lzma_filter_encoder.
Jia Tan [Thu, 22 Dec 2022 15:14:53 +0000 (23:14 +0800)] 
liblzma: Update documentation for lzma_filter_encoder.

2 years agoTests: Adds lzip decoder tests
Jia Tan [Wed, 21 Dec 2022 13:12:03 +0000 (21:12 +0800)] 
Tests: Adds lzip decoder tests

2 years agoDoxygen: Update .gitignore for generating docs for in source build.
Jia Cheong Tan [Tue, 20 Dec 2022 14:05:21 +0000 (22:05 +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.

2 years agoliblzma: Fix lzma_microlzma_encoder() return value.
Jia Tan [Tue, 20 Dec 2022 12:46:44 +0000 (20:46 +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.

2 years agoCMake: Update .gitignore for CMake artifacts from in source build.
Jia Tan [Fri, 16 Dec 2022 12:58:55 +0000 (20:58 +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.

2 years agoliblzma: Update authors list in arm64.c.
Lasse Collin [Fri, 16 Dec 2022 16:30:02 +0000 (18:30 +0200)] 
liblzma: Update authors list in arm64.c.

2 years agoBump version to 5.4.0 and soname to 5.4.0. v5.4.0
Lasse Collin [Tue, 13 Dec 2022 18:37:17 +0000 (20:37 +0200)] 
Bump version to 5.4.0 and soname to 5.4.0.

2 years agoUpdate INSTALL: CMake on Windows isn't experimental anymore.
Lasse Collin [Tue, 13 Dec 2022 18:29:39 +0000 (20:29 +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.

2 years agoAdd NEWS for 5.4.0.
Lasse Collin [Tue, 13 Dec 2022 17:47:53 +0000 (19:47 +0200)] 
Add NEWS for 5.4.0.

2 years agoFix a typo in NEWS.
Lasse Collin [Tue, 13 Dec 2022 15:41:20 +0000 (17:41 +0200)] 
Fix a typo in NEWS.

2 years agoAdd NEWS for 5.2.10.
Lasse Collin [Tue, 13 Dec 2022 15:41:03 +0000 (17:41 +0200)] 
Add NEWS for 5.2.10.

2 years agoTests: Fix a typo in tests/files/README.
Lasse Collin [Tue, 13 Dec 2022 10:30:45 +0000 (12:30 +0200)] 
Tests: Fix a typo in tests/files/README.

2 years agoTests: Add two ARM64 test files.
Lasse Collin [Tue, 13 Dec 2022 10:30:09 +0000 (12:30 +0200)] 
Tests: Add two ARM64 test files.

2 years agoTranslations: Update the Catalan translation.
Lasse Collin [Mon, 12 Dec 2022 20:44:21 +0000 (22:44 +0200)] 
Translations: Update the Catalan translation.

2 years agoUpdate THANKS.
Lasse Collin [Mon, 12 Dec 2022 17:18:12 +0000 (19:18 +0200)] 
Update THANKS.

2 years agoUpdate AUTHORS.
Lasse Collin [Mon, 12 Dec 2022 17:07:58 +0000 (19:07 +0200)] 
Update AUTHORS.

2 years agoDocs: Omit multi-threaded decompress from TODO.
Lasse Collin [Mon, 12 Dec 2022 13:31:14 +0000 (15:31 +0200)] 
Docs: Omit multi-threaded decompress from TODO.

The TODO file outdated still.

2 years agoDocs: Update xz-file-format.txt to 1.1.0 for ARM64 filter.
Lasse Collin [Sun, 11 Dec 2022 19:16:09 +0000 (21:16 +0200)] 
Docs: Update xz-file-format.txt to 1.1.0 for ARM64 filter.

2 years agoxz: Rename --experimental-arm64 to --arm64.
Lasse Collin [Sun, 11 Dec 2022 19:13:57 +0000 (21:13 +0200)] 
xz: Rename --experimental-arm64 to --arm64.

2 years agoliblzma: Change LZMA_FILTER_ARM64 to the official Filter ID 0x0A.
Lasse Collin [Sun, 11 Dec 2022 19:13:06 +0000 (21:13 +0200)] 
liblzma: Change LZMA_FILTER_ARM64 to the official Filter ID 0x0A.

2 years agoxz: Make args_info.files_name a const pointer.
Lasse Collin [Thu, 8 Dec 2022 17:24:22 +0000 (19:24 +0200)] 
xz: Make args_info.files_name a const pointer.

2 years agoxz: Don't modify argv[].
Lasse Collin [Thu, 8 Dec 2022 17:18:16 +0000 (19:18 +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.

2 years agoTranslations: Update the German man page translations.
Lasse Collin [Thu, 8 Dec 2022 16:18:57 +0000 (18:18 +0200)] 
Translations: Update the German man page translations.

2 years agoTranslations: Update the German translation.
Jia Tan [Tue, 6 Dec 2022 15:05:56 +0000 (23:05 +0800)] 
Translations: Update the German translation.

2 years agoTranslations: Update the Turkish translation.
Jia Tan [Tue, 6 Dec 2022 15:04:25 +0000 (23:04 +0800)] 
Translations: Update the Turkish translation.

2 years agoTranslations: Update the Croatian translation.
Jia Tan [Tue, 6 Dec 2022 15:02:11 +0000 (23:02 +0800)] 
Translations: Update the Croatian translation.

2 years agoTranslations: Add Romanian translation of man pages.
Jia Tan [Tue, 6 Dec 2022 14:56:30 +0000 (22:56 +0800)] 
Translations: Add Romanian translation of man pages.

Thanks to Remus-Gabriel Chelu.

2 years agoTranslations: Update the Romanian translation.
Jia Tan [Tue, 6 Dec 2022 14:52:13 +0000 (22:52 +0800)] 
Translations: Update the Romanian translation.

2 years agoliblzma: Check for unexpected NULL pointers in block_header_decode().
Lasse Collin [Thu, 8 Dec 2022 15:30:09 +0000 (17:30 +0200)] 
liblzma: Check for unexpected NULL pointers in block_header_decode().

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.

2 years agoBump version number for 5.3.5beta. v5.3.5beta
Lasse Collin [Thu, 1 Dec 2022 18:59:32 +0000 (20:59 +0200)] 
Bump version number for 5.3.5beta.

This also sorts the symbol names alphabetically in liblzma_*.map.

2 years agoAdd NEWS for 5.3.5beta.
Lasse Collin [Thu, 1 Dec 2022 18:57:26 +0000 (20:57 +0200)] 
Add NEWS for 5.3.5beta.

2 years agoUpdate THANKS.
Lasse Collin [Thu, 1 Dec 2022 18:57:09 +0000 (20:57 +0200)] 
Update THANKS.

2 years agoliblzma: Use __has_attribute(__symver__) to fix Clang detection.
Lasse Collin [Thu, 1 Dec 2022 18:04:17 +0000 (20:04 +0200)] 
liblzma: Use __has_attribute(__symver__) to fix Clang detection.

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.

Thanks to Tomasz Gajc for the bug report.

2 years agoliblzma: Omit zero-skipping from ARM64 filter.
Lasse Collin [Thu, 1 Dec 2022 16:51:52 +0000 (18:51 +0200)] 
liblzma: Omit zero-skipping from ARM64 filter.

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.

This is still marked as experimental with a new temporary Filter ID.

2 years agoxz: Omit the special notes about ARM64 filter on the man page.
Lasse Collin [Thu, 1 Dec 2022 16:13:27 +0000 (18:13 +0200)] 
xz: Omit the special notes about ARM64 filter on the man page.

2 years agoliblzma: Don't be over-specific in lzma_str_to_filters API doc.
Lasse Collin [Thu, 1 Dec 2022 16:12:03 +0000 (18:12 +0200)] 
liblzma: Don't be over-specific in lzma_str_to_filters API doc.

2 years agoliblzma: Silence unused variable warning when BCJ filters are disabled.
Lasse Collin [Thu, 1 Dec 2022 15:54:23 +0000 (17:54 +0200)] 
liblzma: Silence unused variable warning when BCJ filters are disabled.

Thanks to Jia Tan for the original patch.

2 years agoTranslations: Update the Chinese (simplified) translation.
Lasse Collin [Thu, 1 Dec 2022 15:38:03 +0000 (17:38 +0200)] 
Translations: Update the Chinese (simplified) translation.

2 years agoAdd NEWS for 5.2.9.
Lasse Collin [Wed, 30 Nov 2022 16:55:03 +0000 (18:55 +0200)] 
Add NEWS for 5.2.9.

2 years agoxz: Remove message_filters_to_str function prototype from message.h.
Jia Tan [Wed, 30 Nov 2022 15:33:08 +0000 (23:33 +0800)] 
xz: Remove message_filters_to_str function prototype from message.h.

This was forgotten from 7484744af6cbabe81e92af7d9e061dfd597fff7b.

2 years agoChange the bug report address.
Lasse Collin [Wed, 30 Nov 2022 16:08:34 +0000 (18:08 +0200)] 
Change the bug report address.

It forwards to me and Jia Tan.

Also update the IRC reference in README as #tukaani was moved
to Libera Chat long ago.

2 years agoBuild: Add string_conversion.c to CMake, DOS, and VS files.
Lasse Collin [Wed, 30 Nov 2022 15:50:17 +0000 (17:50 +0200)] 
Build: Add string_conversion.c to CMake, DOS, and VS files.

2 years agoUpdate to HTTPS URLs in AUTHORS.
Lasse Collin [Wed, 30 Nov 2022 15:38:32 +0000 (17:38 +0200)] 
Update to HTTPS URLs in AUTHORS.

2 years agoliblzma: Improve documentation for string to filter functions.
Jia Tan [Tue, 29 Nov 2022 16:52:06 +0000 (00:52 +0800)] 
liblzma: Improve documentation for string to filter functions.

2 years agoliblzma: Two fixes to lzma_str_list_filters() API docs.
Lasse Collin [Tue, 29 Nov 2022 20:27:42 +0000 (22:27 +0200)] 
liblzma: Two fixes to lzma_str_list_filters() API docs.

Thanks to Jia Tan.

2 years agoxz: Use lzma_str_from_filters().
Lasse Collin [Mon, 28 Nov 2022 19:57:47 +0000 (21:57 +0200)] 
xz: Use lzma_str_from_filters().

Two uses: Displaying encoder filter chain when compressing with -vv,
and displaying the decoder filter chain in --list -vv.

2 years agoliblzma: Add lzma_str_to_filters, _from_filters, and _list_filters.
Lasse Collin [Mon, 28 Nov 2022 19:37:48 +0000 (21:37 +0200)] 
liblzma: Add lzma_str_to_filters, _from_filters, and _list_filters.

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.

2 years agoliblzma: Make lzma_validate_chain() available outside filter_common.c.
Lasse Collin [Mon, 28 Nov 2022 19:02:19 +0000 (21:02 +0200)] 
liblzma: Make lzma_validate_chain() available outside filter_common.c.

2 years agoliblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused.
Lasse Collin [Mon, 28 Nov 2022 08:51:03 +0000 (10:51 +0200)] 
liblzma: Remove lzma_lz_decoder_uncompressed() as it's now unused.

2 years agoliblzma: Use LZMA1EXT feature in lzma_microlzma_decoder().
Lasse Collin [Mon, 28 Nov 2022 08:48:53 +0000 (10:48 +0200)] 
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.

2 years agoliblzma: Use LZMA1EXT feature in lzma_alone_decoder().
Lasse Collin [Mon, 28 Nov 2022 08:28:20 +0000 (10:28 +0200)] 
liblzma: Use LZMA1EXT feature in lzma_alone_decoder().

This avoids the need to use the slightly ugly method to
set the uncompressed size.

2 years agoliblzma: Add LZMA_FILTER_LZMA1EXT to support LZMA1 without end marker.
Lasse Collin [Sun, 27 Nov 2022 21:16:21 +0000 (23:16 +0200)] 
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).

2 years agoliblzma: Avoid unneeded use of void pointer in LZMA decoder.
Lasse Collin [Sun, 27 Nov 2022 16:43:07 +0000 (18:43 +0200)] 
liblzma: Avoid unneeded use of void pointer in LZMA decoder.

2 years agoliblzma: Pass the Filter ID to LZ encoder and decoder.
Lasse Collin [Sun, 27 Nov 2022 16:20:33 +0000 (18:20 +0200)] 
liblzma: Pass the Filter ID to LZ encoder and decoder.

This allows using two Filter IDs with the same
initialization function and data structures.

2 years agoliblzma: Remove two FIXME comments.
Lasse Collin [Sat, 26 Nov 2022 23:03:16 +0000 (01:03 +0200)] 
liblzma: Remove two FIXME comments.

2 years agoxz: Use lzma_filters_free().
Lasse Collin [Sat, 26 Nov 2022 20:25:30 +0000 (22:25 +0200)] 
xz: Use lzma_filters_free().

2 years agoliblzma: Use lzma_filters_free() in more places.
Lasse Collin [Sat, 26 Nov 2022 20:21:13 +0000 (22:21 +0200)] 
liblzma: Use lzma_filters_free() in more places.

2 years agoliblzma: Omit simple coder init functions if they are disabled.
Lasse Collin [Fri, 25 Nov 2022 16:04:37 +0000 (18:04 +0200)] 
liblzma: Omit simple coder init functions if they are disabled.

2 years agoxz: Allow nice_len 2 and 3 even if match finder requires 3 or 4.
Lasse Collin [Thu, 24 Nov 2022 21:24:59 +0000 (23:24 +0200)] 
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.

2 years agoliblzma: Allow nice_len 2 and 3 even if match finder requires 3 or 4.
Lasse Collin [Thu, 24 Nov 2022 21:23:55 +0000 (23:23 +0200)] 
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.

2 years agoliblzma: Add lzma_filters_update() support to the multi-threaded encoder.
Lasse Collin [Thu, 24 Nov 2022 14:25:10 +0000 (16:25 +0200)] 
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.

2 years agoUpdate THANKS.
Lasse Collin [Thu, 24 Nov 2022 12:53:22 +0000 (14:53 +0200)] 
Update THANKS.

2 years agoBuild: Don't put GNU/Linux-specific symbol versions into static liblzma.
Lasse Collin [Thu, 24 Nov 2022 12:52:44 +0000 (14:52 +0200)] 
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

2 years agoliblzma: Refactor to use lzma_filters_free().
Lasse Collin [Wed, 23 Nov 2022 23:32:16 +0000 (01:32 +0200)] 
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).

2 years agoliblzma: Fix another invalid free() after memory allocation failure.
Lasse Collin [Wed, 23 Nov 2022 23:26:37 +0000 (01:26 +0200)] 
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().

2 years agoliblzma: Add support for LZMA_SYNC_FLUSH in the Block encoder.
Jia Tan [Thu, 5 May 2022 12:53:42 +0000 (20:53 +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().

2 years agoliblzma: Add new API function lzma_filters_free().
Lasse Collin [Wed, 23 Nov 2022 23:02:50 +0000 (01:02 +0200)] 
liblzma: Add new API function lzma_filters_free().

This is small but convenient and should have been added
a long time ago.

2 years agoCMake: Don't use symbol versioning with static library.
Lasse Collin [Wed, 23 Nov 2022 22:02:31 +0000 (00:02 +0200)] 
CMake: Don't use symbol versioning with static library.

2 years agoliblzma: Add lzma_attr_warn_unused_result to lzma_filters_copy().
Lasse Collin [Wed, 23 Nov 2022 19:55:22 +0000 (21:55 +0200)] 
liblzma: Add lzma_attr_warn_unused_result to lzma_filters_copy().

2 years agoliblzma: Fix invalid free() after memory allocation failure.
Lasse Collin [Wed, 23 Nov 2022 19:26:21 +0000 (21:26 +0200)] 
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.

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.

2 years agoliblzma: Fix language in a comment.
Lasse Collin [Tue, 22 Nov 2022 14:37:15 +0000 (16:37 +0200)] 
liblzma: Fix language in a comment.

2 years agoliblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB.
Lasse Collin [Tue, 22 Nov 2022 09:20:17 +0000 (11:20 +0200)] 
liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB.

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.

2 years agoliblzma: Fix two Doxygen commands in the API headers.
Lasse Collin [Mon, 21 Nov 2022 11:02:33 +0000 (13:02 +0200)] 
liblzma: Fix two Doxygen commands in the API headers.

These were caught by clang -Wdocumentation.

2 years agoxz: Refactor duplicate code from hardware_memlimit_mtenc_get().
Lasse Collin [Sat, 19 Nov 2022 17:09:55 +0000 (19:09 +0200)] 
xz: Refactor duplicate code from hardware_memlimit_mtenc_get().

2 years agoxz: Add support --threads=+N so that -T+1 gives threaded mode.
Lasse Collin [Sat, 19 Nov 2022 17:06:13 +0000 (19:06 +0200)] 
xz: Add support --threads=+N so that -T+1 gives threaded mode.

2 years agoCMake: Adds test_memlimit to CMake tests
Jia Tan [Sat, 19 Nov 2022 15:18:04 +0000 (23:18 +0800)] 
CMake: Adds test_memlimit to CMake tests

2 years agoTranslations: Update the Korean translation.
Lasse Collin [Tue, 15 Nov 2022 17:10:21 +0000 (19:10 +0200)] 
Translations: Update the Korean translation.

2 years agoTranslations: Update the Turkish translation.
Lasse Collin [Tue, 15 Nov 2022 17:09:28 +0000 (19:09 +0200)] 
Translations: Update the Turkish translation.

2 years agoBump version number for 5.3.4alpha. v5.3.4alpha
Lasse Collin [Tue, 15 Nov 2022 08:58:39 +0000 (10:58 +0200)] 
Bump version number for 5.3.4alpha.

2 years agoAdd NEWS for 5.3.4alpha.
Lasse Collin [Tue, 15 Nov 2022 08:54:40 +0000 (10:54 +0200)] 
Add NEWS for 5.3.4alpha.

2 years agoAdd NEWS for 5.2.8.
Lasse Collin [Tue, 15 Nov 2022 08:54:08 +0000 (10:54 +0200)] 
Add NEWS for 5.2.8.

2 years agoRevert "liblzma: Simple/BCJ filters: Allow disabling generic BCJ options."
Lasse Collin [Mon, 14 Nov 2022 21:19:57 +0000 (23:19 +0200)] 
Revert "liblzma: Simple/BCJ filters: Allow disabling generic BCJ options."

This reverts commit 177bdc922cb17bd0fd831ab8139dfae912a5c2b8
and also does equivalent change to arm64.c.

Now that ARM64 filter will use lzma_options_bcj, this change
is not needed anymore.

2 years agoReplace the experimental ARM64 filter with a new experimental version.
Lasse Collin [Mon, 14 Nov 2022 21:14:41 +0000 (23:14 +0200)] 
Replace the experimental ARM64 filter with a new experimental version.

This is incompatible with the previous version.

This has space/tab fixes in filter_*.c and bcj.h too.

2 years agoliblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL.
Lasse Collin [Mon, 14 Nov 2022 19:34:57 +0000 (21:34 +0200)] 
liblzma: Add fast CRC64 for 32/64-bit x86 using SSSE3 + SSE4.1 + CLMUL.

It also works on E2K as it supports these intrinsics.

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.

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.

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.

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.

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).

[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

2 years agoTranslations: Update the Swedish translation one more time.
Lasse Collin [Mon, 14 Nov 2022 18:14:34 +0000 (20:14 +0200)] 
Translations: Update the Swedish translation one more time.

2 years agoTranslations: Update the Swedish translation again.
Lasse Collin [Mon, 14 Nov 2022 17:34:15 +0000 (19:34 +0200)] 
Translations: Update the Swedish translation again.

2 years agoTranslations: Update the Swedish translation.
Lasse Collin [Mon, 14 Nov 2022 17:07:45 +0000 (19:07 +0200)] 
Translations: Update the Swedish translation.

2 years agoTranslations: Update the Ukrainian translation.
Lasse Collin [Mon, 14 Nov 2022 16:58:09 +0000 (18:58 +0200)] 
Translations: Update the Ukrainian translation.

2 years agoBuild: Omit x86_64 from --enable-assembler.
Lasse Collin [Mon, 14 Nov 2022 15:58:07 +0000 (17:58 +0200)] 
Build: Omit x86_64 from --enable-assembler.

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.

2 years agoliblzma: Use __attribute__((__constructor__)) if available.
Lasse Collin [Mon, 14 Nov 2022 14:00:52 +0000 (16:00 +0200)] 
liblzma: Use __attribute__((__constructor__)) if available.

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.

2 years agoTranslations: Update the Romanian translation.
Lasse Collin [Sat, 12 Nov 2022 19:19:52 +0000 (21:19 +0200)] 
Translations: Update the Romanian translation.

2 years agoTranslations: Update the Hungarian translation.
Lasse Collin [Sat, 12 Nov 2022 19:17:45 +0000 (21:17 +0200)] 
Translations: Update the Hungarian translation.

2 years agoTranslations: Update the Finnish translation.
Lasse Collin [Fri, 11 Nov 2022 15:58:57 +0000 (17:58 +0200)] 
Translations: Update the Finnish translation.