Commit Graph

1983 Commits

Author SHA1 Message Date
Lasse Collin 20e590bbed CMake: Make symbol versioning configurable.
(cherry picked from commit 82f0c0d39e)
2024-05-22 00:11:58 +03:00
Lasse Collin bcac3e3aa2 CMake: Handle symbol versioning on MicroBlaze specially.
This is to match configure.ac.

(cherry picked from commit 025eb6d787)
2024-05-22 00:11:58 +03:00
Lasse Collin 9e7daa8dbd 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 45d33bfc45)
2024-05-22 00:11:58 +03:00
Sergey Kosukhin ce3a9fa94d 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 f56ed6fac6)
2024-05-22 00:11:45 +03:00
Lasse Collin a8b3fb6d2f INSTALL: Clarify that --disable-assembler affects only 32-bit x86.
(cherry picked from commit 00440f52be)
2024-05-22 00:07:08 +03:00
Lasse Collin b4b315a206 xz: Delete old commented-out code.
(cherry picked from commit 4ce300ce08)
2024-05-22 00:07:08 +03:00
Lasse Collin 9c9a3e7b3f xz: Tweak comments.
(cherry picked from commit 7312dfbb02)
2024-05-22 00:07:08 +03:00
Lasse Collin 7d3418e496 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 c701a5909a)
2024-05-22 00:07:08 +03:00
Lasse Collin fb6cf07ac7 Build: Don't install TODO.
(cherry picked from commit f3440e78c9)
2024-05-22 00:07:08 +03:00
Jia Tan e164211b09 Update m4/.gitignore.
(cherry picked from commit 4323bc3e0c)
2024-05-22 00:07:08 +03:00
Lasse Collin 46b6459c9e Tests: tuktest.h: Add a missing word to a comment.
(cherry picked from commit cce7330b9f)
2024-05-07 18:31:08 +03:00
Lasse Collin e46fcd1ed7 Tests: tuktest.h: Fix the comment about STest.
(cherry picked from commit 5dd8fc9452)
2024-05-07 18:31:08 +03:00
Lasse Collin f892ac150a Docs: Include doc/examples/11_file_info.c in tarballs.
It was added in 2017 in c2e29f06a7
but it never got into any release tarballs because it was
forgotten to be added to Makefile.am.

(cherry picked from commit dfdb60ffe9)
2024-05-07 18:27:50 +03:00
Lasse Collin 62cfb46acc xz: Fix outdated threading related info on the man page.
(cherry picked from commit 0709c2b2d7)
2024-05-07 18:27:15 +03:00
Lasse Collin 65b5ee0716 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 8e4ec79483)
2024-05-07 18:13:03 +03:00
Lasse Collin f200c338f8 liblzma: Sync the AUTHORS fix about SHA-256 to lzma.h.
(based on commit 23de53421e)
2024-05-07 18:11:43 +03:00
Lasse Collin 402fb45c74 Fix SHA-256 authors.
The initial commit 5d018dc035
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 76946dc433)
2024-05-07 18:07:31 +03:00
Lasse Collin e5ba545f16 xzless: Use ||- in LESSOPEN with with "less" 451 and newer.
(cherry picked from commit 9860d418d2)
2024-05-07 18:06:55 +03:00
Lasse Collin 5e7a8c0869 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 fd0692b052)
2024-05-07 18:06:55 +03:00
Lasse Collin c692bd42be Build: Update visibility.m4 from Gnulib
This fixes the syntax of the "serial" line and renames
a temporary variable.
2024-05-07 16:23:46 +03:00
Jia Tan 6e8732c5a3 Bump version and soname for 5.4.6. 2024-01-26 19:41:20 +08:00
Jia Tan 6532f55caa Add NEWS for 5.4.6. 2024-01-26 18:54:24 +08:00
Jia Tan 8b1a2798ad 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.
2024-01-24 21:13:55 +08:00
Jia Tan 55285900b3 xz: Update website URLs in the man pages. 2024-01-24 21:13:52 +08:00
Jia Tan a670f69521 liblzma: Update website URL. 2024-01-24 21:13:49 +08:00
Jia Tan 05aeda9612 Docs: Update website URLs. 2024-01-24 21:13:43 +08:00
Jia Tan 3cc54f1c0b Build: Update website URL. 2024-01-24 21:13:10 +08:00
Jia Tan 82f5515de6 Translations: Update the French translation. 2023-12-22 20:02:06 +08:00
Jia Tan 9e96ca8c48 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.
2023-12-22 20:02:06 +08:00
Jia Tan 8191720eac 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.
2023-12-22 20:02:06 +08:00
Jia Tan 0ba5dd7ba1 liblzma: Tweak a comment. 2023-12-22 20:02:06 +08:00
Jia Tan 27ab54af84 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.
2023-12-22 20:02:06 +08:00
Jia Tan 019afd72e0 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.
2023-12-22 20:02:06 +08:00
Jia Tan 6af9a4cbe5 Docs: Update repository URL in Changelog. 2023-12-22 20:02:06 +08:00
Jia Tan 3f51a4415a 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+.
2023-12-22 20:02:06 +08:00
Jia Tan 932f02990c Update THANKS. 2023-12-22 20:02:06 +08:00
Kian-Meng Ang b26d5d547f Tests: Fix typos 2023-12-22 20:02:06 +08:00
Jia Tan 7dc466d621 xz: Use is_tty() in message.c. 2023-12-22 20:02:06 +08:00
Jia Tan 0ecfaa6df9 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.
2023-12-22 20:02:06 +08:00
Jia Tan 9a300c9068 tuklib_integer: Fix typo discovered by codespell.
Based on internet dictionary searches, 'choise' is an outdated spelling
of 'choice'.
2023-12-22 20:02:06 +08:00
Jia Tan 9b469da8f3 Tests: Fix typo in a comment. 2023-12-22 20:02:06 +08:00
Jia Tan afcb30fcad 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.
2023-12-22 20:02:06 +08:00
Jia Tan 87c956d4c4 xz: Fix suffix check.
The suffix refactor done in 99575947a5
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.
2023-12-22 20:02:06 +08:00
Jia Tan 84196e8c09 liblzma: Add missing comments to lz_encoder.h. 2023-12-22 20:02:03 +08:00
Jia Tan 49053c0a64 Bump version and soname for 5.4.5. 2023-11-01 20:26:15 +08:00
Jia Tan 84c0cfc556 Add NEWS for 5.4.5. 2023-11-01 20:26:12 +08:00
Lasse Collin d90ed84db9 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.
2023-11-01 20:22:15 +08:00
Jia Tan 9b1268538b Build: Fix text wrapping in an output message. 2023-10-31 21:55:21 +08:00
Lasse Collin 068ee436f4 liblzma: Use lzma_always_inline in memcmplen.h. 2023-10-31 18:44:59 +08:00
Lasse Collin 6cdf0a7b79 liblzma: #define lzma_always_inline in common.h. 2023-10-31 18:44:59 +08:00