]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
14 months agoUpdate contact info in README
Lasse Collin [Tue, 28 May 2024 15:36:53 +0000 (18:36 +0300)] 
Update contact info in README

(cherry picked from commit b14c130a58a649f9a73392eeb122cb252327c569)

14 months agoTranslations: Use --package-name=xz-man with po4a
Lasse Collin [Tue, 28 May 2024 10:25:07 +0000 (13:25 +0300)] 
Translations: Use --package-name=xz-man with po4a

This is to match reality. See the added comment.

(cherry picked from commit 75f5f2e014b0ee646963f36bc6a9c840fb272353)

14 months agoTranslations: Omit man page line numbers from .pot and .po files
Lasse Collin [Mon, 27 May 2024 22:17:45 +0000 (01:17 +0300)] 
Translations: Omit man page line numbers from .pot and .po files

(cherry picked from commit 9114267038deaecf4832a5cacb5acbe6591ac839)

14 months agoTranslations: Update po/Makevars
Lasse Collin [Tue, 28 May 2024 14:10:19 +0000 (17:10 +0300)] 
Translations: Update po/Makevars

Use the template from gettext 0.22.5.
Add --add-location=file to XGETTEXT_OPTIONS and MSGMERGE_OPTIONS.
Add --no-wrap to MSGINIT_OPTIONS.

14 months agoliblzma: Omit an unneeded array from the x86 filter
Lasse Collin [Mon, 6 May 2024 20:00:09 +0000 (23:00 +0300)] 
liblzma: Omit an unneeded array from the x86 filter

Fixes: 6aa2a6deeba04808a0fe4461396e7fb70277f3d4
(cherry picked from commit de06b9f0c0a3f72569829ecadbc9c0a3ef099f57)

14 months agoliblzma: Silence a warning from Coverity static analysis
Lasse Collin [Fri, 19 Apr 2024 19:04:21 +0000 (22:04 +0300)] 
liblzma: Silence a warning from Coverity static analysis

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)

14 months agoFix typos
Lasse Collin [Fri, 17 May 2024 21:34:07 +0000 (00:34 +0300)] 
Fix typos

Thanks to xx on #tukaani.

(cherry picked from commit 4e9023857d287f624562156b60dc23d2b64c0f10)

14 months agoliblzma: Fix white space
Lasse Collin [Fri, 17 May 2024 21:23:52 +0000 (00:23 +0300)] 
liblzma: Fix white space

Thanks to xx on #tukaani.

(cherry picked from commit b14d08fbbc254485ace9ccfe7908674f608a62ae)

14 months agoUpdate maintainer and author info.
Lasse Collin [Mon, 8 Apr 2024 15:27:39 +0000 (18:27 +0300)] 
Update maintainer and author info.

The other maintainer suddenly disappeared.

(cherry picked from commit 77a294d98a9d2d48f7e4ac273711518bf689f5c4)

14 months agoAdd NEWS for 5.2.11 and 5.2.12
Lasse Collin [Tue, 7 May 2024 17:42:48 +0000 (20:42 +0300)] 
Add NEWS for 5.2.11 and 5.2.12

14 months agoliblzma: Fix incorrect function type error from sanitizer
Lasse Collin [Tue, 30 Apr 2024 19:22:45 +0000 (22:22 +0300)] 
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)

14 months agoxz: Avoid arithmetic on a null pointer
Lasse Collin [Tue, 30 Apr 2024 18:41:11 +0000 (21:41 +0300)] 
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)

14 months agoTests: test_index: Fix failures when features are disabled
Lasse Collin [Sat, 27 Apr 2024 22:34:50 +0000 (01:34 +0300)] 
Tests: test_index: Fix failures when features are disabled

Fixes: cd88423e76d54eb72aea037364f3ebb21f122503
(cherry picked from commit 710a4573ef2cbd19c66318c3b2d1388e418e26c7)

14 months agoTests: test_index: Edit a misleading test
Lasse Collin [Sat, 27 Apr 2024 15:30:40 +0000 (18:30 +0300)] 
Tests: test_index: Edit a misleading test

(cherry picked from commit d879686469c9c4bf2a7c0bb6420ebe4530fc8f07)

14 months agoTests: test_index: Use minimal values to test integer overflow
Lasse Collin [Sat, 27 Apr 2024 13:46:01 +0000 (16:46 +0300)] 
Tests: test_index: Use minimal values to test integer overflow

(cherry picked from commit 612005bbdb0dea9dc09e9e2e9cc16a15c1480acd)

14 months agoTests: test_index: Test lzma_index_buffer_decode() more
Lasse Collin [Sat, 27 Apr 2024 12:13:39 +0000 (15:13 +0300)] 
Tests: test_index: Test lzma_index_buffer_decode() more

(cherry picked from commit 4ad88b2544c2aaf8de8f38af54587098cbe66c1d)

14 months agoTests: test_index: Test that *i = NULL is done on LZMA_PROG_ERROR
Lasse Collin [Sat, 27 Apr 2024 12:08:29 +0000 (15:08 +0300)] 
Tests: test_index: Test that *i = NULL is done on LZMA_PROG_ERROR

On LZMA_DATA_ERROR from lzma_index_buffer_decode(), *i = NULL was
already done but this adds a test for that case too.

(cherry picked from commit 575b11b0d291e66c5fce31ce7a72f11436d57c83)

14 months agoTests: test_index: Test lzma_index_buffer_encode() with empty output buf
Lasse Collin [Sat, 27 Apr 2024 12:01:25 +0000 (15:01 +0300)] 
Tests: test_index: Test lzma_index_buffer_encode() with empty output buf

(cherry picked from commit 2c970debdb285823f01f75e875561d893345ac2b)

14 months agoTests: test_index: Replace if-statements with tuktest assertions
Lasse Collin [Sat, 27 Apr 2024 11:59:55 +0000 (14:59 +0300)] 
Tests: test_index: Replace if-statements with tuktest assertions

(cherry picked from commit cd88423e76d54eb72aea037364f3ebb21f122503)

14 months agoTests: test_index: Make it clear that my_alloc() has no integer overflows
Lasse Collin [Sat, 27 Apr 2024 11:56:16 +0000 (14:56 +0300)] 
Tests: test_index: Make it clear that my_alloc() has no integer overflows

liblzma guarantees that the product of the allocation size arguments
will fit in size_t.

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)

14 months agoTests: test_index: Verify also iter.block.number_in_stream
Lasse Collin [Sat, 27 Apr 2024 11:51:52 +0000 (14:51 +0300)] 
Tests: test_index: Verify also iter.block.number_in_stream

(cherry picked from commit 12313a3b6596cdcf012e180597f84d231f8730d3)

14 months agoTests: test_index: Check cases that aren't a multiple of 4 bytes
Lasse Collin [Sat, 27 Apr 2024 11:51:06 +0000 (14:51 +0300)] 
Tests: test_index: Check cases that aren't a multiple of 4 bytes

(cherry picked from commit ad2654010d9d641ce1601beeff00630027e6bcd4)

14 months agoliblzma: index_decoder: Fix missing initializations on LZMA_PROG_ERROR
Lasse Collin [Sat, 27 Apr 2024 11:33:38 +0000 (14:33 +0300)] 
liblzma: index_decoder: Fix missing initializations on LZMA_PROG_ERROR

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.

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.

(cherry picked from commit 71eed2520e2eecae89bade9dceea16e56cfa2ea0)

14 months agoCMake: Bump maximum policy version to 3.29
Lasse Collin [Tue, 7 May 2024 16:30:19 +0000 (19:30 +0300)] 
CMake: Bump maximum policy version to 3.29

14 months agoliblzma: API doc cleanups
Lasse Collin [Tue, 23 Apr 2024 22:20:26 +0000 (01:20 +0300)] 
liblzma: API doc cleanups

(cherry picked from commit 08ab0966a75b501aa7c717622223f0c13a113c75)

14 months agoTests: test_filter_str: Add a few assertions
Lasse Collin [Tue, 23 Apr 2024 13:35:33 +0000 (16:35 +0300)] 
Tests: test_filter_str: Add a few assertions

(cherry picked from commit 3ac8a9bb4cccbee88350696dc9c645c48d77c989)

14 months agoTests: test_filter_str: Move one assertion and add a comment
Lasse Collin [Tue, 23 Apr 2024 13:35:08 +0000 (16:35 +0300)] 
Tests: test_filter_str: Move one assertion and add a comment

(cherry picked from commit 26c69be80523b05c84dea86c47c4ddd9a10945d7)

14 months agoTests: test_filter_str: Tweak comments and white space
Lasse Collin [Tue, 23 Apr 2024 13:26:06 +0000 (16:26 +0300)] 
Tests: test_filter_str: Tweak comments and white space

(cherry picked from commit 4f6af853bc99904efb8b6c28a0af7b81a8476c1b)

14 months agoTests: test_filter_str: Test *error_pos more thoroughly
Lasse Collin [Mon, 22 Apr 2024 19:23:32 +0000 (22:23 +0300)] 
Tests: test_filter_str: Test *error_pos more thoroughly

(cherry picked from commit b0366df1d7ed26268101f9303a001c91c0806dfc)

14 months agoliblzma: lzma_str_to_filters: Set *error_pos on all errors
Lasse Collin [Mon, 22 Apr 2024 18:54:39 +0000 (21:54 +0300)] 
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)

14 months agoxz man page: Use .ft CR instead of CW to silence warnings from groff.
Lasse Collin [Mon, 8 Apr 2024 18:19:38 +0000 (21:19 +0300)] 
xz man page: Use .ft CR instead of CW to silence warnings from groff.

(cherry picked from commit 31ef676567c9d6fcc4ec9fc833c312f7a7c21c48)

14 months agoDocs: Update .xz file format specification to 1.2.1.
Lasse Collin [Mon, 8 Apr 2024 15:05:32 +0000 (18:05 +0300)] 
Docs: Update .xz file format specification to 1.2.1.

This only reverts the XZ URL changes.

(cherry picked from commit 8dd03d4484ccf80022722a16d0ed9b37f2b58072)

14 months agoUpdate website URLs back to tukaani.org.
Lasse Collin [Mon, 8 Apr 2024 14:33:56 +0000 (17:33 +0300)] 
Update website URLs back to tukaani.org.

The XZ projects were moved back to their original URLs.

(cherry picked from commit 17aa2e1a796d3f758802df29afc89dcf335db567)

14 months agoUpdate THANKS.
Lasse Collin [Tue, 9 Apr 2024 15:22:16 +0000 (18:22 +0300)] 
Update THANKS.

(cherry picked from commit db4dd74a344580e0b81436598d9741a3454245b0)

14 months agoINSTALL: Document arguments of --enable-symbol-versions.
Lasse Collin [Fri, 15 Mar 2024 15:43:39 +0000 (17:43 +0200)] 
INSTALL: Document arguments of --enable-symbol-versions.

(cherry picked from commit 8a25ba024d55610c448c6e4f1400a00bae51b493)

14 months agoBuild: Use only the generic symbol versioning with NVIDIA HPC Compiler.
Lasse Collin [Fri, 15 Mar 2024 15:15:50 +0000 (17:15 +0200)] 
Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.

This does the previous commit with CMake.

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.

(cherry picked from commit 49324b711f9d42b3543bf2f3ae598eaa03360bd5)

14 months agoCMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.
Lasse Collin [Fri, 15 Mar 2024 14:36:35 +0000 (16:36 +0200)] 
CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.

It doesn't support the __symver__ attribute or __asm__(".symver ...").
The generic symbol versioning can still be used since it only needs
linker support.

(cherry picked from commit c273123ed0ebaebf49994057a7fe98aae7f42c40)

14 months agoUpdate THANKS.
Lasse Collin [Wed, 13 Mar 2024 19:38:24 +0000 (21:38 +0200)] 
Update THANKS.

(cherry picked from commit df7f487648d18a3992386a59b8a061edca862d17)

14 months agoliblzma: Minor comment edits.
Lasse Collin [Wed, 13 Mar 2024 19:30:18 +0000 (21:30 +0200)] 
liblzma: Minor comment edits.

(cherry picked from commit 3217b82b3ec023bf8338249134a076bea0ea30ec)

14 months agoliblzma: Fix building with NVHPC (NVIDIA HPC SDK).
Sergey Kosukhin [Wed, 13 Mar 2024 12:07:13 +0000 (13:07 +0100)] 
liblzma: Fix building with NVHPC (NVIDIA HPC SDK).

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

(This commit was contributed under 0BSD but the author confirmed
that it is fine to backport it to the public domain branches. See
https://github.com/tukaani-project/xz/pull/90#issuecomment-2100185936
and the next two messages.)

(cherry picked from commit 096bc0e3f8fb4bfc4d2f3f64a7f219401ffb4c31)

14 months agoCMake: Disable symbol versioning on non-glibc Linux.
Lasse Collin [Wed, 13 Mar 2024 19:17:10 +0000 (21:17 +0200)] 
CMake: Disable symbol versioning on non-glibc Linux.

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)

14 months agoCMake: Make symbol versioning configurable.
Lasse Collin [Wed, 13 Mar 2024 18:32:46 +0000 (20:32 +0200)] 
CMake: Make symbol versioning configurable.

(cherry picked from commit 82f0c0d39eb2c026b1d96ee706f70ace868d4ed4)

14 months agoCMake: Handle symbol versioning on MicroBlaze specially.
Lasse Collin [Sun, 18 Feb 2024 12:59:52 +0000 (14:59 +0200)] 
CMake: Handle symbol versioning on MicroBlaze specially.

This is to match configure.ac.

(cherry picked from commit 025eb6d7879e4c4e8cb29716b371e0f4c1aea660)

14 months agoBuild: Style tweaks to configure.ac.
Lasse Collin [Wed, 13 Mar 2024 17:47:36 +0000 (19:47 +0200)] 
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)

14 months agoBuild: Let the users override the symbol versioning variant.
Sergey Kosukhin [Tue, 12 Mar 2024 19:03:49 +0000 (20:03 +0100)] 
Build: Let the users override the symbol versioning variant.

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.

(This commit was contributed under 0BSD but the author confirmed
that it is fine to backport it to the public domain branches. See
https://github.com/tukaani-project/xz/pull/90#issuecomment-2100185936
and the next two messages.)

(cherry picked from commit f56ed6fac6619b56b005878d3b5210e2f0d721c0)

14 months agoINSTALL: Clarify that --disable-assembler affects only 32-bit x86.
Lasse Collin [Wed, 21 Feb 2024 15:41:32 +0000 (17:41 +0200)] 
INSTALL: Clarify that --disable-assembler affects only 32-bit x86.

(cherry picked from commit 00440f52be9ac2c7438c7b0cb1082f12399632c6)

14 months agoxz: Delete old commented-out code.
Lasse Collin [Sat, 17 Feb 2024 21:07:35 +0000 (23:07 +0200)] 
xz: Delete old commented-out code.

(cherry picked from commit 4ce300ce0884c6e552de2af9ae8050b47b01f0e7)

14 months agoxz: Tweak comments.
Lasse Collin [Sat, 17 Feb 2024 21:07:35 +0000 (23:07 +0200)] 
xz: Tweak comments.

(cherry picked from commit 7312dfbb02197c7f990c7a3cefd027a9387d1473)

14 months agoxz: Fix message_init() description.
Lasse Collin [Sat, 17 Feb 2024 21:07:35 +0000 (23:07 +0200)] 
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.

(cherry picked from commit c701a5909ad9882469fbab4fab5d2d5556d3ba78)

14 months agoBuild: Don't install TODO.
Lasse Collin [Sat, 17 Feb 2024 17:25:05 +0000 (19:25 +0200)] 
Build: Don't install TODO.

(cherry picked from commit f3440e78c9517db75bfa52e1a378fad60b073bbe)

14 months agoUpdate m4/.gitignore.
Jia Tan [Thu, 15 Feb 2024 14:26:43 +0000 (22:26 +0800)] 
Update m4/.gitignore.

(cherry picked from commit 4323bc3e0c1e1d2037d5e670a3bf6633e8a3031e)

15 months agoTests: tuktest.h: Add a missing word to a comment.
Lasse Collin [Wed, 14 Feb 2024 19:11:03 +0000 (21:11 +0200)] 
Tests: tuktest.h: Add a missing word to a comment.

(cherry picked from commit cce7330b9f23485a0879422e0c3395a7065439ac)

15 months agoTests: tuktest.h: Fix the comment about STest.
Lasse Collin [Wed, 14 Feb 2024 19:10:10 +0000 (21:10 +0200)] 
Tests: tuktest.h: Fix the comment about STest.

(cherry picked from commit 5dd8fc9452a3373cedc27379067ce638f992c741)

15 months agoDocs: Include doc/examples/11_file_info.c in tarballs.
Lasse Collin [Wed, 14 Feb 2024 17:11:48 +0000 (19:11 +0200)] 
Docs: Include doc/examples/11_file_info.c in tarballs.

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.

(cherry picked from commit dfdb60ffe933a1f1497d300dbb4513ed17ec6f0e)

15 months agoxz: Fix outdated threading related info on the man page.
Lasse Collin [Tue, 13 Feb 2024 09:38:10 +0000 (11:38 +0200)] 
xz: Fix outdated threading related info on the man page.

(cherry picked from commit 0709c2b2d7c1d8f437b003f691880fd7810e5be5)

15 months agoliblzma: Fix compilation of price_tablegen.c.
Lasse Collin [Mon, 12 Feb 2024 15:09:10 +0000 (17:09 +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.

(cherry picked from commit 8e4ec794836bc1701d8c9bd5e347b8ce8cc5bbb4)

15 months agoliblzma: Sync the AUTHORS fix about SHA-256 to lzma.h.
Lasse Collin [Mon, 12 Feb 2024 21:25:54 +0000 (23:25 +0200)] 
liblzma: Sync the AUTHORS fix about SHA-256 to lzma.h.

(based on commit 23de53421ea258cde6a3c33a038b1e9d08f771d1)

15 months agoFix SHA-256 authors.
Lasse Collin [Fri, 9 Feb 2024 15:20:31 +0000 (17:20 +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.

(cherry picked from commit 76946dc4336c831fe2cc26696a035d807dd3cf13)

15 months agoxzless: Use ||- in LESSOPEN with with "less" 451 and newer.
Lasse Collin [Fri, 9 Feb 2024 21:21:01 +0000 (23:21 +0200)] 
xzless: Use ||- in LESSOPEN with with "less" 451 and newer.

(cherry picked from commit 9860d418d296eb3c721e5384fb367c0499b579c8)

15 months agoxzless: Use --show-preproc-errors with "less" 632 and newer.
Lasse Collin [Fri, 9 Feb 2024 21:00:05 +0000 (23:00 +0200)] 
xzless: Use --show-preproc-errors with "less" 632 and newer.

This makes "less" show a warning if a decompression error occurred.

(cherry picked from commit fd0692b0525e6c26b496492be9e2c865cab734f8)

15 months agoBuild: Update visibility.m4 from Gnulib
Lasse Collin [Tue, 7 May 2024 13:21:15 +0000 (16:21 +0300)] 
Build: Update visibility.m4 from Gnulib

This fixes the syntax of the "serial" line and renames
a temporary variable.

18 months agoBump version and soname for 5.4.6. v5.4.6
Jia Tan [Fri, 26 Jan 2024 11:41:20 +0000 (19:41 +0800)] 
Bump version and soname for 5.4.6.

18 months agoAdd NEWS for 5.4.6.
Jia Tan [Fri, 26 Jan 2024 10:54:24 +0000 (18:54 +0800)] 
Add NEWS for 5.4.6.

18 months agoDocs: Update .xz file format specification to 1.2.0.
Jia Tan [Fri, 19 Jan 2024 15:08:14 +0000 (23:08 +0800)] 
Docs: Update .xz file format specification to 1.2.0.

The new RISC-V filter was added to the specification, in addition to
updating the specification URL.

18 months agoxz: Update website URLs in the man pages.
Jia Tan [Fri, 19 Jan 2024 15:08:14 +0000 (23:08 +0800)] 
xz: Update website URLs in the man pages.

18 months agoliblzma: Update website URL.
Jia Tan [Fri, 19 Jan 2024 15:08:14 +0000 (23:08 +0800)] 
liblzma: Update website URL.

18 months agoDocs: Update website URLs.
Jia Tan [Fri, 19 Jan 2024 15:08:14 +0000 (23:08 +0800)] 
Docs: Update website URLs.

18 months agoBuild: Update website URL.
Jia Tan [Fri, 19 Jan 2024 15:08:14 +0000 (23:08 +0800)] 
Build: Update website URL.

19 months agoTranslations: Update the French translation.
Jia Tan [Thu, 21 Dec 2023 13:39:08 +0000 (21:39 +0800)] 
Translations: Update the French translation.

19 months agoxz: Add a comment to Capsicum sandbox setup.
Jia Tan [Thu, 21 Dec 2023 08:39:53 +0000 (16:39 +0800)] 
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.

19 months agoliblzma: Set all values in lzma_lz_encoder to NULL after allocation.
Jia Tan [Sat, 16 Dec 2023 12:51:38 +0000 (20:51 +0800)] 
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.

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.

19 months agoliblzma: Tweak a comment.
Jia Tan [Sat, 16 Dec 2023 12:30:55 +0000 (20:30 +0800)] 
liblzma: Tweak a comment.

19 months agoliblzma: Make parameter names in function definition match declaration.
Jia Tan [Sat, 16 Dec 2023 12:28:21 +0000 (20:28 +0800)] 
liblzma: Make parameter names in function definition match declaration.

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.

19 months agoliblzma: Improve lzma encoder init function consistency.
Jia Tan [Sat, 16 Dec 2023 12:18:47 +0000 (20:18 +0800)] 
liblzma: Improve lzma encoder init function consistency.

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.

19 months agoDocs: Update repository URL in Changelog.
Jia Tan [Sat, 16 Dec 2023 03:20:20 +0000 (11:20 +0800)] 
Docs: Update repository URL in Changelog.

19 months agoTests: Silence -Wsign-conversion warning on GCC version < 10.
Jia Tan [Thu, 7 Dec 2023 13:48:07 +0000 (21:48 +0800)] 
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;

Give a warning on GCC 9 and earlier but this:

    uint8_t a = 5;
    uint32_t b = (a + 5) * 2;

Gives a warning with GCC 10+.

19 months agoUpdate THANKS.
Jia Tan [Thu, 30 Nov 2023 15:10:43 +0000 (23:10 +0800)] 
Update THANKS.

19 months agoTests: Fix typos
Kian-Meng Ang [Thu, 30 Nov 2023 15:01:19 +0000 (23:01 +0800)] 
Tests: Fix typos

19 months agoxz: Use is_tty() in message.c.
Jia Tan [Thu, 23 Nov 2023 14:13:39 +0000 (22:13 +0800)] 
xz: Use is_tty() in message.c.

19 months agoxz: Create separate is_tty() function.
Jia Tan [Thu, 23 Nov 2023 14:04:35 +0000 (22:04 +0800)] 
xz: Create separate is_tty() function.

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.

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:

    xz foo -c > /dev/null

would fail because /dev/null was assumed to be a terminal.

19 months agotuklib_integer: Fix typo discovered by codespell.
Jia Tan [Wed, 22 Nov 2023 12:39:41 +0000 (20:39 +0800)] 
tuklib_integer: Fix typo discovered by codespell.

Based on internet dictionary searches, 'choise' is an outdated spelling
of 'choice'.

19 months agoTests: Fix typo in a comment.
Jia Tan [Fri, 17 Nov 2023 12:04:58 +0000 (20:04 +0800)] 
Tests: Fix typo in a comment.

19 months agoTests: Create test_suffix.sh.
Jia Tan [Fri, 17 Nov 2023 12:35:11 +0000 (20:35 +0800)] 
Tests: Create test_suffix.sh.

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.

This test also verifies some recent bugs have been correctly solved
and to hopefully avoid further regressions in the future.

19 months agoxz: Fix suffix check.
Jia Tan [Tue, 14 Nov 2023 12:27:04 +0000 (20:27 +0800)] 
xz: Fix suffix check.

The suffix refactor done in 99575947a58a60416c570eb78038d18a1ea4cef4
had a small regression where raw format compression to standard out
failed if a suffix was not set. In this case, setting the suffix did
not make sense since a file is not created.

Now, xz should only fail when a suffix is not provided when it is
actually needed.

For instance:

    echo "foo" | xz --format=raw --lzma2 | wc -c

does not need a suffix check since it creates no files. But:

    xz --format=raw --lzma2 --suffix=.bar foo

Needs the suffix to be set since it must create foo.bar.

19 months agoliblzma: Add missing comments to lz_encoder.h.
Jia Tan [Wed, 8 Nov 2023 17:21:53 +0000 (01:21 +0800)] 
liblzma: Add missing comments to lz_encoder.h.

21 months agoBump version and soname for 5.4.5. v5.4.5
Jia Tan [Tue, 31 Oct 2023 14:30:29 +0000 (22:30 +0800)] 
Bump version and soname for 5.4.5.

21 months agoAdd NEWS for 5.4.5.
Jia Tan [Wed, 1 Nov 2023 12:18:30 +0000 (20:18 +0800)] 
Add NEWS for 5.4.5.

21 months agoliblzma: Fix compilation of fastpos_tablegen.c.
Lasse Collin [Tue, 31 Oct 2023 19:41:09 +0000 (21:41 +0200)] 
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.

21 months agoBuild: Fix text wrapping in an output message.
Jia Tan [Tue, 31 Oct 2023 13:51:40 +0000 (21:51 +0800)] 
Build: Fix text wrapping in an output message.

21 months agoliblzma: Use lzma_always_inline in memcmplen.h.
Lasse Collin [Sun, 22 Oct 2023 14:59:11 +0000 (17:59 +0300)] 
liblzma: Use lzma_always_inline in memcmplen.h.

21 months agoliblzma: #define lzma_always_inline in common.h.
Lasse Collin [Mon, 30 Oct 2023 15:43:03 +0000 (17:43 +0200)] 
liblzma: #define lzma_always_inline in common.h.

21 months agoliblzma: Use lzma_attr_visibility_hidden on private extern declarations.
Lasse Collin [Sun, 22 Oct 2023 14:15:32 +0000 (17:15 +0300)] 
liblzma: Use lzma_attr_visibility_hidden on private extern declarations.

These variables are internal to liblzma and not exposed in the API.

21 months agoliblzma: #define lzma_attr_visibility_hidden in common.h.
Lasse Collin [Sun, 22 Oct 2023 14:08:39 +0000 (17:08 +0300)] 
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.

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.

21 months agoliblzma: Refer to MinGW-w64 instead of MinGW in the API headers.
Lasse Collin [Sat, 30 Sep 2023 19:54:28 +0000 (22:54 +0300)] 
liblzma: Refer to MinGW-w64 instead of MinGW in the API headers.

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.

21 months agoCMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed.
Lasse Collin [Tue, 26 Sep 2023 21:58:17 +0000 (00:58 +0300)] 
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).

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.

21 months agoCMake: Generate and install liblzma.pc if not using MSVC.
Lasse Collin [Fri, 29 Sep 2023 23:14:25 +0000 (02:14 +0300)] 
CMake: Generate and install liblzma.pc if not using MSVC.

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.

21 months agoCMake: Rearrange the PACKAGE_ variables.
Lasse Collin [Fri, 29 Sep 2023 22:13:13 +0000 (01:13 +0300)] 
CMake: Rearrange the PACKAGE_ variables.

The windres workaround now replaces spaces with \x20 so
the package name isn't repeated.

These changes will help with creation of liblzma.pc.

21 months agoliblzma: Add Cflags.private to liblzma.pc.in for MSYS2.
Lasse Collin [Fri, 29 Sep 2023 17:46:11 +0000 (20:46 +0300)] 
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/

21 months agoCMake: Create liblzma.def when building liblzma.dll with MinGW-w64.
Lasse Collin [Wed, 27 Sep 2023 19:46:20 +0000 (22:46 +0300)] 
CMake: Create liblzma.def when building liblzma.dll with MinGW-w64.

21 months agoCMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR.
Lasse Collin [Thu, 26 Oct 2023 18:44:42 +0000 (21:44 +0300)] 
CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR.

In this case they have identical values.