1
0
mirror of https://git.tukaani.org/xz.git synced 2026-03-28 21:01:22 +00:00

3012 Commits

Author SHA1 Message Date
Lasse Collin
1e00837f72
CI: Add Haiku 2026-03-27 18:13:26 +02:00
Lasse Collin
8082851b78
Update THANKS 2026-03-27 18:13:26 +02:00
Lasse Collin
3cdd412bce
CI: Update MSYS2
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Lasse Collin
e38a4af340
CI: Update Solaris
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Lasse Collin
40b1599217
CI: Update OpenBSD
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Lasse Collin
3aaf2f136c
CI: Update NetBSD
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Lasse Collin
b5c26a249d
CI: Update FreeBSD
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Lasse Collin
1a73f4f917
CI: Update DragonFly BSD
Closes: https://github.com/tukaani-project/xz/pull/213
2026-03-27 18:13:26 +02:00
Salman Muin Kayser Chishti
5d61c5a3cf
CI: Upgrade GitHub Actions for Node 24 compatibility
Signed-off-by: Salman Muin Kayser Chishti <13schishti@gmail.com>
Closes: https://github.com/tukaani-project/xz/pull/212
2026-03-27 18:13:26 +02:00
Lasse Collin
0ac3b93387
xz: Prevent an integer overflow in --files and --files0
This requires a filename (or something that pretends to be a filename)
of at least 2 GiB on a 32-bit platform, and that realloc() to
SIZE_MAX / 2 + 1 bytes has succeeded.

Fixes: https://github.com/tukaani-project/xz/pull/218
2026-03-27 18:13:26 +02:00
Lasse Collin
2faa141bdb
tuklib_integer: Fix inefficient aligned_writeXXne
The __builtin_assume_aligned was applied to the wrong argument which
made aligned writes worse on strict-align archs.

Aligned writes aren't used in liblzma, so this bug didn't matter in
this package; tuklib_integer.h is meant to be usable elsewhere too.
2026-03-27 18:13:26 +02:00
Lasse Collin
685538271e
Build: Remove -Wpre-c2x-compat
It makes clang -std=gnu23 noisy about bool. It's also noisy about
[[__fallthrough__]] which is only used in C23 mode.

Reported-by: Collin Funk <collin.funk1@gmail.com>
2026-03-27 18:13:26 +02:00
Collin Funk
3a78a82bd3
xz: Don't fsync directories on QNX
On QNX calling fsync on a directory fails with EINVAL. This causes the
following test failure:

    $ cat tests/test_suffix.sh.log
    /data/home/root/xz-5.8.2/src/xz/.libs/lt-xz: suffix_temp: Synchronizing the directory of the file failed: Invalid argument
    Failed to decompress a file with a suffix set in raw format
    FAIL test_suffix.sh (exit status: 1)

Closes: https://github.com/tukaani-project/xz/pull/216
2026-03-27 18:13:21 +02:00
Lasse Collin
bfc5f12a84
Update THANKS 2026-02-25 17:33:42 +02:00
Lasse Collin
5553509f1a
liblzma: Fix a copy-paste error in commented-out code
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2841960994
Fixes: 96b663f67c0e ("liblzma: Refactor CRC comments.")
2026-02-25 17:32:13 +02:00
Lasse Collin
4e76651dba
Fix typos and grammar in comments and docs
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2789354505
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2789354515
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2820960196
2026-02-25 17:32:13 +02:00
Lasse Collin
cd8a6231d0
tuklib_open_stdxxx: Fix a typo in macro name
It doesn't matter in this package, but it's good to fix it still.

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313660
2026-02-25 17:32:13 +02:00
Lasse Collin
bf5d32f489
CMake: Fix a wrong #define
HAVE_SYS_PARAM_H was misspelled HAVE_PARAM_H. This might have broken
the build on systems where sysctl() is used to detect the amount of RAM
or the number of processor cores/threads.

The cpuset code for FreeBSD doesn't need the macro it so it was removed.

Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313680
Fixes: https://github.com/dotnet/runtime/pull/124003#discussion_r2782313704
Fixes: 7e3493d40eac ("Build: Add very limited experimental CMake support.")
2026-02-25 17:32:13 +02:00
Radek Zikmund
b0f3b64a25
liblzma/MSVC: Add a cast to fix a warning (C4057) with __cpuid()
__cpuid from MSVC (and also the old Intel ICC) use int[], while
__get_cpuid from <cpuid.h> in GCC and Clang use unsigned int[].
Adding a cast is the simplest fix.

Link: https://github.com/tukaani-project/xz/pull/208
2026-02-25 17:32:13 +02:00
Radek Zikmund
b51d67f4a9
CMake: Guard script configure_file() calls with ENABLE_SCRIPTS
The configure_file() calls for xzdiff, xzgrep, xzmore, and xzless
were running unconditionally within the if(UNIX) block, even when
ENABLE_SCRIPTS was OFF. This would cause a build failure if the
src/scripts/*.in files were not present. Deleting those files can
simplify license compliance when the scripts aren't needed.

Move the foreach loop and related code inside if(ENABLE_SCRIPTS) guard
so that configure_file() is only called when scripts are actually needed.
This is mostly whitespace changes to adjust the indentation.

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Closes: https://github.com/tukaani-project/xz/pull/210
2026-02-25 17:32:07 +02:00
Lasse Collin
1007bf08b5
Translations: Add Arabic man page translations
Rendering of bidirectional text from man pages might not work perfectly
in all cases.
2026-02-04 12:28:07 +02:00
Lasse Collin
54147ad65a
Update THANKS 2026-01-25 13:51:09 +02:00
Lasse Collin
d6bdb446f8
liblzma: Add the "License" property to liblzma.pc
The "License" property is a pkgconf extension. See pc(5).
pkg-config 0.29.2 (2017) ignores unrecognized properties so this
commit shouldn't create compatibility issues.

pkgconf provides bomtool which uses the "License" property to generate
a software bill of materials. In pkgconf.git there is spdxtool for the
same task but with different output format.

The pkgconf extensions "Copyright" and "Maintainer" would also be
used by bomtool and spdxtool, but I don't want to add those properties
at least for now.

Co-authored-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Closes: https://github.com/tukaani-project/xz/pull/178
2026-01-25 13:44:52 +02:00
Lasse Collin
687bd3e30f
Update THANKS 2026-01-25 12:16:53 +02:00
Lasse Collin
b80b6343a4
liblzma: Don't try to use x86-64 inline asm on ARM64EC
Reported-by: Chase Knowlden
Fixes: https://github.com/tukaani-project/xz/issues/206
2026-01-25 12:16:39 +02:00
Pino Toscano
47fb9d84c0
Autotools: Enable x86 assembler on Hurd by default
It has been enabled in Debian GNU/Hurd for 15+ years with no issues.
Hence, enable it by default also in the upstream sources.

The CMake build already had it enabled.

Link: https://salsa.debian.org/debian/xz-utils/-/blob/debian/5.8.2-2/debian/rules?ref_type=tags#L98
Closes: https://github.com/tukaani-project/xz/pull/204
2026-01-25 12:01:32 +02:00
Lasse Collin
9f4c5a0d48
doc/SHA256SUMS: Add 5.8.2 2025-12-17 14:49:12 +02:00
Lasse Collin
3d078b52ad
Bump version and soname for 5.8.2 v5.8.2 2025-12-17 13:36:42 +02:00
Lasse Collin
fb14afd5c9
Add NEWS for 5.8.2 2025-12-17 13:36:35 +02:00
Lasse Collin
590f4713b2
CMake: Bump maximum policy version to 4.2
CMP0186 is curious but we aren't affected.
2025-12-16 11:34:22 +02:00
Lasse Collin
26d22ed16b
tuklib_integer/CMake: Log a message about unaligned access check 2025-12-16 11:34:22 +02:00
Lasse Collin
f7381cf927
tuklib_integer/CMake: Don't run unaligned access checks unnecessarily
If the cache variable TUKLIB_FAST_UNALIGNED_ACCESS is already set,
the autodetection result isn't needed because the option() command
does nothing when the cache variable is already set.

This is largely white space change to indent the if...endif block.
2025-12-16 11:34:22 +02:00
Lasse Collin
dc1a421ce3
tuklib_integer: Use CMAKE_C_COMPILER_ARCHITECTURE_ID when available
CMake >= 4.1 sets CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID on many
platforms. The list of possible values are documented. Use this
variable when available. On older CMake versions CMAKE_SYSTEM_PROCESSOR
is still used, thus the regexes have to include values like ^amd64 still.

With old CMake versions, checking CMAKE_C_COMPILER_ARCHITECTURE_ID
is somewhat useful with MSVC because CMAKE_SYSTEM_PROCESSOR might
not match the target architecture.
2025-12-16 11:34:22 +02:00
Lasse Collin
c690101ddd
tuklib_integer: Autodetect when -mstrict-align is used with GCC on ARM64
On ARM64, support for fast unaligned memory access was autodetected by
checking if __ARM_FEATURE_UNALIGNED is defined. However, at least GCC
versions up to 15.2.0 define the macro even when -mstrict-align has
been specified. Thus, autodetection with GCC doesn't work correctly,
and binaries built using -mstrict-align can be much slower than they
need to be, unless the user also passes --disable-unaligned-access
to configure or -DTUKLIB_FAST_UNALIGNED_ACCESS=OFF to cmake.

See the GCC bug:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555

Workaround the issue by using heuristics with GCC on ARM64.

With Clang, the detection using __ARM_FEATURE_UNALIGNED works.
It also works with GCC on 32-bit ARM.

Fixes: e5f13a66567b ("tuklib_integer: Autodetect support for unaligned access on ARM.")
2025-12-16 11:34:10 +02:00
Lasse Collin
d9b318f5b8
CI: Update MSYS2 2025-12-09 18:02:23 +02:00
Lasse Collin
700e32f1b7
CI: Update DragonFly BSD 2025-12-09 18:02:05 +02:00
Lasse Collin
a7b749389c
CI: Update Solaris 2025-12-09 17:58:52 +02:00
Lasse Collin
e0b3c6ee0a
CI: Update NetBSD 2025-12-09 17:56:58 +02:00
Lasse Collin
fbc1046248
CI: Update OpenBSD 2025-12-09 17:54:54 +02:00
Lasse Collin
8f0579ba56
CI: Update FreeBSD 2025-12-09 17:52:01 +02:00
Lasse Collin
f8424b0416
Update THANKS 2025-12-09 17:40:05 +02:00
Lasse Collin
c4340692d4
Translations: Add src/xz/sandbox.c to POTFILES.in
There are no strings to translate in that file now, but it's good to
list it anyway in case translatable strings are added in the future.

Fixes: 374868d81d47 ("xz: Move sandboxing code to sandbox.c and improve Landlock sandbox.")
2025-12-09 17:18:23 +02:00
Lasse Collin
b8af36920b
xz: Never translate "Failed to enable the sandbox"
This was already the case in practice because I had forgotten to list
src/xz/sandbox.c in po/POTFILES.in. However, it seems better to never
translate this particular error message. It should almost never occur
and if it does, an untranslated message is should make it easier to
find bug reports about it.
2025-12-09 17:18:23 +02:00
Lasse Collin
5a7fc1af3d
Translations: Update the Swedish man page translations 2025-12-09 17:18:23 +02:00
Lasse Collin
88531e5463
Translations: Update the Romanian man page translations 2025-12-09 17:18:23 +02:00
Lasse Collin
8a81727719
Update THANKS 2025-12-09 17:18:23 +02:00
Lasse Collin
1ec43aa781
CMake: Autodetect unaligned access support on LoongArch
This still relies on CMAKE_SYSTEM_PROCESSOR. CMake 4.1 added more
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID values to detect the arch in
a more defined manner, but 4.1 is too new to require for now.

Thanks-to: Li Chenggang <lichenggang@deepin.org>
Closes: https://github.com/tukaani-project/xz/pull/186
2025-12-09 17:18:23 +02:00
Lasse Collin
7971566247
Autotools: Autodetect unaligned access support on LoongArch
According to [1] sections 7.4, 8.1, and 8.2, desktop and server
processors support fast unaligned access, but embedded systems likely
don't.

It's important that TUKLIB_FAST_UNALIGNED_ACCESS isn't defined when
-mstrict-align is in use because it will result in slower binaries
even if running on a processor that supports fast unaligned access.
It's because compilers will translate multibyte memcpy() to multiple
byte-by-byte instructions instead of wider loads and stores. The
compression times from [2] show this well:

    Unaligned access    CFLAGS                     Compression time
        enabled         -O2 -mno-strict-align          66.1 s
        disabled        -O2 -mno-strict-align          79.5 s
        disabled        -O2 -mstrict-align             79.9 s
        enabled         -O2 -mstrict-align            129.1 s

There currently (GCC 15.2) is no preprocessor macro on LoongArch
to detect if -mstrict-align or -mno-strict-align is in effect (the
default is -mno-strict-align). Use heuristics to detect which of the
flags is in effect.

[1] https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
[2] https://github.com/tukaani-project/xz/pull/186#issuecomment-3494570304

Thanks-to: Li Chenggang <lichenggang@deepin.org>
Thanks-to: Xi Ruoyao
See: https://github.com/tukaani-project/xz/pull/186
2025-12-09 17:18:22 +02:00
Lasse Collin
338f952c00
xz: Silence clang -Wunreachable-code-break
Fixes: a165d7df1964 ("xz: Add a new --filters-help option.")
2025-12-09 17:18:22 +02:00
Lasse Collin
723cee44d0
liblzma: Remove unwanted semicolons
These didn't affect control flow.
2025-12-09 17:18:22 +02:00