1
0
mirror of https://git.tukaani.org/xz.git synced 2025-12-18 11:28:45 +00:00

Compare commits

..

133 Commits

Author SHA1 Message Date
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 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
Lasse Collin
524f6a7384
Tests: Remove an unwanted semicolon from a macro definition
It didn't affect control flow.

Fixes: fe3bd438fb11 ("Tests: Fix memory leaks in test_block_header.")
2025-12-09 17:18:22 +02:00
Lasse Collin
0f41a28bfa
Build: Use -Wextra-semi-stmt when supported 2025-12-09 17:18:22 +02:00
Lasse Collin
91170c8cab
CI: Add clang-cl
Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-3577456136
2025-12-09 17:18:22 +02:00
Lasse Collin
a3c6cb0911
xz/Windows: Add a missing #include to fix the build with clang-cl
Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-1986829734
Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-3577456136
2025-12-09 17:18:22 +02:00
Lasse Collin
c410ccc625
xz: Check return value of sigaction() before calling raise()
Fixes: Coverity CID 456022
2025-12-09 17:18:21 +02:00
Lasse Collin
6cc2da0a4b
liblzma: Refactor a loop in lzma_filters_copy()
Arguably it's nicer if i doesn't wrap around when the loop terminates.

Fixes: Coverity CID 464589
Fixes: 6d118a0b9def ("Add lzma_filters_copy().")
2025-12-09 17:18:21 +02:00
Lasse Collin
90b67853d5
liblzma: Silence two Coverity warnings
lzma_lzma_decoder_memusage() returns UINT64_MAX if lc/lp/pb aren't
valid. alone_decoder.c and lzip_decoder.c didn't check the return
value because in both it is known that lc/lp/pb are valid. Make them
call the _nocheck() variant instead which skips the validation (it
already existed for LZMA2's internal use).

Fixes: Coverity CID 464658
Fixes: Coverity CID 897069
2025-12-09 17:18:21 +02:00
Lasse Collin
be365b7010
liblzma: Fix a harmless read of shared variable without mutex
The partial_update_mode enumeration had three states, _DISABLED,
_START, and _ENABLED. Main thread changed it from _DISABLED to _START
while holding a mutex. Once set to _START, worker thread changed it
to _ENABLED without a mutex. Later main thread read it without a mutex,
so it could see either _START or _ENABLED. However, it made no
difference because the main thread checked for != _DISABLED, so
it didn't matter if it saw _START or _ENABLED.

Nevertheless, such things must not be done. It's clear it was a mistake
because there were two comments that directly contradicted each
other about how the variable was accessed.

Split the enumeration into two booleans:

  - partial_update_enabled: A worker thread locks the mutex to read
    this variable and the main thread locks the mutex to change the
    value. Because only the main thread modifies the variable, the
    main thread can read the value without locking the mutex.
    This variable replaces the _DISABLED -> _START transition.

  - partial_update_started is for worker thread's internal use and thus
    needs no mutex. This replaces the _START -> _ENABLED transition.

Fixes: Coverity CID 456025
Fixes: bd93b776c1bd ("liblzma: Fix a deadlock in threaded decoder.")
2025-12-09 17:18:21 +02:00
Lasse Collin
2686554da0
CI: Add Coverity Scan
Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Fixes: https://github.com/tukaani-project/xz/issues/198
2025-12-09 17:18:21 +02:00
Lasse Collin
1b30734c9c
Change the sorting order in THANKS
In short, sort the names with this command (-k1,1 isn't needed because
the lines with names start with "  -"):

    LC_ALL=en_US.UTF-8 sort -k2,2 -k3,3 -k4,4 -k5,5

When THANKS was created, I wrote the names as "First Last" and attempted
to keep them sorted by last name / surname / family name. This works
with many names in THANKS, but it becomes complicated with names that
don't fit that pattern. For example, names that are written as
"Last First" can be manually sorted by family name, but only if one
knows which part of the name is the family name.[*] And of course,
the concept of first/last name doesn't apply to all names.

[*] xz had a co-maintainer who could help me with such names,
    but fortunately he isn't working on the project anymore.

Adding the names in chronological order could have worked too, although
if something is contributed by multiple people, one would still have to
decide how to sort the names within the batch. Another downside would
be that if THANKS is updated in more than one work-in-progress branch,
merge conflicts would occur more often.

Don't attempt to sort by last name. Let's be happy that people tend to
provide names that can be expressed in a reasonable number of printable
Unicode characters. In practice, people have been even nicer: if the
native language doesn't use a Latin script alphabet, people often provide
a transliterated name (only or in addition to the original spelling),
which is very much appreciated by those who don't know the native script.

Treat the names as opaque strings or space-separated strings for sorting
purposes. This means that most names will now be sorted by first name.
There still are many choices how to sort:

(1) LC_ALL=en_US.UTF-8 sort

    The project is in English, so this may sound like a logical choice.
    However, spaces have a lower weight than letters, which results in
    this order:

        - A Ba
        - Ab C
        - A Bc
        - A Bd

(2) LC_ALL=en_US.UTF-8 sort -k2,2

    This first sorts by the first word and then by the rest of the
    string. It's -k2,2 instead of -k1,1 to skip the leading dash.

        - A Ba
        - A Bc
        - A Bd
        - Ab C

    I like this more than (1). One could add -k3,3 -k4,4 -k5,5 ... too.
    With current THANKS it makes no difference but it might some day.

    NOTE: The ordering in en_US.UTF-8 can differ between libc versions
    and operating systems. Luckily it's not a big deal in THANKS.

(3) LC_ALL=en_US.UTF-8 sort -f -k2,2

    Passing -f (--ignore-case) to sort affects sorting of single-byte
    characters but not multibyte characters (GNU coreutils 9.9):

        No -f       With -f     LC_ALL=C
        Aa          A.A         A.A
        A.A         Aa          Aa
        Ää          Ää          Ä.Ä
        Ä.Ä         Ä.Ä         Ää

    In GNU coreutils, the THANKS file is sorted using "sort -f -k1,1".
    There is also a basic check that the en_US.UTF-8 locale is
    behaving as expected.

(4) LC_ALL=C sort

    This sorts by byte order which in UTF-8 is the same as Unicode
    code point order. With the strings in (1) and (2), this produces
    the same result as in (2). The difference in (3) can be seen above.

    The results differ from en_US.UTF-8 when a name component starts
    with a lower case ASCII letter (like "von" or "de"). Worse, any
    non-ASCII characters sort after ASCII chars. These properties might
    look weird in English language text, although it's good to remember
    that en_US.UTF-8 sorting can appear weird too if one's native
    language isn't English.

The choice between (2) and (4) was difficult but I went with (2).

;-)
2025-12-09 17:18:09 +02:00
Lasse Collin
8bb516887c
Landlock: Add missing #ifdefs
The build was broken on distros that have an old <sys/landlock.h>.

Fixes: 2b2652e914b1 ("Landlock: Workaround a bug in RHEL 9 kernel")
2025-11-23 20:39:28 +02:00
Lasse Collin
23c95c6a7c
Update THANKS 2025-11-23 20:13:50 +02:00
Lasse Collin
2b2652e914
Landlock: Workaround a bug in RHEL 9 kernel
If one runs xz 5.8.0 or 5.8.1 from some other distribution in a container
on RHEL 9, xz will fail with the message "Failed to enable the sandbox".

RHEL 9 kernel since 5.14.0-603.el9 (2025-07-30) claims to support
Landlock ABI version 6, but it lacks support for LANDLOCK_SCOPE_SIGNAL.
The issue is still present in 5.14.0-643.el9 (2025-11-22). Red Hat is
aware of the issue, but I don't know when it will be fixed.

The sandbox is meant to be transparent to users, thus there isn't and
won't be a command line option to disable it. Instead, add a workaround
to keep xz working on the buggy RHEL 9 kernels.

Reported-by: Richard W.M. Jones
Thanks-to: Pavel Raiskup
Tested-by: Orgad Shaneh
Tested-by: Richard W.M. Jones
Fixes: https://github.com/tukaani-project/xz/issues/199
Link: https://issues.redhat.com/browse/RHEL-125143
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2407105
Link: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/65BDSY56R5ZJRTUC4B6CIVCVLY4LG4ME/
2025-11-23 20:13:49 +02:00
Lasse Collin
ee75c76958
Landlock: Cache the ABI version
In xz it can avoid up to two syscalls that query the ABI version.
2025-11-23 20:13:37 +02:00
Lasse Collin
f57b1716cd
Update THANKS 2025-11-03 14:52:45 +02:00
Lasse Collin
211cde0923
mythread.h: Fix the build on Emscripten when threading is disabled
To make a non-threaded liblzma-only build work with WASI SDK, <signal.h>
and mythread_sigmask() were omitted from mythread.h in the commit
81db3b889830. This broke non-threaded full build with Emscripten because
src/xz/signals.c needs mythread_sigmask() (liblzma-only build was fine).

If __wasm__ is defined, omit <signal.h> and mythread_sigmask() in
non-threaded builds only when __EMSCRIPTEN__ isn't defined.

Reported-by: Marcus Tillmanns
Thanks-to: ChanTsune
Fixes: https://github.com/tukaani-project/xz/issues/161
Fixes: 81db3b889830 ("mythread.h: Disable signal functions in builds targeting Wasm + WASI.")
2025-11-03 14:48:15 +02:00
Lasse Collin
cbf50a99e3
Translations: Update the Serbian man page translations
The earlier bug fixes are now included in the Translation Project.
2025-11-03 11:56:32 +02:00
Lasse Collin
68d1591187
xz: Silence a compiler warning when signals_block_count is unused
Move the static variable signals_block_count to the #ifndef block
that already has the functions that need the variable.
2025-11-02 19:40:55 +02:00
Lasse Collin
beca015891
xz: Silence a warning from Clang on glibc systems
Fixes: e8838b2f5922 ("xz: Look at resource limits when determining the default memlimit")
2025-11-02 17:45:20 +02:00
Lasse Collin
3e394278ed
Translations: Update the Serbian man page translations
Preserve the bug fixes made in 71ad5e82888f and 4f52e7387012 because
upstream hasn't included them.
2025-11-02 14:37:52 +02:00
Lasse Collin
ace28e3573
Translations: Update the Korean man page translations 2025-11-02 14:27:10 +02:00
Lasse Collin
ffd14a099f
Translations: Update the Italian man page translations 2025-11-02 14:24:43 +02:00
Lasse Collin
6f3152874e
Translations: Update the Ukrainian man page translations 2025-11-02 14:12:23 +02:00
Lasse Collin
ef67e051d7
liblzma: Fix build on old Linux/glibc on ARM64
getauxval() can be available even if HWCAP_CRC32 isn't #defined, so
both have to be checked. HWCAP_CRC32 was added in glibc 2.24 (2016).

Fixes: https://github.com/tukaani-project/xz/issues/190
2025-10-31 19:21:48 +02:00
Lasse Collin
71c2ede383
CI: Update Solaris 2025-10-31 14:44:24 +02:00
Lasse Collin
02da8de0ed
CI: Update DragonFly BSD 2025-10-31 14:44:24 +02:00
Lasse Collin
75b18d325f
CI: Update NetBSD 2025-10-31 14:44:24 +02:00
Lasse Collin
0102072915
CI: Update FreeBSD 2025-10-31 14:44:24 +02:00
Lasse Collin
83419783a6
CI: Update OpenBSD 2025-10-31 14:44:18 +02:00
Lasse Collin
3b5f5af9bc
Update THANKS 2025-10-31 12:43:43 +02:00
Kirill A. Korinsky
e8838b2f59
xz: Look at resource limits when determining the default memlimit
When no memory usage limits have been set by the user, the default
for multithreaded mode has been 1/4 of total RAM. If this limit is
too high and memory allocation fails, liblzma (and xz) fail. Perhaps
liblzma should handle it better by reducing the number of threads
and continuing with the amount of memory it can allocate, but currently
that isn't the case.

If resource limits were set to about 1/4 of RAM or lower, then xz
could fail for the above reason. This commit makes xz look at
RLIMIT_DATA, RLIMIT_AS, and RLIMIT_VMEM when they are available,
and set the limit 64 MiB below the lowest of those limits. This is
more or less a hack just like the 1/4-of-RAM method is, but this is
simple and quick to implement.

On Linux, there are other limits like cgroup v2 memory.max which
can still make xz fail. The same is likely possible with FreeBSD's
rctl(8).

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Thanks-to: Fangrui Song
Fixes: https://github.com/tukaani-project/xz/issues/195
Closes: https://github.com/tukaani-project/xz/pull/196
2025-10-31 12:43:37 +02:00
Lasse Collin
8d26b72915
CI: Remove windows-2019 (which had VS 2019)
GitHub has removed the runner image.

A breakage with CLMUL CRC code occurred with VS 2019 but not 2022,
see b5a5d9e3f702. MS supports VS 2019 for a few more years, so it's
unfortunate that it can no longer be tested on GitHub.
2025-10-01 12:50:53 +03:00
Lasse Collin
32412bd2a4
Update THANKS 2025-09-29 19:34:58 +03:00
Lakshmi-Surekha
eaa150df98
xz: Don't fsync() directories on AIX
It fails with EBADF.

Fixes: https://github.com/tukaani-project/xz/issues/188
Closes: https://github.com/tukaani-project/xz/pull/189
2025-09-29 19:25:11 +03:00
Lasse Collin
61b114e92f
liblzma: Document that lzma_allocator.free(opaque, NULL) is possible
It feels better to fix the docs than change the code because this
way newly-written applications will be forced to be compatible with
the lzma_allocator behavior of old liblzma versions. It can matter
if someone builds the application against an older liblzma version.

Fixes: https://github.com/tukaani-project/xz/issues/183
2025-09-29 18:37:19 +03:00
Simon Josefsson
6d287a3ae9
Update GPLv2 and LGPLv2.1 copies from gnu.org
Closes: https://github.com/tukaani-project/xz/pull/194
2025-09-29 17:55:41 +03:00
Lasse Collin
41a421dbad
tests/test_suffix.sh: Avoid variables in printf format string 2025-09-29 17:50:46 +03:00
Lasse Collin
a2c6aa8764
build-aux/manconv.sh: Add quotes 2025-09-29 17:50:46 +03:00
Lasse Collin
8e4153253e
windows/build.bash: Add quotes
In this case they aren't needed but it's better style.
2025-09-29 17:50:46 +03:00
Lasse Collin
37a57a926d
po4a/update-po: Ensure that a glob won't expand to a command line option 2025-09-29 17:50:45 +03:00
Lasse Collin
e3ba73034a
liblzma: validate_map.sh: Catch some unlikely errors 2025-09-29 17:50:45 +03:00
Lasse Collin
067cecdea6
CI: Catch unsupported arguments in ci_build.bash 2025-09-29 17:50:45 +03:00
Lasse Collin
4fc6208abe
Scripts: Add shellcheck directives to silence warnings
Set also shell because the xz*.in files start with '#!@POSIX_SHELL@'.

SC1003 and SC2016 are only info messages, not warnings. Several other
shellcheck info messages remain. They are safe to ignore, but I didn't
want to disable them now.

Partially-fixes: https://github.com/tukaani-project/xz/issues/174
2025-09-29 17:50:45 +03:00
Lasse Collin
7844aff1a8
Scripts: Silence two shellcheck warnings 2025-09-29 17:50:39 +03:00
Lasse Collin
4d439aaeed
Translations: Add Swedish man page translations 2025-09-29 17:29:23 +03:00
Lasse Collin
dd4a1b2599
CI: Add timeout-minutes
Sometimes the VM workflows (like FreeBSD VM on Ubuntu) get stuck
and the default timeout is six hours. While at it, set a sensible
timeout for all workflows.
2025-05-23 13:09:14 +03:00
Lasse Collin
d660fe5d56
liblzma: Fix grammar in API docs
Fixes: a27920002dbc ("liblzma: Add generic support for input seeking (LZMA_SEEK).")
2025-05-23 12:28:17 +03:00
Lasse Collin
ab45bdf432
Update THANKS 2025-05-21 16:07:01 +03:00
Lasse Collin
f023993653
CMake: With symbol versioning, try to pass --undefined-version to linker
Fixes: https://github.com/tukaani-project/xz/issues/180
Fixes: https://bugs.gentoo.org/956119
2025-05-21 16:07:01 +03:00
Lasse Collin
377be0ea7a
Build: With symbol versioning, try to pass --undefined-version to linker
Fixes: https://github.com/tukaani-project/xz/issues/180
Fixes: https://bugs.gentoo.org/956119
2025-05-21 16:07:01 +03:00
Lasse Collin
ff49c82176
CMake: Fix comments 2025-05-21 14:48:18 +03:00
Lasse Collin
71ad5e8288
Translations: Update Serbian man page translations
Compared to the file in the Translation Project, I still had to apply
a few fixes that were needed with the previous (5.7.1-dev1) version too:

  - Remove two extra '<' characters that break the build with po4a.

  - Don't translate XZ_DEFAULTS and XZ_OPT environment variable names.
2025-05-21 13:14:04 +03:00
Lasse Collin
31a983ad47
Update po/.gitignore 2025-05-21 12:55:28 +03:00
Lasse Collin
d9e70da25a
Translations: Update the Spanish translation 2025-05-21 12:54:42 +03:00
Lasse Collin
dbfb925c81
Tests: Silence a warning from GCC 15.1
It was (probably) intentionally without the null terminator, but the test
works with null terminator too (the test still fails with xz <= 5.0.3),
so simply omit one character to silence the warning.

tests/test_bcj_exact_size.c:30:32: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
   30 |         const uint8_t in[16] = "0123456789ABCDEF";
      |                                ^~~~~~~~~~~~~~~~~~

Fixes: d8db706acb83 ("liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.")
Fixes: https://github.com/tukaani-project/xz/issues/176
2025-05-03 12:37:28 +03:00
Lasse Collin
7c12726c51
Update THANKS 2025-04-28 18:16:14 +03:00
Lasse Collin
1bd7361a04
Update THANKS 2025-04-25 17:52:50 +03:00
Guillaume Outters
5cc2e479eb
xz, xzdec: Capsicum sandbox: Fix incorrect use of cap_rights_clear()
cap_rights_clear() with no additional arguments acts as a no-op, so
instead of removing all capability rights from STDIN_FILENO, the same
rights were allowed for STDIN_FILENO as were allowed for src_fd.

Fixes: a0eecc235d3b ("xz: Make Capsicum sandbox more strict with stdin and stdout.")
(The commit message says "stdout". It should have said "stderr".)
2025-04-25 17:43:47 +03:00
Lasse Collin
56aa9a0796
CI: Valgrind: Improve the skipping of traced child processes
Use --trace-children-skip instead of --trace-children-skip-by-arg
so that the skipping is only done based on the executable names.
(--trace-children-skip-by-arg can match other args than argv[0].)

Update the list of executables to skip to match what the scripts run.

Do not skip bash or sh. If Valgrind didn't trace the shell, then the
xz and xzdec programs run by the shell wouldn't be analyzed either.

Fixes: 7e99856f66c0 ("CI: Speed up Valgrind job by using --trace-children-skip-by-arg=...")
2025-04-22 21:26:21 +03:00
Lasse Collin
f33da20b75
CI: Valgrind: Test with static liblzma
If shared liblzma is built, tests/test_* and src/xz/xz are wrapper
scripts created by Libtool. The wrappers set library search path
so that the freshly-built shared library is found.

With a static liblzma, no wrapper scripts are needed, and Libtool
places the real executables to the aforementioned locations. This
speeds up the tests under Valgrind dramatically.

Fixes: 6c095a98fbec ("ci: test Valgrind")
2025-04-22 21:26:21 +03:00
Lasse Collin
5606fa89f9
CI: Add Ubuntu on ARM64 2025-04-22 21:26:15 +03:00
Lasse Collin
ec047a65a0
Doxygen: Update the comment about tested versions 2025-04-22 19:00:20 +03:00
Lasse Collin
4f86e77bef
Doxygen: Set HAVE_DOT = NO
Debian and Ubuntu have a patch that changes the upstream default to
HAVE_DOT = YES. Undo it to have more consistent results across distros.

This was noticed in Ubuntu CI runner where "doxygen" tried to run "dot"
but that failed due to "dot" not being installed. "doxygen" still
finished with exit status 0 until the commit that turned warnings to
errors with WARN_AS_ERROR = FAIL_ON_WARNINGS.
2025-04-22 19:00:20 +03:00
Lasse Collin
ff96542d1c
Doxygen: Treat warnings as errors
Also set WARN_IF_UNDOCUMENTED = NO because even the API headers have
a few things that won't have their own docs.
2025-04-22 19:00:20 +03:00
Lasse Collin
a6711d1c4a
Doxygen: Fix errors and some warnings in internal docs 2025-04-22 19:00:19 +03:00
Lasse Collin
8efd80adfc
CI: Use --disable-sandbox instead of --enable-sandbox=no
It's the same thing, just a style difference.
2025-04-22 19:00:19 +03:00
Lasse Collin
a2e47c7a59
CI: Support Doxygen in ci_build.bash 2025-04-22 19:00:19 +03:00
Lasse Collin
9048e72494
CI: Add Doxygen dependency to CMake builds on Ubuntu and macOS 2025-04-22 19:00:19 +03:00
Lasse Collin
d8e9dc63a6
CI: Support XZ_NLS=OFF with CMake 2025-04-22 19:00:19 +03:00
Lasse Collin
ffa9fadecc
CI: Revise MSYS2
Re-enable CLANG64 environment. Add CLANGARM64. Don't add MINGW64
to slightly reduce the number of runner VMs needed.

Install the required packages using the setup-msys2 action instead
of running the commands separately.

Test Autotools and CMake in the same job to reduce the number of VMs.
This doesn't slow it down too much because the msys2-setup step is
needed by both. However, do only the full builds on ARM64 because
those runners seem to be slower.

Test fewer build configurations. The point of testing on MSYS2 is to
catch Windows-related issues. It should be enough that the more unusual
build configurations are tested in ci.yml.

Run the build commands directly instead of using ci_build.bash. This
makes it easier to see what commands are run even if it is a little
more verbose now.

Run the workflow automatically when commit are pushed to master.
With the fewer build variants it's not too slow.
2025-04-22 19:00:19 +03:00
Lasse Collin
6f2aaa77da
CI: Rename the MSYS2 workflow file 2025-04-22 19:00:19 +03:00
Lasse Collin
09110ad4c7
CI: Enable assertions on NetBSD + CMake 2025-04-22 19:00:10 +03:00
Lasse Collin
516b90f6e1
liblzma: Update lzma_lzip_decoder() docs about trailing data
Don't say that the .lz format allows trailing data. According to the
lzip 1.25 manual, trailing data isn't part of the file format at all.
However, tools are still expected to behave as usefully as possible
when there is trailing data.

Fix the description of lzip >= 1.20 behavior when some of the first
bytes of trailing data match the magic bytes. While the lzip 1.25 manual
recommends that none of the first four bytes in trailing data should
match the magic bytes, the default behavior of lzip 1.25 treats
trailing data as a corrupt member header only if two or three bytes
match the magic bytes; one matching byte isn't enough.

Reported-by: Antonio Diaz Diaz
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00702.html
2025-04-21 12:23:37 +03:00
Lasse Collin
c330220d47
Update THANKS 2025-04-21 11:21:08 +03:00
Lasse Collin
6cc7672c22
CI: Add DragonflyBSD 2025-04-17 20:38:20 +03:00
Lasse Collin
07dc509137
CI: Update Solaris 2025-04-17 20:38:20 +03:00
Lasse Collin
cfcaae1945
CI: Update OpenBSD
Use --disable-nls --enable-external-sha256 because those are used
in the xz Makefile in the OpenBSD ports tree.
2025-04-17 20:38:20 +03:00
Lasse Collin
5240fcfee3
CI: Update NetBSD
For variety, use CMake and Ninja.
2025-04-17 20:38:20 +03:00
Lasse Collin
85ff0cf0ce
CI: Update FreeBSD
ARM64 was left commented out because it's slow under both
ubuntu-latest (x86-64) and ubuntu-24.04-arm (aarch64) hosts.
2025-04-17 20:38:06 +03:00
Lasse Collin
907ac2215d
CI: Specify only the main version of the standard GH actions 2025-04-17 18:43:16 +03:00
Lasse Collin
b0d0e62474
CI: Add 'permissions' to ci.yml and msvc.yml 2025-04-17 18:43:03 +03:00
Sam James
1edc14e8ca
CI: Add CIFuzz
xz is already part of OSS-Fuzz, but OSS-Fuzz provides & encourages [0]
its 'CIFuzz' service to test individual commits.

[0] https://google.github.io/oss-fuzz/getting-started/continuous-integration/

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
2025-04-17 18:38:52 +03:00
Lasse Collin
35e06c4c42
CMake: Don't check for optreset if using replacement getopt_long
If <getopt.h> had optreset but not getopt_long, xz used optreset while
the replacement getopt_long doesn't support optreset. I'm not aware of
any relevant system where bug is possible. Autotools build didn't have
this bug.

Fixes: af66cd585902 ("CMake: Add support for replacement getopt_long (lib/getopt*).")
2025-04-17 18:36:54 +03:00
Lasse Collin
99f4b9db9d
Update THANKS 2025-04-17 18:33:10 +03:00
Lasse Collin
dd006a67e5
liblzma: Update the lzma_lzip_decoder() docs about sync flush marker 2025-04-17 18:30:26 +03:00
Lasse Collin
f59c585960
xz: Don't mention lzip's sync flush marker on the man page
The sync flush marker isn't valid in .lz files. The sync flush marker
may be used by lzlib, but the resulting streams are only meant to be
decoded by lzlib itself. lzlib's docs make this clear.

Reported-by: Antonio Diaz Diaz
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00700.html
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00701.html
2025-04-17 18:16:40 +03:00
Lasse Collin
49258439b4
Update THANKS 2025-04-17 18:15:48 +03:00
Lasse Collin
a69fbd3aae
CI: MSVC: Use fewer runners for the same number of tests
Using eight runners seems wasteful. Using only two runners isn't
much slower due to the runner startup overhead.

Also add a comment about the test that fails without b5a5d9e3f702.
2025-04-10 20:13:07 +03:00
Lasse Collin
8a300d1c4f
Update THANKS 2025-04-10 20:10:31 +03:00
Lasse Collin
b5a5d9e3f7
liblzma: Disable CLMUL CRC on old MSVC targeting 32-bit x86
On GitHub runners, VS 2019 16.11 (MSVC 19.29.30158) results in
test failures. VS 2022 17.13 (MSVC 19.43.34808) works.

In xz 5.6.x there was a #pragma-based workaround for MSVC builds for
32-bit x86. Another method was thought to work with the new rewritten
CLMUL CRC. Apparently it doesn't. Keep it simple and disable CLMUL CRC
with any non-recent MSVC when building for 32-bit x86.

Fixes: 54eaea5ea49b ("liblzma: x86 CLMUL CRC: Rewrite")
Fixes: https://github.com/tukaani-project/xz/issues/171
Reported-by: Andrew Murray
2025-04-07 22:36:58 +03:00
Lasse Collin
c5fd88dfc3
liblzma: Remove MSVC hack from CLMUL CRC
It's not enough with MSVC 19.29 (VS 2019) even if the hack was also
applied to the CRC32 code. The tests crash when built for 32-bit x86.
2025-04-07 22:36:58 +03:00
Lasse Collin
49ba8c69ea
CI: Test 32/64-bit x86 builds with Visual Studio 2019 and 2022 2025-04-07 22:36:52 +03:00
Lasse Collin
1176a19df6
Tests: Add fuzz_decode_stream_mt.options 2025-04-04 20:08:37 +03:00
Lasse Collin
c3cb1e53a1
doc/SHA256SUMS: Add 5.8.1 2025-04-03 15:06:07 +03:00
Lasse Collin
a522a22654
Bump version and soname for 5.8.1 2025-04-03 14:34:43 +03:00
Lasse Collin
1c462c2ad8
Add NEWS for 5.8.1 2025-04-03 14:34:43 +03:00
Lasse Collin
513cabcf7f
Tests: Call lzma_code() in smaller chunks in fuzz_common.h
This makes it easy to crash fuzz_decode_stream_mt when tested
against the code from 5.8.0.

Obviously this might make it harder to reach some other code path now.
The previous code has been in use since 2018 when fuzzing was added
in 106d1a663d4b ("Tests: Add a fuzz test program and a config file
for OSS-Fuzz.").
2025-04-03 14:34:43 +03:00
Lasse Collin
48440e24a2
Tests: Add a fuzzing target for the multithreaded .xz decoder
It doesn't seem possible to trigger the CVE-2025-31115 bug with this
fuzzing target at the moment. It's because the code in fuzz_common.h
passes the whole input buffer to lzma_code() at once.
2025-04-03 14:34:43 +03:00
Lasse Collin
0c80045ab8
liblzma: mt dec: Fix lack of parallelization in single-shot decoding
Single-shot decoding means calling lzma_code() by giving it the whole
input at once and enough output buffer space to store the uncompressed
data, and combining this with LZMA_FINISH and no timeout
(lzma_mt.timeout = 0). This way the file is decoded with a single
lzma_code() call if possible.

The bug prevented the decoder from starting more than one worker thread
in single-shot mode. The issue was noticed when reviewing the code;
there are no bug reports. Thus maybe few have tried this mode.

Fixes: 64b6d496dc81 ("liblzma: Threaded decoder: Always wait for output if LZMA_FINISH is used.")
2025-04-03 14:34:42 +03:00
Lasse Collin
8188048854
liblzma: mt dec: Don't modify thr->in_size in the worker thread
Don't set thr->in_size = 0 when returning the thread to the stack of
available threads. Not only is it useless, but the main thread may
read the value in SEQ_BLOCK_THR_RUN. With valid inputs, it made
no difference if the main thread saw the original value or 0. With
invalid inputs (when worker thread stops early), thr->in_size was
no longer modified after the previous commit with the security fix
("Don't free the input buffer too early").

So while the bug appears harmless now, it's important to fix it because
the variable was being modified without proper locking. It's trivial
to fix because there is no need to change the value. Only main thread
needs to set the value in (in SEQ_BLOCK_THR_INIT) when starting a new
Block before the worker thread is activated.

Fixes: 4cce3e27f529 ("liblzma: Add threaded .xz decompressor.")
Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thanks-to: Sam James <sam@gentoo.org>
2025-04-03 14:34:42 +03:00
Lasse Collin
d5a2ffe41b
liblzma: mt dec: Don't free the input buffer too early (CVE-2025-31115)
The input buffer must be valid as long as the main thread is writing
to the worker-specific input buffer. Fix it by making the worker
thread not free the buffer on errors and not return the worker thread to
the pool. The input buffer will be freed when threads_end() is called.

With invalid input, the bug could at least result in a crash. The
effects include heap use after free and writing to an address based
on the null pointer plus an offset.

The bug has been there since the first committed version of the threaded
decoder and thus affects versions from 5.3.3alpha to 5.8.0.

As the commit message in 4cce3e27f529 says, I had made significant
changes on top of Sebastian's patch. This bug was indeed introduced
by my changes; it wasn't in Sebastian's version.

Thanks to Harri K. Koskinen for discovering and reporting this issue.

Fixes: 4cce3e27f529 ("liblzma: Add threaded .xz decompressor.")
Reported-by: Harri K. Koskinen <x64nop@nannu.org>
Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thanks-to: Sam James <sam@gentoo.org>
2025-04-03 14:34:42 +03:00
Lasse Collin
c0c835964d
liblzma: mt dec: Simplify by removing the THR_STOP state
The main thread can directly set THR_IDLE in threads_stop() which is
called when errors are detected. threads_stop() won't return the stopped
threads to the pool or free the memory pointed by thr->in anymore, but
it doesn't matter because the existing workers won't be reused after
an error. The resources will be cleaned up when threads_end() is
called (reinitializing the decoder always calls threads_end()).

Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thanks-to: Sam James <sam@gentoo.org>
2025-04-03 14:34:42 +03:00
Lasse Collin
831b55b971
liblzma: mt dec: Fix a comment
Reviewed-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thanks-to: Sam James <sam@gentoo.org>
2025-04-03 14:34:42 +03:00
Lasse Collin
b9d168eee4
liblzma: Add assertions to lzma_bufcpy() 2025-04-03 14:34:30 +03:00
Lasse Collin
c8e0a4897b
DOS: Update Makefile to fix the build 2025-04-02 16:54:40 +03:00
Lasse Collin
307c02ed69
sysdefs.h: Avoid <stdalign.h> even with C11 compilers
Oracle Developer Studio 12.6 on Solaris 10 claims C11 support in
__STDC_VERSION__ and supports _Alignas. However, <stdalign.h> is missing.
We only need alignas, so define it to _Alignas with C11/C17 compilers.
If something included <stdalign.h> later, it shouldn't cause problems.

Thanks to Ihsan Dogan for reporting the issue and testing the fix.

Fixes: c0e7eaae8d6eef1e313c9d0da20ccf126ec61f38
2025-03-29 12:41:32 +02:00
Lasse Collin
7ce38b3183
Update THANKS 2025-03-29 12:32:05 +02:00
Lasse Collin
688e51bde4
Translations: Update the Croatian translation 2025-03-29 12:21:51 +02:00
Lasse Collin
173fb5c68b
doc/SHA256SUMS: Add 5.8.0 2025-03-25 18:23:57 +02:00
79 changed files with 5727 additions and 831 deletions

View File

@ -18,15 +18,18 @@ on:
# Allows running workflow manually # Allows running workflow manually
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
POSIX: POSIX:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, macos-latest] os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
build_system: [autotools, cmake] build_system: [autotools, cmake]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v4.1.6 - uses: actions/checkout@v4
######################## ########################
# Install Dependencies # # Install Dependencies #
@ -34,10 +37,15 @@ jobs:
# Install Autotools on Linux # Install Autotools on Linux
- name: Install Dependencies - name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools valgrind sudo apt-get install -y autoconf automake build-essential po4a autopoint doxygen musl-tools valgrind
- name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
sudo apt-get install -y gcc-multilib
# Install Autotools on Mac # Install Autotools on Mac
- name: Install Dependencies - name: Install Dependencies
@ -46,15 +54,15 @@ jobs:
# Install CMake on Linux # Install CMake on Linux
- name: Install Dependencies - name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'cmake' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'cmake' }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y build-essential cmake gettext musl-tools sudo apt-get install -y build-essential cmake gettext doxygen musl-tools
# Install CMake on Mac # Install CMake on Mac
- name: Install Dependencies - name: Install Dependencies
if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }} if: ${{ matrix.os == 'macos-latest' && matrix.build_system == 'cmake' }}
run: brew install cmake gettext run: brew install cmake gettext doxygen
################## ##################
# Build and Test # # Build and Test #
@ -81,33 +89,33 @@ jobs:
# the /proc/ filesystem on Linux, which is used by the sanitizer's # the /proc/ filesystem on Linux, which is used by the sanitizer's
# instrumentation. # instrumentation.
- name: Build with -fsanitize=address,undefined - name: Build with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox
- name: Test with -fsanitize=address,undefined - name: Test with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: | run: |
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
./build-aux/ci_build.bash -b autotools -p test -f "-fsanitize=address,undefined" -d sandbox ./build-aux/ci_build.bash -b autotools -p test -f "-fsanitize=address,undefined" -d sandbox
cd ../xz_build && make distclean cd ../xz_build && make distclean
- name: Build with Valgrind - name: Build with Valgrind
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: ./build-aux/ci_build.bash -b autotools -p build -d sandbox run: ./build-aux/ci_build.bash -b autotools -p build -d shared,sandbox
- name: Test with Valgrind - name: Test with Valgrind
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: | run: |
./build-aux/ci_build.bash -b autotools -p test -d sandbox -w "valgrind --quiet --trace-children=yes --trace-children-skip-by-arg=ls,cp,sed,grep,bash,sh --exit-on-first-error=yes --error-exitcode=1" ./build-aux/ci_build.bash -b autotools -p test -d sandbox -w "valgrind --quiet --trace-children=yes --trace-children-skip=*/cmp,*/cp,*/diff,*/grep,*/rm,*/sed --exit-on-first-error=yes --error-exitcode=1"
cd ../xz_build && make distclean cd ../xz_build && make distclean
- name: Build with musl libc - name: Build with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}} if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc" run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
- name: Test with musl libc - name: Test with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}} if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: | run: |
./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc" ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
- name: Clean up musl libc run - name: Clean up musl libc run
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }} if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.build_system == 'autotools' }}
run: cd ../xz_build && make distclean run: cd ../xz_build && make distclean
- name: Build with full features - name: Build with full features
@ -156,7 +164,7 @@ jobs:
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p test -n small run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p test -n small
# Attempt to upload the test logs as artifacts if any step has failed # Attempt to upload the test logs as artifacts if any step has failed
- uses: actions/upload-artifact@v4.3.3 - uses: actions/upload-artifact@v4
if: ${{ failure() }} if: ${{ failure() }}
with: with:
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs

55
.github/workflows/cifuzz.yml vendored Normal file
View File

@ -0,0 +1,55 @@
# SPDX-License-Identifier: 0BSD
# Authors: Sam James
# Lasse Collin
#
# This was written based on the OSS-Fuzz docs:
# https://google.github.io/oss-fuzz/getting-started/continuous-integration/
name: CIFuzz
on:
push:
branches: [ master ]
workflow_dispatch:
permissions: {}
jobs:
CIFuzz:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
sanitizer: [ address, undefined, memory ]
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'xz'
# The language must match the one in project.yaml in OSS-Fuzz:
# https://github.com/google/oss-fuzz/blob/master/projects/xz/project.yaml
# Thus, use C++ even though there are no C++ files in XZ Utils.
language: c++
sanitizer: ${{ matrix.sanitizer }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'xz'
language: c++
sanitizer: ${{ matrix.sanitizer }}
fuzz-seconds: 600
report-timeouts: true
report-ooms: true
- name: Upload Crash
uses: actions/upload-artifact@v4
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts
path: ./out/artifacts

38
.github/workflows/coverity.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# SPDX-License-Identifier: 0BSD
name: Coverity Scan
# We only want to test a special branch, per
# https://docs.travis-ci.com/user/coverity-scan/#build-submission-frequency
on:
push:
branches: [coverity_scan]
jobs:
coverity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -qy autoconf automake build-essential autopoint gcc-multilib
- name: Run autogen.sh
run: ./autogen.sh --no-po4a
- name: Run configure
run: ./configure --enable-debug --disable-silent-rules
# Coverity doesn't understand what the inline asm does,
# which results in false positives.
- name: Disable complex inline assembly code
run: echo '#define LZMA_RANGE_DECODER_CONFIG 0' >> config.h
- name: Coverity Scan
uses: vapier/coverity-scan-action@2068473c7bdf8c2fb984a6a40ae76ee7facd7a85 # v1.8.0
with:
command: make -Oline -j$(nproc)
email: ${{ secrets.COVERITY_SCAN_EMAIL }}
token: ${{ secrets.COVERITY_SCAN_TOKEN }}

40
.github/workflows/dragonflybsd.yml vendored Normal file
View File

@ -0,0 +1,40 @@
# SPDX-License-Identifier: 0BSD
name: DragonFly BSD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions: {}
jobs:
DragonflyBSD:
runs-on: ubuntu-latest
timeout-minutes: 10
name: DragonFly BSD
steps:
- uses: actions/checkout@v4
- name: Test in DragonFly BSD
id: test
uses: vmactions/dragonflybsd-vm@4ffb90652b45abc8156f89ede453c85f7ea257bb #v1.1.4
with:
usesh: true
prepare: >
pkg install -y
autoconf
automake
gettext-tools
libtool
m4
run: |
set -e
uname -a
./autogen.sh --no-po4a
# Innocent putc() triggers strict-overflow warnings.
./configure --disable-static --enable-debug --enable-werror CFLAGS='-g -O2 -pipe -Wno-error=strict-overflow'
make -j4 check

View File

@ -9,24 +9,50 @@ on:
branches: [ master ] branches: [ master ]
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
FreeBSD-test: FreeBSD:
runs-on: ubuntu-latest strategy:
name: Test xz on FreeBSD matrix:
include:
- host: ubuntu-latest
version: 12.4
arch: x86_64
- host: ubuntu-latest
version: 15.0
arch: x86_64
# NOTE: Comment in the repo says that aarch64 VM is faster
# on x86_64 host compared to ubuntu-24.04-arm.
# - host: ubuntu-24.04-arm
# version: 15.0
# arch: aarch64
runs-on: ${{ matrix.host }}
timeout-minutes: 10
name: FreeBSD
steps: steps:
- uses: actions/checkout@v4.1.6 - uses: actions/checkout@v4
- name: Test in FreeBSD
id: test - name: Test in FreeBSD
uses: vmactions/FreeBSD-vm@d7b8fcc7711aa41ad45e8d9b737cf90f035a7e3d #v1.1.3 uses: vmactions/freebsd-vm@670398e4236735b8b65805c3da44b7a511fb8b27 #v1.3.0
with: with:
usesh: true release: ${{ matrix.release }}
prepare: | arch: ${{ matrix.arch }}
pkg install -y autoconf automake gmake gettext-tools gtar libtool m4 po4a usesh: true
run: | prepare: >
set -e pkg install -y
export LC_ALL=C LANG=C autoconf
uname -a automake
./autogen.sh gettext-tools
./configure --enable-werror libtool
make m4
make check VERBOSE=1 po4a
run: |
set -e
uname -a
./autogen.sh
./configure --disable-static --enable-debug --enable-werror
make -j4 check

138
.github/workflows/msvc.yml vendored Normal file
View File

@ -0,0 +1,138 @@
# SPDX-License-Identifier: 0BSD
# Author: Lasse Collin
name: Windows-MSVC
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions: {}
jobs:
MSVC:
strategy:
fail-fast: false
matrix:
os: [ windows-latest ]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Configure Win32
run: >
cmake
-A Win32
-B build-msvc-win32
- name: Build Win32 Debug
run: >
cmake
--build build-msvc-win32
--config Debug
- name: Test Win32 Debug
run: >
ctest
--test-dir build-msvc-win32
--build-config Debug
--output-on-failure
- name: Build Win32 Release
run: >
cmake
--build build-msvc-win32
--config Release
# This fails with VS 2019 without b5a5d9e3f702.
- name: Test Win32 Release
run: >
ctest
--test-dir build-msvc-win32
--build-config Release
--output-on-failure
- name: Configure x64
run: >
cmake
-A x64
-B build-msvc-x64
- name: Build x64 Debug
run: >
cmake
--build build-msvc-x64
--config Debug
- name: Test x64 Debug
run: >
ctest
--test-dir build-msvc-x64
--build-config Debug
--output-on-failure
- name: Build x64 Release
run: >
cmake
--build build-msvc-x64
--config Release
- name: Test x64 Release
run: >
ctest
--test-dir build-msvc-x64
--build-config Release
--output-on-failure
- name: Configure ClangCL x64
run: >
cmake
-T ClangCL
-A x64
-B build-clangcl-x64
-DCMAKE_C_FLAGS="
-Wno-cast-align
-Wno-cast-qual
-Wno-covered-switch-default
-Wno-declaration-after-statement
-Wno-deprecated-declarations
-Wno-disabled-macro-expansion
-Wno-nonportable-system-include-path
-Wno-overlength-strings
-Wno-pre-c11-compat
-Wno-reserved-identifier
-Wno-unsafe-buffer-usage
-Wno-used-but-marked-unused"
- name: Build ClangCL x64 Debug
run: >
cmake
--build build-clangcl-x64
--config Debug
- name: Test ClangCL x64 Debug
run: >
ctest
--test-dir build-clangcl-x64
--build-config Debug
--output-on-failure
- name: Build ClangCL x64 Release
run: >
cmake
--build build-clangcl-x64
--config Release
- name: Test ClangCL x64 Release
run: >
ctest
--test-dir build-clangcl-x64
--build-config Release
--output-on-failure

148
.github/workflows/msys2.yml vendored Normal file
View File

@ -0,0 +1,148 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Authors: Jia Tan
# Lasse Collin
#
#############################################################################
name: Windows-MSYS2
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions: {}
jobs:
MSYS2:
strategy:
fail-fast: false
matrix:
runner: [ windows-latest ]
sys: [ mingw32, ucrt64, clang64, msys ]
include:
- runner: windows-11-arm
sys: clangarm64
# Set the shell to be msys2 as a default to avoid setting it for
# every individual run command.
defaults:
run:
shell: msys2 {0}
runs-on: ${{ matrix.runner }}
timeout-minutes: 20
steps:
- name: Setup MSYS2
if: ${{ matrix.sys == 'msys' }}
uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0
with:
msystem: ${{ matrix.sys }}
update: true
install: >
make
ninja
autotools
cmake
base-devel
gettext-devel
gcc
- name: Setup MSYS2
if: ${{ matrix.sys != 'msys' }}
uses: msys2/setup-msys2@fb197b72ce45fb24f17bf3f807a388985654d1f2 # v2.29.0
with:
msystem: ${{ matrix.sys }}
update: true
pacboy: >
make:p
ninja:p
autotools:p
cmake:p
toolchain:p
gettext:p
- name: Git configuration
# Need to explicitly set the shell here since we set the default
# shell as msys2 earlier. This avoids an extra msys2 dependency on
# git.
shell: powershell
# Avoid Windows line endings. Otherwise test_scripts.sh will fail
# because the expected output is stored in the test framework as a
# text file and will not match the output from xzgrep.
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- name: CMake (full, shared)
run: |
set -e
cmake -G Ninja -B b-cmake-full \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_FLAGS='-UNDEBUG -g -O2 -pipe' \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
${{ startsWith(matrix.sys, 'mingw') && '-DXZ_NLS=OFF' || '' }}
ninja -C b-cmake-full
ctest --test-dir b-cmake-full --output-on-failure
- name: CMake (small, static)
if: ${{ matrix.runner == 'windows-latest' }}
run: |
set -e
cmake -G Ninja -B b-cmake-small \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_FLAGS='-UNDEBUG -g -Os -pipe' \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DXZ_SMALL=ON \
-DXZ_THREADS=no \
-DXZ_NLS=OFF
ninja -C b-cmake-small
ctest --test-dir b-cmake-small --output-on-failure
- name: autogen.sh
run: ./autogen.sh --no-po4a
- name: Autotools (full, shared)
run: |
set -e
mkdir b-autotools-full
cd b-autotools-full
../configure \
--enable-debug \
--enable-werror \
--disable-static \
${{ startsWith(matrix.sys, 'mingw') && '--disable-nls' || '' }}
make -j"$(nproc)" check
- name: Autotools (small, static)
if: ${{ matrix.runner == 'windows-latest' }}
run: |
set -e
mkdir b-autotools-small
cd b-autotools-small
../configure \
--enable-debug \
--enable-werror \
--disable-shared \
--enable-small \
--disable-threads \
--disable-nls \
CFLAGS='-g -Os'
make -j"$(nproc)" check
# Upload the test logs as artifacts if any step has failed.
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-logs-${{ matrix.sys }}
path: |
b-cmake-*/Testing/Temporary/
b-cmake-*/test_*/
b-autotools-*/tests/*.log
b-autotools-*/tests/*output

View File

@ -9,24 +9,32 @@ on:
branches: [ master ] branches: [ master ]
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
NetBSD-test: NetBSD:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Test xz on NetBSD timeout-minutes: 10
name: NetBSD
steps: steps:
- uses: actions/checkout@v4.1.6 - uses: actions/checkout@v4
- name: Test in NetBSD
id: test - name: Test in NetBSD
uses: vmactions/NetBSD-vm@dd0161ecbb6386e562fd098acf367633501487a4 #v1.1.3 id: test
with: uses: vmactions/netbsd-vm@b24ed5f7a605362ab1226e73df291c8b01990c85 #v1.2.3
usesh: true with:
prepare: | usesh: true
/usr/sbin/pkg_add -v autoconf automake gmake gettext-tools gtar-base libtool-base m4 po4a prepare: >
run: | /usr/sbin/pkg_add -v
set -e cmake
export LC_ALL=C LANG=C gettext-tools
uname -a ninja-build
./autogen.sh po4a
./configure --enable-werror run: |
make set -e
make check VERBOSE=1 uname -a
./po4a/update-po
# Innocent putc() triggers strict-overflow warnings.
cmake -G Ninja -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_C_FLAGS='-UNDEBUG -g -O2 -pipe -Wno-error=strict-overflow' -DCMAKE_COMPILE_WARNING_AS_ERROR=ON
ninja -C build
ctest --test-dir build --output-on-failure

View File

@ -9,27 +9,32 @@ on:
branches: [ master ] branches: [ master ]
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
OpenBSD-test: OpenBSD:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Test xz on OpenBSD timeout-minutes: 10
name: OpenBSD
steps: steps:
- uses: actions/checkout@v4.1.6 - uses: actions/checkout@v4
- name: Test in OpenBSD
id: test - name: Test in OpenBSD
uses: vmactions/OpenBSD-vm@ebafa4eac4adf5e7d04e5bbb4aa764b75dd160df #v1.1.2 uses: vmactions/openbsd-vm@2e29de1eb150dfe1c9c97b84ff2b7896f14ca690 #v1.2.5
with: with:
usesh: true usesh: true
prepare: | prepare: >
/usr/sbin/pkg_add -I -v autoconf-2.71 automake-1.16.5 gmake gettext-tools gtar libtool m4 /usr/sbin/pkg_add -I -v
run: | autoconf-2.72p0
set -e automake-1.17
export LC_ALL=C LANG=C gettext-tools
export AUTOCONF_VERSION=2.71 libtool
export AUTOMAKE_VERSION=1.16 m4
uname -a run: |
# OpenBSD ports lack po4a set -e
./autogen.sh --no-po4a export AUTOCONF_VERSION=2.72
./configure --enable-werror export AUTOMAKE_VERSION=1.17
make uname -a
make check VERBOSE=1 ./autogen.sh --no-po4a
./configure --disable-static --enable-debug --enable-werror --disable-nls --enable-external-sha256
make -j4 check

View File

@ -9,24 +9,26 @@ on:
branches: [ master ] branches: [ master ]
workflow_dispatch: workflow_dispatch:
permissions: {}
jobs: jobs:
solaris-test: Solaris:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Test xz on Solaris timeout-minutes: 10
name: Solaris
steps: steps:
- uses: actions/checkout@v4.1.6 - uses: actions/checkout@v4
- name: Test in Solaris
id: test - name: Test in Solaris
uses: vmactions/solaris-vm@960d7483ffd6ac03397964cf6423a2f41332c9c8 #v1.0.9 uses: vmactions/solaris-vm@47bea106d03acaf91084e52548ee460556011602 #v1.1.8
with: with:
usesh: true release: 11.4-gcc
prepare: | usesh: true
pkg install bash libtool automake gnu-m4 tree wget gcc autoconf //solaris/text/gawk pkg://solaris/text/gnu-diffutils pkg://solaris/text/gnu-grep pkg://solaris/text/gnu-sed run: |
run: | set -e
set -e uname -a
export LC_ALL=C LANG=C # /usr/xpg4/bin isn't in PATH by default.
uname -a echo "Environment variable PATH: $PATH"
./autogen.sh --no-po4a ./autogen.sh --no-po4a
./configure --enable-werror ./configure --disable-static --enable-debug --enable-werror
make make check
make check VERBOSE=1

View File

@ -1,124 +0,0 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
#############################################################################
name: Windows-CI
# Only run the Windows CI manually since it takes much longer than the others.
on: workflow_dispatch
jobs:
POSIX:
strategy:
matrix:
# Test different environments since the code may change between
# them and we want to ensure that we support all potential users.
# clang64 builds are currently broken when building static libraries
# due to a bug in ldd search path:
# https://github.com/llvm/llvm-project/issues/67779
# TODO - re-enable clang64 when this is resolved.
msys2_env: [mingw64, mingw32, ucrt64, msys]
build_system: [autotools, cmake]
# Set the shell to be msys2 as a default to avoid setting it for
# every individual run command.
defaults:
run:
shell: msys2 {0}
runs-on: windows-latest
steps:
#####################
# Setup Environment #
#####################
# Rely on the msys2 GitHub Action to set up the msys2 environment.
- name: Setup MSYS2
uses: msys2/setup-msys2@cc11e9188b693c2b100158c3322424c4cc1dadea #v2.22.0
with:
msystem: ${{ matrix.msys2_env }}
update: true
install: pactoys make
- name: Checkout code
# Need to explicitly set the shell here since we set the default
# shell as msys2 earlier. This avoids an extra msys2 dependency on
# git.
shell: powershell
# Avoid Windows line endings. Otherwise test_scripts.sh will fail
# because the expected output is stored in the test framework as a
# text file and will not match the output from xzgrep.
run: git config --global core.autocrlf false
- uses: actions/checkout@v4.1.6
########################
# Install Dependencies #
########################
# The pacman repository has a different naming scheme for default
# msys packages than the others. The pacboy tool allows installing
# the packages possible in matrix setup without a burdensome amount
# of ifs.
- name: Install Dependencies
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'autotools' }}
run: pacman --noconfirm -S --needed autotools base-devel doxygen gettext-devel gcc
- name: Install Dependencies
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'autotools' }}
run: pacboy --noconfirm -S --needed autotools:p toolchain:p doxygen:p
- name: Install Dependencies
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'cmake' }}
run: pacman --noconfirm -S --needed cmake base-devel gcc
- name: Install Dependencies
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'cmake' }}
run: pacboy --noconfirm -S --needed cmake:p toolchain:p
##################
# Build and Test #
##################
- name: Build with full features
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p build
- name: Test with full features
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features
- name: Build without threads
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build
- name: Test without threads
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
- name: Build without encoders
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build
- name: Test without encoders
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
- name: Build without decoders
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build
- name: Test without decoders
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
- name: Build with only crc32 check
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build
- name: Test with only crc32 check
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only
###############
# Upload Logs #
###############
# Upload the test logs as artifacts if any step has failed.
- uses: actions/upload-artifact@v4.3.3
if: ${{ failure() }}
with:
name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs
path: build-aux/artifacts

View File

@ -77,7 +77,7 @@
# #
############################################################################# #############################################################################
cmake_minimum_required(VERSION 3.20...3.31 FATAL_ERROR) cmake_minimum_required(VERSION 3.20...4.2 FATAL_ERROR)
include(CMakePushCheckState) include(CMakePushCheckState)
include(CheckIncludeFile) include(CheckIncludeFile)
@ -85,6 +85,7 @@ include(CheckSymbolExists)
include(CheckStructHasMember) include(CheckStructHasMember)
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
include(CheckCCompilerFlag) include(CheckCCompilerFlag)
include(CheckLinkerFlag)
include(cmake/tuklib_large_file_support.cmake) include(cmake/tuklib_large_file_support.cmake)
include(cmake/tuklib_integer.cmake) include(cmake/tuklib_integer.cmake)
include(cmake/tuklib_cpucores.cmake) include(cmake/tuklib_cpucores.cmake)
@ -448,6 +449,7 @@ if(CMAKE_C_COMPILER_ID MATCHES GNU|Clang)
-Wdocumentation -Wdocumentation
-Wduplicate-enum -Wduplicate-enum
-Wempty-translation-unit -Wempty-translation-unit
-Wextra-semi-stmt
-Wflexible-array-extensions -Wflexible-array-extensions
-Wmissing-variable-declarations -Wmissing-variable-declarations
-Wnewline-eof -Wnewline-eof
@ -484,7 +486,7 @@ if(NOT WIN32)
# auto Autodetect between no, generic, and linux # auto Autodetect between no, generic, and linux
# yes Force on by autodetecting between linux and generic # yes Force on by autodetecting between linux and generic
# no Disable symbol versioning # no Disable symbol versioning
# generic FreeBSD, most Linux/glibc systems, and GNU/Hurd # generic FreeBSD, some Linux/glibc systems, and GNU/Hurd
# linux Linux/glibc with extra symbol versions for compatibility # linux Linux/glibc with extra symbol versions for compatibility
# with binaries that have been linked against a liblzma version # with binaries that have been linked against a liblzma version
# that has been patched with "xz-5.2.2-compat-libs.patch" from # that has been patched with "xz-5.2.2-compat-libs.patch" from
@ -541,7 +543,7 @@ symbol versioning (${SUPPORTED_SYMBOL_VERSIONING_VARIANTS})")
# somewhere in the string). # somewhere in the string).
# #
# NVIDIA HPC Compiler doesn't support symbol versioning but # NVIDIA HPC Compiler doesn't support symbol versioning but
# it uses the linked from the system so the linker script # it uses the linker from the system so the linker script
# can still be used to get the generic symbol versioning. # can still be used to get the generic symbol versioning.
set(SYMBOL_VERSIONING "generic") set(SYMBOL_VERSIONING "generic")
@ -556,6 +558,21 @@ symbol versioning (${SUPPORTED_SYMBOL_VERSIONING_VARIANTS})")
set(SYMBOL_VERSIONING "generic") set(SYMBOL_VERSIONING "generic")
endif() endif()
endif() endif()
if(NOT SYMBOL_VERSIONING STREQUAL "no")
# If features are disabled in liblzma, some symbols may be missing.
# LLVM's lld defaults to --no-undefined-version and the build breaks
# if not all symbols in the version script exist. That is good for
# catching errors like typos, but in our case the downside is too big.
# Avoid the problem by using --undefined-version if the linker
# supports it.
#
# GNU ld has had --no-undefined-version for a long time but it's not
# the default. The opposite option --undefined-version was only added
# in 2022, thus we must use --undefined-version conditionally.
check_linker_flag(C "-Wl,--undefined-version"
HAVE_LINKER_FLAG_UNDEFINED_VERSION)
endif()
endif() endif()
set(LIBLZMA_API_HEADERS set(LIBLZMA_API_HEADERS
@ -1363,6 +1380,13 @@ if(XZ_ARM64_CRC32)
check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL) check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL)
tuklib_add_definition_if(liblzma HAVE_GETAUXVAL) tuklib_add_definition_if(liblzma HAVE_GETAUXVAL)
# With getauxval() we also need HWCAP_CRC32 which was
# added in glibc 2.24.
if(HAVE_GETAUXVAL)
check_symbol_exists(HWCAP_CRC32 sys/auxv.h HAVE_HWCAP_CRC32)
tuklib_add_definition_if(liblzma HAVE_HWCAP_CRC32)
endif()
# elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6. # elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6.
check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO) check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
tuklib_add_definition_if(liblzma HAVE_ELF_AUX_INFO) tuklib_add_definition_if(liblzma HAVE_ELF_AUX_INFO)
@ -1480,6 +1504,9 @@ elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "linux")
# NOTE: Set it explicitly to 1 to make it clear that versioning is # NOTE: Set it explicitly to 1 to make it clear that versioning is
# done unconditionally in the C files. # done unconditionally in the C files.
target_compile_definitions(liblzma PRIVATE HAVE_SYMBOL_VERSIONS_LINUX=1) target_compile_definitions(liblzma PRIVATE HAVE_SYMBOL_VERSIONS_LINUX=1)
if(HAVE_LINKER_FLAG_UNDEFINED_VERSION)
target_link_options(liblzma PRIVATE "-Wl,--undefined-version")
endif()
target_link_options(liblzma PRIVATE target_link_options(liblzma PRIVATE
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map" "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
) )
@ -1487,6 +1514,9 @@ elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "linux")
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map" LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
) )
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "generic") elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "generic")
if(HAVE_LINKER_FLAG_UNDEFINED_VERSION)
target_link_options(liblzma PRIVATE "-Wl,--undefined-version")
endif()
target_link_options(liblzma PRIVATE target_link_options(liblzma PRIVATE
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map" "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
) )
@ -2171,8 +2201,13 @@ this many MiB of RAM if xz cannot determine the amount at runtime")
tuklib_progname(xz) tuklib_progname(xz)
tuklib_mbstr(xz) tuklib_mbstr(xz)
check_symbol_exists(optreset getopt.h HAVE_OPTRESET) if(HAVE_GETOPT_LONG)
tuklib_add_definition_if(xz HAVE_OPTRESET) check_symbol_exists(optreset getopt.h HAVE_OPTRESET)
tuklib_add_definition_if(xz HAVE_OPTRESET)
endif()
check_symbol_exists(getrlimit sys/resource.h HAVE_GETRLIMIT)
tuklib_add_definition_if(xz HAVE_GETRLIMIT)
check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE) check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE)
tuklib_add_definition_if(xz HAVE_POSIX_FADVISE) tuklib_add_definition_if(xz HAVE_POSIX_FADVISE)

View File

@ -2,7 +2,7 @@
Version 2, June 1991 Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -304,8 +304,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., with this program; if not, see <https://www.gnu.org/licenses/>.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -329,8 +328,8 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker. `Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989 <signature of Moe Ghoul>, 1 April 1989
Ty Coon, President of Vice Moe Ghoul, President of Vice
This General Public License does not permit incorporating your program into This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may proprietary programs. If your program is a subroutine library, you may

View File

@ -2,7 +2,7 @@
Version 2.1, February 1999 Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc. Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -484,8 +484,7 @@ convey the exclusion of warranty; and each file should have at least the
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, see <https://www.gnu.org/licenses/>.
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -496,7 +495,7 @@ necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker. library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990 <signature of Moe Ghoul>, 1 April 1990
Ty Coon, President of Vice Moe Ghoul, President of Vice
That's all there is to it! That's all there is to it!

102
NEWS
View File

@ -2,6 +2,108 @@
XZ Utils Release Notes XZ Utils Release Notes
====================== ======================
5.8.2 (2025-12-17)
* liblzma:
- Fix the build on ARM64 on glibc versions older than
2.24 (2016). They don't have HWCAP_CRC32 in <sys/auxv.h>.
- Disable CLMUL CRC code when building for 32-bit x86 with
old MSVC versions. This avoids a compiler bug. The exact
compiler version in which the issue was fixed is unknown,
but VS 2022 17.13 (MSVC 19.43.34808) is known to work, so
CLMUL CRC on 32-bit x86 is disabled with MSVC versions
older than that.
* xz:
- Add a workaround for Red Hat Enterprise Linux 9 kernel bug
which made xz fail with "xz: Failed to enable the sandbox".
It only occurs with xz 5.8.0 and 5.8.1 binaries built for
other distros. For example, running Debian 13 in a container
on RHEL/CentOS 9 would trigger the issue.
The bug was introduced in RHEL 9 kernel 5.14.0-603.el9
(2025-07-30) and fixed in 5.14.0-648.el9 (2025-12-05).
However, as of writing, the fixed kernel isn't available
to RHEL 9 users yet, so including the workaround in this
xz release seems reasonable. The workaround will be removed
when it's no longer needed.
xzdec was also affected by this issue.
- On AIX, don't use fsync() on directories because it fails.
- Fix the build on Emscripten.
- Fix the build on clang-cl on Windows.
- Take resource limits (RLIMIT_DATA, RLIMIT_AS, and RLIMIT_VMEM)
into account when determining the default memory usage limit
for multithreaded mode. This should prevent xz from failing
when a resource limit has been set to a value that is less
than 1/4 of total RAM. Other memory limits can still trigger
the same issue, for example, Linux cgroup v2 memory.max.
* Build systems:
- When symbol versioning is enabled, pass --undefined-version
to the linker if the option is supported. This fixes the
build when using LLVM's lld and some liblzma features have
been disabled at build time.
- ARM64: Fix autodetection of fast unaligned memory access when
using GCC and -mstrict-align is in effect. Previously the
build systems would incorrectly guess that unaligned access
is fast, which would result in much slower binaries than
needed. The fix is a workaround for GCC bug 111555;
autodetection already worked with Clang.
- LoongArch: Autodetect if fast unaligned memory access is
supported. This can improve compression speed by 15 % (but
not decompression speed).
* Translations:
- Update the Spanish translation.
- Add Swedish man page translations.
- Update Italian, Korean, Romanian, Serbian, and Ukrainian
man page translations.
5.8.1 (2025-04-03)
IMPORTANT: This includes a security fix for CVE-2025-31115 which
affects XZ Utils from 5.3.3alpha to 5.8.0. No new 5.4.x or 5.6.x
releases will be made, but the fix is in the v5.4 and v5.6 branches
in the xz Git repository. A standalone patch for all affected
versions is available as well.
* Multithreaded .xz decoder (lzma_stream_decoder_mt()):
- Fix a bug that could at least result in a crash with
invalid input. (CVE-2025-31115)
- Fix a performance bug: Only one thread was used if the whole
input file was provided at once to lzma_code(), the output
buffer was big enough, timeout was disabled, and LZMA_FINISH
was used. There are no bug reports about this, thus it's
possible that no real-world application was affected.
* Avoid <stdalign.h> even with C11/C17 compilers. This fixes the
build with Oracle Developer Studio 12.6 on Solaris 10 when the
compiler is in C11 mode (the header doesn't exist).
* Autotools: Restore compatibility with GNU make versions older
than 4.0 by creating the package using GNU gettext 0.23.1
infrastructure instead of 0.24.
* Update Croatian translation.
5.8.0 (2025-03-25) 5.8.0 (2025-03-25)
This bumps the minor version of liblzma because new features were This bumps the minor version of liblzma because new features were

433
THANKS
View File

@ -3,224 +3,243 @@ Thanks
====== ======
Some people have helped more, some less, but nevertheless everyone's help Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order: has been important. :-)
- Mark Adler
- Kian-Meng Ang
- H. Peter Anvin
- Jeff Bastian
- Nelson H. F. Beebe
- Karl Beldan
- Karl Berry
- Anders F. Björklund
- Emmanuel Blot
- Melanie Blower
- Alexander Bluhm
- Martin Blumenstingl
- Ben Boeckel
- Jakub Bogusz
- Adam Borowski - Adam Borowski
- Maarten Bosmans - Adam Walling
- Roel Bouckaert
- Lukas Braune
- Benjamin Buch
- Trent W. Buck
- Kevin R. Bulgrien
- James Buren
- David Burklund
- Frank Busse
- Daniel Mealha Cabrita
- Milo Casagrande
- Cristiano Ceglia
- Marek Černocký
- Tomer Chachamu
- Vitaly Chikunov
- Antoine Cœur
- Elijah Almeida Coimbra
- Felix Collin
- Ryan Colyer
- Marcus Comstedt
- Vincent Cruz
- Gabi Davar
- Ron Desmond
- İhsan Doğan
- Chris Donawa
- Andrew Dudman
- Markus Duft
- İsmail Dönmez
- Dexter Castor Döpping
- Paul Eggert
- Robert Elz
- Gilles Espinasse
- Denis Excoffier
- Vincent Fazio
- Michael Felt
- Sean Fenian
- Michael Fox
- Andres Freund
- Mike Frysinger
- Collin Funk
- Daniel Richard G.
- Tomasz Gajc
- Bjarni Ingi Gislason
- John Paul Adrian Glaubitz
- Bill Glessner
- Matthew Good
- Michał Górny
- Jason Gorski
- Alexander M. Greenham
- Juan Manuel Guerrero
- Gabriela Gutierrez
- Diederik de Haas
- Jan Terje Hansen
- Tobias Lahrmann Hansen
- Joachim Henke
- Lizandro Heredia
- Christian Hesse
- Vincenzo Innocente
- Peter Ivanov
- Nicholas Jackson
- Sam James
- Hajin Jang
- Hans Jansen
- Jouk Jansen
- Jun I Jin
- Christoph Junghans
- Kiyoshi Kanazawa
- Joona Kannisto
- Per Øyvind Karlsen
- Firas Khalil Khana
- Iouri Kharon
- Kim Jinyeong
- Thomas Klausner
- Richard Koch
- Anton Kochkov
- Ville Koskinen
- Sergey Kosukhin
- Marcin Kowalczyk
- Jan Kratochvil
- Christian Kujau
- Stephan Kulow
- Ilya Kurdyukov
- Peter Lawler
- James M Leddy
- Kelvin Lee
- Vincent Lefevre
- Hin-Tak Leung
- Andraž 'ruskie' Levstik
- Cary Lewis
- Wim Lewis
- Xin Li
- Yifeng Li
- Eric Lindblad
- Lorenzo De Liso
- H.J. Lu
- Bela Lubkin
- Chenxi Mao
- Gregory Margo
- Julien Marrec
- Pierre-Yves Martin
- Ed Maste
- Martin Matuška
- Scott McAllister
- Chris McCrohan
- Derwin McGeary
- Ivan A. Melnikov
- Jim Meyering
- Arkadiusz Miskiewicz
- Nathan Moinvaziri
- Étienne Mollier
- Conley Moorhous
- Dirk Müller
- Rainer Müller
- Andrew Murray
- Rafał Mużyło
- Adrien Nader - Adrien Nader
- Evan Nemerson
- Alexander Neumann
- Hongbo Ni
- Jonathan Nieder
- Asgeir Storesund Nilsen
- Andre Noll
- Ruarí Ødegaard
- Peter O'Gorman
- Dimitri Papadopoulos Orfanos
- Daniel Packard
- Filip Palian
- Peter Pallinger
- Kai Pastor
- Keith Patton
- Rui Paulo
- Igor Pavlov
- Diego Elio Pettenò
- Elbert Pol
- Guiorgy Potskhishvili
- Mikko Pouru
- Frank Prochnow
- Rich Prohaska
- Trần Ngọc Quân
- Pavel Raiskup
- Matthieu Rakotojaona
- Ole André Vadla Ravnås
- Eric S. Raymond
- Robert Readman
- Bernhard Reutner-Fischer
- Markus Rickert
- Cristian Rodríguez
- Jeroen Roovers
- Christian von Roques
- Boud Roukema
- Torsten Rupp
- Stephen Sachs
- Jukka Salmi
- Agostino Sarubbo - Agostino Sarubbo
- Vijay Sarvepalli - Alexander Bluhm
- Alexander M. Greenham
- Alexander Neumann
- Alexandre Sauvé - Alexandre Sauvé
- Benno Schulenberg - Alexey Tourbin
- Anders F. Björklund
- Andraž 'ruskie' Levstik
- Andre Noll
- Andreas K. Hüttel
- Andreas Müller
- Andreas Schwab - Andreas Schwab
- Eli Schwartz - Andreas Zieringer
- Peter Seiderer
- Bhargava Shastry
- Dan Shechter
- Stuart Shelton
- Sebastian Andrzej Siewior
- Andrej Skenderija - Andrej Skenderija
- Ville Skyttä - Andres Freund
- Andrew Dudman
- Andrew Murray
- Antoine Cœur
- Anton Kochkov
- Antonio Diaz Diaz
- Arkadiusz Miskiewicz
- Asgeir Storesund Nilsen
- Aziz Chaudhry
- Bela Lubkin
- Ben Boeckel
- Benjamin Buch
- Benno Schulenberg
- Bernhard Reutner-Fischer
- Bert Wesarg
- Bhargava Shastry
- Bill Glessner
- Bjarni Ingi Gislason
- Boud Roukema
- Brad Smith - Brad Smith
- Bruce Stark - Bruce Stark
- Pippijn van Steenhoven - Cary Lewis
- Tobias Stoeckmann
- Martin Storsjö
- Jonathan Stott
- Dan Stromberg
- Douglas Thor
- Vincent Torri
- Alexey Tourbin
- Paul Townsend
- Mohammed Adnène Trojette
- Orange Tsai
- Taiki Tsunekawa
- Mathieu Vachon
- Maksym Vatsyk
- Loganaden Velvindron
- Patrick J. Volkerding
- Martin Väth
- Adam Walling
- Jeffrey Walton
- Christian Weisgerber
- Dan Weiss
- Bert Wesarg
- Mark Wielaard
- Fredrik Wikstrom
- Jim Wilcoxson
- Ralf Wildenhues
- Charles Wilson - Charles Wilson
- Lars Wirzenius - Chenxi Mao
- Vincent Wixsom
- Pilorz Wojciech
- Chien Wong - Chien Wong
- Xi Ruoyao - Chris Donawa
- Chris McCrohan
- Christian Hesse
- Christian Kujau
- Christian von Roques
- Christian Weisgerber
- Christoph Junghans
- Collin Funk
- Conley Moorhous
- Cristian Rodríguez
- Cristiano Ceglia
- Dan Shechter
- Dan Stromberg
- Dan Weiss
- Daniel Leonard
- Daniel Mealha Cabrita
- Daniel Packard
- Daniel Richard G.
- David Burklund
- Denis Excoffier
- Derwin McGeary
- Dexter Castor Döpping
- Diederik de Haas
- Diego Elio Pettenò
- Dimitri Papadopoulos Orfanos
- Dirk Müller
- Douglas Thor
- Ed Maste
- Elbert Pol
- Eli Schwartz
- Elijah Almeida Coimbra
- Émilie Labbé
- Emmanuel Blot
- Eric Lindblad
- Eric S. Raymond
- Étienne Mollier
- Evan Nemerson
- Fangrui Song
- Felix Collin
- Filip Palian
- Firas Khalil Khana
- François Etcheverry
- Frank Busse
- Frank Prochnow
- Fredrik Wikstrom
- Gabi Davar
- Gabriela Gutierrez
- Gilles Espinasse
- Gregory Margo
- Guillaume Outters
- Guiorgy Potskhishvili
- H. Peter Anvin
- Hajin Jang
- Hans Jansen
- Harri K. Koskinen
- Hin-Tak Leung
- H.J. Lu
- Hongbo Ni
- Igor Pavlov
- İhsan Doğan
- Ilya Kurdyukov
- Iouri Kharon
- İsmail Dönmez
- Ivan A. Melnikov
- Jakub Bogusz
- James Buren
- James M Leddy
- Jan Kratochvil
- Jan Terje Hansen
- Jason Gorski
- Jeff Bastian
- Jeffrey Walton
- Jeroen Roovers
- Jim Meyering
- Jim Wilcoxson
- Joachim Henke
- John Paul Adrian Glaubitz
- Jonathan Nieder
- Jonathan Stott
- Joona Kannisto
- Jouk Jansen
- Juan Manuel Guerrero
- Jukka Salmi
- Julien Marrec
- Jun I Jin
- Kai Pastor
- Karl Beldan
- Karl Berry
- Keith Patton
- Kelvin Lee
- Kevin R. Bulgrien
- Kian-Meng Ang
- Kim Jinyeong
- Kirill A. Korinsky
- Kiyoshi Kanazawa
- Lars Wirzenius
- Li Chenggang
- Lizandro Heredia
- Loganaden Velvindron
- Lorenzo De Liso
- Lukas Braune
- Maarten Bosmans
- Maksym Vatsyk
- Marcin Kowalczyk
- Marcus Comstedt
- Marcus Tillmanns
- Marek Černocký
- Mark Adler
- Mark Wielaard
- Markus Duft
- Markus Rickert
- Martin Blumenstingl
- Martin Matuška
- Martin Storsjö
- Martin Väth
- Mathieu Vachon
- Matthew Good
- Matthieu Rakotojaona
- Melanie Blower
- Michael Felt
- Michael Fox
- Michał Górny
- Mike Frysinger
- Mikko Pouru
- Milo Casagrande
- Mohammed Adnène Trojette
- Nathan Moinvaziri
- Nelson H. F. Beebe
- Nicholas Jackson
- Ole André Vadla Ravnås
- Orange Tsai
- Orgad Shaneh
- Patrick J. Volkerding
- Paul Eggert
- Paul Townsend
- Pavel Raiskup
- Per Øyvind Karlsen
- Peter Ivanov
- Peter Lawler
- Peter O'Gorman
- Peter Pallinger
- Peter Seiderer
- Pierre-Yves Martin
- Pilorz Wojciech
- Pippijn van Steenhoven
- Rafał Mużyło
- Rainer Müller
- Ralf Wildenhues
- Rich Prohaska
- Richard Koch
- Richard W.M. Jones
- Robert Elz
- Robert Readman
- Roel Bouckaert
- Ron Desmond
- Ruarí Ødegaard
- Rui Paulo
- Ryan Colyer
- Ryan Young - Ryan Young
- Andreas Zieringer - Sam James
- Scott McAllister
- Sean Fenian
- Sebastian Andrzej Siewior
- Sergey Kosukhin
- Simon Josefsson
- Siteshwar Vashisht
- Steffen Nurpmeso
- Stephan Kulow
- Stephen Sachs
- Stuart Shelton
- Taiki Tsunekawa
- Thomas Klausner
- Tobias Lahrmann Hansen
- Tobias Stoeckmann
- Tomasz Gajc
- Tomer Chachamu
- Torsten Rupp
- Trần Ngọc Quân
- Trent W. Buck
- Victoria Alexia
- Vijay Sarvepalli
- Ville Koskinen
- Ville Skyttä
- Vincent Cruz
- Vincent Fazio
- Vincent Lefevre
- Vincent Torri
- Vincent Wixsom
- Vincenzo Innocente
- Vitaly Chikunov
- Wim Lewis
- Xi Ruoyao
- Xin Li
- Yifeng Li
- 榆柳松 (ZhengSen Wang) - 榆柳松 (ZhengSen Wang)
Companies: Companies:

View File

@ -43,6 +43,7 @@ NATIVE_LANG_SUPPORT="y"
SMALL="n" SMALL="n"
CLMUL="y" CLMUL="y"
SANDBOX="y" SANDBOX="y"
DOXYGEN="y"
SRC_DIR="$ABS_DIR/../" SRC_DIR="$ABS_DIR/../"
DEST_DIR="$SRC_DIR/../xz_build" DEST_DIR="$SRC_DIR/../xz_build"
PHASE="all" PHASE="all"
@ -91,6 +92,7 @@ while getopts a:b:c:d:l:m:n:s:p:f:w:h opt; do
small) SMALL="y";; small) SMALL="y";;
clmul) CLMUL="n";; clmul) CLMUL="n";;
sandbox) SANDBOX="n";; sandbox) SANDBOX="n";;
doxygen) DOXYGEN="n";;
*) echo "Invalid disable value: $disable_arg"; exit 1 ;; *) echo "Invalid disable value: $disable_arg"; exit 1 ;;
esac esac
done done
@ -113,6 +115,10 @@ while getopts a:b:c:d:l:m:n:s:p:f:w:h opt; do
;; ;;
w) WRAPPER="$OPTARG" w) WRAPPER="$OPTARG"
;; ;;
*)
echo "Unsupported option: $opt"
exit 1
;;
esac esac
done done
@ -207,7 +213,8 @@ then
add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls" add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls"
add_extra_option "$SMALL" "--enable-small" "" add_extra_option "$SMALL" "--enable-small" ""
add_extra_option "$CLMUL" "" "--disable-clmul-crc" add_extra_option "$CLMUL" "" "--disable-clmul-crc"
add_extra_option "$SANDBOX" "" "--enable-sandbox=no" add_extra_option "$SANDBOX" "" "--disable-sandbox"
add_extra_option "$DOXYGEN" "--enable-doxygen" ""
# Workaround a bug in too old config.guess. Version with # Workaround a bug in too old config.guess. Version with
# timestamp='2022-05-08' would be needed but the autotools-dev # timestamp='2022-05-08' would be needed but the autotools-dev
@ -241,7 +248,9 @@ then
# CMake disables the shared library by default. # CMake disables the shared library by default.
add_extra_option "$SHARED" "-DBUILD_SHARED_LIBS=ON" "" add_extra_option "$SHARED" "-DBUILD_SHARED_LIBS=ON" ""
add_extra_option "$NATIVE_LANG_SUPPORT" "" "-DXZ_NLS=OFF"
add_extra_option "$SMALL" "-DXZ_SMALL=ON" "" add_extra_option "$SMALL" "-DXZ_SMALL=ON" ""
add_extra_option "$DOXYGEN" "-DXZ_DOXYGEN=ON" ""
# Remove old cache file to clear previous settings. # Remove old cache file to clear previous settings.
rm -f "CMakeCache.txt" rm -f "CMakeCache.txt"

View File

@ -42,12 +42,12 @@ case $FORMAT in
groff -t -mandoc -Tutf8 -P-c | col -bx groff -t -mandoc -Tutf8 -P-c | col -bx
;; ;;
ps) ps)
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \ sed "$SED_PD" | groff -dpaper="$PAPER" -t -mandoc \
-rC1 -rS$FONT -Tps -P-p$PAPER -rC1 -rS"$FONT" -Tps -P-p"$PAPER"
;; ;;
pdf) pdf)
sed "$SED_PD" | groff -dpaper=$PAPER -t -mandoc \ sed "$SED_PD" | groff -dpaper="$PAPER" -t -mandoc \
-rC1 -rS$FONT -Tps -P-p$PAPER | ps2pdf - - -rC1 -rS"$FONT" -Tps -P-p"$PAPER" | ps2pdf - -
;; ;;
*) *)
echo 'Invalid arguments' >&2 echo 'Invalid arguments' >&2

View File

@ -14,6 +14,69 @@ include(CheckCSourceCompiles)
include(CheckIncludeFile) include(CheckIncludeFile)
include(CheckSymbolExists) include(CheckSymbolExists)
# An internal helper for tuklib_integer that attempts to detect if
# -mstrict-align or -mno-strict-align is in effect. This sets the
# cache variable TUKLIB_INTEGER_STRICT_ALIGN to ON if OBJDUMP_REGEX
# matches the objdump output of a check program. Otherwise it is set to OFF.
function(tuklib_integer_internal_strict_align OBJDUMP_REGEX)
if(NOT DEFINED TUKLIB_INTEGER_STRICT_ALIGN)
# Build a static library because then the function won't be optimized
# away, and there won't be any unrelated startup code either.
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
# CMake >= 3.25 wouldn't require us to create a temporary file,
# but the following method is compatible with 3.20.
file(WRITE "${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.c" "
#include <string.h>
unsigned int check_strict_align(const void *p)
{
unsigned int i;
memcpy(&i, p, sizeof(i));
return i;
}
")
# Force -O2 because memcpy() won't be optimized out if optimizations
# are disabled.
try_compile(
TRY_COMPILE_RESULT
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.c"
COMPILE_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}"
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS=${CMAKE_REQUIRED_FLAGS} -O2"
COPY_FILE "${CMAKE_BINARY_DIR}/tuklib_integer_strict_align.a"
)
if(NOT TRY_COMPILE_RESULT)
message(FATAL_ERROR
"Compilation of the strict align check failed. "
"Either the specified compiler flags are broken "
"or ${CMAKE_CURRENT_FUNCTION_LIST_FILE} has a bug.")
endif()
# Use WORKING_DIRECTORY instead of passing the full path to objdump.
# This ensures that the pathname won't affect the objdump output,
# which could result in an unwanted regex match in the next step.
execute_process(
COMMAND "${CMAKE_OBJDUMP}" -d "tuklib_integer_strict_align.a"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
OUTPUT_VARIABLE OBJDUMP_OUTPUT
RESULT_VARIABLE OBJDUMP_RESULT
)
# FIXME? Should we remove the temporary files here?
# Look for instructions that load unsigned bytes. If none are found,
# assume that -mno-strict-align is in effect.
if(OBJDUMP_RESULT STREQUAL "0" AND
OBJDUMP_OUTPUT MATCHES "${OBJDUMP_REGEX}")
set(TUKLIB_INTEGER_STRICT_ALIGN ON CACHE INTERNAL "")
else()
set(TUKLIB_INTEGER_STRICT_ALIGN OFF CACHE INTERNAL "")
endif()
endif()
endfunction()
function(tuklib_integer TARGET_OR_ALL) function(tuklib_integer TARGET_OR_ALL)
# Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't # Check for endianness. Unlike the Autoconf's AC_C_BIGENDIAN, this doesn't
# support Apple universal binaries. The CMake module will leave the # support Apple universal binaries. The CMake module will leave the
@ -60,61 +123,145 @@ function(tuklib_integer TARGET_OR_ALL)
endif() endif()
endif() endif()
# Guess that unaligned access is fast on these archs: # Autodetect if unaligned memory access is fast when the cache variable
# - 32/64-bit x86 / x86-64 # TUKLIB_FAST_UNALIGNED_ACCESS isn't set. The result is stored in
# - 32/64-bit big endian PowerPC # FAST_UNALIGNED_GUESS. Assume that unaligned access shouldn't be used.
# - 64-bit little endian PowerPC # Initialize the variable here so that it's never undefined in the
# - Some 32-bit ARM # option() command after the if()...endif() block.
# - Some 64-bit ARM64 (AArch64)
# - Some 32/64-bit RISC-V
#
# CMake doesn't provide a standardized/normalized list of processor arch
# names. For example, x86-64 may be "x86_64" (Linux), "AMD64" (Windows),
# or even "EM64T" (64-bit WinXP).
set(FAST_UNALIGNED_GUESS OFF) set(FAST_UNALIGNED_GUESS OFF)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PROCESSOR) if(NOT DEFINED TUKLIB_FAST_UNALIGNED_ACCESS)
message(CHECK_START "Check if unaligned memory access should be used")
# There is no ^ in the first regex branch to allow "i" at the beginning # Guess that unaligned access is fast on these archs:
# so it can match "i386" to "i786", and "x86_64". # - 32/64-bit x86 / x86-64
if(PROCESSOR MATCHES "[x34567]86|^x64|^amd64|^em64t") # - 32/64-bit big endian PowerPC
set(FAST_UNALIGNED_GUESS ON) # - 64-bit little endian PowerPC
# - 32/64-bit Loongarch (*)
# - Some 32-bit ARM
# - Some 64-bit ARM64 (AArch64)
# - Some 32/64-bit RISC-V
#
# (*) See sections 7.4, 8.1, and 8.2:
# https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
#
# That is, desktop and server processors likely support
# unaligned access in hardware but embedded processors
# might not. GCC defaults to -mno-strict-align and so
# do majority of GNU/Linux distributions. As of
# GCC 15.2, there is no predefined macro to detect
# if -mstrict-align or -mno-strict-align is in effect.
# We use heuristics based on compiler output.
#
# CMake < 4.1 doesn't provide a standardized/normalized list of arch
# names. For example, x86-64 may be "x86_64" (Linux),
# "AMD64" (Windows), or even "EM64T" (64-bit WinXP).
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PROCESSOR)
elseif(PROCESSOR MATCHES "^powerpc|^ppc") # CMake 4.1 made CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID useful on many
if(WORDS_BIGENDIAN OR PROCESSOR MATCHES "64") # targets. In earlier versions it's still useful with MSVC with which
set(FAST_UNALIGNED_GUESS ON) # CMAKE_SYSTEM_PROCESSOR can refer to the build machine.
if(NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "")
# CMake 4.2.0 docs say that the list typically has only one entry
# except possibly on macOS. On macOS, most (all?) archs support
# unaligned access. Just pick the first one from the list.
list(GET CMAKE_C_COMPILER_ARCHITECTURE_ID 0 PROCESSOR)
string(TOLOWER "${PROCESSOR}" PROCESSOR)
endif() endif()
elseif(PROCESSOR MATCHES "^arm|^aarch64|^riscv") # There is no ^ in the first regex branch to allow "i" at
# On 32-bit and 64-bit ARM, GCC and Clang # the beginning so it can match "i386" to "i786", and "x86_64".
# #define __ARM_FEATURE_UNALIGNED if if(PROCESSOR MATCHES "[x34567]86|^x64|^amd64|^em64t")
# unaligned access is supported.
#
# Exception: GCC at least up to 13.2.0
# defines it even when using -mstrict-align
# so in that case this autodetection goes wrong.
# Most of the time -mstrict-align isn't used so it
# shouldn't be a common problem in practice. See:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
#
# RISC-V C API Specification says that if
# __riscv_misaligned_fast is defined then
# unaligned access is known to be fast.
#
# MSVC is handled as a special case: We assume that
# 32/64-bit ARM supports fast unaligned access.
# If MSVC gets RISC-V support then this will assume
# fast unaligned access on RISC-V too.
check_c_source_compiles("
#if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER)
compile error
#endif
int main(void) { return 0; }
"
TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
if(TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
set(FAST_UNALIGNED_GUESS ON) set(FAST_UNALIGNED_GUESS ON)
elseif(PROCESSOR MATCHES "^powerpc|^ppc")
if(WORDS_BIGENDIAN OR PROCESSOR MATCHES "64")
set(FAST_UNALIGNED_GUESS ON)
endif()
elseif(PROCESSOR MATCHES "^arm|^riscv" AND
NOT PROCESSOR MATCHES "^arm64")
# On 32-bit ARM, GCC and Clang # #define __ARM_FEATURE_UNALIGNED
# if and only if unaligned access is supported.
#
# RISC-V C API Specification says that if
# __riscv_misaligned_fast is defined then
# unaligned access is known to be fast.
#
# MSVC is handled as a special case: We assume that
# 32-bit ARM supports fast unaligned access.
# If MSVC gets RISC-V support then this will assume
# fast unaligned access on RISC-V too.
check_c_source_compiles("
#if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER)
compile error
#endif
int main(void) { return 0; }
"
TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
if(TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
set(FAST_UNALIGNED_GUESS ON)
endif()
elseif(PROCESSOR MATCHES "^aarch64|^arm64")
# On ARM64, Clang defines __ARM_FEATURE_UNALIGNED if and only if
# unaligned access is supported. However, GCC (at least up to 15.2.0)
# defines it even when using -mstrict-align, so autodetection with
# this macro doesn't work with GCC on ARM64. (It does work on
# 32-bit ARM.) See:
#
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
#
# We need three checks:
#
# 1. If __ARM_FEATURE_UNALIGNED is defined and the
# compiler isn't GCC, unaligned access is enabled.
# If the compiler is MSVC, unaligned access is
# enabled even without __ARM_FEATURE_UNALIGNED.
check_c_source_compiles("
#if defined(__ARM_FEATURE_UNALIGNED) \
&& (!defined(__GNUC__) || defined(__clang__))
#elif defined(_MSC_VER)
#else
compile error
#endif
int main(void) { return 0; }
"
TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
if(TUKLIB_FAST_UNALIGNED_DEFINED_BY_PREPROCESSOR)
set(FAST_UNALIGNED_GUESS ON)
else()
# 2. If __ARM_FEATURE_UNALIGNED is not defined,
# unaligned access is disabled.
check_c_source_compiles("
#ifdef __ARM_FEATURE_UNALIGNED
compile error
#endif
int main(void) { return 0; }
"
TUKLIB_FAST_UNALIGNED_NOT_DEFINED_BY_PREPROCESSOR)
if(NOT TUKLIB_FAST_UNALIGNED_NOT_DEFINED_BY_PREPROCESSOR)
# 3. Use heuristics to detect if -mstrict-align is
# in effect when building with GCC.
tuklib_integer_internal_strict_align("[ \t]ldrb[ \t]")
if(NOT TUKLIB_INTEGER_STRICT_ALIGN)
set(FAST_UNALIGNED_GUESS ON)
endif()
endif()
endif()
elseif(PROCESSOR MATCHES "^loongarch")
tuklib_integer_internal_strict_align("[ \t]ld\\.bu[ \t]")
if(NOT TUKLIB_INTEGER_STRICT_ALIGN)
set(FAST_UNALIGNED_GUESS ON)
endif()
endif()
if(FAST_UNALIGNED_GUESS)
message(CHECK_PASS "yes")
else()
message(CHECK_PASS "no")
endif() endif()
endif() endif()

View File

@ -758,6 +758,7 @@ fi
# --with-pic and --without-pic though. As long as neither --with-pic nor # --with-pic and --without-pic though. As long as neither --with-pic nor
# --without-pic is used then we can use #ifdef PIC to detect if the file is # --without-pic is used then we can use #ifdef PIC to detect if the file is
# being built for a shared library. # being built for a shared library.
LINKER_FLAG_UNDEFINED_VERSION=
AS_IF([test "x$enable_symbol_versions" = xno], [ AS_IF([test "x$enable_symbol_versions" = xno], [
enable_symbol_versions=no enable_symbol_versions=no
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
@ -831,12 +832,34 @@ AS_IF([test "x$enable_symbol_versions" = xno], [
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions']) AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
fi fi
AC_MSG_RESULT([yes ($enable_symbol_versions)]) AC_MSG_RESULT([yes ($enable_symbol_versions)])
# If features are disabled in liblzma, some symbols may be missing.
# LLVM's lld defaults to --no-undefined-version and the build breaks
# if not all symbols in the version script exist. That is good for
# catching errors like typos, but in our case the downside is too big.
# Avoid the problem by using --undefined-version if the linker
# supports it.
#
# GNU ld has had --no-undefined-version for a long time but it's not
# the default. The opposite option --undefined-version was only added
# in 2022, thus we must use --undefined-version conditionally.
AC_MSG_CHECKING([if linker supports --undefined-version])
OLD_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--undefined-version"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])], [
LINKER_FLAG_UNDEFINED_VERSION=-Wl,--undefined-version
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
LDFLAGS=$OLD_LDFLAGS
]) ])
AM_CONDITIONAL([COND_SYMVERS_LINUX], AM_CONDITIONAL([COND_SYMVERS_LINUX],
[test "x$enable_symbol_versions" = xlinux]) [test "x$enable_symbol_versions" = xlinux])
AM_CONDITIONAL([COND_SYMVERS_GENERIC], AM_CONDITIONAL([COND_SYMVERS_GENERIC],
[test "x$enable_symbol_versions" = xgeneric]) [test "x$enable_symbol_versions" = xgeneric])
AC_SUBST([LINKER_FLAG_UNDEFINED_VERSION])
############################################################################### ###############################################################################
@ -985,8 +1008,8 @@ AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1],
# Find the best function to set timestamps. # Find the best function to set timestamps.
AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break]) AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break])
# This is nice to have but not mandatory. # These are nice to have but not mandatory.
AC_CHECK_FUNCS([posix_fadvise]) AC_CHECK_FUNCS([getrlimit posix_fadvise])
TUKLIB_PROGNAME TUKLIB_PROGNAME
TUKLIB_INTEGER TUKLIB_INTEGER
@ -1145,7 +1168,8 @@ int main(void)
# Check for ARM64 CRC32 instruction runtime detection. # Check for ARM64 CRC32 instruction runtime detection.
# #
# - getauxval() is supported on Linux. # - getauxval() is supported on Linux. We also need HWCAP_CRC32 which was
# added in glibc 2.24.
# #
# - elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6. # - elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6.
# #
@ -1157,6 +1181,9 @@ int main(void)
# #
AS_IF([test "x$enable_arm64_crc32" = xyes], [ AS_IF([test "x$enable_arm64_crc32" = xyes], [
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname], [break]) AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname], [break])
AC_CHECK_DECL([HWCAP_CRC32], [AC_DEFINE([HAVE_HWCAP_CRC32], [1],
[Define to 1 if 'HWCAP_CRC32' is declared in <sys/auxv.h>.])],
[], [[#include <sys/auxv.h>]])
]) ])
@ -1333,6 +1360,7 @@ AS_IF([test "$GCC" = yes], [
-Wdocumentation \ -Wdocumentation \
-Wduplicate-enum \ -Wduplicate-enum \
-Wempty-translation-unit \ -Wempty-translation-unit \
-Wextra-semi-stmt \
-Wflexible-array-extensions \ -Wflexible-array-extensions \
-Wmissing-variable-declarations \ -Wmissing-variable-declarations \
-Wnewline-eof \ -Wnewline-eof \

View File

@ -228,3 +228,22 @@ c859193b8619f6818326141ee041870d9b76ba83f55c3c94ebcfcb71e1f79e5d xz-5.7.1alpha.
b75a932fa38515e5d3953242b1e3c2e7edd882504b24280f0e9776d596e9cc0d xz-5.7.2beta.tar b75a932fa38515e5d3953242b1e3c2e7edd882504b24280f0e9776d596e9cc0d xz-5.7.2beta.tar
608ed92561c9f27a1eead76653c6f63c6a40d0a20ec91753ed508ba40f9703b3 xz-5.7.2beta.tar.gz 608ed92561c9f27a1eead76653c6f63c6a40d0a20ec91753ed508ba40f9703b3 xz-5.7.2beta.tar.gz
98a61e45e5917b93ce17d826ef2d11f9331951882b2558675cdf115cdf3f77c8 xz-5.7.2beta.tar.xz 98a61e45e5917b93ce17d826ef2d11f9331951882b2558675cdf115cdf3f77c8 xz-5.7.2beta.tar.xz
bdff4615bf19c46042bced4d7b8c52bdacce61261b39db464d482692c948dd02 xz-5.8.0.tar
8c107270289807e2047f35d687b4d7a5bb029137f7c89ebdcfa909cb3b674440 xz-5.8.0.tar.bz2
b523c5e47d1490338c5121bdf2a6ecca2bcf0dce05a83ad40a830029cbe6679b xz-5.8.0.tar.gz
05ecad9e71919f4fca9f19fbbc979ea28e230188ed123dc6f06b98031ea14542 xz-5.8.0.tar.xz
397165cedccb8e16700b8fdd026c3fd7ff2d18923e28cfbf7d0c5f89cd6a50af xz-5.8.0-windows.zip
078caa9d406018d4d43df343455f57811e9ba69c1340670a85a0ae6341d42ba3 xz-5.8.0-windows.7z
ee188eabc3220684422f62df7a385541a86d2a5c385407f9d8fd94d49b251c4e xz-cve-2025-31115.patch
c9789682496d124fd214e665f6aa2f6d3d9e8527a7f0e120f9180c531d322bd6 xz-5.8.1.tar
5965c692c4c8800cd4b33ce6d0f6ac9ac9d6ab227b17c512b6561bce4f08d47e xz-5.8.1.tar.bz2
507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543 xz-5.8.1.tar.gz
0b54f79df85912504de0b14aec7971e3f964491af1812d83447005807513cd9e xz-5.8.1.tar.xz
62fdfde73d5c5d293bbb4a96211b29d09adbd56bc6736976e4c9fc9942ae3c67 xz-5.8.1-windows.zip
8ed1403fe6c971a2a6ac85fb7b27c8438b83175bc6f3bc49fec06540c904c84d xz-5.8.1-windows.7z
b4c8a939220546e275456fac3d19540b152a85dfdb13d6e36289ed8fb49cb700 xz-5.8.2.tar
60345d7c0b9c8d7ffa469e96898c300def3669f5047fc76219b819340839f3d8 xz-5.8.2.tar.bz2
ce09c50a5962786b83e5da389c90dd2c15ecd0980a258dd01f70f9e7ce58a8f1 xz-5.8.2.tar.gz
890966ec3f5d5cc151077879e157c0593500a522f413ac50ba26d22a9a145214 xz-5.8.2.tar.xz
c90c4044b9562594d2125409dd4969ce0e281b9db60d2224c2f4a5419c7e2a4e xz-5.8.2-windows.zip
a64996b3219461bd959735376eb413fecfe71a6247bcdb870a7be30bf2040fd8 xz-5.8.2-windows.7z

View File

@ -45,7 +45,9 @@ SRCS_C = \
../src/common/tuklib_cpucores.c \ ../src/common/tuklib_cpucores.c \
../src/common/tuklib_exit.c \ ../src/common/tuklib_exit.c \
../src/common/tuklib_mbstr_fw.c \ ../src/common/tuklib_mbstr_fw.c \
../src/common/tuklib_mbstr_nonprint.c \
../src/common/tuklib_mbstr_width.c \ ../src/common/tuklib_mbstr_width.c \
../src/common/tuklib_mbstr_wrap.c \
../src/common/tuklib_open_stdxxx.c \ ../src/common/tuklib_open_stdxxx.c \
../src/common/tuklib_physmem.c \ ../src/common/tuklib_physmem.c \
../src/common/tuklib_progname.c \ ../src/common/tuklib_progname.c \

View File

@ -8,7 +8,7 @@
# - Instead of API docs, docs of XZ Utils internals may be built. # - Instead of API docs, docs of XZ Utils internals may be built.
# - Change the output directory for out-of-tree builds. # - Change the output directory for out-of-tree builds.
# #
# These options were tested with Doxygen 1.10.0. # These options were tested with Doxygen 1.9.8 and 1.13.2.
PROJECT_NAME = "liblzma (XZ Utils)" PROJECT_NAME = "liblzma (XZ Utils)"
OUTPUT_DIRECTORY = ../doc OUTPUT_DIRECTORY = ../doc
@ -19,6 +19,8 @@ RECURSIVE = YES
OPTIMIZE_OUTPUT_FOR_C = YES OPTIMIZE_OUTPUT_FOR_C = YES
EXTRACT_STATIC = YES EXTRACT_STATIC = YES
SORT_MEMBER_DOCS = NO SORT_MEMBER_DOCS = NO
WARN_IF_UNDOCUMENTED = NO
WARN_AS_ERROR = FAIL_ON_WARNINGS
SOURCE_TOOLTIPS = NO SOURCE_TOOLTIPS = NO
VERBATIM_HEADERS = NO VERBATIM_HEADERS = NO
ALPHABETICAL_INDEX = NO ALPHABETICAL_INDEX = NO
@ -37,3 +39,7 @@ PREDEFINED = LZMA_API(type)=type \
tuklib_attr_noreturn= \ tuklib_attr_noreturn= \
lzma_attribute(attr)= \ lzma_attribute(attr)= \
lzma_attr_alloc_size(size)= lzma_attr_alloc_size(size)=
# Debian and Ubuntu patch Doxygen so that HAVE_DOT = YES is the default.
# Set HAVE_DOT explicitly to get consistent behavior across distributions.
HAVE_DOT = NO

View File

@ -62,6 +62,58 @@ main(void)
fi fi
]) ])
# On archs that we use tuklib_integer_strict_align() (see below), we need
# objdump to detect support for unaligned access. (Libtool needs objdump
# too, so Libtool does this same tool check as well.)
AC_CHECK_TOOL([OBJDUMP], [objdump], [false])
# An internal helper that attempts to detect if -mstrict-align or
# -mno-strict-align is in effect. This sets enable_unaligned_access=yes
# if compilation succeeds and the regex passed as an argument does *not*
# match the objdump output of a check program. Otherwise this sets
# enable_unaligned_access=no.
tuklib_integer_strict_align ()
{
# First guess no.
enable_unaligned_access=no
# Force -O2 because without optimizations the memcpy()
# won't be optimized out.
tuklib_integer_saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -O2"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <string.h>
unsigned int check_strict_align(const void *p)
{
unsigned int i;
memcpy(&i, p, sizeof(i));
return i;
}
]])], [
# Disassemble the test function from the object file.
if $OBJDUMP -d conftest.$ac_objext > conftest.s ; then
# This function should be passed a regex that
# matches if there are instructions that load
# unsigned bytes. Such instructions indicate
# that -mstrict-align is in effect.
#
# NOTE: Use braces to avoid M4 parameter
# expansion.
if grep -- "${1}" conftest.s > /dev/null ; then
:
else
# No single-byte unsigned load
# instructions were found,
# so it seems that -mno-strict-align
# is in effect.
# Override our earlier guess.
enable_unaligned_access=yes
fi
fi
])
CFLAGS=$tuklib_integer_saved_CFLAGS
}
AC_MSG_CHECKING([if unaligned memory access should be used]) AC_MSG_CHECKING([if unaligned memory access should be used])
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access], AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
[Enable if the system supports *fast* unaligned memory access [Enable if the system supports *fast* unaligned memory access
@ -78,34 +130,90 @@ if test "x$enable_unaligned_access" = xauto ; then
i?86|x86_64|powerpc|powerpc64|powerpc64le) i?86|x86_64|powerpc|powerpc64|powerpc64le)
enable_unaligned_access=yes enable_unaligned_access=yes
;; ;;
arm*|aarch64*|riscv*) arm*|riscv*)
# On 32-bit and 64-bit ARM, GCC and Clang # On 32-bit ARM, GCC and Clang
# #define __ARM_FEATURE_UNALIGNED if # #define __ARM_FEATURE_UNALIGNED
# unaligned access is supported. # if and only if unaligned access is supported.
#
# Exception: GCC at least up to 13.2.0
# defines it even when using -mstrict-align
# so in that case this autodetection goes wrong.
# Most of the time -mstrict-align isn't used so it
# shouldn't be a common problem in practice. See:
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
# #
# RISC-V C API Specification says that if # RISC-V C API Specification says that if
# __riscv_misaligned_fast is defined then # __riscv_misaligned_fast is defined then
# unaligned access is known to be fast. # unaligned access is known to be fast.
# #
# MSVC is handled as a special case: We assume that # MSVC is handled as a special case: We assume that
# 32/64-bit ARM supports fast unaligned access. # 32-bit ARM supports fast unaligned access.
# If MSVC gets RISC-V support then this will assume # If MSVC gets RISC-V support then this will assume
# fast unaligned access on RISC-V too. # fast unaligned access on RISC-V too.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#if !defined(__ARM_FEATURE_UNALIGNED) \ #if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \ && !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER) && !defined(_MSC_VER)
compile error compile error
#endif #endif
int main(void) { return 0; } int main(void) { return 0; }
])], [enable_unaligned_access=yes], [enable_unaligned_access=no]) ])],
[enable_unaligned_access=yes],
[enable_unaligned_access=no])
;;
aarch64*)
# On ARM64, Clang defines __ARM_FEATURE_UNALIGNED
# if and only if unaligned access is supported.
# However, GCC (at least up to 15.2.0) defines it
# even when using -mstrict-align, so autodetection
# with this macro doesn't work with GCC on ARM64.
# (It does work on 32-bit ARM.) See:
#
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111555
#
# We need three checks:
#
# 1. If __ARM_FEATURE_UNALIGNED is defined and the
# compiler isn't GCC, unaligned access is enabled.
# If the compiler is MSVC, unaligned access is
# enabled even without __ARM_FEATURE_UNALIGNED.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#if defined(__ARM_FEATURE_UNALIGNED) \
&& (!defined(__GNUC__) \
|| defined(__clang__))
#elif defined(_MSC_VER)
#else
compile error
#endif
int main(void) { return 0; }
])], [enable_unaligned_access=yes])
# 2. If __ARM_FEATURE_UNALIGNED is not defined,
# unaligned access is disabled.
if test "x$enable_unaligned_access" = xauto ; then
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#ifdef __ARM_FEATURE_UNALIGNED
compile error
#endif
int main(void) { return 0; }
])], [enable_unaligned_access=no])
fi
# 3. Use heuristics to detect if -mstrict-align is
# in effect when building with GCC.
if test "x$enable_unaligned_access" = xauto ; then
[tuklib_integer_strict_align \
'[[:blank:]]ldrb[[:blank:]]']
fi
;;
loongarch*)
# See sections 7.4, 8.1, and 8.2:
# https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
#
# That is, desktop and server processors likely support
# unaligned access in hardware but embedded processors
# might not. GCC defaults to -mno-strict-align and so
# do majority of GNU/Linux distributions. As of
# GCC 15.2, there is no predefined macro to detect
# if -mstrict-align or -mno-strict-align is in effect.
# Use heuristics based on compiler output.
[
tuklib_integer_strict_align \
'[[:blank:]]ld\.bu[[:blank:]]'
]
;; ;;
*) *)
enable_unaligned_access=no enable_unaligned_access=no

1
po/.gitignore vendored
View File

@ -5,6 +5,7 @@ Rules-quot
boldquot.sed boldquot.sed
en@boldquot.header en@boldquot.header
en@quot.header en@quot.header
insert-header.sed
insert-header.sin insert-header.sin
quot.sed quot.sed
remove-potcdate.sin remove-potcdate.sin

View File

@ -10,6 +10,7 @@ src/xz/main.c
src/xz/message.c src/xz/message.c
src/xz/mytime.c src/xz/mytime.c
src/xz/options.c src/xz/options.c
src/xz/sandbox.c
src/xz/signals.c src/xz/signals.c
src/xz/suffix.c src/xz/suffix.c
src/xz/util.c src/xz/util.c

View File

@ -1,16 +1,16 @@
# SPDX-License-Identifier: 0BSD # SPDX-License-Identifier: 0BSD
# #
# Spanish translation for xz-5.7.1-dev1. # Spanish translation for xz-5.8.0-pre1.
# Copyright (C) 2024, 2025 The XZ Utils authors and contributors # Copyright (C) 2024, 2025 The XZ Utils authors and contributors
# This file is published under the BSD Zero Clause License. # This file is published under the BSD Zero Clause License.
# Cristian Othón Martínez Vera <cfuga@cfuga.mx>, 2022, 2023, 2024, 2025. # Cristian Othón Martínez Vera <cfuga@cfuga.mx>, 2022, 2023, 2024, 2025.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz 5.7.1-dev1\n" "Project-Id-Version: xz 5.8.0-pre1\n"
"Report-Msgid-Bugs-To: xz@tukaani.org\n" "Report-Msgid-Bugs-To: xz@tukaani.org\n"
"POT-Creation-Date: 2025-01-29 20:59+0200\n" "POT-Creation-Date: 2025-01-29 20:59+0200\n"
"PO-Revision-Date: 2025-01-24 09:25-0600\n" "PO-Revision-Date: 2025-05-14 14:23-0600\n"
"Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n" "Last-Translator: Cristian Othón Martínez Vera <cfuga@cfuga.mx>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
"Language: es\n" "Language: es\n"
@ -1169,7 +1169,7 @@ msgstr "Los sufijos válidos son 'KiB' (2^10), 'MiB' (2^20), y 'GiB' (2^30)."
#: src/xz/util.c #: src/xz/util.c
#, c-format #, c-format
msgid "Value of the option '%s' must be in the range [%<PRIu64>, %<PRIu64>]" msgid "Value of the option '%s' must be in the range [%<PRIu64>, %<PRIu64>]"
msgstr "El valor de la opción '%s' debe estar en el rango [%<PRIu64>, %<PRIu64>]" msgstr "El valor de la opción '%s' debe estar en el intervalo [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c #: src/xz/util.c
msgid "Compressed data cannot be read from a terminal" msgid "Compressed data cannot be read from a terminal"
@ -1223,7 +1223,7 @@ msgstr "El valor de la opción no puede estar vacío"
#: src/liblzma/common/string_conversion.c #: src/liblzma/common/string_conversion.c
msgid "Value out of range" msgid "Value out of range"
msgstr "Valor fuera de rango" msgstr "Valor fuera de intervalo"
#: src/liblzma/common/string_conversion.c #: src/liblzma/common/string_conversion.c
msgid "This option does not support any multiplier suffixes" msgid "This option does not support any multiplier suffixes"

View File

@ -13,7 +13,7 @@ msgstr ""
"Project-Id-Version: xz 5.8.0-pre1\n" "Project-Id-Version: xz 5.8.0-pre1\n"
"Report-Msgid-Bugs-To: xz@tukaani.org\n" "Report-Msgid-Bugs-To: xz@tukaani.org\n"
"POT-Creation-Date: 2025-01-29 20:59+0200\n" "POT-Creation-Date: 2025-01-29 20:59+0200\n"
"PO-Revision-Date: 2025-03-09 11:56-0700\n" "PO-Revision-Date: 2025-03-26 21:00-0700\n"
"Last-Translator: Božidar Putanec <bozidarp@yahoo.com>\n" "Last-Translator: Božidar Putanec <bozidarp@yahoo.com>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n" "Language-Team: Croatian <lokalizacija@linux.hr>\n"
"Language: hr\n" "Language: hr\n"
@ -69,7 +69,7 @@ msgstr "%s: %s"
#: src/xz/args.c #: src/xz/args.c
#, c-format #, c-format
msgid "The environment variable %s contains too many arguments" msgid "The environment variable %s contains too many arguments"
msgstr "Varijabla okoline '%s' sadrži previše argumenata" msgstr "Varijabla okruženja '%s' sadrži previše argumenata"
#: src/xz/args.c #: src/xz/args.c
msgid "Compression support was disabled at build time" msgid "Compression support was disabled at build time"
@ -394,7 +394,7 @@ msgstr "Kontrola:"
#: src/xz/list.c #: src/xz/list.c
msgid "Stream Padding:" msgid "Stream Padding:"
msgstr "Ispuna toka:" msgstr "Dopuna toka:"
#: src/xz/list.c #: src/xz/list.c
msgid "Memory needed:" msgid "Memory needed:"
@ -454,7 +454,7 @@ msgstr "KontrVrijedn"
#: src/xz/list.c #: src/xz/list.c
msgid "Padding" msgid "Padding"
msgstr "Ispuna" msgstr "Dopuna"
#: src/xz/list.c #: src/xz/list.c
msgid "Header" msgid "Header"
@ -1013,7 +1013,7 @@ msgstr "Valid OPTS za sve BCJ filtre:"
#. This is word wrapped at spaces. The Unicode character U+00A0 works as a non-breaking space. Tab (\t) is interpret as a zero-width space (the tab itself is not displayed); U+200B is NOT supported. Manual word wrapping with \n is supported but requires care. #. This is word wrapped at spaces. The Unicode character U+00A0 works as a non-breaking space. Tab (\t) is interpret as a zero-width space (the tab itself is not displayed); U+200B is NOT supported. Manual word wrapping with \n is supported but requires care.
#: src/xz/message.c #: src/xz/message.c
msgid "start offset for conversions (default=0)" msgid "start offset for conversions (default=0)"
msgstr "početni odmak za konverzije (zadano=0)" msgstr "početni pomak za konverzije (zadano=0)"
#. This is word wrapped at spaces. The Unicode character U+00A0 works as a non-breaking space. Tab (\t) is interpret as a zero-width space (the tab itself is not displayed); U+200B is NOT supported. Manual word wrapping with \n is supported but requires care. #. This is word wrapped at spaces. The Unicode character U+00A0 works as a non-breaking space. Tab (\t) is interpret as a zero-width space (the tab itself is not displayed); U+200B is NOT supported. Manual word wrapping with \n is supported but requires care.
#: src/xz/message.c #: src/xz/message.c
@ -1160,12 +1160,12 @@ msgstr "%s: Nevaljana ekstenzija u imenu datoteke"
#: src/xz/util.c src/liblzma/common/string_conversion.c #: src/xz/util.c src/liblzma/common/string_conversion.c
msgid "Value is not a non-negative decimal integer" msgid "Value is not a non-negative decimal integer"
msgstr "Vrijednost nije nula ili pozitivni decimalni cijeli broj" msgstr "Vrijednost nije nula ili pozitivni dekadski cijeli broj"
#: src/xz/util.c #: src/xz/util.c
#, c-format #, c-format
msgid "%s: Invalid multiplier suffix" msgid "%s: Invalid multiplier suffix"
msgstr "%s: Nevaljana sufiks-množitelj" msgstr "%s: Nevaljani sufiks-množitelj"
#: src/xz/util.c #: src/xz/util.c
msgid "Valid suffixes are 'KiB' (2^10), 'MiB' (2^20), and 'GiB' (2^30)." msgid "Valid suffixes are 'KiB' (2^10), 'MiB' (2^20), and 'GiB' (2^30)."

View File

@ -6,9 +6,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-man 5.8.0-pre1\n" "Project-Id-Version: xz-man 5.8.2-pre1\n"
"POT-Creation-Date: 2025-03-08 14:50+0200\n" "POT-Creation-Date: 2025-10-31 13:23+0200\n"
"PO-Revision-Date: 2025-03-10 08:02+0000\n" "PO-Revision-Date: 2025-11-01 11:04+0200\n"
"Last-Translator: Luca Vercelli <luca.vercelli.to@gmail.com>\n" "Last-Translator: Luca Vercelli <luca.vercelli.to@gmail.com>\n"
"Language-Team: Italian <tp@lists.linux.it>\n" "Language-Team: Italian <tp@lists.linux.it>\n"
"Language: it\n" "Language: it\n"
@ -586,13 +586,8 @@ msgstr "Accetta solo file B<.lz> per la decompressione. La compressione non è s
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18." msgid "The B<.lz> format versions 0 and 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18. B<lzip> 1.4 and later create files in the format version 1."
msgstr "Sono supportati il formato B<.lz> versione 0 e la versione 1 non estesa. I file della versione 0 sono stati prodotti da B<lzip> 1.3 e precedenti. Tali file non sono comuni, ma possono essere trovati negli archivi di file poiché alcuni pacchetti sorgente sono stati rilasciati in questo formato. Anche alcune persone potrebbero avere vecchi file personali in questo formato. Il supporto alla decompressione per il formato versione 0 è stato rimosso in B<lzip> 1.18." msgstr "Sono supportate le versioni 0 e 1 del formato B<.lz>. I file in versione 0 sono stati prodotti da B<lzip> 1.3 e precedenti. Questi file non sono comuni, ma possono essere trovati negli archivi di file, perché alcuni pacchetti sorgente erano stati rilasciati in questo formato. Qualcuno potrebbe anche avere vecchi file personali in questo formato. Il supporto alla decompressione per la versione di formato 0 è stato rimosso in B<lzip> 1.18. B<lzip> 1.4 e successivi creano i file nella versione di formato 1."
#. type: Plain text
#: ../src/xz/xz.1
msgid "B<lzip> 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B<lzip> 1.6. This extension is rarely used and isn't supported by B<xz> (diagnosed as corrupt input)."
msgstr "B<lzip> 1.4 e successivi creano file nel formato v1. L'estensione del marcatore di scaricamento sincronizzazione al formato v1 è stata aggiunta in B<lzip> 1.6. Questa estensione è utilizzata raramente e non è supportata da B<xz>(viene segnalata come input corrotto)."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1

View File

@ -5,9 +5,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-man 5.8.0-pre1\n" "Project-Id-Version: xz-man 5.8.2-pre1\n"
"POT-Creation-Date: 2025-03-08 14:50+0200\n" "POT-Creation-Date: 2025-10-31 13:23+0200\n"
"PO-Revision-Date: 2025-03-11 01:03+0900\n" "PO-Revision-Date: 2025-11-01 23:14+0900\n"
"Last-Translator: Seong-ho Cho <darkcircle.0426@gmail.com>\n" "Last-Translator: Seong-ho Cho <darkcircle.0426@gmail.com>\n"
"Language-Team: Korean <translation-team-ko@googlegroups.com>\n" "Language-Team: Korean <translation-team-ko@googlegroups.com>\n"
"Language: ko\n" "Language: ko\n"
@ -16,7 +16,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Bugs: Report translation errors to the Language-Team address.\n" "X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.7\n"
#. type: TH #. type: TH
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -580,13 +580,8 @@ msgstr "압축 해제시 B<.lz> 파일만 받아들입니다. 압축은 지원
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18." msgid "The B<.lz> format versions 0 and 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18. B<lzip> 1.4 and later create files in the format version 1."
msgstr "B<.lz> 형식 버전 0과 비확장 버전 1을 지원합니다. 버전 0파일은 B<lzip> 1.3 이전에서만 만듭니다. 일반적이진 않지만 일부 파일의 경우 이 형식과 관련된 원본 패키지로 보관한 파일을 찾을 수도 있습니다. 개인적으로 이 형식으로 압축한 오래된 개인 파일을 가지고 있을 수도 있습니다. 형식 버전 0 압축 해제 지원은 B<lzip> 1.18에서 제거했습니다." msgstr "B<.lz> 형식 버전 0과 1을 지원합니다. 버전 0파일은 B<lzip> 1.3 이전에서만 만듭니다. 일반적이진 않지만 일부 파일의 경우 이 형식의 원본 패키지로 보관한 파일을 찾을 수도 있습니다. 개인적으로 이 형식으로 압축한 오래된 개인 파일을 가지고 있을 수도 있습니다. 형식 버전 0 압축 해제 지원은 B<lzip> 1.18에서 제거했습니다. B<lzip> 1.4 이후의 버전에서는 버전 1 형식 파일을 만듭니다."
#. type: Plain text
#: ../src/xz/xz.1
msgid "B<lzip> 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B<lzip> 1.6. This extension is rarely used and isn't supported by B<xz> (diagnosed as corrupt input)."
msgstr "B<lzip> 1.4 이상에서는 버전 1형식의 파일을 만듭니다. 형식 버전 1로의 동기화 제거 마커 확장은 B<lzip> 1.6에 추가했습니다. 이 확장은 거의 쓰지 않으며 B<xz> 에서 조차도 지원하지 않습니다(손상된 입력 파일로 진단함)."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1

View File

@ -4,7 +4,7 @@
# to get a new .po file. After translating the .po file, run # to get a new .po file. After translating the .po file, run
# "update-po" again to generate the translated man pages. # "update-po" again to generate the translated man pages.
[po4a_langs] de fr it ko pt_BR ro sr uk [po4a_langs] de fr it ko pt_BR ro sr sv uk
[po4a_paths] xz-man.pot $lang:$lang.po [po4a_paths] xz-man.pot $lang:$lang.po
[type: man] ../src/xz/xz.1 $lang:man/$lang/xz.1 add_$lang:?$lang.po.authors [type: man] ../src/xz/xz.1 $lang:man/$lang/xz.1 add_$lang:?$lang.po.authors

View File

@ -15,13 +15,14 @@
# Actualizare a traducerii pentru versiunea 5.6.0-pre2, făcută de R-GC, feb-2024. # Actualizare a traducerii pentru versiunea 5.6.0-pre2, făcută de R-GC, feb-2024.
# Actualizare a traducerii pentru versiunea 5.7.1-dev1, făcută de R-GC, ian-2025. # Actualizare a traducerii pentru versiunea 5.7.1-dev1, făcută de R-GC, ian-2025.
# Actualizare a traducerii pentru versiunea 5.8.0-pre1, făcută de R-GC, mar-2025. # Actualizare a traducerii pentru versiunea 5.8.0-pre1, făcută de R-GC, mar-2025.
# Actualizare a traducerii pentru versiunea 5.8.2-pre1, făcută de R-GC, oct-2025.
# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). # Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul).
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-man 5.8.0-pre1\n" "Project-Id-Version: xz-man 5.8.2-pre1\n"
"POT-Creation-Date: 2025-03-08 14:50+0200\n" "POT-Creation-Date: 2025-10-31 13:23+0200\n"
"PO-Revision-Date: 2025-03-09 20:57+0100\n" "PO-Revision-Date: 2025-10-31 18:03+0100\n"
"Last-Translator: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>\n" "Last-Translator: Remus-Gabriel Chelu <remusgabriel.chelu@disroot.org>\n"
"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n" "Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
"Language: ro\n" "Language: ro\n"
@ -30,7 +31,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: plural=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);\n" "Plural-Forms: plural=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2);\n"
"X-Bugs: Report translation errors to the Language-Team address.\n" "X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.6\n"
#. type: TH #. type: TH
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -600,13 +601,8 @@ msgstr "Acceptă numai fișierele B<.lz> când decomprimă. Comprimarea nu este
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18." msgid "The B<.lz> format versions 0 and 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18. B<lzip> 1.4 and later create files in the format version 1."
msgstr "Formatul B<.lz> versiunea 0 și versiunea neextinsă 1 sunt acceptate. Fișierele versiunea 0 au fost produse de B<lzip> cu versiunea 1.3 sau mai veche. Astfel de fișiere nu sunt obișnuite, dar pot fi găsite în arhivele de fișiere, deoarece câteva pachete sursă au fost lansate în acest format. Oamenii ar putea avea și fișiere personale vechi în acest format. Suportul de decomprimare pentru versiunea de format 0 a fost eliminat în B<lzip> 1.18." msgstr "Sunt acceptate versiunile 0 și 1 ale formatului B<.lz>. Fișierele versiunii 0 au fost create cu B<lzip> 1.3 și versiuni mai vechi. Astfel de fișiere nu sunt comune, dar pot fi găsite în arhivele de fișiere, deoarece câteva pachete sursă au fost lansate în acest format. Este posibil ca oamenii să aibă și fișiere personale vechi în acest format. Suportul pentru decomprimare pentru versiunea 0 a formatului a fost eliminat în B<lzip> 1.18. B<lzip> 1.4 și versiunile ulterioare creează fișiere în versiunea 1 a formatului."
#. type: Plain text
#: ../src/xz/xz.1
msgid "B<lzip> 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B<lzip> 1.6. This extension is rarely used and isn't supported by B<xz> (diagnosed as corrupt input)."
msgstr "B<lzip> 1.4 și versiunile ulterioare creează fișiere în formatul versiunea 1. Extensia „sync flush marker” pentru versiunea 1 de format a fost adăugată în B<lzip> 1.6. Această extensie este folosită rar și nu este acceptată de B<xz> (diagnosticată ca intrare coruptă)."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1

View File

@ -7,9 +7,9 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-man 5.7.1-dev1\n" "Project-Id-Version: xz-man 5.8.2-pre1\n"
"POT-Creation-Date: 2025-03-25 12:28+0200\n" "POT-Creation-Date: 2025-10-31 13:23+0200\n"
"PO-Revision-Date: 2025-03-02 17:46+0100\n" "PO-Revision-Date: 2025-11-02 19:22+0100\n"
"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n" "Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
"Language-Team: Serbian <(nothing)>\n" "Language-Team: Serbian <(nothing)>\n"
"Language: sr\n" "Language: sr\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Bugs: Report translation errors to the Language-Team address.\n" "X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Generator: Poedit 3.5\n" "X-Generator: Poedit 3.6\n"
#. type: TH #. type: TH
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -28,10 +28,9 @@ msgstr "XZ"
#. type: TH #. type: TH
#: ../src/xz/xz.1 #: ../src/xz/xz.1
#, fuzzy, no-wrap #, no-wrap
#| msgid "2025-01-05"
msgid "2025-03-08" msgid "2025-03-08"
msgstr "05.01.2025." msgstr "08.03.2025."
#. type: TH #. type: TH
#: ../src/xz/xz.1 ../src/xzdec/xzdec.1 ../src/lzmainfo/lzmainfo.1 #: ../src/xz/xz.1 ../src/xzdec/xzdec.1 ../src/lzmainfo/lzmainfo.1
@ -583,13 +582,8 @@ msgstr "Прихвата само B<.lz> датотеке приликом ра
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18." msgid "The B<.lz> format versions 0 and 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18. B<lzip> 1.4 and later create files in the format version 1."
msgstr "Формат B<.lz> издање 0 и непроширено издање 1 су подржани. Датотеке издања 0 су настале са B<lzip> 1.3 и старијим. Такве датотеке нису уобичајене али се могу наћи у архивама датотека јер је неколико пакета извора издато у овом формату. Такође можда неко има старе личне датотеке у овом формату. Подршка распакивања за формат издања 0 је уклоњена у B<lzip> 1.18." msgstr "Формат B<.lz> издања 0 и 1 је подржан. Датотеке издања 0 су настале са B<lzip> 1.3 и старијим. Такве датотеке нису уобичајене али се могу наћи у архивама датотека јер је неколико пакета извора издато у овом формату. Такође можда неко има старе личне датотеке у овом формату. Подршка распакивања за формат издања 0 је уклоњена у B<lzip> 1.18. B<lzip> 1.4 и новији ствара датотеке у формату издања 1."
#. type: Plain text
#: ../src/xz/xz.1
msgid "B<lzip> 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B<lzip> 1.6. This extension is rarely used and isn't supported by B<xz> (diagnosed as corrupt input)."
msgstr "B<lzip> 1.4 и новији праве датотеке у формату издања 1. Проширење означавача испирања усклађивања за формат издања 1 додато је у B<lzip> 1.6. Ово проширење се ретко користи и не подржава га B<xz> (препознаје се као оштећени улаз)."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -1561,7 +1555,7 @@ msgstr "B<preset=>I<предподешавање>"
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "Reset all LZMA1 or LZMA2 I<options> to I<preset>. I<Preset> consist of an integer, which may be followed by single-letter preset modifiers. The integer can be from B<0> to B<9>, matching the command line options B<-0> \\&...\\& B<-9>. The only supported modifier is currently B<e>, which matches B<--extreme>. If no B<preset> is specified, the default values of LZMA1 or LZMA2 I<options> are taken from the preset B<6>." msgid "Reset all LZMA1 or LZMA2 I<options> to I<preset>. I<Preset> consist of an integer, which may be followed by single-letter preset modifiers. The integer can be from B<0> to B<9>, matching the command line options B<-0> \\&...\\& B<-9>. The only supported modifier is currently B<e>, which matches B<--extreme>. If no B<preset> is specified, the default values of LZMA1 or LZMA2 I<options> are taken from the preset B<6>."
msgstr "Враћа све LZMA1 или LZMA2 I<опције> на I<предподешеност>. I<Предпдешеност> се састоји од целог броја, за којим може да следи једнословни измењивач предподешености. Цео број може бити од B<0> до B<9>, поклапајући опције линије наредби B<-0> \\&...\\& B<-9>. Једини тренутно подржани измењивач је B<e>, који се поклапа са B<--extreme>. Ако B<предподешеност> није наведена, основне вредности LZMA1 или LZMA2 I<опција> се узимају из предподешености B<6>." msgstr "Враћа све LZMA1 или LZMA2 I<опције> на I<предподешеност>. I<Предпдешеност> се састоји од целог броја, за којим може да следи једнословни измењивач предподешености. Цео број може бити од B<0> до B<9>, поклапајући опције линије наредби B<-0> \\&...\\& B<-9>. Једини тренутно подржани измењивач је B<e>, који се поклапа са B<--extreme>. Ако B<preset> није наведено, основне вредности LZMA1 или LZMA2 I<опција> се узимају из предподешености B<6>."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -2646,7 +2640,7 @@ msgstr "Број датотека. Ту се држи поредак раниј
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "If B<--verbose> was specified twice, additional columns are included on the B<totals> line:" msgid "If B<--verbose> was specified twice, additional columns are included on the B<totals> line:"
msgstr "Ако је B<--verbose> наведено два пута, додатне колоне су укључене у реду B<укупности>:" msgstr "Ако је B<--verbose> наведено два пута, додатне колоне су укључене у реду B<totals>:"
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -2902,7 +2896,7 @@ msgstr "B<xz> обрађује размаком одвојени списак о
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "B<Warning:> By setting these environment variables, one is effectively modifying programs and scripts that run B<xz>. Most of the time it is safe to set memory usage limits, number of threads, and compression options via the environment variables. However, some options can break scripts. An obvious example is B<--help> which makes B<xz> show the help text instead of compressing or decompressing a file. More subtle examples are B<--quiet> and B<--verbose>. In many cases it works well to enable the progress indicator using B<--verbose>, but in some situations the extra messages create problems. The verbosity level also affects the behavior of B<--list>." msgid "B<Warning:> By setting these environment variables, one is effectively modifying programs and scripts that run B<xz>. Most of the time it is safe to set memory usage limits, number of threads, and compression options via the environment variables. However, some options can break scripts. An obvious example is B<--help> which makes B<xz> show the help text instead of compressing or decompressing a file. More subtle examples are B<--quiet> and B<--verbose>. In many cases it works well to enable the progress indicator using B<--verbose>, but in some situations the extra messages create problems. The verbosity level also affects the behavior of B<--list>."
msgstr "" msgstr "B<Упозорење:> Постављањем ових променљивих окружења, ефективно мењате програме и скрипте које покреће B<xz>. У већини случајева је безбедно поставити ограничење коришћења, број нити и опција паковања путем променљивих окружења. Међутим, неке опције могу да уруше скрипте. Очигледан пример је B<--help> која чини да B<xz> прикаже текст помоћи уместо да запакује или распакује датотеку. Суптилнији примери су B<--quiet> и B<--verbose>. У многим случајевима добро функционише омогућавање указивача напредовања коришћењем B<--verbose>, али у неким ситуацијама додатне поруке стварају проблеме. Ниво опширности такође утиче на понашање B<--list>"
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -2912,10 +2906,8 @@ msgstr "B<XZ_DEFAULTS>"
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
#, fuzzy
#| msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B<xz>'s memory usage limiter by default. Excluding shell initialization scripts and similar special cases, scripts must never set or unset B<XZ_DEFAULTS>."
msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B<xz>'s memory usage limiter by default or set the default number of threads. Excluding shell initialization scripts and similar special cases, scripts should never set or unset B<XZ_DEFAULTS>." msgid "User-specific or system-wide default options. Typically this is set in a shell initialization script to enable B<xz>'s memory usage limiter by default or set the default number of threads. Excluding shell initialization scripts and similar special cases, scripts should never set or unset B<XZ_DEFAULTS>."
msgstr "Кориснику специфичне или свеопште системске основне опције. Обично је ово постављено у скрипти покретања конзоле за укључивање B<xz> ограничавача коришћења меморије по основи. Искључивање скрипти покретања конзоле и сличних специјалних случајева, скрипте не смеју никада да поставе или пониште B<XZ_DEFAULTS>." msgstr "Кориснику специфичне или свеопште системске основне опције. Обично је ово постављено у скрипти покретања конзоле за укључивање B<xz> ограничавача коришћења меморије по основи или за постављање основног броја нити. Искључивање скрипти покретања конзоле и сличних специјалних случајева, скрипте не смеју никада да поставе или пониште B<XZ_DEFAULTS>."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1
@ -3591,10 +3583,9 @@ msgstr "XZDIFF"
#. type: TH #. type: TH
#: ../src/scripts/xzdiff.1 ../src/scripts/xzgrep.1 ../src/scripts/xzless.1 #: ../src/scripts/xzdiff.1 ../src/scripts/xzgrep.1 ../src/scripts/xzless.1
#: ../src/scripts/xzmore.1 #: ../src/scripts/xzmore.1
#, fuzzy, no-wrap #, no-wrap
#| msgid "2025-01-05"
msgid "2025-03-06" msgid "2025-03-06"
msgstr "05.01.2025." msgstr "06.03.2025."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
@ -3613,17 +3604,13 @@ msgstr "B<xzdiff> \\&..."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
#, fuzzy
#| msgid "B<lzcmp> \\&..."
msgid "B<lzcmp> \\&... (DEPRECATED)" msgid "B<lzcmp> \\&... (DEPRECATED)"
msgstr "B<lzcmp> \\&..." msgstr "B<lzcmp> \\&... (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
#, fuzzy
#| msgid "B<lzdiff> \\&..."
msgid "B<lzdiff> \\&... (DEPRECATED)" msgid "B<lzdiff> \\&... (DEPRECATED)"
msgstr "B<lzdiff> \\&..." msgstr "B<lzdiff> \\&... (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
@ -3642,10 +3629,8 @@ msgstr "Ако је достављен само један назив датот
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
#, fuzzy
#| msgid "The commands B<lzcmp> and B<lzdiff> are provided for backward compatibility with LZMA Utils."
msgid "The commands B<lzcmp> and B<lzdiff> are provided for backward compatibility with LZMA Utils. They are deprecated and will be removed in a future version." msgid "The commands B<lzcmp> and B<lzdiff> are provided for backward compatibility with LZMA Utils. They are deprecated and will be removed in a future version."
msgstr "Наредбе B<lzcmp> и B<lzdiff> се достављају зарад назадне сагласности са LZMA Utils." msgstr "Наредбе B<lzcmp> и B<lzdiff> се достављају зарад назадне сагласности са LZMA Utils. Застареле су и биће уклоњене у будућем издању."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzdiff.1 #: ../src/scripts/xzdiff.1
@ -3685,29 +3670,23 @@ msgstr "B<xzfgrep> \\&..."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
#, fuzzy
#| msgid "B<lzgrep> \\&..."
msgid "B<lzgrep> \\&... (DEPRECATED)" msgid "B<lzgrep> \\&... (DEPRECATED)"
msgstr "B<lzgrep> \\&..." msgstr "B<lzgrep> \\&... (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
#, fuzzy
#| msgid "B<lzegrep> \\&..."
msgid "B<lzegrep> \\&... (DEPRECATED)" msgid "B<lzegrep> \\&... (DEPRECATED)"
msgstr "B<lzegrep> \\&..." msgstr "B<lzegrep> \\&... (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
#, fuzzy
#| msgid "B<lzfgrep> \\&..."
msgid "B<lzfgrep> \\&... (DEPRECATED)" msgid "B<lzfgrep> \\&... (DEPRECATED)"
msgstr "B<lzfgrep> \\&..." msgstr "B<lzfgrep> \\&... (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
msgid "B<xzgrep> invokes B<grep>(1) on uncompressed contents of files. The formats of the I<files> are determined from the filename suffixes. Any I<file> with a suffix supported by B<xz>(1), B<gzip>(1), B<bzip2>(1), B<lzop>(1), B<zstd>(1), or B<lz4>(1) will be decompressed; all other files are assumed to be uncompressed." msgid "B<xzgrep> invokes B<grep>(1) on uncompressed contents of files. The formats of the I<files> are determined from the filename suffixes. Any I<file> with a suffix supported by B<xz>(1), B<gzip>(1), B<bzip2>(1), B<lzop>(1), B<zstd>(1), or B<lz4>(1) will be decompressed; all other files are assumed to be uncompressed."
msgstr "B<xzgrep> призива B<grep>(1) на незапакованим садржајима датотека. Формати I<датотека> се одређују из суфикса назива датотека. Било која I<датотека> са суфиксом подржаним од стране B<xz>(1), B<gzip>(1), B<bzip2>(1), B<lzop>(1), B<zstd>(1) или B<lz4>(1) биће распакована; све остале датотеке се подразумевају да нису запаковане" msgstr "B<xzgrep> призива B<grep>(1) на незапакованим садржајима датотека. Формати I<датотека> се одређују из суфикса назива датотека. Било која I<датотека> са суфиксом подржаним од стране B<xz>(1), B<gzip>(1), B<bzip2>(1), B<lzop>(1), B<zstd>(1) или B<lz4>(1) биће распакована; све остале датотеке се подразумевају да нису запаковане."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
@ -3771,10 +3750,8 @@ msgstr "B<xzegrep> је алијас за B<xzgrep -E>. B<xzfgrep> је али
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
#, fuzzy
#| msgid "The commands B<lzgrep>, B<lzegrep>, and B<lzfgrep> are provided for backward compatibility with LZMA Utils."
msgid "The commands B<lzgrep>, B<lzegrep>, and B<lzfgrep> are provided for backward compatibility with LZMA Utils. They are deprecated and will be removed in a future version." msgid "The commands B<lzgrep>, B<lzegrep>, and B<lzfgrep> are provided for backward compatibility with LZMA Utils. They are deprecated and will be removed in a future version."
msgstr "Наредбе B<lzgrep>, B<lzegrep> и B<lzfgrep> се достављају зарад назадне сагласности са LZMA Utils." msgstr "Наредбе B<lzgrep>, B<lzegrep> и B<lzfgrep> се достављају зарад назадне сагласности са LZMA Utils. Застареле су и биће уклоњене у будућем издању."
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzgrep.1 #: ../src/scripts/xzgrep.1
@ -3831,10 +3808,8 @@ msgstr "B<xzless> [I<датотека>...]"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzless.1 #: ../src/scripts/xzless.1
#, fuzzy
#| msgid "B<lzless> [I<file>...]"
msgid "B<lzless> [I<file>...] (DEPRECATED)" msgid "B<lzless> [I<file>...] (DEPRECATED)"
msgstr "B<lzless> [I<датотека>...]" msgstr "B<lzless> [I<датотека>...] (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzless.1 #: ../src/scripts/xzless.1
@ -3848,10 +3823,8 @@ msgstr "B<xzless> користи B<less>(1) да представи свој и
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzless.1 #: ../src/scripts/xzless.1
#, fuzzy
#| msgid "The command named B<lzless> is provided for backward compatibility with LZMA Utils."
msgid "The command named B<lzless> is provided for backward compatibility with LZMA Utils. It is deprecated and will be removed in a future version." msgid "The command named B<lzless> is provided for backward compatibility with LZMA Utils. It is deprecated and will be removed in a future version."
msgstr "Наредба B<lzless> се доставља зарад назадне сагласности са LZMA Utils." msgstr "Наредба B<lzless> се доставља зарад назадне сагласности са LZMA Utils. Застарела је и биће уклоњена у будућем издању."
#. type: TP #. type: TP
#: ../src/scripts/xzless.1 #: ../src/scripts/xzless.1
@ -3898,10 +3871,8 @@ msgstr "B<xzmore> [I<датотека>...]"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzmore.1 #: ../src/scripts/xzmore.1
#, fuzzy
#| msgid "B<lzmore> [I<file>...]"
msgid "B<lzmore> [I<file>...] (DEPRECATED)" msgid "B<lzmore> [I<file>...] (DEPRECATED)"
msgstr "B<lzmore> [I<датотека>...]" msgstr "B<lzmore> [I<датотека>...] (ЗАСТАРЕЛО)"
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzmore.1 #: ../src/scripts/xzmore.1
@ -3915,10 +3886,8 @@ msgstr "Знајте да клизање уназад можда неће бит
#. type: Plain text #. type: Plain text
#: ../src/scripts/xzmore.1 #: ../src/scripts/xzmore.1
#, fuzzy
#| msgid "The command B<lzmore> is provided for backward compatibility with LZMA Utils."
msgid "The command B<lzmore> is provided for backward compatibility with LZMA Utils. It is deprecated and will be removed in a future version." msgid "The command B<lzmore> is provided for backward compatibility with LZMA Utils. It is deprecated and will be removed in a future version."
msgstr "Наредба B<lzmore> се доставља зарад назадне сагласности са LZMA Utils." msgstr "Наредба B<lzmore> се доставља зарад назадне сагласности са LZMA Utils. Застарела је и биће уклоњена у будућем издању."
#. TRANSLATORS: Don't translate the uppercase PAGER. #. TRANSLATORS: Don't translate the uppercase PAGER.
#. It is a name of an environment variable. #. It is a name of an environment variable.

3904
po4a/sv.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@
# Yuri Chornoivan <yurchor@ukr.net>, 2019, 2022, 2023, 2024, 2025. # Yuri Chornoivan <yurchor@ukr.net>, 2019, 2022, 2023, 2024, 2025.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: xz-man-5.8.0-pre1\n" "Project-Id-Version: xz-man-5.8.2-pre1\n"
"POT-Creation-Date: 2025-03-08 14:50+0200\n" "POT-Creation-Date: 2025-10-31 13:23+0200\n"
"PO-Revision-Date: 2025-03-09 20:04+0200\n" "PO-Revision-Date: 2025-10-31 20:48+0200\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n" "Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
"Language: uk\n" "Language: uk\n"
@ -582,13 +582,8 @@ msgstr "Приймати лише файли B<.lz> при розпакуван
#. type: Plain text #. type: Plain text
#: ../src/xz/xz.1 #: ../src/xz/xz.1
msgid "The B<.lz> format version 0 and the unextended version 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18." msgid "The B<.lz> format versions 0 and 1 are supported. Version 0 files were produced by B<lzip> 1.3 and older. Such files aren't common but may be found from file archives as a few source packages were released in this format. People might have old personal files in this format too. Decompression support for the format version 0 was removed in B<lzip> 1.18. B<lzip> 1.4 and later create files in the format version 1."
msgstr "Передбачено підтримку версії формату B<.lz> 0 та нерозширеної версії 1. Файли версії 0 було створено B<lzip> 1.3 та старішими версіями. Такі файли не є поширеними, але їх можна знайти у файлових архівах, оскільки певну незначну кількість пакунків із початковим кодом було випущено у цьому форматі. Також можуть існувати особисті файли у цьому форматі. Підтримку розпаковування для формату версії 0 було вилучено у B<lzip> 1.18." msgstr "Передбачено підтримку версії формату B<.lz> 0 та 1. Файли версії 0 було створено B<lzip> 1.3 та старішими версіями. Такі файли не є поширеними, але їх можна знайти у файлових архівах, оскільки певну незначну кількість пакунків із початковим кодом було випущено у цьому форматі. Також можуть існувати особисті файли у цьому форматі. Підтримку розпаковування для формату версії 0 було вилучено у B<lzip> 1.18. Версія B<lzip> 1.4 і новіші версії створюють файли у форматі версії 1."
#. type: Plain text
#: ../src/xz/xz.1
msgid "B<lzip> 1.4 and later create files in the format version 1. The sync flush marker extension to the format version 1 was added in B<lzip> 1.6. This extension is rarely used and isn't supported by B<xz> (diagnosed as corrupt input)."
msgstr "B<lzip> 1.4 і пізніші версії створюють файли у форматі версії 1. Розширення синхронізації позначки витирання до формату версії 1 було додано у B<lzip> 1.6. Це розширення використовують не часто, його підтримки у B<xz> не передбачено (програма повідомлятиме про пошкоджені вхідні дані)."
#. type: TP #. type: TP
#: ../src/xz/xz.1 #: ../src/xz/xz.1

View File

@ -82,7 +82,7 @@ po4a --force --verbose \
# Remove the *.po.authors files that were generated above. # Remove the *.po.authors files that were generated above.
# This way they won't get included in distribution tarballs. # This way they won't get included in distribution tarballs.
rm -f *.po.authors rm -f -- *.po.authors
# Add the customized POT header which contains the SPDX license # Add the customized POT header which contains the SPDX license
# identifier and spells out the license name instead of saying # identifier and spells out the license name instead of saying

View File

@ -4,6 +4,10 @@
// //
/// \file my_landlock.h /// \file my_landlock.h
/// \brief Linux Landlock sandbox helper functions /// \brief Linux Landlock sandbox helper functions
///
/// \note This uses static variables to cache the Landlock ABI version.
/// Only one file in an application should include this header.
/// Only one thread should call these functions.
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
@ -17,6 +21,7 @@
#include <linux/landlock.h> #include <linux/landlock.h>
#include <sys/syscall.h> #include <sys/syscall.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/utsname.h>
/// \brief Initialize Landlock ruleset attributes to forbid everything /// \brief Initialize Landlock ruleset attributes to forbid everything
@ -32,8 +37,38 @@ my_landlock_ruleset_attr_forbid_all(struct landlock_ruleset_attr *attr)
{ {
memzero(attr, sizeof(*attr)); memzero(attr, sizeof(*attr));
const int abi_version = syscall(SYS_landlock_create_ruleset, // Cache the Landlock ABI version:
// 0 = not checked yet
// -1 = Landlock not supported
// >0 = Landlock ABI version
static int abi_version = 0;
#ifdef LANDLOCK_SCOPE_SIGNAL
// Red Hat Enterprise Linux 9 kernel since 5.14.0-603.el9 (2025-07-30)
// claims ABI version 6 support, but as of 5.14.0-643.el9 (2025-11-22)
// it lacks LANDLOCK_SCOPE_SIGNAL. ABI version 6 was added in upstream
// Linux 6.12 while RHEL 9 has Linux 5.14 with lots of backports.
// We assume that any kernel version 5.14 with ABI version 6 is buggy.
static bool is_rhel9 = false;
#endif
if (abi_version == 0) {
abi_version = syscall(SYS_landlock_create_ruleset,
(void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION); (void *)NULL, 0, LANDLOCK_CREATE_RULESET_VERSION);
#ifdef LANDLOCK_SCOPE_SIGNAL
if (abi_version == 6) {
static const char rel[] = "5.14.";
const size_t rel_len = sizeof(rel) - 1;
struct utsname un;
if (uname(&un) == 0 && strncmp(
un.release, rel, rel_len) == 0)
is_rhel9 = true;
}
#endif
}
if (abi_version <= 0) if (abi_version <= 0)
return -1; return -1;
@ -109,6 +144,14 @@ my_landlock_ruleset_attr_forbid_all(struct landlock_ruleset_attr *attr)
#endif #endif
FALLTHROUGH; FALLTHROUGH;
case 6:
#ifdef LANDLOCK_SCOPE_SIGNAL
if (is_rhel9)
attr->scoped &= ~LANDLOCK_SCOPE_SIGNAL;
#endif
FALLTHROUGH;
default: default:
// We only know about the features of the ABIs 1-6. // We only know about the features of the ABIs 1-6.
break; break;

View File

@ -78,7 +78,8 @@ do { \
} while (0) } while (0)
#if !(defined(_WIN32) && !defined(__CYGWIN__)) && !defined(__wasm__) #if !(defined(_WIN32) && !defined(__CYGWIN__)) \
&& (!defined(__wasm__) || defined(__EMSCRIPTEN__))
// Use sigprocmask() to set the signal mask in single-threaded programs. // Use sigprocmask() to set the signal mask in single-threaded programs.
#include <signal.h> #include <signal.h>

View File

@ -172,7 +172,9 @@ typedef unsigned char _Bool;
#if __STDC_VERSION__ >= 202311 #if __STDC_VERSION__ >= 202311
// alignas is a keyword in C23. Do nothing. // alignas is a keyword in C23. Do nothing.
#elif __STDC_VERSION__ >= 201112 #elif __STDC_VERSION__ >= 201112
# include <stdalign.h> // Oracle Developer Studio 12.6 lacks <stdalign.h>.
// For simplicity, avoid the header with all C11/C17 compilers.
# define alignas _Alignas
#elif defined(__GNUC__) || defined(__clang__) #elif defined(__GNUC__) || defined(__clang__)
# define alignas(n) __attribute__((__aligned__(n))) # define alignas(n) __attribute__((__aligned__(n)))
#else #else

View File

@ -20,15 +20,17 @@ liblzma_la_CPPFLAGS = \
-I$(top_srcdir)/src/liblzma/simple \ -I$(top_srcdir)/src/liblzma/simple \
-I$(top_srcdir)/src/common \ -I$(top_srcdir)/src/common \
-DTUKLIB_SYMBOL_PREFIX=lzma_ -DTUKLIB_SYMBOL_PREFIX=lzma_
liblzma_la_LDFLAGS = -no-undefined -version-info 13:0:8 liblzma_la_LDFLAGS = -no-undefined -version-info 13:2:8
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
if COND_SYMVERS_GENERIC if COND_SYMVERS_GENERIC
liblzma_la_LDFLAGS += \ liblzma_la_LDFLAGS += \
$(LINKER_FLAG_UNDEFINED_VERSION) \
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_generic.map -Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_generic.map
endif endif
if COND_SYMVERS_LINUX if COND_SYMVERS_LINUX
liblzma_la_LDFLAGS += \ liblzma_la_LDFLAGS += \
$(LINKER_FLAG_UNDEFINED_VERSION) \
-Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_linux.map -Wl,--version-script=$(top_srcdir)/src/liblzma/liblzma_linux.map
endif endif

View File

@ -450,7 +450,9 @@ typedef struct {
* \param opaque lzma_allocator.opaque (see below) * \param opaque lzma_allocator.opaque (see below)
* \param ptr Pointer returned by lzma_allocator.alloc(), * \param ptr Pointer returned by lzma_allocator.alloc(),
* or when it is set to NULL, a pointer returned * or when it is set to NULL, a pointer returned
* by the standard malloc(). * by the standard malloc(). In addition, NULL
* is a possible value. The function should do
* nothing when ptr == NULL.
*/ */
void (LZMA_API_CALL *free)(void *opaque, void *ptr); void (LZMA_API_CALL *free)(void *opaque, void *ptr);
@ -561,7 +563,7 @@ typedef struct {
* \brief New seek input position for LZMA_SEEK_NEEDED * \brief New seek input position for LZMA_SEEK_NEEDED
* *
* When lzma_code() returns LZMA_SEEK_NEEDED, the new input position * When lzma_code() returns LZMA_SEEK_NEEDED, the new input position
* needed by liblzma will be available seek_pos. The value is * needed by liblzma will be available in seek_pos. The value is
* guaranteed to not exceed the file size that was specified when * guaranteed to not exceed the file size that was specified when
* this lzma_stream was initialized. * this lzma_stream was initialized.
* *

View File

@ -843,8 +843,7 @@ extern LZMA_API(lzma_ret) lzma_alone_decoder(
/** /**
* \brief Initialize .lz (lzip) decoder (a foreign file format) * \brief Initialize .lz (lzip) decoder (a foreign file format)
* *
* This decoder supports the .lz format version 0 and the unextended .lz * This decoder supports the .lz format versions 0 and 1:
* format version 1:
* *
* - Files in the format version 0 were produced by lzip 1.3 and older. * - Files in the format version 0 were produced by lzip 1.3 and older.
* Such files aren't common but may be found from file archives * Such files aren't common but may be found from file archives
@ -853,28 +852,27 @@ extern LZMA_API(lzma_ret) lzma_alone_decoder(
* support for the format version 0 was removed in lzip 1.18. * support for the format version 0 was removed in lzip 1.18.
* *
* - lzip 1.3 added decompression support for .lz format version 1 files. * - lzip 1.3 added decompression support for .lz format version 1 files.
* Compression support was added in lzip 1.4. In lzip 1.6 the .lz format * Compression support was added in lzip 1.4.
* version 1 was extended to support the Sync Flush marker. This extension *
* is not supported by liblzma. lzma_code() will return LZMA_DATA_ERROR * - lzlib extends version 1 format with the Sync Flush marker. This
* at the location of the Sync Flush marker. In practice files with * extension is only meant for lzlib use; it's not valid in normal .lz
* the Sync Flush marker are very rare and thus liblzma can decompress * files. This extension is not supported by liblzma. lzma_code() will
* almost all .lz files. * return LZMA_DATA_ERROR at the location of the Sync Flush marker.
* *
* Just like with lzma_stream_decoder() for .xz files, LZMA_CONCATENATED * Just like with lzma_stream_decoder() for .xz files, LZMA_CONCATENATED
* should be used when decompressing normal standalone .lz files. * should be used when decompressing normal standalone .lz files.
* *
* The .lz format allows putting non-.lz data at the end of a file after at * If LZMA_CONCATENATED is used and there is non-.lz data after at least one
* least one valid .lz member. That is, one can append custom data at the end * valid .lz member, lzma_code() leaves lzma_stream.next_in pointing to the
* of a .lz file and the decoder is required to ignore it. In liblzma this * first byte of the non-.lz data and returns LZMA_STREAM_END. That is, one
* is relevant only when LZMA_CONCATENATED is used. In that case lzma_code() * can append custom data at the end of a .lz file and the decoder will
* will return LZMA_STREAM_END and leave lzma_stream.next_in pointing to * ignore it. An exception to this is if the first 1-3 bytes of the non-.lz
* the first byte of the non-.lz data. An exception to this is if the first * data are identical to the .lz magic bytes (0x4C, 0x5A, 0x49, 0x50; "LZIP"
* 1-3 bytes of the non-.lz data are identical to the .lz magic bytes * in US-ASCII). In such a case the 1-3 bytes are consumed by lzma_code().
* (0x4C, 0x5A, 0x49, 0x50; "LZIP" in US-ASCII). In such a case the 1-3 bytes * If one wishes to locate the non-.lz data reliably, one must ensure that
* will have been ignored by lzma_code(). If one wishes to locate the non-.lz * the first byte isn't 0x4C. It's best if none of the first four bytes of
* data reliably, one must ensure that the first byte isn't 0x4C. Actually * trailing data are equal to the magic bytes because if two or three bytes
* one should ensure that none of the first four bytes of trailing data are * are, lzip >= 1.20 diagnoses it as a corrupt member header by default.
* equal to the magic bytes because lzip >= 1.20 requires it by default.
* *
* \param strm Pointer to lzma_stream that is at least initialized * \param strm Pointer to lzma_stream that is at least initialized
* with LZMA_STREAM_INIT. * with LZMA_STREAM_INIT.

View File

@ -22,7 +22,7 @@
#define LZMA_VERSION_MINOR 8 #define LZMA_VERSION_MINOR 8
/** \brief Patch version number of the liblzma release. */ /** \brief Patch version number of the liblzma release. */
#define LZMA_VERSION_PATCH 0 #define LZMA_VERSION_PATCH 2
/** /**
* \brief Version stability marker * \brief Version stability marker

View File

@ -23,7 +23,8 @@
// If both versions are going to be built, we need runtime detection // If both versions are going to be built, we need runtime detection
// to check if the instructions are supported. // to check if the instructions are supported.
#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED) #if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
# if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO) # if (defined(HAVE_GETAUXVAL) && defined(HAVE_HWCAP_CRC32)) \
|| defined(HAVE_ELF_AUX_INFO)
# include <sys/auxv.h> # include <sys/auxv.h>
# elif defined(_WIN32) # elif defined(_WIN32)
# include <processthreadsapi.h> # include <processthreadsapi.h>
@ -103,7 +104,7 @@ crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
static inline bool static inline bool
is_arch_extension_supported(void) is_arch_extension_supported(void)
{ {
#if defined(HAVE_GETAUXVAL) #if defined(HAVE_GETAUXVAL) && defined(HAVE_HWCAP_CRC32)
return (getauxval(AT_HWCAP) & HWCAP_CRC32) != 0; return (getauxval(AT_HWCAP) & HWCAP_CRC32) != 0;
#elif defined(HAVE_ELF_AUX_INFO) #elif defined(HAVE_ELF_AUX_INFO)

View File

@ -2,7 +2,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file crc32.c /// \file crc32_fast.c
/// \brief CRC32 calculation /// \brief CRC32 calculation
// //
// Authors: Lasse Collin // Authors: Lasse Collin

View File

@ -2,7 +2,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// //
/// \file crc64.c /// \file crc64_fast.c
/// \brief CRC64 calculation /// \brief CRC64 calculation
// //
// Authors: Lasse Collin // Authors: Lasse Collin
@ -146,14 +146,6 @@ crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc)
extern LZMA_API(uint64_t) extern LZMA_API(uint64_t)
lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
{ {
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__clang__) \
&& defined(_M_IX86) && defined(CRC64_ARCH_OPTIMIZED)
// VS2015-2022 might corrupt the ebx register on 32-bit x86 when
// the CLMUL code is enabled. This hack forces MSVC to store and
// restore ebx. This is only needed here, not in lzma_crc32().
__asm mov ebx, ebx
#endif
#if defined(CRC64_GENERIC) && defined(CRC64_ARCH_OPTIMIZED) #if defined(CRC64_GENERIC) && defined(CRC64_ARCH_OPTIMIZED)
return crc64_func(buf, size, crc); return crc64_func(buf, size, crc);

View File

@ -89,7 +89,8 @@ extern const uint64_t lzma_crc64_table[4][256];
// ARM64 // ARM64
// //
// Keep this in sync with changes to crc32_arm64.h // Keep this in sync with changes to crc32_arm64.h
#if defined(_WIN32) || defined(HAVE_GETAUXVAL) \ #if defined(_WIN32) \
|| (defined(HAVE_GETAUXVAL) && defined(HAVE_HWCAP_CRC32)) \
|| defined(HAVE_ELF_AUX_INFO) \ || defined(HAVE_ELF_AUX_INFO) \
|| (defined(__APPLE__) && defined(HAVE_SYSCTLBYNAME)) || (defined(__APPLE__) && defined(HAVE_SYSCTLBYNAME))
# define CRC_ARM64_RUNTIME_DETECTION 1 # define CRC_ARM64_RUNTIME_DETECTION 1
@ -134,10 +135,20 @@ extern const uint64_t lzma_crc64_table[4][256];
// built and runtime detection is used even if compiler flags // built and runtime detection is used even if compiler flags
// were set to allow CLMUL unconditionally. // were set to allow CLMUL unconditionally.
// //
// - This doesn't work with MSVC as I don't know how to detect // - The unconditional use doesn't work with MSVC as I don't know
// the features here. // how to detect the features here.
// //
# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__) \ // Don't enable CLMUL at all on old MSVC that targets 32-bit x86.
// There seems to be a compiler bug that produces broken code
// in optimized (Release) builds. It results in crashing tests.
// It is known that VS 2019 16.11 (MSVC 19.29.30158) is broken
// and that VS 2022 17.13 (MSVC 19.43.34808) works.
# if defined(_MSC_FULL_VER) && _MSC_FULL_VER < 194334808 \
&& !defined(__INTEL_COMPILER) && !defined(__clang__) \
&& defined(_M_IX86)
// Old MSVC targeting 32-bit x86: Don't enable CLMUL at all.
# elif (defined(__SSSE3__) && defined(__SSE4_1__) \
&& defined(__PCLMUL__) \
&& !defined(HAVE_CRC_X86_ASM)) \ && !defined(HAVE_CRC_X86_ASM)) \
|| (defined(__e2k__) && __iset__ >= 6) || (defined(__e2k__) && __iset__ >= 6)
# define CRC32_ARCH_OPTIMIZED 1 # define CRC32_ARCH_OPTIMIZED 1

View File

@ -128,8 +128,10 @@ alone_decode(void *coder_ptr, const lzma_allocator *allocator,
lzma_set_ext_size(coder->options, coder->uncompressed_size); lzma_set_ext_size(coder->options, coder->uncompressed_size);
// Calculate the memory usage so that it is ready // Calculate the memory usage so that it is ready
// for SEQ_CODER_INIT. // for SEQ_CODER_INIT. We know that lc/lp/pb are valid
coder->memusage = lzma_lzma_decoder_memusage(&coder->options) // so we can use the _nocheck variant.
coder->memusage
= lzma_lzma_decoder_memusage_nocheck(&coder->options)
+ LZMA_MEMUSAGE_BASE; + LZMA_MEMUSAGE_BASE;
coder->pos = 0; coder->pos = 0;

View File

@ -96,6 +96,12 @@ lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
size_t in_size, uint8_t *restrict out, size_t in_size, uint8_t *restrict out,
size_t *restrict out_pos, size_t out_size) size_t *restrict out_pos, size_t out_size)
{ {
assert(in != NULL || *in_pos == in_size);
assert(out != NULL || *out_pos == out_size);
assert(*in_pos <= in_size);
assert(*out_pos <= out_size);
const size_t in_avail = in_size - *in_pos; const size_t in_avail = in_size - *in_pos;
const size_t out_avail = out_size - *out_pos; const size_t out_avail = out_size - *out_pos;
const size_t copy_size = my_min(in_avail, out_avail); const size_t copy_size = my_min(in_avail, out_avail);

View File

@ -213,8 +213,8 @@ lzma_filters_copy(const lzma_filter *src, lzma_filter *real_dest,
error: error:
// Free the options which we have already allocated. // Free the options which we have already allocated.
while (i-- > 0) while (i > 0)
lzma_free(dest[i].options, allocator); lzma_free(dest[--i].options, allocator);
return ret; return ret;
} }

View File

@ -212,7 +212,8 @@ lzip_decode(void *coder_ptr, const lzma_allocator *allocator,
coder->options.pb = LZIP_PB; coder->options.pb = LZIP_PB;
// Calculate the memory usage. // Calculate the memory usage.
coder->memusage = lzma_lzma_decoder_memusage(&coder->options) coder->memusage
= lzma_lzma_decoder_memusage_nocheck(&coder->options)
+ LZMA_MEMUSAGE_BASE; + LZMA_MEMUSAGE_BASE;
// Initialization is a separate step because if we return // Initialization is a separate step because if we return

View File

@ -188,6 +188,7 @@ extern bool lzma_outq_is_readable(const lzma_outq *outq);
/// \brief Read finished data /// \brief Read finished data
/// ///
/// \param outq Pointer to an output queue /// \param outq Pointer to an output queue
/// \param allocator lzma_allocator for custom allocator functions
/// \param out Beginning of the output buffer /// \param out Beginning of the output buffer
/// \param out_pos The next byte will be written to /// \param out_pos The next byte will be written to
/// out[*out_pos]. /// out[*out_pos].

View File

@ -23,41 +23,16 @@ typedef enum {
THR_IDLE, THR_IDLE,
/// Decoding is in progress. /// Decoding is in progress.
/// Main thread may change this to THR_STOP or THR_EXIT. /// Main thread may change this to THR_IDLE or THR_EXIT.
/// The worker thread may change this to THR_IDLE. /// The worker thread may change this to THR_IDLE.
THR_RUN, THR_RUN,
/// The main thread wants the thread to stop whatever it was doing
/// but not exit. Main thread may change this to THR_EXIT.
/// The worker thread may change this to THR_IDLE.
THR_STOP,
/// The main thread wants the thread to exit. /// The main thread wants the thread to exit.
THR_EXIT, THR_EXIT,
} worker_state; } worker_state;
typedef enum {
/// Partial updates (storing of worker thread progress
/// to lzma_outbuf) are disabled.
PARTIAL_DISABLED,
/// Main thread requests partial updates to be enabled but
/// no partial update has been done by the worker thread yet.
///
/// Changing from PARTIAL_DISABLED to PARTIAL_START requires
/// use of the worker-thread mutex. Other transitions don't
/// need a mutex.
PARTIAL_START,
/// Partial updates are enabled and the worker thread has done
/// at least one partial update.
PARTIAL_ENABLED,
} partial_update_mode;
struct worker_thread { struct worker_thread {
/// Worker state is protected with our mutex. /// Worker state is protected with our mutex.
worker_state state; worker_state state;
@ -109,10 +84,18 @@ struct worker_thread {
/// happen if all worker threads were frequently locking the main /// happen if all worker threads were frequently locking the main
/// mutex to update their outbuf->pos. /// mutex to update their outbuf->pos.
/// ///
/// Only when partial_update is something else than PARTIAL_DISABLED, /// When partial_update_enabled is true, this worker thread will
/// this worker thread will update outbuf->pos after each call to /// update outbuf->pos and outbuf->decoder_in_pos after each call
/// the Block decoder. /// to the Block decoder. This is initially false. Main thread may
partial_update_mode partial_update; /// set this to true.
bool partial_update_enabled;
/// Once the main thread has set partial_updated_enabled = true,
/// we will do the first partial update as soon as we can and
/// set partial_update_started = true. After the first update,
/// we only update if we have made progress. This avoids useless
/// locking of thr->coder->mutex.
bool partial_update_started;
/// Block decoder /// Block decoder
lzma_next_coder block_decoder; lzma_next_coder block_decoder;
@ -340,39 +323,18 @@ worker_enable_partial_update(void *thr_ptr)
struct worker_thread *thr = thr_ptr; struct worker_thread *thr = thr_ptr;
mythread_sync(thr->mutex) { mythread_sync(thr->mutex) {
thr->partial_update = PARTIAL_START; thr->partial_update_enabled = true;
mythread_cond_signal(&thr->cond); mythread_cond_signal(&thr->cond);
} }
} }
/// Things do to at THR_STOP or when finishing a Block.
/// This is called with thr->mutex locked.
static void
worker_stop(struct worker_thread *thr)
{
// Update memory usage counters.
thr->coder->mem_in_use -= thr->in_size;
thr->in_size = 0; // thr->in was freed above.
thr->coder->mem_in_use -= thr->mem_filters;
thr->coder->mem_cached += thr->mem_filters;
// Put this thread to the stack of free threads.
thr->next = thr->coder->threads_free;
thr->coder->threads_free = thr;
mythread_cond_signal(&thr->coder->cond);
return;
}
static MYTHREAD_RET_TYPE static MYTHREAD_RET_TYPE
worker_decoder(void *thr_ptr) worker_decoder(void *thr_ptr)
{ {
struct worker_thread *thr = thr_ptr; struct worker_thread *thr = thr_ptr;
size_t in_filled; size_t in_filled;
partial_update_mode partial_update; bool partial_update_enabled;
lzma_ret ret; lzma_ret ret;
next_loop_lock: next_loop_lock:
@ -397,17 +359,6 @@ next_loop_unlocked:
return MYTHREAD_RET_VALUE; return MYTHREAD_RET_VALUE;
} }
if (thr->state == THR_STOP) {
thr->state = THR_IDLE;
mythread_mutex_unlock(&thr->mutex);
mythread_sync(thr->coder->mutex) {
worker_stop(thr);
}
goto next_loop_lock;
}
assert(thr->state == THR_RUN); assert(thr->state == THR_RUN);
// Update progress info for get_progress(). // Update progress info for get_progress().
@ -415,14 +366,16 @@ next_loop_unlocked:
thr->progress_out = thr->out_pos; thr->progress_out = thr->out_pos;
// If we don't have any new input, wait for a signal from the main // If we don't have any new input, wait for a signal from the main
// thread except if partial output has just been enabled. In that // thread except if partial output has just been enabled
// (partial_update_enabled is true but _started is false). In that
// case we will do one normal run so that the partial output info // case we will do one normal run so that the partial output info
// gets passed to the main thread. The call to block_decoder.code() // gets passed to the main thread. The call to block_decoder.code()
// is useless but harmless as it can occur only once per Block. // is useless but harmless as it can occur only once per Block.
in_filled = thr->in_filled; in_filled = thr->in_filled;
partial_update = thr->partial_update; partial_update_enabled = thr->partial_update_enabled;
if (in_filled == thr->in_pos && partial_update != PARTIAL_START) { if (in_filled == thr->in_pos && !(partial_update_enabled
&& !thr->partial_update_started)) {
mythread_cond_wait(&thr->cond, &thr->mutex); mythread_cond_wait(&thr->cond, &thr->mutex);
goto next_loop_unlocked; goto next_loop_unlocked;
} }
@ -444,23 +397,21 @@ next_loop_unlocked:
thr->outbuf->allocated, LZMA_RUN); thr->outbuf->allocated, LZMA_RUN);
if (ret == LZMA_OK) { if (ret == LZMA_OK) {
if (partial_update != PARTIAL_DISABLED) { if (partial_update_enabled) {
// The main thread uses thr->mutex to change from // Remember that we have done at least one partial
// PARTIAL_DISABLED to PARTIAL_START. The main thread // update. After the first update we won't do updates
// doesn't care about this variable after that so we // unless we have made progress.
// can safely change it here to PARTIAL_ENABLED thr->partial_update_started = true;
// without a mutex.
thr->partial_update = PARTIAL_ENABLED;
// The main thread is reading decompressed data // The main thread is reading decompressed data
// from thr->outbuf. Tell the main thread about // from thr->outbuf. Tell the main thread about
// our progress. // our progress.
// //
// NOTE: It's possible that we consumed input without // NOTE: It's possible that we consumed input without
// producing any new output so it's possible that // producing any new output so it's possible that only
// only in_pos has changed. In case of PARTIAL_START // in_pos has changed. If thr->partial_update_started
// it is possible that neither in_pos nor out_pos has // was false, it is possible that neither in_pos nor
// changed. // out_pos has changed.
mythread_sync(thr->coder->mutex) { mythread_sync(thr->coder->mutex) {
thr->outbuf->pos = thr->out_pos; thr->outbuf->pos = thr->out_pos;
thr->outbuf->decoder_in_pos = thr->in_pos; thr->outbuf->decoder_in_pos = thr->in_pos;
@ -472,8 +423,7 @@ next_loop_unlocked:
} }
// Either we finished successfully (LZMA_STREAM_END) or an error // Either we finished successfully (LZMA_STREAM_END) or an error
// occurred. Both cases are handled almost identically. The error // occurred.
// case requires updating thr->coder->thread_error.
// //
// The sizes are in the Block Header and the Block decoder // The sizes are in the Block Header and the Block decoder
// checks that they match, thus we know these: // checks that they match, thus we know these:
@ -481,16 +431,30 @@ next_loop_unlocked:
assert(ret != LZMA_STREAM_END assert(ret != LZMA_STREAM_END
|| thr->out_pos == thr->block_options.uncompressed_size); || thr->out_pos == thr->block_options.uncompressed_size);
// Free the input buffer. Don't update in_size as we need
// it later to update thr->coder->mem_in_use.
lzma_free(thr->in, thr->allocator);
thr->in = NULL;
mythread_sync(thr->mutex) { mythread_sync(thr->mutex) {
// Block decoder ensures this, but do a sanity check anyway
// because thr->in_filled < thr->in_size means that the main
// thread is still writing to thr->in.
if (ret == LZMA_STREAM_END && thr->in_filled != thr->in_size) {
assert(0);
ret = LZMA_PROG_ERROR;
}
if (thr->state != THR_EXIT) if (thr->state != THR_EXIT)
thr->state = THR_IDLE; thr->state = THR_IDLE;
} }
// Free the input buffer. Don't update in_size as we need
// it later to update thr->coder->mem_in_use.
//
// This step is skipped if an error occurred because the main thread
// might still be writing to thr->in. The memory will be freed after
// threads_end() sets thr->state = THR_EXIT.
if (ret == LZMA_STREAM_END) {
lzma_free(thr->in, thr->allocator);
thr->in = NULL;
}
mythread_sync(thr->coder->mutex) { mythread_sync(thr->coder->mutex) {
// Move our progress info to the main thread. // Move our progress info to the main thread.
thr->coder->progress_in += thr->in_pos; thr->coder->progress_in += thr->in_pos;
@ -510,7 +474,20 @@ next_loop_unlocked:
&& thr->coder->thread_error == LZMA_OK) && thr->coder->thread_error == LZMA_OK)
thr->coder->thread_error = ret; thr->coder->thread_error = ret;
worker_stop(thr); // Return the worker thread to the stack of available
// threads only if no errors occurred.
if (ret == LZMA_STREAM_END) {
// Update memory usage counters.
thr->coder->mem_in_use -= thr->in_size;
thr->coder->mem_in_use -= thr->mem_filters;
thr->coder->mem_cached += thr->mem_filters;
// Put this thread to the stack of free threads.
thr->next = thr->coder->threads_free;
thr->coder->threads_free = thr;
}
mythread_cond_signal(&thr->coder->cond);
} }
goto next_loop_lock; goto next_loop_lock;
@ -544,17 +521,22 @@ threads_end(struct lzma_stream_coder *coder, const lzma_allocator *allocator)
} }
/// Tell worker threads to stop without doing any cleaning up.
/// The clean up will be done when threads_exit() is called;
/// it's not possible to reuse the threads after threads_stop().
///
/// This is called before returning an unrecoverable error code
/// to the application. It would be waste of processor time
/// to keep the threads running in such a situation.
static void static void
threads_stop(struct lzma_stream_coder *coder) threads_stop(struct lzma_stream_coder *coder)
{ {
for (uint32_t i = 0; i < coder->threads_initialized; ++i) { for (uint32_t i = 0; i < coder->threads_initialized; ++i) {
// The threads that are in the THR_RUN state will stop
// when they check the state the next time. There's no
// need to signal coder->threads[i].cond.
mythread_sync(coder->threads[i].mutex) { mythread_sync(coder->threads[i].mutex) {
// The state must be changed conditionally because coder->threads[i].state = THR_IDLE;
// THR_IDLE -> THR_STOP is not a valid state change.
if (coder->threads[i].state != THR_IDLE) {
coder->threads[i].state = THR_STOP;
mythread_cond_signal(&coder->threads[i].cond);
}
} }
} }
@ -651,7 +633,8 @@ get_thread(struct lzma_stream_coder *coder, const lzma_allocator *allocator)
coder->thr->progress_in = 0; coder->thr->progress_in = 0;
coder->thr->progress_out = 0; coder->thr->progress_out = 0;
coder->thr->partial_update = PARTIAL_DISABLED; coder->thr->partial_update_enabled = false;
coder->thr->partial_update_started = false;
return LZMA_OK; return LZMA_OK;
} }
@ -822,12 +805,12 @@ read_output_and_wait(struct lzma_stream_coder *coder,
// keeps calling lzma_code() without providing more // keeps calling lzma_code() without providing more
// input, it will eventually get LZMA_BUF_ERROR. // input, it will eventually get LZMA_BUF_ERROR.
// //
// NOTE: We can read partial_update and in_filled // NOTE: We can read partial_update_enabled and
// without thr->mutex as only the main thread // in_filled without thr->mutex as only the main thread
// modifies these variables. decoder_in_pos requires // modifies these variables. decoder_in_pos requires
// coder->mutex which we are already holding. // coder->mutex which we are already holding.
if (coder->thr != NULL && coder->thr->partial_update if (coder->thr != NULL &&
!= PARTIAL_DISABLED) { coder->thr->partial_update_enabled) {
// There is exactly one outbuf in the queue. // There is exactly one outbuf in the queue.
assert(coder->thr->outbuf == coder->outq.head); assert(coder->thr->outbuf == coder->outq.head);
assert(coder->thr->outbuf == coder->outq.tail); assert(coder->thr->outbuf == coder->outq.tail);
@ -1546,10 +1529,17 @@ stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator,
// Read output from the output queue. Just like in // Read output from the output queue. Just like in
// SEQ_BLOCK_HEADER, we wait to fill the output buffer // SEQ_BLOCK_HEADER, we wait to fill the output buffer
// only if waiting_allowed was set to true in the beginning // only if waiting_allowed was set to true in the beginning
// of this function (see the comment there). // of this function (see the comment there) and there is
// no input available. In SEQ_BLOCK_HEADER, there is never
// input available when read_output_and_wait() is called,
// but here there can be when LZMA_FINISH is used, thus we
// need to check if *in_pos == in_size. Otherwise we would
// wait here instead of using the available input to start
// a new thread.
return_if_error(read_output_and_wait(coder, allocator, return_if_error(read_output_and_wait(coder, allocator,
out, out_pos, out_size, out, out_pos, out_size,
NULL, waiting_allowed, NULL,
waiting_allowed && *in_pos == in_size,
&wait_abs, &has_blocked)); &wait_abs, &has_blocked));
if (coder->pending_error != LZMA_OK) { if (coder->pending_error != LZMA_OK) {
@ -1558,6 +1548,10 @@ stream_decode_mt(void *coder_ptr, const lzma_allocator *allocator,
} }
// Return if the input didn't contain the whole Block. // Return if the input didn't contain the whole Block.
//
// NOTE: When we updated coder->thr->in_filled a few lines
// above, the worker thread might by now have finished its
// work and returned itself back to the stack of free threads.
if (coder->thr->in_filled < coder->thr->in_size) { if (coder->thr->in_filled < coder->thr->in_size) {
assert(*in_pos == in_size); assert(*in_pos == in_size);
return LZMA_OK; return LZMA_OK;
@ -1941,7 +1935,7 @@ stream_decoder_mt_init(lzma_next_coder *next, const lzma_allocator *allocator,
// accounting from scratch, too. Changes in filter and block sizes may // accounting from scratch, too. Changes in filter and block sizes may
// affect number of threads. // affect number of threads.
// //
// FIXME? Reusing should be easy but unlike the single-threaded // Reusing threads doesn't seem worth it. Unlike the single-threaded
// decoder, with some types of input file combinations reusing // decoder, with some types of input file combinations reusing
// could leave quite a lot of memory allocated but unused (first // could leave quite a lot of memory allocated but unused (first
// file could allocate a lot, the next files could use fewer // file could allocate a lot, the next files could use fewer

View File

@ -38,7 +38,7 @@ lzma_vli_decode(lzma_vli *restrict vli, size_t *vli_pos,
// Validate the arguments. // Validate the arguments.
if (*vli_pos >= LZMA_VLI_BYTES_MAX if (*vli_pos >= LZMA_VLI_BYTES_MAX
|| (*vli >> (*vli_pos * 7)) != 0) || (*vli >> (*vli_pos * 7)) != 0)
return LZMA_PROG_ERROR;; return LZMA_PROG_ERROR;
if (*in_pos >= in_size) if (*in_pos >= in_size)
return LZMA_BUF_ERROR; return LZMA_BUF_ERROR;

View File

@ -88,14 +88,14 @@ typedef enum {
#define update_literal_normal(state) \ #define update_literal_normal(state) \
state = ((state) <= STATE_SHORTREP_LIT_LIT \ state = ((state) <= STATE_SHORTREP_LIT_LIT \
? STATE_LIT_LIT \ ? STATE_LIT_LIT \
: (state) - 3); : (state) - 3)
/// Like update_literal(state) but when it is already known that /// Like update_literal(state) but when it is already known that
/// is_literal_state(state) is false. /// is_literal_state(state) is false.
#define update_literal_matched(state) \ #define update_literal_matched(state) \
state = ((state) <= STATE_LIT_SHORTREP \ state = ((state) <= STATE_LIT_SHORTREP \
? (state) - 3 \ ? (state) - 3 \
: (state) - 6); : (state) - 6)
/// Indicate that the latest state was a match. /// Indicate that the latest state was a match.
#define update_match(state) \ #define update_match(state) \

View File

@ -23,6 +23,12 @@ extern lzma_ret lzma_lzma_decoder_init(lzma_next_coder *next,
extern uint64_t lzma_lzma_decoder_memusage(const void *options); extern uint64_t lzma_lzma_decoder_memusage(const void *options);
/// Gets memory usage without validating lc/lp/pb. This is used by LZMA2
/// decoder, because raw LZMA2 decoding doesn't need lc/lp/pb. Also
/// alone_decoder.c and lzip_decoder.c use this because there lc/lp/pb
/// are known to be valid.
extern uint64_t lzma_lzma_decoder_memusage_nocheck(const void *options);
extern lzma_ret lzma_lzma_props_decode( extern lzma_ret lzma_lzma_props_decode(
void **options, const lzma_allocator *allocator, void **options, const lzma_allocator *allocator,
const uint8_t *props, size_t props_size); const uint8_t *props, size_t props_size);
@ -42,11 +48,6 @@ extern bool lzma_lzma_lclppb_decode(
extern lzma_ret lzma_lzma_decoder_create( extern lzma_ret lzma_lzma_decoder_create(
lzma_lz_decoder *lz, const lzma_allocator *allocator, lzma_lz_decoder *lz, const lzma_allocator *allocator,
const lzma_options_lzma *opt, lzma_lz_options *lz_options); const lzma_options_lzma *opt, lzma_lz_options *lz_options);
/// Gets memory usage without validating lc/lp/pb. This is used by LZMA2
/// decoder, because raw LZMA2 decoding doesn't need lc/lp/pb.
extern uint64_t lzma_lzma_decoder_memusage_nocheck(const void *options);
#endif #endif
#endif #endif

View File

@ -246,14 +246,14 @@ do { \
#define rc_bit(prob, action0, action1) \ #define rc_bit(prob, action0, action1) \
rc_bit_last(prob, \ rc_bit_last(prob, \
symbol <<= 1; action0, \ symbol <<= 1; action0, \
symbol = (symbol << 1) + 1; action1); symbol = (symbol << 1) + 1; action1)
#define rc_bit_safe(prob, action0, action1, seq) \ #define rc_bit_safe(prob, action0, action1, seq) \
rc_bit_last_safe(prob, \ rc_bit_last_safe(prob, \
symbol <<= 1; action0, \ symbol <<= 1; action0, \
symbol = (symbol << 1) + 1; action1, \ symbol = (symbol << 1) + 1; action1, \
seq); seq)
// Unroll fixed-sized bittree decoding. // Unroll fixed-sized bittree decoding.
// //
@ -327,7 +327,7 @@ do { \
#define rc_bit_add_if_1(probs, dest, value_to_add_if_1) \ #define rc_bit_add_if_1(probs, dest, value_to_add_if_1) \
rc_bit(probs[symbol], \ rc_bit(probs[symbol], \
, \ , \
dest += value_to_add_if_1); dest += value_to_add_if_1)
// Matched literal // Matched literal

View File

@ -86,7 +86,7 @@ export LC_ALL
STATUS=0 STATUS=0
cd "$(dirname "$0")" cd "$(dirname "$0")" || exit 1
# Get the list of symbols that aren't defined in liblzma_generic.map. # Get the list of symbols that aren't defined in liblzma_generic.map.
SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \ SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \
@ -95,7 +95,7 @@ SYMS=$(sed -n 's/^extern LZMA_API([^)]*) \([a-z0-9_]*\)(.*$/\1;/p' \
| grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma_generic.map)") | grep -Fve "$(sed '/[{}:*]/d;/^$/d;s/^ //' liblzma_generic.map)")
# Check that there are no old alpha or beta versions listed. # Check that there are no old alpha or beta versions listed.
VER=$(cd ../.. && sh build-aux/version.sh) VER=$(cd ../.. && sh build-aux/version.sh) || exit 1
NAMES= NAMES=
case $VER in case $VER in
*alpha | *beta) *alpha | *beta)

View File

@ -16,6 +16,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# shellcheck shell=sh disable=SC1003,SC2016
@enable_path_for_scripts@ @enable_path_for_scripts@
#SET_PATH - This line is a placeholder to ease patching this script. #SET_PATH - This line is a placeholder to ease patching this script.
@ -63,7 +65,7 @@ done
cmp="$cmp --" cmp="$cmp --"
for file; do for file; do
test "X$file" = X- || <"$file" || exit 2 test "X$file" = X- || true < "$file" || exit 2
done done
# xz needs -qQ to ignore warnings like unsupported check type. # xz needs -qQ to ignore warnings like unsupported check type.
@ -90,6 +92,8 @@ if test $# -eq 1; then
printf '%s\n' "$0: $1: Unknown compressed file name suffix" >&2 printf '%s\n' "$0: $1: Unknown compressed file name suffix" >&2
exit 2;; exit 2;;
esac esac
# The FILE variable is used with eval, and shellcheck doesn't see that.
# shellcheck disable=SC2034
case $1 in case $1 in
*[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *[-.]lzo | *[-.]zst | *[-.]lz4) *[-.][zZ] | *_z | *[-.][gx]z | *[-.]bz2 | *[-.]lzma | *[-.]lz | *[-.]lzo | *[-.]zst | *[-.]lz4)
FILE=`expr "X$1" : 'X\(.*\)[-.][abglmostxzZ24]*$'`;; FILE=`expr "X$1" : 'X\(.*\)[-.][abglmostxzZ24]*$'`;;

View File

@ -19,6 +19,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# shellcheck shell=sh disable=SC1003,SC2016
@enable_path_for_scripts@ @enable_path_for_scripts@
#SET_PATH - This line is a placeholder to ease patching this script. #SET_PATH - This line is a placeholder to ease patching this script.

View File

@ -16,6 +16,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# shellcheck shell=sh disable=SC2089,SC2090
@enable_path_for_scripts@ @enable_path_for_scripts@
#SET_PATH - This line is a placeholder to ease patching this script. #SET_PATH - This line is a placeholder to ease patching this script.

View File

@ -16,6 +16,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# shellcheck shell=sh
@enable_path_for_scripts@ @enable_path_for_scripts@
#SET_PATH - This line is a placeholder to ease patching this script. #SET_PATH - This line is a placeholder to ease patching this script.
@ -58,7 +60,7 @@ if test $# = 0; then
else else
FIRST=1 FIRST=1
for FILE; do for FILE; do
< "$FILE" || continue true < "$FILE" || continue
if test $FIRST -eq 0; then if test $FIRST -eq 0; then
printf "%s--More--(Next file: %s)" "" "$FILE" printf "%s--More--(Next file: %s)" "" "$FILE"
stty $cb -echo 2>/dev/null stty $cb -echo 2>/dev/null

View File

@ -480,7 +480,6 @@ parse_real(args_info *args, int argc, char **argv)
case OPT_FILTERS_HELP: case OPT_FILTERS_HELP:
// This doesn't return. // This doesn't return.
message_filters_help(); message_filters_help();
break;
case OPT_X86: case OPT_X86:
coder_add_filter(LZMA_FILTER_X86, coder_add_filter(LZMA_FILTER_X86,

View File

@ -493,7 +493,8 @@ io_sync_dest(file_pair *pair)
return true; return true;
} }
#ifndef TUKLIB_DOSLIKE #if !defined(TUKLIB_DOSLIKE) && !defined(_AIX)
// On AIX, this would fail with EBADF.
if (fsync(pair->dir_fd)) { if (fsync(pair->dir_fd)) {
message_error(_("%s: Synchronizing the directory of " message_error(_("%s: Synchronizing the directory of "
"the file failed: %s"), "the file failed: %s"),

View File

@ -11,6 +11,10 @@
#include "private.h" #include "private.h"
#ifdef HAVE_GETRLIMIT
# include <sys/resource.h>
#endif
/// Maximum number of worker threads. This can be set with /// Maximum number of worker threads. This can be set with
/// the --threads=NUM command line option. /// the --threads=NUM command line option.
@ -321,6 +325,74 @@ hardware_init(void)
// /proc/meminfo as the starting point. // /proc/meminfo as the starting point.
memlimit_mt_default = total_ram / 4; memlimit_mt_default = total_ram / 4;
#ifdef HAVE_GETRLIMIT
// Try to set the default multithreaded memory usage limit so that
// we won't exceed resource limits. Exceeding the limits would result
// in allocation failures, which currently make liblzma and xz fail
// (instead of continuing by reducing the number of threads).
const int resources[] = {
RLIMIT_DATA,
# ifdef RLIMIT_AS
RLIMIT_AS, // OpenBSD 7.8 doesn't have RLIMIT_AS.
# endif
# if defined(RLIMIT_VMEM) && RLIMIT_VMEM != RLIMIT_AS
RLIMIT_VMEM, // For Solaris. On FreeBSD this is an alias.
# endif
};
// The resource limits cannot be passed to liblzma directly;
// some margin is required:
// - The memory usage limit counts only liblzma's memory usage,
// but xz itself needs some memory (including gettext usage etc.).
// - Memory allocation has some overhead.
// - Address space limit counts code size too.
//
// The following value is a guess based on quick testing on Linux.
const rlim_t margin = 64 << 20;
for (size_t i = 0; i < ARRAY_SIZE(resources); ++i) {
// glibc: When GNU extensions are enabled, <sys/resource.h>
// declares getrlimit() so that the first argument is an enum
// instead of int as in POSIX. GCC and Clang use unsigned int
// for enums when possible, so a sign conversion occurs when
// resources[i] is convert to the enum type. Clang warns about
// this with -Wsign-conversion but GCC doesn't.
#ifdef __clang__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
// RLIM_SAVED_* might be used on some 32-bit OSes
// (AIX at least) when the limit doesn't fit in a 32-bit
// unsigned integer. Thus, for us these are the same thing
// as no limit at all.
struct rlimit rl;
if (getrlimit(resources[i], &rl) == 0
&& rl.rlim_cur != RLIM_INFINITY
&& rl.rlim_cur != RLIM_SAVED_CUR
&& rl.rlim_cur != RLIM_SAVED_MAX) {
#ifdef __clang__
# pragma GCC diagnostic pop
#endif
// Subtract the margin from the current resource
// limit, but avoid negative results. Avoid also 0
// because hardware_memlimit_show() (--info-memory)
// treats it specially. In practice, 1 byte is
// effectively 0 anyway.
//
// SUSv2 and POSIX.1-2024 require rlimit_t to be
// unsigned. A cast is needed to silence a compiler
// warning still because, for historical reasons,
// rlim_t is intentionally signed on FreeBSD 14.
const uint64_t rl_with_margin = rl.rlim_cur > margin
? (uint64_t)(rl.rlim_cur - margin) : 1;
// Lower the memory usage limit if needed.
if (memlimit_mt_default > rl_with_margin)
memlimit_mt_default = rl_with_margin;
}
}
#endif
#if SIZE_MAX == UINT32_MAX #if SIZE_MAX == UINT32_MAX
// A too high value may cause 32-bit xz to run out of address space. // A too high value may cause 32-bit xz to run out of address space.
// Use a conservative maximum value here. A few typical address space // Use a conservative maximum value here. A few typical address space

View File

@ -655,6 +655,8 @@ parse_check_value(file_pair *pair, const lzma_index_iter *iter)
/// be printed. /// be printed.
/// \param bhi Pointer to structure where to store the information /// \param bhi Pointer to structure where to store the information
/// about the Block Header field. /// about the Block Header field.
/// \param xfi Pointer to structure where to store the information
/// about the entire .xz file.
/// ///
/// \return False on success, true on error. If an error occurs, /// \return False on success, true on error. If an error occurs,
/// the error message is printed too so the caller doesn't /// the error message is printed too so the caller doesn't

View File

@ -144,6 +144,10 @@ extern void message_filename(const char *src_name);
/// given *strm becomes invalid. /// given *strm becomes invalid.
/// ///
/// \param strm Pointer to lzma_stream used for the coding. /// \param strm Pointer to lzma_stream used for the coding.
/// \param is_passthru
/// If true, we are copying input to output without
/// encoding or decoding, and thus cannot use
/// lzma_get_progress().
/// \param in_size Size of the input file, or zero if unknown. /// \param in_size Size of the input file, or zero if unknown.
/// ///
extern void message_progress_start(lzma_stream *strm, extern void message_progress_start(lzma_stream *strm,

View File

@ -4,6 +4,15 @@
// //
/// \file sandbox.c /// \file sandbox.c
/// \brief Sandbox support /// \brief Sandbox support
///
/// \note When sandbox_init() is called, gettext hasn't been
/// initialized yet, and thus wrapping error messages
/// in _("...") is pointless in that function. In other
/// functions gettext can be used, but the only error message
/// we have is "Failed to enable the sandbox" which should
/// (almost) never occur. If it does occur anyway, leaving
/// the message untranslated can make it easier to find
/// bug reports about the issue.
// //
// Author: Lasse Collin // Author: Lasse Collin
// //
@ -71,11 +80,8 @@ prepare_for_strict_sandbox(void)
extern void extern void
sandbox_init(void) sandbox_init(void)
{ {
if (pledge("stdio rpath wpath cpath fattr", "")) { if (pledge("stdio rpath wpath cpath fattr", ""))
// gettext hasn't been initialized yet so
// there's no point to call it here.
message_fatal("Failed to enable the sandbox"); message_fatal("Failed to enable the sandbox");
}
return; return;
} }
@ -87,7 +93,7 @@ sandbox_enable_read_only(void)
// We will be opening files for reading but // We will be opening files for reading but
// won't create or remove any files. // won't create or remove any files.
if (pledge("stdio rpath", "")) if (pledge("stdio rpath", ""))
message_fatal(_("Failed to enable the sandbox")); message_fatal("Failed to enable the sandbox");
return; return;
} }
@ -103,7 +109,7 @@ sandbox_enable_strict_if_allowed(int src_fd lzma_attribute((__unused__)),
// All files that need to be opened have already been opened. // All files that need to be opened have already been opened.
if (pledge("stdio", "")) if (pledge("stdio", ""))
message_fatal(_("Failed to enable the sandbox")); message_fatal("Failed to enable the sandbox");
return; return;
} }
@ -139,7 +145,7 @@ enable_landlock(uint64_t required_rights)
const int ruleset_fd = my_landlock_create_ruleset( const int ruleset_fd = my_landlock_create_ruleset(
&attr, sizeof(attr), 0); &attr, sizeof(attr), 0);
if (ruleset_fd < 0) if (ruleset_fd < 0)
message_fatal(_("Failed to enable the sandbox")); message_fatal("Failed to enable the sandbox");
// All files we need should have already been opened. Thus, // All files we need should have already been opened. Thus,
// we don't need to add any rules using landlock_add_rule(2) // we don't need to add any rules using landlock_add_rule(2)
@ -154,7 +160,7 @@ enable_landlock(uint64_t required_rights)
// prctl(PR_SET_NO_NEW_PRIVS, ...) was already called in // prctl(PR_SET_NO_NEW_PRIVS, ...) was already called in
// sandbox_init() so we don't do it here again. // sandbox_init() so we don't do it here again.
if (my_landlock_restrict_self(ruleset_fd, 0) != 0) if (my_landlock_restrict_self(ruleset_fd, 0) != 0)
message_fatal(_("Failed to enable the sandbox")); message_fatal("Failed to enable the sandbox");
(void)close(ruleset_fd); (void)close(ruleset_fd);
return; return;
@ -274,7 +280,7 @@ sandbox_enable_strict_if_allowed(
// If not reading from stdin, remove all capabilities from it. // If not reading from stdin, remove all capabilities from it.
if (src_fd != STDIN_FILENO && cap_rights_limit( if (src_fd != STDIN_FILENO && cap_rights_limit(
STDIN_FILENO, cap_rights_clear(&rights))) STDIN_FILENO, cap_rights_init(&rights)))
goto error; goto error;
if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights, if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,
@ -305,7 +311,7 @@ error:
if (errno == ENOSYS) if (errno == ENOSYS)
return; return;
message_fatal(_("Failed to enable the sandbox")); message_fatal("Failed to enable the sandbox");
} }
#endif #endif

View File

@ -31,9 +31,6 @@ static sigset_t hooked_signals;
/// signals_unblock() are called before signals_init() has been called. /// signals_unblock() are called before signals_init() has been called.
static bool signals_are_initialized = false; static bool signals_are_initialized = false;
/// signals_block() and signals_unblock() can be called recursively.
static size_t signals_block_count = 0;
static void static void
signal_handler(int sig) signal_handler(int sig)
@ -137,6 +134,10 @@ signals_init(void)
#ifndef __VMS #ifndef __VMS
/// signals_block() and signals_unblock() can be called recursively.
static size_t signals_block_count = 0;
extern void extern void
signals_block(void) signals_block(void)
{ {
@ -186,8 +187,14 @@ signals_exit(void)
sa.sa_handler = SIG_DFL; sa.sa_handler = SIG_DFL;
sigfillset(&sa.sa_mask); sigfillset(&sa.sa_mask);
sa.sa_flags = 0; sa.sa_flags = 0;
sigaction(sig, &sa, NULL);
raise(sig); // This shouldn't fail, but check it anyway.
if (sigaction(sig, &sa, NULL) == 0)
raise(sig);
// We shouldn't get here, but just in case we do,
// make main() exit with E_ERROR.
set_exit_status(E_ERROR);
#endif #endif
} }

View File

@ -12,6 +12,10 @@
#include "private.h" #include "private.h"
#include <stdarg.h> #include <stdarg.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
# include <io.h>
#endif
/// Buffers for uint64_to_str() and uint64_to_nicestr() /// Buffers for uint64_to_str() and uint64_to_nicestr()
static char bufs[4][128]; static char bufs[4][128];

View File

@ -615,7 +615,7 @@ Compression is not supported.
.IP "" .IP ""
The The
.B .lz .B .lz
format version 0 and the unextended version 1 are supported. format versions 0 and 1 are supported.
Version 0 files were produced by Version 0 files were produced by
.B lzip .B lzip
1.3 and older. 1.3 and older.
@ -625,15 +625,8 @@ People might have old personal files in this format too.
Decompression support for the format version 0 was removed in Decompression support for the format version 0 was removed in
.B lzip .B lzip
1.18. 1.18.
.IP ""
.B lzip .B lzip
1.4 and later create files in the format version 1. 1.4 and later create files in the format version 1.
The sync flush marker extension to the format version 1 was added in
.B lzip
1.6.
This extension is rarely used and isn't supported by
.B xz
(diagnosed as corrupt input).
.TP .TP
.B raw .B raw
Compress or uncompress a raw stream (no headers). Compress or uncompress a raw stream (no headers).

View File

@ -321,7 +321,7 @@ sandbox_enter(int src_fd)
// If not reading from stdin, remove all capabilities from it. // If not reading from stdin, remove all capabilities from it.
if (src_fd != STDIN_FILENO && cap_rights_limit( if (src_fd != STDIN_FILENO && cap_rights_limit(
STDIN_FILENO, cap_rights_clear(&rights))) STDIN_FILENO, cap_rights_init(&rights)))
goto error; goto error;
if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights, if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,

View File

@ -0,0 +1,4 @@
# SPDX-License-Identifier: 0BSD
[libfuzzer]
dict = fuzz_xz.dict

View File

@ -20,6 +20,9 @@
// prevent extreme allocations when fuzzing. // prevent extreme allocations when fuzzing.
#define MEM_LIMIT (300 << 20) // 300 MiB #define MEM_LIMIT (300 << 20) // 300 MiB
// Amount of input to pass to lzma_code() per call at most.
#define IN_CHUNK_SIZE 2047
static void static void
fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) { fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) {
@ -27,15 +30,29 @@ fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) {
// cares about the actual data written here. // cares about the actual data written here.
uint8_t outbuf[4096]; uint8_t outbuf[4096];
// Give the whole input buffer at once to liblzma. // Pass half of the input on the first call and then proceed in
// Output buffer isn't initialized as liblzma only writes to it. // chunks. It's fine that this rounds to 0 when inbuf_size is 1.
stream->next_in = inbuf; stream->next_in = inbuf;
stream->avail_in = inbuf_size; stream->avail_in = inbuf_size / 2;
stream->next_out = outbuf;
stream->avail_out = sizeof(outbuf); lzma_action action = LZMA_RUN;
lzma_ret ret; lzma_ret ret;
while ((ret = lzma_code(stream, LZMA_FINISH)) == LZMA_OK) { do {
if (stream->avail_in == 0 && inbuf_size > 0) {
const size_t chunk_size = inbuf_size < IN_CHUNK_SIZE
? inbuf_size : IN_CHUNK_SIZE;
stream->next_in = inbuf;
stream->avail_in = chunk_size;
inbuf += chunk_size;
inbuf_size -= chunk_size;
if (inbuf_size == 0)
action = LZMA_FINISH;
}
if (stream->avail_out == 0) { if (stream->avail_out == 0) {
// outbuf became full. We don't care about the // outbuf became full. We don't care about the
// uncompressed data there, so we simply reuse // uncompressed data there, so we simply reuse
@ -43,7 +60,7 @@ fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) {
stream->next_out = outbuf; stream->next_out = outbuf;
stream->avail_out = sizeof(outbuf); stream->avail_out = sizeof(outbuf);
} }
} } while ((ret = lzma_code(stream, action)) == LZMA_OK);
// LZMA_PROG_ERROR should never happen as long as the code calling // LZMA_PROG_ERROR should never happen as long as the code calling
// the liblzma functions is correct. Thus LZMA_PROG_ERROR is a sign // the liblzma functions is correct. Thus LZMA_PROG_ERROR is a sign

View File

@ -0,0 +1,47 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file fuzz_decode_stream_mt.c
/// \brief Fuzz test program for multithreaded .xz decoding
//
// Author: Lasse Collin
//
///////////////////////////////////////////////////////////////////////////////
#include <inttypes.h>
#include <stdlib.h>
#include <stdio.h>
#include "lzma.h"
#include "fuzz_common.h"
extern int
LLVMFuzzerTestOneInput(const uint8_t *inbuf, size_t inbuf_size)
{
lzma_stream strm = LZMA_STREAM_INIT;
lzma_mt mt = {
.flags = LZMA_CONCATENATED | LZMA_IGNORE_CHECK,
.threads = 2,
.timeout = 0,
.memlimit_threading = MEM_LIMIT / 2,
.memlimit_stop = MEM_LIMIT,
};
lzma_ret ret = lzma_stream_decoder_mt(&strm, &mt);
if (ret != LZMA_OK) {
// This should never happen unless the system has
// no free memory or address space to allow the small
// allocations that the initialization requires.
fprintf(stderr, "lzma_stream_decoder_mt() failed (%d)\n", ret);
abort();
}
fuzz_code(&strm, inbuf, inbuf_size);
lzma_end(&strm);
return 0;
}

View File

@ -27,7 +27,7 @@ test_exact_size(void)
"is disabled"); "is disabled");
// Something to be compressed // Something to be compressed
const uint8_t in[16] = "0123456789ABCDEF"; const uint8_t in[16] = "0123456789ABCDE";
// in[] after compression // in[] after compression
uint8_t compressed[1024]; uint8_t compressed[1024];

View File

@ -27,7 +27,7 @@ do { \
memzero(&(block), sizeof(lzma_block)); \ memzero(&(block), sizeof(lzma_block)); \
(block).filters = filters_; \ (block).filters = filters_; \
(block).check = LZMA_CHECK_CRC32; \ (block).check = LZMA_CHECK_CRC32; \
} while (0); } while (0)
#ifdef HAVE_ENCODERS #ifdef HAVE_ENCODERS

View File

@ -118,8 +118,8 @@ else
fi fi
# Create two temporary files to be used with --files and --files0. # Create two temporary files to be used with --files and --files0.
printf "$SUFFIX_INPUT\n" > "$SUFFIX_INPUT_FILES" printf '%s\n' "$SUFFIX_INPUT" > "$SUFFIX_INPUT_FILES"
printf "$SUFFIX_INPUT\0" > "$SUFFIX_INPUT_FILES0" printf '%s\0' "$SUFFIX_INPUT" > "$SUFFIX_INPUT_FILES0"
# Test proper handling of --files/--files0 when no suffix is set. This # Test proper handling of --files/--files0 when no suffix is set. This
# must result in an error because xz does not know how to rename the output # must result in an error because xz does not know how to rename the output

View File

@ -231,8 +231,8 @@ done
VER=$(sh build-aux/version.sh) VER=$(sh build-aux/version.sh)
if [ -x "$SEVENZ" ]; then if [ -x "$SEVENZ" ]; then
cd pkg cd pkg
"$SEVENZ" a -tzip ../xz-$VER-windows.zip * "$SEVENZ" a -tzip "../xz-$VER-windows.zip" *
"$SEVENZ" a ../xz-$VER-windows.7z * "$SEVENZ" a "../xz-$VER-windows.7z" *
else else
echo echo
echo "NOTE: 7z was not found. xz-$VER-windows.zip" echo "NOTE: 7z was not found. xz-$VER-windows.zip"