]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
10 months agocmake/tuklib_large_file_support.cmake: Add a missing include v5.2
Lasse Collin [Tue, 1 Oct 2024 11:49:41 +0000 (14:49 +0300)] 
cmake/tuklib_large_file_support.cmake: Add a missing include

v5.2 didn't build with CMake. Other branches had
include(CMakePushCheckState) in top-level CMakeLists.txt
which made the build work.

Fixes: 597f49b61475438a43a417236989b2acc968a686
(cherry picked from commit be4bf94446b6286a5dffdde85fc1d21448f4edff)

10 months agoWindows: Embed an application manifest in the EXE files
Lasse Collin [Tue, 1 Oct 2024 09:10:23 +0000 (12:10 +0300)] 
Windows: Embed an application manifest in the EXE files

IMPORTANT: This includes a security fix to command line tool
           argument handling.

Some toolchains embed an application manifest by default to declare
UAC-compliance. Some also declare compatibility with Vista/8/8.1/10/11
to let the app access features newer than those of Vista.

We want all the above but also two more things:

  - Declare that the app is long path aware to support paths longer
    than 259 characters (this may also require a registry change).

  - Force the code page to UTF-8. This allows the command line tools
    to access files whose names contain characters that don't exist
    in the current legacy code page (except unpaired surrogates).
    The UTF-8 code page also fixes security issues in command line
    argument handling which can be exploited with malicious filenames.

Thanks to Orange Tsai and splitline from DEVCORE Research Team
for discovering this issue.

Thanks to Vijay Sarvepalli for reporting the issue to me.

Thanks to Kelvin Lee for testing with MSVC and helping with
the required build system fixes.

(cherry picked from commit 46ee0061629fb075d61d83839e14dd193337af59)

14 months agoBump version and soname for 5.2.13 v5.2.13
Lasse Collin [Wed, 29 May 2024 14:51:23 +0000 (17:51 +0300)] 
Bump version and soname for 5.2.13

14 months agoAdd NEWS for 5.2.13
Lasse Collin [Wed, 29 May 2024 14:49:42 +0000 (17:49 +0300)] 
Add NEWS for 5.2.13

14 months agoBuild: Update po/*.po files only when needed
Lasse Collin [Wed, 29 May 2024 13:33:24 +0000 (16:33 +0300)] 
Build: Update po/*.po files only when needed

When po/xz.pot doesn't exist, running "make" or "make dist" will
create it. Then the .po files will be updated but only if they
actually would change more than the POT-Creation-Date line.
Then the .gmo files would be generated from the .po files.
This is the case before and after this commit.

However, "make dist" and thus "make mydist" did a forced update
to the files, updating them even if the only change was the
POT-Creation-Date line. This had pros and cons: It made it clear
that the .po file really is in sync with the recent strings in
the package. On the other hand, it added noise in form of changed
files in the source tree and distribution tarballs. It can be
ignored with something like "diff -I'^"POT-Creation-Date: '" but
it's still a minor annoyance *if* there's not enough value in
having the most recent timestamp.

Setting DIST_DEPENDS_ON_UPDATE_PO = no means that such forced
update won't happen in "make dist" anymore. However, the "mydist"
target will use xz.pot-update target which is the same target that
is run when xz.pot doesn't exist at all yet. Thus "mydist" will
ensure that the translations are up to date, without noise from
changes that would affect only the POT-Creation-Date line.

Note that po4a always uses msgmerge with --update, so POT-Creation-Date
in the man page translations is never the only change in .po files.
In that sense this commit makes the message translations behave more
similarly to the man page translations.

Distribution tarballs will still have non-reproducible POT-Creation-Date
in po/xz.pot and po4a/xz-man.pot but those are just two files. Even they
could be made reproducible from a Git timestamp if desired.

(cherry picked from commit 9284f1aea31f0eb23e2ea72f7218b271e2234762)

14 months agoTranslations: Run po4a/update-po and cleanup unused strings
Lasse Collin [Tue, 28 May 2024 18:23:40 +0000 (21:23 +0300)] 
Translations: Run po4a/update-po and cleanup unused strings

The v5.2 branch won't get any translation updates so the fuzzy
strings and obsolete strings are all useless. Cleaning them up
makes the files smaller and less messy to compare.

    ./update-po

    for I in *.po
    do
        msgattrib --clear-fuzzy --clear-previous --empty \
                  --no-obsolete --no-wrap "$I" > tmp
        mv tmp "$I"
    done

The po4a run gave "Parse error at" message from fr.po but
after the fr.po was rewritten the error is gone.

14 months agopo4a/update-po: Disable wrapping in .pot and .po files
Lasse Collin [Tue, 28 May 2024 18:10:33 +0000 (21:10 +0300)] 
po4a/update-po: Disable wrapping in .pot and .po files

The .po files from the Translation Project come with unwrapped
strings so this matches it.

This may reduce the noise in diffs too. When the beginning of
a paragraph had changed, the rest of the lines got rewrapped
in msgsid. Now it's just one very long line that changes when
a paragraph has been edited.

The --add-location=file option was removed as redundant. The line
numbers don't exist in the .pot file due to --porefs file and thus
they cannot get copied to the .po files either.

(cherry picked from commit 4beba1cd62d7f8f7a6f1e899b68292d94c53b599)

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: Run "make -C po update-po"
Lasse Collin [Tue, 28 May 2024 14:46:52 +0000 (17:46 +0300)] 
Translations: Run "make -C po update-po"

In the past this wasn't done before releases; the Git repository
just contained the files from the Translation Project. But this
way it is clearer when comparing release tarballs against the
Git repository.

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.

(cherry picked from commit 451f6986a5621201367c7ace5b31c552124eac13)

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 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)
(cherry picked from commit 37c46f7b67feddc164f227273770121412038ee2)

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)
(cherry picked from commit 64e0a5f726c483bdda2ee35ed7ae5f515278272f)

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)
(cherry picked from commit 203d48259935bad1c26e35d42f3db3c0f414bd8c)

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)
(cherry picked from commit 214569ace8ebb34a853cdc958ac7117c8051fe03)

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

(cherry picked from commit 80f72396ea391c6e3e6856b16b49433e07067865)

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)
(cherry picked from commit 6edc2b554f1c96bb6065e8dc1d8aa6af1056747f)

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

(cherry picked from commit db4dd74a344580e0b81436598d9741a3454245b0)
(cherry picked from commit 995afe464604c89f15c50b22cbdfa4b4acc8b001)

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)
(cherry picked from commit 44a5c1374e9622054a20dc48c02bd146cbd51ec0)

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)
(cherry picked from commit b03139b1d210865526ab0e945aa79b2627f8c202)

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)
(cherry picked from commit 08754772e801218e5e06dc06e51c9e712ddf3e49)

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

(cherry picked from commit df7f487648d18a3992386a59b8a061edca862d17)
(cherry picked from commit 9579efdbfd1499b41e17c00811bab9416165e19f)

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)
(cherry picked from commit 32e256c12ac703bbfcaad6c7157148a20e10a633)

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 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)
(cherry picked from commit 65ac20807c1303e80fb8fc28ec810d740078e328)

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)
(cherry picked from commit 78a015e753d40d604952d6c1e4428c5f440ea6b9)

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)
(cherry picked from commit 20e590bbed2b618911acf248477bd1f81b74c05a)

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)
(cherry picked from commit bcac3e3aa29d476e38a8722d687776cdbac1f3dc)

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)
(cherry picked from commit 9e7daa8dbdc38f32696b6ec90cb4ba4ca49fa6cc)

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)
(cherry picked from commit ce3a9fa94d6092665c3b000dc0dbe9a2900d4df2)

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)
(cherry picked from commit a8b3fb6d2f8e662dc03b4c239116bd057f3a5f0b)

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)
(cherry picked from commit b4b315a2060c0771b0d0ca83b9b31fcf1db40484)

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)
(cherry picked from commit 9c9a3e7b3f70b214cfdc2aada90d28a54466a5db)

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)
(cherry picked from commit 7d3418e496d00287d08a7f5af265379b757247a6)

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)
(cherry picked from commit fb6cf07ac7797d072aa04012c44def2dfd3b256b)

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)
(cherry picked from commit e164211b09d65f7f8663c46b1f74f12ac1c54d48)

14 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)
(cherry picked from commit 65b5ee071697e4fe4c2a31c14c1d68b727f1654c)

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

(cherry picked from commit f200c338f8d40b1b961033a3403d6512d3f34730)

14 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)
(cherry picked from commit 402fb45c743b736fa033b4b04881f6d1098581fd)

14 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)
(cherry picked from commit e5ba545f16e989ac51c38556e727c8c81988c04e)

14 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)
(cherry picked from commit 5e7a8c0869d9b4c32c34d70b48b0935721aa37fd)

14 months agoliblzma: Set all values in lzma_lz_encoder to NULL after allocation.
Lasse Collin [Tue, 7 May 2024 16:56:46 +0000 (19:56 +0300)] 
liblzma: Set all values in lzma_lz_encoder to NULL after allocation.

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.

(based on commit 8191720eac950a5db89c4d33d6beea6316a49b19)

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

(cherry picked from commit 27ab54af848ec4adc9c17362f6c64a42a7003df5)

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

(cherry picked from commit 019afd72e02339a6bf00c32bfb56f649c637dd6b)

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

(cherry picked from commit 6af9a4cbe5b677a2c48b009b370539ad30dc269a)

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

(cherry picked from commit 7dc466d62155cb7442aa5e10633e084ed384360d)

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

(cherry picked from commit 0ecfaa6df91f7c37510f370295f593b9c0b88b98)

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

(cherry picked from commit 9b469da8f3415e12d650705c7a82256e62e7871b)

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

(cherry picked from commit 84196e8c094402cb71b669fb9e984c56ebabb145)

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

(cherry picked from commit d90ed84db9770712e2421e170076b43bda9b64a7)

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

(cherry picked from commit 068ee436f4a8a706125ef43e8228b30001b1554e)

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

(cherry picked from commit 6cdf0a7b7974baf58c1fd20ec3278f3b84ae56e5)

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

(cherry picked from commit 33daad3961a4f07f3902b40f13e823e6e43e85da)

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

(cherry picked from commit 6961a5ac7df178bfc2b7a181c40575847bc3035f)

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

(cherry picked from commit 5b9e16764905d06fa8e8339ba185ddfee304e5fb)

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

(cherry picked from commit 36fabdbe67c8a8fbdc3ac695a91fc443a1328cc4)

14 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/
(cherry picked from commit 4083c8e9501a48934a5fb563d2c3ce2ae143cd27)

14 months agoCMake/Windows: Fix the import library filename.
Lasse Collin [Sun, 1 Oct 2023 16:10:57 +0000 (19:10 +0300)] 
CMake/Windows: Fix the import library filename.

Both PREFIX and IMPORT_PERFIX have to be set to "" to get
liblzma.dll and liblzma.dll.a.

(cherry picked from commit da4d04e4d6e199d28b58bd2e0df4e120c52dd5d7)

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

14 months agoBuild: Update visibility.m4 from Gnulib.
Jia Tan [Thu, 12 Oct 2023 12:12:18 +0000 (20:12 +0800)] 
Build: Update visibility.m4 from Gnulib.

Updating from version 6 -> 8 from upstream. Declarations for variables
and function bodies were added to avoid unnecessary failures with
-Werror.

(cherry picked from commit 4cc91ceb3992ef4f51302b56178c3b2c2aeaaaad)

14 months agoUpdate THANKS.
Lasse Collin [Fri, 6 Oct 2023 16:36:35 +0000 (19:36 +0300)] 
Update THANKS.

(cherry picked from commit 1824a6007cb1c8d5d7abcc7bf649148bc06fa72c)

14 months agoCMake: Fix Windows build with Clang/LLVM 17.
Lasse Collin [Wed, 27 Sep 2023 16:54:35 +0000 (19:54 +0300)] 
CMake: Fix Windows build with Clang/LLVM 17.

llvm-windres 17.0.0 has more accurate emulation of GNU windres, so
the hack for GNU windres must now be used with llvm-windres too.

LLVM 16.0.6 has the old behavior and there likely won't be more
16.x releases. So we can simply check for >= 17.0.0.

The workaround must not be used with Clang that is acting in
MSVC mode. This checks for the known environments that need
the workaround instead of using "NOT MSVC".

See also:
https://github.com/llvm/llvm-project/commit/2bcc0fdc58a220cb9921b47ec8a32c85f2511a47

(cherry picked from commit 38171492ded6426ddf53d0c200fa8c93fcd02a60)

14 months agoBuild: Fix underquoted AC_LANG_SOURCE.
Lasse Collin [Tue, 26 Sep 2023 10:51:31 +0000 (13:51 +0300)] 
Build: Fix underquoted AC_LANG_SOURCE.

It made no practical difference in this case.

(cherry picked from commit f3c32762ae309afa2fe330e7fb397acfdedc4d37)

14 months agosysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO.
Lasse Collin [Sun, 24 Sep 2023 13:32:32 +0000 (16:32 +0300)] 
sysdefs.h: Update the comment about __USE_MINGW_ANSI_STDIO.

(cherry picked from commit 4ae13cfe0dedb8ddc3cf9ded8cd1ac09361b3bd1)

14 months agoxz: Windows: Don't (de)compress to special files like "con" or "nul".
Lasse Collin [Thu, 21 Sep 2023 23:33:29 +0000 (02:33 +0300)] 
xz: Windows: Don't (de)compress to special files like "con" or "nul".

Before this commit, the following writes "foo" to the
console and deletes the input file:

    echo foo | xz > con_xz
    xz --suffix=_xz --decompress con_xz

It cannot happen without --suffix because names like con.xz
are also special and so attempting to decompress con.xz
(or compress con to con.xz) will already fail when opening
the input file.

Similar thing is possible when compressing. The following
writes to "nul" and the input file "n" is deleted.

    echo foo | xz > n
    xz --suffix=ul n

Now xz checks if the destination is a special file before
continuing. DOS/DJGPP version had a check for this but
Windows (and OS/2) didn't.

(cherry picked from commit 660c8c29e57d30dbd5009ef1f0ec1bbe195ccef6)

14 months agoCMake: Bump maximum policy version to 3.27.
Lasse Collin [Tue, 12 Sep 2023 18:12:34 +0000 (21:12 +0300)] 
CMake: Bump maximum policy version to 3.27.

There are several new policies. CMP0149 may affect the Windows SDK
version that CMake will choose by default. The new behavior is more
predictable, always choosing the latest SDK version by default.

The other new policies shouldn't affect this package.

(cherry picked from commit 5be6275f19784cdd5a954f0188045c8ff4934d54)

14 months agoliblzma: Move a few __attribute__ uses in function declarations.
Lasse Collin [Mon, 11 Sep 2023 15:47:26 +0000 (18:47 +0300)] 
liblzma: Move a few __attribute__ uses in function declarations.

The API headers have many attributes but these were left
as is for now.

(cherry picked from commit e3478ae4f36cd06522a2fef023860893f068434d)

14 months agoxz, xzdec, lzmainfo: Use tuklib_attr_noreturn.
Lasse Collin [Mon, 11 Sep 2023 16:03:35 +0000 (19:03 +0300)] 
xz, xzdec, lzmainfo: Use tuklib_attr_noreturn.

For compatibility with C23's [[noreturn]], tuklib_attr_noreturn
must be at the beginning of declaration (before "extern" or
"static", and even before any GNU C's __attribute__).

This commit also moves all other function attributes to
the beginning of function declarations. "extern" is kept
at the beginning of a line so the attributes are listed on
separate lines before "extern" or "static".

(cherry picked from commit b71b8922ef3971e5ccffd1e213888d44abe21d11)

14 months agoRemove incorrect uses of __attribute__((__malloc__)).
Lasse Collin [Mon, 11 Sep 2023 15:53:31 +0000 (18:53 +0300)] 
Remove incorrect uses of __attribute__((__malloc__)).

xrealloc() is obviously incorrect, modern GCC docs even
mention realloc() as an example where this attribute
cannot be used.

liblzma's lzma_alloc() and lzma_alloc_zero() would be
correct uses most of the time but custom allocators
may use a memory pool or otherwise hold the pointer
so aliasing issues could happen in theory.

The xstrdup() case likely was correct but I removed it anyway.
Now there are no __malloc__ attributes left in the code.
The allocations aren't in hot paths so this should make
no practical difference.

(cherry picked from commit 359e5c6cb128dab64ea6070d21d1c240f96cea6b)

14 months agoCMake: Fix time.h checks not running on second CMake run.
Jia Tan [Tue, 12 Sep 2023 14:36:12 +0000 (22:36 +0800)] 
CMake: Fix time.h checks not running on second CMake run.

If CMake was configured more than once, HAVE_CLOCK_GETTIME and
HAVE_CLOCK_MONOTONIC would not be set as compile definitions. The check
for librt being needed to provide HAVE_CLOCK_GETTIME was also
simplified.

(cherry picked from commit a70e96d2da761b8b3a77bf14e08002d871e5950b)

14 months agoxz: Fix a too relaxed assertion and remove uses of SSIZE_MAX.
Lasse Collin [Thu, 31 Aug 2023 15:14:43 +0000 (18:14 +0300)] 
xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX.

SSIZE_MAX isn't readily available on MSVC. Removing it means
that there is one thing less to worry when porting to MSVC.

(cherry picked from commit ef71f83973a20cc28a3221f85681922026ea33f5)

14 months agoUpdate THANKS.
Jia Tan [Mon, 28 Aug 2023 13:52:54 +0000 (21:52 +0800)] 
Update THANKS.

(cherry picked from commit 4b23b84b89e39a5117e16f66c3b01db4f08ed3e7)

14 months agoliblzma: Update assert in vli_ceil4().
Jia Tan [Mon, 28 Aug 2023 13:50:16 +0000 (21:50 +0800)] 
liblzma: Update assert in vli_ceil4().

The argument to vli_ceil4() should always guarantee the return value
is also a valid lzma_vli. Thus the highest three valid lzma_vli values
are invalid arguments. All uses of the function ensure this so the
assert is updated to match this.

(cherry picked from commit 773f1e8622cb1465df528cb16a749517650acd93)

14 months agoliblzma: Add overflow check for Unpadded size in lzma_index_append().
Jia Tan [Mon, 28 Aug 2023 13:31:25 +0000 (21:31 +0800)] 
liblzma: Add overflow check for Unpadded size in lzma_index_append().

This was not a security bug since there was no path to overflow
UINT64_MAX in lzma_index_append() or when it calls index_file_size().
The bug was discovered by a failing assert() in vli_ceil4() when called
from index_file_size() when unpadded_sum (the sum of the compressed size
of current Stream and the unpadded_size parameter) exceeds LZMA_VLI_MAX.

Previously, the unpadded_size parameter was checked to be not greater
than UNPADDED_SIZE_MAX, but no check was done once compressed_base was
added.

This could not have caused an integer overflow in index_file_size() when
called by lzma_index_append(). The calculation for file_size breaks down
into the sum of:

- Compressed base from all previous Streams
- 2 * LZMA_STREAM_HEADER_SIZE (size of the current Streams header and
  footer)
- stream_padding (can be set by lzma_index_stream_padding())
- Compressed base from the current Stream
- Unpadded size (parameter to lzma_index_append())

The sum of everything except for Unpadded size must be less than
LZMA_VLI_MAX. This is guarenteed by overflow checks in the functions
that can set these values including lzma_index_stream_padding(),
lzma_index_append(), and lzma_index_cat(). The maximum value for
Unpadded size is enforced by lzma_index_append() to be less than or
equal UNPADDED_SIZE_MAX. Thus, the sum cannot exceed UINT64_MAX since
LZMA_VLI_MAX is half of UINT64_MAX.

Thanks to Joona Kannisto for reporting this.

(cherry picked from commit 68bda971bb8b666a009331455fcedb4e18d837a4)

14 months agomythread.h: Fix typo error in Vista threads mythread_once().
Jamaika1 [Tue, 8 Aug 2023 12:07:59 +0000 (14:07 +0200)] 
mythread.h: Fix typo error in Vista threads mythread_once().

The "once_" variable was accidentally referred to as just "once". This
prevented building with Vista threads when
HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR was not defined.

(cherry picked from commit c0c0cd4a483a672b66a13761583bc4f84d86d501)

14 months agobuild-aux/manconv.sh: Fix US-ASCII and UTF-8 output.
Lasse Collin [Wed, 2 Aug 2023 12:19:43 +0000 (15:19 +0300)] 
build-aux/manconv.sh: Fix US-ASCII and UTF-8 output.

groff defaults to SGR escapes. Using -P-c passes -c to grotty
which restores the old behavior. Perhaps there is a better way to
get pure plain text output but this works for now.

(cherry picked from commit 6a1093c0004c42eeaef312456c295671496dd67a)

14 months agoliblzma: Prevent an empty translation unit in Windows builds.
Jia Tan [Mon, 24 Jul 2023 13:43:44 +0000 (21:43 +0800)] 
liblzma: Prevent an empty translation unit in Windows builds.

To workaround Automake lacking Windows resource compiler support, an
empty source file is compiled to overwrite the resource files for static
library builds. Translation units without an external declaration are
not allowed by the C standard and result in a warning when used with
-Wempty-translation-unit (Clang) or -pedantic (GCC).

(cherry picked from commit 19899340cf74d98304f9f5b726c72e85c7017d72)

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

(cherry picked from commit b406828a6dfd3caa4f77efe3ff3e3eea263eee62)

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

(cherry picked from commit ef4a07ad9434f81417395f6fe0bb331e027a703b)

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

(cherry picked from commit 64ee0caaea06654b28afaee850fb187a11bf9cb2)

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

(cherry picked from commit 1155471651ad456c5f90aee6435931fae65682bf)

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

(cherry picked from commit 62dd1c9bf0c66679ceeebc8b99bca136ca43bcb9)

14 months 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 "LibLZMA::LibLZMA"
because another target with the same name already exists.`

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

(cherry picked from commit d04eb78ab3892d3678c180437dd66379efa051fd)

2 years agoBump version and soname for 5.2.12. v5.2.12
Jia Tan [Thu, 4 May 2023 11:48:19 +0000 (19:48 +0800)] 
Bump version and soname for 5.2.12.

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

2 years agoBuild: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.
Lasse Collin [Tue, 21 Mar 2023 12:07:51 +0000 (14:07 +0200)] 
Build: Add a comment that AC_PROG_CC_C99 is needed for Autoconf 2.69.

It's obsolete in Autoconf >= 2.70 and just an alias for AC_PROG_CC
but Autoconf 2.69 requires AC_PROG_CC_C99 to get a C99 compiler.

2 years agoBuild: configure.ac: Use AS_IF and AS_CASE where required.
Lasse Collin [Tue, 21 Mar 2023 12:04:37 +0000 (14:04 +0200)] 
Build: configure.ac: Use AS_IF and AS_CASE where required.

This makes no functional difference in the generated configure
(at least with the Autotools versions I have installed) but this
change might prevent future bugs like the one that was just
fixed in the commit 5a5bd7f871818029d5ccbe189f087f591258c294.

2 years agoUpdate THANKS.
Lasse Collin [Tue, 21 Mar 2023 11:12:03 +0000 (13:12 +0200)] 
Update THANKS.

2 years agoBuild: Fix --disable-threads breaking the building of shared libs.
Lasse Collin [Tue, 21 Mar 2023 11:11:49 +0000 (13:11 +0200)] 
Build: Fix --disable-threads breaking the building of shared libs.

This is broken in the releases 5.2.6 to 5.4.2. A workaround
for these releases is to pass EGREP='grep -E' as an argument
to configure in addition to --disable-threads.

The problem appeared when m4/ax_pthread.m4 was updated in
the commit 6629ed929cc7d45a11e385f357ab58ec15e7e4ad which
introduced the use of AC_EGREP_CPP. AC_EGREP_CPP calls
AC_REQUIRE([AC_PROG_EGREP]) to set the shell variable EGREP
but this was only executed if POSIX threads were enabled.
Libtool code also has AC_REQUIRE([AC_PROG_EGREP]) but Autoconf
omits it as AC_PROG_EGREP has already been required earlier.
Thus, if not using POSIX threads, the shell variable EGREP
would be undefined in the Libtool code in configure.

ax_pthread.m4 is fine. The bug was in configure.ac which called
AX_PTHREAD conditionally in an incorrect way. Using AS_CASE
ensures that all AC_REQUIREs get always run.

Thanks to Frank Busse for reporting the bug.
Fixes: https://github.com/tukaani-project/xz/issues/45