]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
2 years agoTranslations: Update the Romanian man page translations.
Jia Tan [Thu, 20 Jul 2023 12:02:56 +0000 (20:02 +0800)] 
Translations: Update the Romanian man page translations.

2 years agoliblzma: Suppress -Wunused-function warning.
Jia Tan [Wed, 19 Jul 2023 15:36:00 +0000 (23:36 +0800)] 
liblzma: Suppress -Wunused-function warning.

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

At this time, the bug is still unresolved, but has been reported:
https://github.com/llvm/llvm-project/issues/63957

This is not a problem in GCC.

2 years agoliblzma: Reword lzma_str_list_filters() documentation.
Jia Tan [Tue, 18 Jul 2023 14:52:25 +0000 (22:52 +0800)] 
liblzma: Reword lzma_str_list_filters() documentation.

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.

2 years agoliblzma: Improve comment in string_conversion.c.
Jia Tan [Tue, 18 Jul 2023 14:49:57 +0000 (22:49 +0800)] 
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.

2 years agoxz: Translate the second "%s: " in message.c since French needs "%s : ".
Lasse Collin [Tue, 18 Jul 2023 14:37:33 +0000 (17:37 +0300)] 
xz: Translate the second "%s: " in message.c since French needs "%s : ".

This string is used to print a filename when using "xz -v" and
stderr isn't a terminal.

2 years agoxz: Make "%s: %s" translatable because French needs "%s : %s".
Lasse Collin [Tue, 18 Jul 2023 11:35:33 +0000 (14:35 +0300)] 
xz: Make "%s: %s" translatable because French needs "%s : %s".

2 years agoliblzma: Tweak #if condition in memcmplen.h.
Lasse Collin [Tue, 18 Jul 2023 10:57:54 +0000 (13:57 +0300)] 
liblzma: Tweak #if condition in memcmplen.h.

Maybe ICC always #defines _MSC_VER on Windows but now
it's very clear which code will get used.

2 years agoliblzma: Omit unnecessary parenthesis in a preprocessor directive.
Lasse Collin [Tue, 18 Jul 2023 10:49:43 +0000 (13:49 +0300)] 
liblzma: Omit unnecessary parenthesis in a preprocessor directive.

2 years agoxz: Update Authors list in a few files.
Jia Tan [Mon, 17 Jul 2023 16:51:48 +0000 (00:51 +0800)] 
xz: Update Authors list in a few files.

2 years agoDocs: Add a new section to INSTALL for Tests.
Jia Tan [Fri, 14 Jul 2023 15:20:33 +0000 (23:20 +0800)] 
Docs: Add a new section to INSTALL for Tests.

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.

Fixes: https://github.com/tukaani-project/xz/issues/54
2 years agoDocs: Update README.
Jia Tan [Fri, 14 Jul 2023 13:10:27 +0000 (21:10 +0800)] 
Docs: Update README.

This adds an entry to "Other implementations of the .xz format" for
XZ for Java.

2 years agoxz: Fix typo in man page.
Jia Tan [Thu, 13 Jul 2023 15:32:10 +0000 (23:32 +0800)] 
xz: Fix typo in man page.

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.

2 years agoxz: Minor clean up for coder.c
Jia Tan [Thu, 13 Jul 2023 13:46:12 +0000 (21:46 +0800)] 
xz: Minor clean up for coder.c

* 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

2 years agoxz: Update man page Authors and date.
Jia Tan [Thu, 13 Jul 2023 13:26:47 +0000 (21:26 +0800)] 
xz: Update man page Authors and date.

2 years agoxz: Add a section to man page for robot mode --filters-help.
Jia Tan [Tue, 20 Jun 2023 12:32:59 +0000 (20:32 +0800)] 
xz: Add a section to man page for robot mode --filters-help.

2 years agoxz: Slight reword in xz man page for consistency.
Jia Tan [Mon, 19 Jun 2023 15:11:41 +0000 (23:11 +0800)] 
xz: Slight reword in xz man page for consistency.

Changed will print => prints in xz --robot --version description to
match --robot --info-memory description.

2 years agoxz: Reorder robot mode subsections in the man page.
Jia Tan [Mon, 19 Jun 2023 15:07:10 +0000 (23:07 +0800)] 
xz: Reorder robot mode subsections in the man page.

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

Instead of the previous order:
1. --version
2. --info-memory
3. --list

2 years agoxz: Update man page for new --filters-help option.
Jia Tan [Fri, 12 May 2023 16:46:50 +0000 (00:46 +0800)] 
xz: Update man page for new --filters-help option.

2 years agoxz: Add a new --filters-help option.
Jia Tan [Fri, 12 May 2023 16:44:41 +0000 (00:44 +0800)] 
xz: Add a new --filters-help option.

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.

In --robot mode, xz will only print the output from liblzma function
lzma_str_list_filters.

2 years agoxz: Update the man page for --block-list and --filtersX
Jia Tan [Fri, 21 Apr 2023 12:28:11 +0000 (20:28 +0800)] 
xz: Update the man page for --block-list and --filtersX

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.

2 years agoxz: Update --long-help for the new --filtersX option.
Jia Tan [Fri, 21 Apr 2023 11:50:14 +0000 (19:50 +0800)] 
xz: Update --long-help for the new --filtersX option.

2 years agoxz: Ignore filter chains that are set but never used in --block-list.
Jia Tan [Sat, 17 Jun 2023 12:46:21 +0000 (20:46 +0800)] 
xz: Ignore filter chains that are set but never used in --block-list.

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.

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.

2 years agoxz: Set the Block size for mt encoding correctly.
Jia Tan [Sat, 13 May 2023 12:11:13 +0000 (20:11 +0800)] 
xz: Set the Block size for mt encoding correctly.

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.

2 years agoxz: Validate --flush-timeout for all specified filter chains.
Jia Tan [Wed, 10 May 2023 16:09:41 +0000 (00:09 +0800)] 
xz: Validate --flush-timeout for all specified filter chains.

2 years agoxz: Allows --block-list filters to scale down memory usage.
Jia Tan [Sat, 13 May 2023 11:54:33 +0000 (19:54 +0800)] 
xz: Allows --block-list filters to scale down memory usage.

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.

2 years agoxz: Do not include block splitting if encoders are disabled.
Jia Tan [Wed, 10 May 2023 13:50:33 +0000 (21:50 +0800)] 
xz: Do not include block splitting if encoders are disabled.

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.

2 years agoxz: Free filters[] in debug mode.
Jia Tan [Wed, 10 May 2023 14:38:59 +0000 (22:38 +0800)] 
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.

2 years agoxz: Add a message if --block-list is used outside of xz compresssion.
Jia Tan [Sat, 13 May 2023 11:28:23 +0000 (19:28 +0800)] 
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.

2 years agoxz: Create command line options for filters[1-9].
Jia Tan [Tue, 18 Apr 2023 12:29:09 +0000 (20:29 +0800)] 
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.

2 years agoxz: Use lzma_filters_free() in forget_filter_chain().
Jia Tan [Sat, 13 May 2023 11:36:09 +0000 (19:36 +0800)] 
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().

2 years agoxz: Separate string to filter conversion into a helper function.
Jia Tan [Mon, 17 Apr 2023 14:22:45 +0000 (22:22 +0800)] 
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.

2 years agoTests: Use new --filters option in test_compress.sh
Jia Tan [Thu, 5 Jan 2023 16:03:35 +0000 (00:03 +0800)] 
Tests: Use new --filters option in test_compress.sh

2 years agoxz: Update --long-help and man page for new --filters option.
Jia Tan [Thu, 5 Jan 2023 16:03:06 +0000 (00:03 +0800)] 
xz: Update --long-help and man page for new --filters option.

2 years agoxz: Add --filters option to CLI.
Jia Tan [Thu, 5 Jan 2023 16:02:29 +0000 (00:02 +0800)] 
xz: Add --filters option to CLI.

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.

2 years agoTests: Improve feature testing for skipping.
Jia Tan [Fri, 14 Jul 2023 13:30:25 +0000 (21:30 +0800)] 
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.

2 years agoTranslations: Update the Chinese (traditional) translation.
Jia Tan [Mon, 10 Jul 2023 12:56:28 +0000 (20:56 +0800)] 
Translations: Update the Chinese (traditional) translation.

2 years agoliblzma: Remove non-portable empty initializer.
Jia Tan [Sat, 8 Jul 2023 13:24:19 +0000 (21:24 +0800)] 
liblzma: Remove non-portable empty initializer.

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.

2 years agoTranslations: Update the Vietnamese translation.
Jia Tan [Sat, 8 Jul 2023 12:03:59 +0000 (20:03 +0800)] 
Translations: Update the Vietnamese translation.

2 years agoTests: Fix memory leaks in test_index.
Jia Tan [Wed, 28 Jun 2023 12:46:31 +0000 (20:46 +0800)] 
Tests: Fix memory leaks in test_index.

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.

2 years agoTests: Fix memory leaks in test_block_header.
Jia Tan [Wed, 28 Jun 2023 12:43:29 +0000 (20:43 +0800)] 
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.

2 years agoliblzma: Prevent uninitialzed warning in mt stream encoder.
Jia Tan [Wed, 28 Jun 2023 12:31:11 +0000 (20:31 +0800)] 
liblzma: Prevent uninitialzed warning in mt stream encoder.

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

Since the mythread.h code is different between the POSIX and
Windows versions, this warning was only present on Windows builds.

Thanks to Arthur S for reporting the warning and providing an initial
patch.

2 years agoliblzma: Prevent warning for MSYS2 Windows build.
Jia Tan [Wed, 28 Jun 2023 12:22:38 +0000 (20:22 +0800)] 
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>.

Now, lzma_memcmplen() will use __builtin_ctzll() for MSYS2 GCC builds as
expected.

2 years agoCI: Add test with -fsanitize=address,undefined.
Jia Tan [Wed, 28 Jun 2023 13:01:22 +0000 (21:01 +0800)] 
CI: Add test with -fsanitize=address,undefined.

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.

This test will only run on Autotools Linux.

2 years agoCI: Upgrade checkout action from v2 to v3.
Jia Tan [Wed, 28 Jun 2023 12:16:04 +0000 (20:16 +0800)] 
CI: Upgrade checkout action from v2 to v3.

2 years agoUpdate THANKS.
Jia Tan [Tue, 27 Jun 2023 15:38:32 +0000 (23:38 +0800)] 
Update THANKS.

2 years agoDocs: Document the configure option --disable-ifunc in INSTALL.
Jia Tan [Tue, 27 Jun 2023 14:27:09 +0000 (17:27 +0300)] 
Docs: Document the configure option --disable-ifunc in INSTALL.

2 years agoMinor tweaks to style and comments.
Lasse Collin [Tue, 27 Jun 2023 14:24:49 +0000 (17:24 +0300)] 
Minor tweaks to style and comments.

2 years agoCMake: Rename CHECK_ATTR_IFUNC to ALLOW_ATTR_IFUNC.
Lasse Collin [Tue, 27 Jun 2023 14:19:49 +0000 (17:19 +0300)] 
CMake: Rename CHECK_ATTR_IFUNC to ALLOW_ATTR_IFUNC.

It's so that there's a clear difference in wording compared
to liblzma's integrity check types.

2 years agoliblzma: Add ifunc implementation to crc64_fast.c.
Lasse Collin [Tue, 27 Jun 2023 14:05:23 +0000 (17:05 +0300)] 
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.

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
2 years agoAdd ifunc check to CMakeLists.txt
Hans Jansen [Thu, 22 Jun 2023 17:49:30 +0000 (19:49 +0200)] 
Add ifunc check to CMakeLists.txt

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.

2 years agoAdd ifunc check to configure.ac
Hans Jansen [Thu, 22 Jun 2023 17:46:55 +0000 (19:46 +0200)] 
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.

2 years agoCI: Add apt update command before installing dependencies.
Jia Tan [Tue, 6 Jun 2023 16:18:30 +0000 (00:18 +0800)] 
CI: Add apt update command before installing dependencies.

Without the extra command, all of the CI tests were automatically
failing because the Ubuntu servers could not be reached properly.

2 years agoUpdate THANKS.
Jia Tan [Tue, 6 Jun 2023 16:10:38 +0000 (00:10 +0800)] 
Update THANKS.

2 years agoCMake: Protects against double find_package
Benjamin Buch [Tue, 6 Jun 2023 13:32:45 +0000 (15:32 +0200)] 
CMake: Protects against double find_package

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

This can simply be fixed by skipping the alias part on secondary
`find_package` runs.

2 years agoTranslations: Update the Esperanto translation.
Jia Tan [Wed, 31 May 2023 12:26:42 +0000 (20:26 +0800)] 
Translations: Update the Esperanto translation.

2 years agoTranslations: Update the Croatian translation.
Jia Tan [Wed, 31 May 2023 12:25:00 +0000 (20:25 +0800)] 
Translations: Update the Croatian translation.

2 years agoTranslations: Update the Chinese (simplified) translation.
Jia Tan [Wed, 31 May 2023 12:15:53 +0000 (20:15 +0800)] 
Translations: Update the Chinese (simplified) translation.

2 years agoTranslations: Update German translation of man pages.
Jia Tan [Wed, 17 May 2023 15:12:13 +0000 (23:12 +0800)] 
Translations: Update German translation of man pages.

2 years agoTranslations: Update the German translation.
Jia Tan [Wed, 17 May 2023 15:09:18 +0000 (23:09 +0800)] 
Translations: Update the German translation.

2 years agoTranslations: Update the Croatian translation.
Jia Tan [Wed, 17 May 2023 12:30:01 +0000 (20:30 +0800)] 
Translations: Update the Croatian translation.

2 years agoTranslations: Update Korean translation of man pages.
Jia Tan [Wed, 17 May 2023 12:26:54 +0000 (20:26 +0800)] 
Translations: Update Korean translation of man pages.

2 years agoTranslations: Update the Korean translation.
Jia Tan [Wed, 17 May 2023 12:13:01 +0000 (20:13 +0800)] 
Translations: Update the Korean translation.

2 years agoTranslations: Update the Spanish translation.
Jia Tan [Tue, 16 May 2023 15:49:09 +0000 (23:49 +0800)] 
Translations: Update the Spanish translation.

2 years agoTranslations: Update the Romanian translation.
Jia Tan [Tue, 16 May 2023 15:47:23 +0000 (23:47 +0800)] 
Translations: Update the Romanian translation.

2 years agoTranslations: Update Romanian translation of man pages.
Jia Tan [Tue, 16 May 2023 15:45:43 +0000 (23:45 +0800)] 
Translations: Update Romanian translation of man pages.

2 years agoTranslations: Update Ukrainian translation of man pages.
Jia Tan [Tue, 16 May 2023 15:43:51 +0000 (23:43 +0800)] 
Translations: Update Ukrainian translation of man pages.

2 years agoTranslations: Update the Ukrainian translation.
Jia Tan [Tue, 16 May 2023 15:37:54 +0000 (23:37 +0800)] 
Translations: Update the Ukrainian translation.

2 years agoTranslations: Update the Polish translation.
Jia Tan [Tue, 16 May 2023 15:07:35 +0000 (23:07 +0800)] 
Translations: Update the Polish translation.

2 years agoTranslations: Update the Swedish translation.
Jia Tan [Tue, 16 May 2023 14:52:14 +0000 (22:52 +0800)] 
Translations: Update the Swedish translation.

2 years agoTranslations: Update the Esperanto translation.
Jia Tan [Tue, 16 May 2023 13:21:38 +0000 (21:21 +0800)] 
Translations: Update the Esperanto translation.

2 years agoliblzma: Slightly rewords lzma_str_list_filters() documentation.
Jia Tan [Sat, 13 May 2023 13:21:54 +0000 (21:21 +0800)] 
liblzma: Slightly rewords lzma_str_list_filters() documentation.

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.

2 years agoliblzma: Adds lzma_nothrow to MicroLZMA API functions.
Jia Tan [Thu, 11 May 2023 15:49:23 +0000 (23:49 +0800)] 
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.

2 years agoliblzma: Exports lzma_mt_block_size() as an API function.
Jia Tan [Tue, 9 May 2023 12:20:06 +0000 (20:20 +0800)] 
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.

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.

2 years agoliblzma: Creates IS_ENC_DICT_SIZE_VALID() macro.
Jia Tan [Mon, 8 May 2023 14:58:09 +0000 (22:58 +0800)] 
liblzma: Creates IS_ENC_DICT_SIZE_VALID() macro.

This creates an internal liblzma macro to test if the dictionary size
is valid for encoding.

2 years agoAdd NEWS for 5.4.3.
Jia Tan [Tue, 2 May 2023 12:39:56 +0000 (20:39 +0800)] 
Add NEWS for 5.4.3.

2 years agoAdd NEWS for 5.2.12.
Jia Tan [Tue, 2 May 2023 12:39:37 +0000 (20:39 +0800)] 
Add NEWS for 5.2.12.

2 years agoTranslations: Update the Croatian translation.
Jia Tan [Thu, 4 May 2023 12:38:52 +0000 (20:38 +0800)] 
Translations: Update the Croatian translation.

2 years agotuklib_integer.h: Reverts previous commit.
Jia Tan [Thu, 4 May 2023 12:30:25 +0000 (20:30 +0800)] 
tuklib_integer.h: Reverts previous commit.

Previous commit 6be460dde07113fe3f08f814b61ddc3264125a96 would cause an
error if the integer size was 32 bit.

2 years agotuklib_integer.h: Changes two other UINT_MAX == UINT32_MAX to >=.
Jia Tan [Thu, 4 May 2023 11:25:20 +0000 (19:25 +0800)] 
tuklib_integer.h: Changes two other UINT_MAX == UINT32_MAX to >=.

2 years agotuklib_integer.h: Fix a recent copypaste error in Clang detection.
Lasse Collin [Wed, 3 May 2023 19:46:42 +0000 (22:46 +0300)] 
tuklib_integer.h: Fix a recent copypaste error in Clang detection.

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.

2 years agoCI: Adds a build and test for small configuration.
Jia Tan [Tue, 25 Apr 2023 12:06:15 +0000 (20:06 +0800)] 
CI: Adds a build and test for small configuration.

2 years agoCI: ci_build.sh allows configuring small build.
Jia Tan [Tue, 25 Apr 2023 12:05:26 +0000 (20:05 +0800)] 
CI: ci_build.sh allows configuring small build.

2 years agoUpdate THANKS.
Jia Tan [Thu, 20 Apr 2023 12:15:00 +0000 (20:15 +0800)] 
Update THANKS.

2 years agoWindows: Include <intrin.h> when needed.
Jia Tan [Wed, 19 Apr 2023 14:22:16 +0000 (22:22 +0800)] 
Windows: Include <intrin.h> when needed.

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.

2 years agotuklib_integer: Use __builtin_clz() with Clang.
Jia Tan [Wed, 19 Apr 2023 13:59:03 +0000 (21:59 +0800)] 
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.

Thanks to Anton Kochkov for notifying us about the bug.

2 years agoliblzma: Update project maintainers in lzma.h.
Lasse Collin [Fri, 14 Apr 2023 15:42:33 +0000 (18:42 +0300)] 
liblzma: Update project maintainers in lzma.h.

AUTHORS was updated earlier, lzma.h was simply forgotten.

2 years agoliblzma: Cleans up old commented out code.
Jia Tan [Thu, 13 Apr 2023 12:45:19 +0000 (20:45 +0800)] 
liblzma: Cleans up old commented out code.

2 years agoDocs: Add missing word to SECURITY.md.
Jia Tan [Fri, 7 Apr 2023 12:46:41 +0000 (20:46 +0800)] 
Docs: Add missing word to SECURITY.md.

2 years agoUpdate THANKS.
Jia Tan [Fri, 7 Apr 2023 12:43:22 +0000 (20:43 +0800)] 
Update THANKS.

2 years agoDocs: Minor edits to SECURITY.md.
Jia Tan [Fri, 7 Apr 2023 12:42:12 +0000 (20:42 +0800)] 
Docs: Minor edits to SECURITY.md.

2 years agoDocs: Create SECURITY.md
Gabriela Gutierrez [Fri, 7 Apr 2023 12:08:30 +0000 (12:08 +0000)] 
Docs: Create SECURITY.md

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
2 years agoCI: Tests for disabling threading on CMake builds.
Jia Tan [Tue, 28 Mar 2023 14:48:24 +0000 (22:48 +0800)] 
CI: Tests for disabling threading on CMake builds.

2 years agoCI: Removes CMakeCache.txt between builds.
Jia Tan [Tue, 28 Mar 2023 14:45:42 +0000 (22:45 +0800)] 
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.

2 years agoCMake: Update liblzma-config.cmake generation.
Jia Tan [Tue, 28 Mar 2023 14:32:40 +0000 (22:32 +0800)] 
CMake: Update liblzma-config.cmake generation.

Now that the threading is configurable, the liblzma CMake package only
needs the threading library when using POSIX threads.

2 years agoCMake: Allows setting thread method.
Jia Tan [Tue, 28 Mar 2023 14:25:33 +0000 (22:25 +0800)] 
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.

2 years agoCI: Runs CMake feature tests.
Jia Tan [Fri, 24 Mar 2023 15:05:48 +0000 (23:05 +0800)] 
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.

2 years agoCI: ci_build.sh allows CMake features to be configured.
Jia Tan [Fri, 24 Mar 2023 12:35:11 +0000 (20:35 +0800)] 
CI: ci_build.sh allows CMake features to be configured.

Also included various clean ups for style and helper functions for
repeated work.

2 years agoCI: Change ci_build.sh to use bash instead of sh.
Jia Tan [Fri, 24 Mar 2023 12:06:33 +0000 (20:06 +0800)] 
CI: Change ci_build.sh to use bash instead of sh.

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.

2 years agoCMake: Only build xzdec if decoders are enabled.
Jia Tan [Fri, 24 Mar 2023 12:05:59 +0000 (20:05 +0800)] 
CMake: Only build xzdec if decoders are enabled.

2 years agoBuild: Removes redundant check for LZMA1 filter support.
Jia Tan [Wed, 22 Mar 2023 07:42:04 +0000 (15:42 +0800)] 
Build: Removes redundant check for LZMA1 filter support.