Compare commits

...

318 Commits

Author SHA1 Message Date
Jia Tan af071ef770 Docs: Simplify SECURITY.md. 2024-03-26 03:38:12 +08:00
Lasse Collin 0b99783d63 liblzma: memcmplen.h: Add a comment why subtraction is used. 2024-03-22 17:46:30 +02:00
Lasse Collin 8a25ba024d INSTALL: Document arguments of --enable-symbol-versions. 2024-03-15 18:04:10 +02:00
Lasse Collin 49324b711f Build: Use only the generic symbol versioning with NVIDIA HPC Compiler.
This does the previous commit with CMake.

AC_EGREP_CPP uses AC_REQUIRE so the outermost if-commands must
be changed to AS_IF to ensure that things wont break some day.
See 5a5bd7f871.
2024-03-15 18:04:10 +02:00
Lasse Collin c273123ed0 CMake: Use only the generic symbol versioning with NVIDIA HPC Compiler.
It doesn't support the __symver__ attribute or __asm__(".symver ...").
The generic symbol versioning can still be used since it only needs
linker support.
2024-03-15 18:04:10 +02:00
Lasse Collin df7f487648 Update THANKS. 2024-03-15 18:04:10 +02:00
Lasse Collin 3217b82b3e liblzma: Minor comment edits. 2024-03-15 18:03:47 +02:00
Sergey Kosukhin 096bc0e3f8 liblzma: Fix building with NVHPC (NVIDIA HPC SDK).
NVHPC compiler has several issues that make it impossible to
build liblzma:
  - the compiler cannot handle unions that contain pointers that
    are not the first members;
  - the compiler cannot handle the assembler code in range_decoder.h
    (LZMA_RANGE_DECODER_CONFIG has to be set to zero);
  - the compiler fails to produce valid code for delta_decode if the
    vectorization is enabled, which results in failed tests.

This introduces NVHPC-specific workarounds that address the issues.
2024-03-15 17:30:50 +02:00
Lasse Collin 2ad7fad670 CMake: Disable symbol versioning on non-glibc Linux.
This better matches what configure.ac does. For example, musl has
only basic symbol versioning support:

https://wiki.musl-libc.org/functional-differences-from-glibc.html#Symbol_versioning

configure.ac tries to enable symbol versioning only with glibc
so now CMake does the same.
2024-03-15 17:30:50 +02:00
Lasse Collin 82f0c0d39e CMake: Make symbol versioning configurable. 2024-03-15 17:30:50 +02:00
Lasse Collin 45d33bfc45 Build: Style tweaks to configure.ac.
The AC_MSG_ERROR line is overlong anyway as are a few other
AC_MSG_ERROR lines already.
2024-03-13 22:00:23 +02:00
Sergey Kosukhin f56ed6fac6 Build: Let the users override the symbol versioning variant.
There are cases when the users want to decide themselves whether
they want to have the generic (even on GNU/Linux) or the linux
(even if we do not recommend that) symbol versioning variant.
The former might be needed to circumvent compiler issues (i.e.
the compiler does not support all features that are required
for the linux versioning), the latter might help in overriding
the assumptions made in the configure script.
2024-03-13 21:59:55 +02:00
Jia Tan a4f2e20d84 Add NEWS for 5.6.1 2024-03-09 11:27:27 +08:00
Jia Tan f01be8ad75 Translations: Add missing --riscv option to man page translations. 2024-03-09 10:43:20 +08:00
Jia Tan 6e636819e8 Tests: Update two test files.
The original files were generated with random local to my machine.
To better reproduce these files in the future, a constant seed was used
to recreate these files.
2024-03-09 10:18:29 +08:00
Jia Tan a3a29bbd5d Tests: Test --single-stream can decompress bad-3-corrupt_lzma2.xz.
The first stream in this file is valid, so this tests that xz properly
stops after decompressing it.
2024-03-09 10:08:32 +08:00
Jia Tan 0b4ccc9145 Tests: Update RISC-V test files.
This increases code coverage and tests for possible shifting bugs.
2024-03-09 10:05:32 +08:00
Jia Tan 8c9b8b2063 liblzma: Fix typos in crc32_fast.c and crc64_fast.c. 2024-03-09 09:52:32 +08:00
Jia Tan b93a8d7631 Tests: Replace HAVE_MICROLZMA usage in CMake and Autotools builds.
This reverts commit adaacafde6.
2024-03-09 09:49:55 +08:00
Jia Tan 82ecc53819 liblzma: Fix false Valgrind error report with GCC.
With GCC and a certain combination of flags, Valgrind will falsely
trigger an invalid write. This appears to be due to the omission of
instructions to properly save, set up, and restore the frame pointer.

The IFUNC resolver is a leaf function since it only calls a function
that is inlined. So sometimes GCC omits the frame pointer instructions
in the resolver unless this optimization is explictly disabled.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=2267598.
2024-03-09 09:20:57 +08:00
Lasse Collin 3007e74ef2 liblzma: Fix a typo in a comment in the RISC-V filter. 2024-03-05 23:23:16 +02:00
Jia Tan 72d2933bfa liblzma: Use attribute no_profile_instrument_function with ifunc.
Thanks to Sam James for determining this was the attribute needed to
workaround the GCC bug and for his version of the patch in Gentoo.
2024-03-05 01:54:30 +08:00
Jia Tan e5faaebbcf Build: Require attribute no_profile_instrument_function for ifunc usage.
Using __attribute__((__no_profile_instrument_function__)) on the ifunc
resolver works around a bug in GCC -fprofile-generate:
it adds profiling code even to ifunc resolvers which can make
the ifunc resolver crash at program startup. This attribute
was not introduced until GCC 7 and Clang 13, so ifunc won't
be used with prior versions of these compilers.

This bug was brought to our attention by:

    https://bugs.gentoo.org/925415

And was reported to upstream GCC by:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11411
2024-03-05 01:54:30 +08:00
Lasse Collin 7eeadd279a liblzma: Fix a comment in the RISC-V filter. 2024-03-04 19:23:18 +02:00
Lasse Collin 5f3d059529 CMake: Warn if translated man pages are missing. 2024-02-29 16:37:19 +02:00
Lasse Collin 4cd1042ee7 CMake: Warn if gettext tools and pre-created .gmo files are missing.
It's only done with CMake >= 3.20 and if library support
for translation was already found.

Sort of fixes: https://github.com/tukaani-project/xz/issues/82
2024-02-29 16:37:19 +02:00
Lasse Collin a94b42362c xz: Add comments. 2024-02-28 18:26:25 +02:00
Jia Tan bbf112e323 xz: Change logging level for thread reduction to highest verbosity only.
Now that multi threaded encoding is the default, users do not need to
see a warning message everytime the number of threads is reduced. On
some machines, this could happen very often. It is not unreasonable for
users to need to set double verbose mode to see this kind of
information.

To see these warning messages -vv or --verbose --verbose must be passed
to set xz into the highest possible verbosity mode.

These warnings had caused automated testing frameworks to fail when they
expected no output to stderr.

Thanks to Sebastian Andrzej Siewior for reporting this and for the
initial version of the patch.
2024-02-29 00:05:50 +08:00
Lasse Collin 649f644744 Fix sorting in THANKS. 2024-02-26 23:06:13 +02:00
Jia Tan 1255b7d849 Update THANKS. 2024-02-26 23:40:50 +08:00
Chien Wong eee579fff5 xz: Add missing RISC-V on the filter list in the man page
Signed-off-by: Chien Wong <m@xv97.com>
2024-02-26 23:36:04 +08:00
Jia Tan 328c52da8a Build: Fix Linux Landlock feature test in Autotools and CMake builds.
The previous Linux Landlock feature test assumed that having the
linux/landlock.h header file was enough. The new feature tests also
requires that prctl() and the required Landlock system calls are
supported.
2024-02-26 23:27:44 +08:00
Jia Tan eb8ad59e9b Tests: Add test_microlzma to .gitignore and CMakeLists.txt. 2024-02-26 20:06:10 +08:00
Jia Tan 9eed1b9a3a Tests: Correct license header in test_microlzma.c. 2024-02-26 19:56:25 +08:00
Jia Tan 8bf9f72ee1 Fix typos in NEWS and CMakeLists. 2024-02-25 21:41:55 +08:00
Jia Tan 5d8d915ebe Bump version and soname for 5.7.0alpha.
Like 5.5.0alpha, 5.7.0alpha won't be released, it's just to mark that
the branch is not stable.

Once again there is no API/ABI stability for new features in devel
versions. The major soname won't be bumped even if API/ABI of new
features breaks between devel releases.
2024-02-24 16:30:06 +08:00
Jia Tan a18fb1edef Add NEWS for 5.6.0. 2024-02-24 15:50:36 +08:00
Jia Tan 24355c5280 Translations: Remove obsolete and fuzzy matches from some translations.
The French and Brazilian Portuguese man page translations have not been
updated since the switch from public domain to 0BSD. The old GPLv2
strings have now been removed from these files.
2024-02-22 22:27:01 +08:00
Jia Tan 02ca4a7d7b Translations: Patch man pages to avoid fuzzy matches.
This will be fixed in the next round of translations, but this avoids
having a fuzzy match or not fixing the English version.
2024-02-21 00:31:54 +08:00
Jia Tan 898aad9fc7 xzmore: Fix typo in xzmore.1.
Thanks to Yuri Chornoivan.
2024-02-21 00:30:43 +08:00
Jia Tan 5631aa206c Translations: Update the Vietnamese translation. 2024-02-24 12:12:16 +08:00
Jia Tan a65fd7ce9d Translations: Update the Esperanto translation. 2024-02-24 12:06:40 +08:00
Jia Tan cf44e4b7f5 Tests: Add a few test files. 2024-02-23 23:09:59 +08:00
Jia Tan 39f4a1a86a Tests: Add MicroLZMA test. 2024-02-23 20:58:36 +08:00
Jia Tan adaacafde6 Build: Define HAVE_MICROLZMA when it is configured. 2024-02-23 20:57:59 +08:00
Jia Tan eea78216d2 xz: Fix Capsicum sandbox compile error.
user_abort_pipe[] was still being used instead of the parameters.
2024-02-23 20:27:15 +08:00
Jia Tan 32b0a3ce19 Build: Fix ARM64 CRC32 instruction feature test.
Old versions of Clang reported the unsupported function attribute and
__crc32d() function as warnings instead of errors, so the feature test
passed when it shouldn't have, causing a compile error at build time.
-Werror was added to this feature test to fix this. The change is not
needed for CMake because check_c_source_compiles() also performs
linking and the error is caught then.

Thanks to Sebastian Andrzej Siewior for reporting this.
2024-02-23 16:12:32 +08:00
Lasse Collin 4c81c9611f CMake: Add LOCALEDIR to the windres workaround.
LOCALEDIR may contain spaces like in "C:\Program Files".
2024-02-22 19:16:35 +02:00
Lasse Collin de4337fd89 xz: Landlock: Fix error message if input file is a directory.
If xz is given a directory, it should look like this:

    $ xz /usr/bin
    xz: /usr/bin: Is a directory, skipping

The Landlock rules didn't allow opening directories for reading:

    $ xz /usr/bin
    xz: /usr/bin: Permission denied

The simplest fix was to allow opening directories for reading.
While it's a bit silly to allow it solely for the error message,
it shouldn't make the sandbox significantly weaker.

The single-file use case (like when called from GNU tar) is
still as strict as possible: all Landlock restrictions are
enabled before (de)compression starts.
2024-02-22 15:18:25 +02:00
Lasse Collin 120da10ae1 liblzma: Disable branchless C version in range decoder.
Thanks to Sebastian Andrzej Siewior and Sam James for
benchmarking on various systems.
2024-02-22 14:41:29 +02:00
Lasse Collin 00440f52be INSTALL: Clarify that --disable-assembler affects only 32-bit x86. 2024-02-21 17:41:32 +02:00
Lasse Collin 11405be84e Windows: build.bash: Include COPYING.0BSD in the package. 2024-02-21 16:57:20 +02:00
Lasse Collin c27cf64e3e Windows: build.bash: include liblzma-crt-mixing.txt in the package. 2024-02-21 16:57:20 +02:00
Lasse Collin 8d38941bae Windows: Major update to Windows build instructions. 2024-02-21 16:57:20 +02:00
Lasse Collin 4b5b0d3523 Windows: Update windows/README-Windows.txt.
It's for binary packages built with windows/build.bash.
2024-02-21 16:57:20 +02:00
Lasse Collin 1ee716f740 Windows: Update windows/build.bash.
Support for the old MinGW was dropped. Only MinGW-w64 with GCC
is supported now.

The script now supports also cross-compilation from GNU/Linux
(tests are not run). MSYS2 and also the old MSYS 1.0.11 work
for building on Windows. The i686 and x86_64 toolchains must
be in PATH to build both 32-bit and 64-bit versions.

Parallel builds are done if "nproc" from GNU coreutils is available.

MinGW-w64 runtime copyright information file was renamed from
COPYING-Windows.txt to COPYING.MinGW-w64-runtime.txt which
is the filename used by MinGW-w64 itself. Its existence
is now mandatory, it's checked at the beginning of the script.

The file TODO is no longer copied to the package.
2024-02-20 21:04:29 +02:00
Jia Tan 60462e4260 Translations: Update the Romanian man page translations. 2024-02-20 23:32:22 +08:00
Jia Tan 10d733e5b8 Translations: Update the Korean man page translations. 2024-02-20 23:30:25 +08:00
Jia Tan 797a34b72a Translations: Update the Spanish translation. 2024-02-20 21:03:53 +08:00
Jia Tan 5c3751d019 Translations: Update the Romanian translation. 2024-02-20 20:18:07 +08:00
Jia Tan e2d31154ec Translations: Update the Croatian translation. 2024-02-20 20:15:50 +08:00
Jia Tan 704500f994 Translations: Update the German man page translations. 2024-02-20 20:05:44 +08:00
Jia Tan 1cfd3dca3f Translations: Update the German translation. 2024-02-20 19:58:25 +08:00
Jia Tan 28b9b3f16c Translations: Update the Hungarian translation. 2024-02-20 19:56:52 +08:00
Lasse Collin 00b06cd0af CMake: Fix building of lzmainfo when translations are enabled. 2024-02-19 16:48:18 +02:00
Lasse Collin b0d1422b60 CMake: Don't assume that -fvisibility=hidden is supported outside Windows.
The original code was good enough for supporting GNU/Linux
and a few others but it wasn't very portable.

CMake doesn't support Solaris Studio's -xldscope=hidden.
If it ever does, things should still work with this commit
as Solaris Studio supports not only its own __global but also
the GNU C __attribute__((visibility("default"))). Support for the
attribute was added in 2007 to Sun Studio 12 compiler version 5.9.
2024-02-19 16:28:49 +02:00
Lasse Collin 2ced9d34be CMake: Revise the component splitting. 2024-02-19 16:28:49 +02:00
Lasse Collin 426bdc709c CMake: Update the main comment and document CMAKE_BUILD_TYPE=Release. 2024-02-19 16:28:49 +02:00
Lasse Collin 4430e075f7 CMake: Use -O2 instead of -O3 in CMAKE_BUILD_TYPE=Release.
-O3 doesn't seem useful for speed but it makes the code bigger.
CMake makes is difficult for users to simply override the
optimization level: CFLAGS / CMAKE_C_FLAGS aren't helpful because
they go before CMAKE_C_FLAGS_RELEASE. Of course, users can override
CMAKE_C_FLAGS_RELEASE directly but then they have to remember to
add also -DNDEBUG to disable assertions.

This commit changes -O3 to -O2 in CMAKE_C_FLAGS_RELEASE if and only if
CMAKE_C_FLAGS_RELEASE cache variable doesn't already exist. So if
a custom value is passed on the command line (or reconfiguring an
already-configured build), the cache variable won't be modified.
2024-02-19 16:28:49 +02:00
Lasse Collin 025eb6d787 CMake: Handle symbol versioning on MicroBlaze specially.
This is to match configure.ac.
2024-02-19 16:28:49 +02:00
Lasse Collin 2edd1a35b2 CMake: Keep build working even if lib/*.[ch] are removed. 2024-02-19 12:21:37 +02:00
Lasse Collin d753e2ce47 CMake: Install documentation. 2024-02-19 12:21:37 +02:00
Lasse Collin 7a0405bea9 CMake: Bump maximum policy version to 3.28.
CMP0154 doesn't affect us since we don't use FILE_SET.
2024-02-19 12:21:37 +02:00
Lasse Collin c2264ffbe3 CMake: Build lzmainfo. 2024-02-19 12:21:37 +02:00
Lasse Collin 998d0b2953 CMake: Build lzmadec. 2024-02-19 12:21:37 +02:00
Lasse Collin 74e8bc7417 CMake: Add test_scripts.sh to the tests.
In contrast to Automake, skipping of this test when decoders
are disabled is handled at CMake side instead of test_scripts.sh
because CMake-build doesn't create config.h.
2024-02-19 12:21:37 +02:00
Lasse Collin 4808f238a7 CMake: Install scripts.
Compared to the Autotools-based build, this has simpler handling
for the shell (@POSIX_SHELL@) and extra PATH entry for the scripts
(configure has --enable-path-for-scripts=PREFIX). The simpler
metho should be enough for non-ancient systems and Solaris.
2024-02-19 12:21:37 +02:00
Lasse Collin 3462362ebd Scripts: Use @PACKAGE_VERSION@ instead of @VERSION@.
PACKAGE_VERSION was already used in liblzma.pc.in.
This way only one version @foo@ is used.
2024-02-19 12:21:37 +02:00
Lasse Collin 67610c245b CMake: Simplify symlink creation and install translated man pages.
It helps that cmake_install.cmake doesn't parallelize installation
so symlinks can be created so that the target is always known to
exist (a requirement on Windows in some cases).

This bumps the minimum CMake version from 3.13 to 3.14 to use
file(CREATE_LINK ...). It could be made to work on 3.13 by
calling "cmake -E create_symlink" but it's uglier code and
slower in "make install". 3.14 should be a reasonable version
to require nowadays, especially since the Autotools build
is still the primary build system for most OSes.
2024-02-19 12:21:37 +02:00
Lasse Collin 50cc1d8a5a CMake: Add support for building and installing xz with translations.
If gettext tools are available, the .po files listed in po/LINGUAS
are converted using msgfmt. This allows building with translations
directly from xz.git without Autotools.

If gettext tools aren't available, the Autotools-created .gmo files
in the "po" directory will be used. This allows CMake-based build
to use translations from Autotools-generated tarball.

If translation support is found (Intl_FOUND) but both the
gettext tools and the pre-generated .gmo files are missing,
then "make" will fail.
2024-02-19 12:21:37 +02:00
Lasse Collin 746c471643 liblzma: Remove commented-out code. 2024-02-19 11:58:33 +02:00
Lasse Collin 4ce300ce08 xz: Delete old commented-out code. 2024-02-17 23:07:35 +02:00
Lasse Collin cae9a5e0bf xz: Use stricter pledge(2) and Landlock sandbox.
This makes these sandboxing methods stricter when no files are
created or deleted. That is, it's a middle ground between the
initial sandbox and the strictest single-file-to-stdout sandbox:
this allows opening files for reading but output has to go to stdout.
2024-02-17 23:07:35 +02:00
Lasse Collin 02e3505991 xz: Support Landlock ABI version 4.
Linux 6.7 added support for ABI version 4 which restricts
TCP connections which xz won't need and thus those can be
forbidden now. Since the ABI version is handled at runtime,
supporting version 4 won't cause any compatibility issues.

Note that new enough kernel headers are required to get
version 4 support enabled at build time.
2024-02-17 23:07:35 +02:00
Lasse Collin 374868d81d xz: Move sandboxing code to sandbox.c and improve Landlock sandbox.
Landlock is now always used just like pledge(2) is: first in more
permissive mode and later (under certain common conditions) in
a strict mode that doesn't allow opening more files.

I put pledge(2) first in sandbox.c because it's the simplest API
to use and still somewhat fine-grained for basic applications.
So it's the simplest thing to understand for anyone reading sandbox.c.
2024-02-17 23:07:35 +02:00
Lasse Collin 7312dfbb02 xz: Tweak comments. 2024-02-17 23:07:35 +02:00
Lasse Collin c701a5909a xz: Fix message_init() description.
Also explicitly initialize progress_automatic to make it clear
that it can be read before message_init() sets it. Static variable
was initialized to false by default already so this is only for
clarity.
2024-02-17 23:07:35 +02:00
Lasse Collin 9466306719 Build: Makefile.am: Sort EXTRA_DIST.
Dirs first, then files in case-sensitive ASCII order.
2024-02-17 19:42:30 +02:00
Lasse Collin f3440e78c9 Build: Don't install TODO. 2024-02-17 19:42:30 +02:00
Jia Tan a7a3b62e2a Translations: Update the Korean man page translations. 2024-02-18 01:09:11 +08:00
Jia Tan 9b315db2d5 Translations: Update the Korean translation. 2024-02-18 01:08:32 +08:00
Lasse Collin 56246607df Build: Install translated lzmainfo man pages.
All other translated man pages were being installed but
lzmainfo had been forgotten.
2024-02-17 16:23:14 +02:00
Lasse Collin f1d6b88aef liblzma: Avoid implementation-defined behavior in the RISC-V filter.
GCC docs promise that it works and a few other compilers do
too. Clang/LLVM is documented source code only but unsurprisingly
it behaves the same as others on x86-64 at least. But the
certainly-portable way is good enough here so use that.
2024-02-17 16:01:32 +02:00
Lasse Collin 843ddc5f61 liblzma: Wrap a line exceeding 80 chars. 2024-02-17 15:50:21 +02:00
Sebastian Andrzej Siewior e9053c9072 liblzma/rangecoder: Exclude x32 from the x86-64 optimisation.
The x32 port has a x86-64 ABI in term of all registers but uses only
32bit pointer like x86-32. The assembly optimisation fails to compile on
x32. Given the state of x32 I suggest to exclude it from the
optimisation rather than trying to fix it.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2024-02-17 15:50:21 +02:00
Jia Tan 3d198fb13b Translations: Update the Spanish translation. 2024-02-17 21:05:07 +08:00
Jia Tan cf278bfe60 Translations: Update the Swedish translation. 2024-02-17 20:43:29 +08:00
Jia Tan b0f1a41be5 Translations: Update the Polish translation. 2024-02-17 20:41:38 +08:00
Jia Tan d74ed48b30 Translations: Update the Ukrainian translation. 2024-02-17 20:41:02 +08:00
Lasse Collin 711e22d5c5 Translations: Use the same sentence in xz.pot-header that the TP uses. 2024-02-16 17:53:34 +02:00
Jia Tan fb5f6aaf18 Fix typos discovered by codespell. 2024-02-16 22:54:59 +08:00
Jia Tan c64723bbb0 Translations: Update the Ukrainian man page translations. 2024-02-16 22:54:59 +08:00
Jia Tan 2895195ed0 Translations: Update the Ukrainian translation. 2024-02-16 22:54:59 +08:00
Lasse Collin 4c20781f4c Translations: Omit the generic copyright line from man page headers. 2024-02-15 22:33:49 +02:00
Jia Tan 4323bc3e0c Update m4/.gitignore. 2024-02-15 22:26:43 +08:00
Lasse Collin 5394a1665b Tests: tuktest.h: Treat Clang separately from GCC.
Don't assume that Clang defines __GNUC__ as the extensions
are available in clang-cl as well (and possibly in some other
Clang variants?).
2024-02-14 21:12:58 +02:00
Lasse Collin cce7330b9f Tests: tuktest.h: Add a missing word to a comment. 2024-02-14 21:11:03 +02:00
Lasse Collin 5dd8fc9452 Tests: tuktest.h: Fix the comment about STest. 2024-02-14 21:10:10 +02:00
Jia Tan 6f1790254a Bump version for 5.5.2beta. 2024-02-15 01:53:40 +08:00
Lasse Collin 924fdeedf4 liblzma: Fix validate_map.sh.
Adding the SPDX license identifier changed the line numbers.
2024-02-14 19:46:11 +02:00
Lasse Collin 22140a2df6 Build: Start the generated ChangeLog from around 5.4.0 instead of 5.2.0. 2024-02-14 19:38:34 +02:00
Lasse Collin 0b8cefa136 Fixed NEWS for 5.5.2beta. 2024-02-14 19:27:46 +02:00
Lasse Collin a4557bad96 liblzma: Silence warnings in --enable-small build. 2024-02-14 19:21:45 +02:00
Lasse Collin 38edf47323 Build: Install COPYING.0BSD as part of docs. 2024-02-14 19:15:58 +02:00
Lasse Collin b74e10bd83 Docs: List COPYING.0BSD in README. 2024-02-14 19:15:34 +02:00
Lasse Collin dfdb60ffe9 Docs: Include doc/examples/11_file_info.c in tarballs.
It was added in 2017 in c2e29f06a7
but it never got into any release tarballs because it was
forgotten to be added to Makefile.am.
2024-02-14 19:11:48 +02:00
Lasse Collin 160b686264 liblzma: Silence a warning. 2024-02-14 19:05:58 +02:00
Lasse Collin eeedd4d092 Add NEWS for 5.5.2beta. 2024-02-14 18:32:27 +02:00
Lasse Collin 8af7db854f xz: Mention lzmainfo if trying to use 'lzma --list'.
This kind of fixes the problem reported here:
https://bugs.launchpad.net/ubuntu/+source/xz-utils/+bug/1291020
2024-02-14 18:31:16 +02:00
Lasse Collin 0668907ff7 liblzma: Add comments. 2024-02-14 18:31:16 +02:00
Lasse Collin 109f1913d4 Scripts: Add lz4 support to xzgrep and xzdiff. 2024-02-14 18:31:16 +02:00
Lasse Collin de55485cb2 liblzma: Choose the range decoder variants using a bitmask macro. 2024-02-14 18:31:16 +02:00
Lasse Collin 0709c2b2d7 xz: Fix outdated threading related info on the man page. 2024-02-14 18:31:16 +02:00
Lasse Collin 3182a330c1 liblzma: Range decoder: Add x86-64 inline assembly.
It's compatible with GCC and Clang.
2024-02-14 18:31:16 +02:00
Lasse Collin cba2edc991 liblzma: Range decoder: Add branchless C code.
It's used only for basic bittrees and fixed-size reverse bittree
because those showed a clear benefit on x86-64 with GCC and Clang.
The other methods were more mixed and thus are commented out but
they should be tested on other archs.
2024-02-14 18:31:16 +02:00
Lasse Collin e290a72d6d liblzma: Clarify a comment. 2024-02-14 18:31:16 +02:00
Lasse Collin 5e04706b91 liblzma: LZMA decoder: Optimize loop comparison.
But now it needs one more local variable.
2024-02-14 18:31:16 +02:00
Lasse Collin 88276f9f2c liblzma: Optimize literal_subcoder() macro slightly. 2024-02-14 18:31:16 +02:00
Lasse Collin 5938f6de4d liblzma: LZ decoder: Add unlikely(). 2024-02-14 18:31:16 +02:00
Lasse Collin 9c252e3ed0 liblzma: LZ decoder: Remove a useless unlikely(). 2024-02-14 18:31:16 +02:00
Lasse Collin f3872a5947 liblzma: Optimize LZ decoder slightly.
Now extra buffer space is reserved so that repeating bytes for
any single match will never need to copy from two places (both
the beginning and the end of the buffer). This simplifies
dict_repeat() and helps a little with speed.

This seems to reduce .lzma decompression time about 2 %, so
with .xz and CRC it could be slightly less. The small things
add up still.
2024-02-14 18:31:16 +02:00
Lasse Collin eb518446e5 liblzma: LZMA decoder: Get rid of next_state[].
It's not completely obvious if this is better in the decoder.
It should be good if compiler can avoid creating a branch
(like using CMOV on x86).

This also makes lzma_encoder.c use the new macros.
2024-02-14 18:31:16 +02:00
Lasse Collin e0c0ee475c liblzma: LZMA decoder improvements.
This adds macros for bittree decoding which prepares the code
for alternative C versions and inline assembly.
2024-02-14 18:31:16 +02:00
Jia Tan de5c5e4176 liblzma: Creates Non-resumable and Resumable modes for lzma_decoder.
The new decoder resumes the first decoder loop in the Resumable mode.
Then, the code executes in Non-resumable mode until it detects that it
cannot guarantee to have enough input/output to decode another symbol.

The Resumable mode is how the decoder has always worked. Before decoding
every input bit, it checks if there is enough space and will save its
location to be resumed later. When the decoder has more input/output,
it jumps back to the correct sequence in the Resumable mode code.

When the input/output buffers are large, the Resumable mode is much
slower than the Non-resumable because it has more branches and is harder
for the compiler to optimize since it is in a large switch block.

Early benchmarking shows significant time improvement (8-10% on gcc and
clang x86) by using the Non-resumable code as much as possible.
2024-02-14 18:31:16 +02:00
Jia Tan e446ab7a18 liblzma: Creates separate "safe" range decoder mode.
The new "safe" range decoder mode is the same as old range decoder, but
now the default behavior of the range decoder will not check if there is
enough input or output to complete the operation. When the buffers are
close to fully consumed, the "safe" operations must be used instead. This
will improve speed because it will reduce the number of branches needed
for most of the range decoder operations.
2024-02-14 18:31:16 +02:00
Lasse Collin 7f6d9ca329 doxygen/footer.html: Add missing closing tags and don't open a new tab.
The footer template from Doxygen has the closing </body> </html>
as Doxygen doesn't add them otherwise.

target="_blank" was omitted as it's not useful here but
it can be slightly annoying as one cannot just go back
in the browser history.

Since the footer links to the license file in the same
directory and not to CC website, the rel attributes
can be omitted.
2024-02-14 18:31:16 +02:00
Lasse Collin 26d1527d34 Tweak the expressions in AUTHORS. 2024-02-14 18:31:16 +02:00
Lasse Collin d231d56580 Translations: Add the man page translators into man page header comment.
It looked odd to only have the original English authors listed
in the header comments of the translated files.
2024-02-14 18:31:16 +02:00
Lasse Collin 6d35fcb936 Translations: Translate also messages of lzmainfo.
lzmainfo has had translation support since 2009 at least but
it was never added to po/POTFILES.in so the messages weren't
translated. It's a very rarely needed tool so it's not too bad.

This also adds src/xz/mytime.c to po/POTFILES.in although there
are no translatable strings. It's simpler this way so that it
won't be forgotten if strings were ever added to that file.
2024-02-14 18:31:16 +02:00
Lasse Collin a9f369dd54 Translations: Add custom .pot header with SPDX license identifier.
The same is used for both po/xz.pot and po4a/xz-man.pot.
2024-02-14 18:31:16 +02:00
Lasse Collin 469cd6653b Translations: po4a/update-po: Add copyright notice to xz-man.pot.
All man pages are under 0BSD now so this is simple now.
2024-02-14 18:31:16 +02:00
Lasse Collin 28ce45e38f Update COPYING about the man pages of the scripts. 2024-02-14 18:31:16 +02:00
Lasse Collin e48287bf51 xzdiff, xzgrep, and xzmore: Rewrite the man pages.
The main reason is a kind of silly one:

xz-man.pot contains strings from all man pages in XZ Utils.
The man pages of xzdiff, xzgrep, and xzmore were under GPLv2
and the rest under 0BSD. Thus xz-man.pot contained strings
under two licences. po4a creates the translated man pages
from the combined 0BSD+GPLv2 xz-man.pot.

I haven't liked this mixing in xz-man.pot but the
Translation Project requires that all man pages must be
in the same .pot file. So a separate xz-man-gpl.pot
wasn't an option.

Since these man pages are short, rewriting them was quick enough.
Now xz-man.pot is entirely under 0BSD and marking the per-file
licenses is simpler.

As a bonus, some wording hopefully is now slightly better
although it's perhaps a matter of taste.

NOTE: In xzgrep.1, the EXIT STATUS section was written by me
in the commit d796b6d7fd so that's
why that section could be taken as is from the old xzgrep.1.
2024-02-14 18:31:16 +02:00
Lasse Collin 3e551b111b xzless: Update man page slightly.
The xz tool can decompress three file formats and xzless
has always supported uncompressed files too.
2024-02-14 18:31:16 +02:00
Lasse Collin 40f36da226 Translations: Change po/Makevars to add a copyright notice to po/xz.pot. 2024-02-14 18:31:16 +02:00
Lasse Collin 24192854e2 Translations: Update po/Makevars to use the template from gettext 0.22.4.
Also add SPDX license identifier now that there is a known license.
2024-02-14 18:31:16 +02:00
Lasse Collin b941549573 liblzma: Include the SPDX license identifier 0BSD to generated files.
Perhaps the generated files aren't even copyrightable but
using the same license for them as for the rest of the liblzma
keeps things more consistent for tools that look for license info.
2024-02-14 18:31:16 +02:00
Lasse Collin 8e4ec79483 liblzma: Fix compilation of price_tablegen.c.
It is built and run only manually so this didn't matter
unless one wanted to regenerate the price_table.c.
2024-02-14 18:31:16 +02:00
Lasse Collin e99bff3ffb Add SPDX license identifiers to GPL, LGPL, and FSFULLR files. 2024-02-14 18:31:16 +02:00
Lasse Collin 22af94128b Add SPDX license identifier into 0BSD source code files. 2024-02-14 18:31:16 +02:00
Lasse Collin 23de53421e liblzma: Sync the AUTHORS fix about SHA-256 to lzma.h. 2024-02-14 18:31:16 +02:00
Lasse Collin 689e0228ba Change most public domain parts to 0BSD.
Translations and doc/xz-file-format.txt and doc/lzma-file-format.txt
were not touched.

COPYING.0BSD was added.
2024-02-14 18:31:12 +02:00
Lasse Collin 76946dc433 Fix SHA-256 authors.
The initial commit 5d018dc035
in 2007 had a comment in sha256.c that the code is based on
Crypto++ Library 5.5.1. In 2009 the Authors list in sha256.c
and the AUTHORS file was updated with information that the
code had come from Crypto++ but via 7-Zip. I know I had viewed
7-Zip's SHA-256 code but back then the C code has been identical
enough with Crypto++, so I don't why I thought the author info
would need that extra step via 7-Zip for this single file.

Another error is that I had mixed sha.* and shacal2.* files
when checking for author info in Crypto++. The shacal2.* files
aren't related to liblzma's sha256.c and thus Kevin Springle's
code in Crypto++ isn't either.
2024-02-14 15:23:00 +02:00
Lasse Collin 21d9cbae9e Remove macosx/build.sh.
It was last updated in 2013.
2024-02-14 15:23:00 +02:00
Lasse Collin eac2c3c67f Doc: Remove doc/examples_old.
It was good to keep these around in parallel with the newer examples
but I think it's OK to remove the old ones at this point.
2024-02-14 15:23:00 +02:00
Jia Tan 89ea1a22f4 Tests: Add RISC-V filter support in a few places. 2024-02-13 23:33:27 +08:00
Jia Tan 45663443eb liblzma: Fix build error if only RISC-V BCJ filter is enabled.
If any other BCJ filter was enabled for encoding or decoding, then this
was not a problem.
2024-02-13 23:33:21 +08:00
Jia Tan 2f15597d67 Translations: Update the Korean translation. 2024-02-13 23:26:55 +08:00
Jia Tan df873143ad Translations: Update the Korean man page translations. 2024-02-13 01:55:53 +08:00
Jia Tan b3f415eddb Translations: Update the Chinese (simplified) translation. 2024-02-13 01:53:33 +08:00
Lasse Collin 9860d418d2 xzless: Use ||- in LESSOPEN with with "less" 451 and newer. 2024-02-09 23:21:01 +02:00
Lasse Collin fd0692b052 xzless: Use --show-preproc-errors with "less" 632 and newer.
This makes "less" show a warning if a decompression error occurred.
2024-02-09 23:00:05 +02:00
Jia Tan adb073da76 liblzma: Fix typo discovered by codespell. 2024-02-09 23:59:54 +08:00
Jia Tan 55d9fc883d Translations: Update the Swedish translation. 2024-02-09 20:01:06 +08:00
Jia Tan 55ba4a1ea3 Translations: Update the Spanish translation. 2024-02-08 20:09:04 +08:00
Jia Tan 7f2293cd80 Translations: Update the Spanish translation. 2024-02-07 21:34:35 +08:00
Jia Tan f4af2036bc Translations: Update the Polish translation. 2024-02-07 21:28:32 +08:00
Jia Tan e5e93bb816 Translations: Update the German translation. 2024-02-07 19:40:12 +08:00
Jia Tan 28f18ff8e2 Translations: Update the German man page translations. 2024-02-07 19:27:25 +08:00
Jia Tan cabfbc7947 Translations: Update the Romanian translation. 2024-02-06 23:44:06 +08:00
Jia Tan bf20c94f5d Translations: Update the Romanian man page translations. 2024-02-06 23:45:02 +08:00
Jia Tan 7c25ec9feb Translations: Update the Ukrainian translation. 2024-02-07 20:56:57 +08:00
Jia Tan b3523250e9 Translations: Update the Ukrainian man page translations. 2024-02-06 23:30:03 +08:00
Jia Tan a5c177f514 Update AUTHORS. 2024-02-02 01:39:28 +08:00
Jia Tan 7f68a68c19 liblzma: Update Authors list in crc32_arm64.h. 2024-02-02 01:38:51 +08:00
Jia Tan 97f9ba50b8 liblzma: Check HAVE_USABLE_CLMUL before omitting CRC32 table.
This was split from the prior commit so it could be easily applied to
the 5.4 branch.

Closes: https://github.com/tukaani-project/xz/pull/77
2024-02-01 20:09:11 +08:00
Jia Tan ca9015f4de liblzma: Check HAVE_USABLE_CLMUL before omitting CRC64 table.
If liblzma is configured with --disable-clmul-crc
CFLAGS="-msse4.1 -mpclmul", then it will fail to compile because the
generic version must be used but the CRC tables were not included.
2024-02-01 20:09:11 +08:00
Jia Tan 2f1552a91c liblzma: Only use ifunc in crcXX_fast.c if its needed.
The code was using HAVE_FUNC_ATTRIBUTE_IFUNC instead of CRC_USE_IFUNC.
With ARM64, ifunc is incompatible because it requires non-inline
function calls for runtime detection.
2024-02-01 20:09:11 +08:00
Jia Tan 30a25f3742 Docs: Add --disable-arm64-crc32 description to INSTALL. 2024-02-01 20:09:11 +08:00
Jia Tan 1940f0ec28 liblzma: Omit CRC tables when not needed with ARM64 optimizations.
This is similar to the existing x86-64 CLMUL conditions to omit the
tables. They were slightly refactored to improve readability.
2024-02-01 20:09:11 +08:00
Jia Tan 761f5b69a4 liblzma: Rename crc32_aarch64.h to crc32_arm64.h.
Even though the proper name for the architecture is aarch64, this
project uses ARM64 throughout. So the rename is for consistency.

Additionally, crc32_arm64.h was slightly refactored for the following
changes:

   * Added MSVC, FreeBSD, and macOS support in
     is_arch_extension_supported().

   * crc32_arch_optimized() now checks the size when aligning the
     buffer.

   * crc32_arch_optimized() loop conditions were slightly modified to
     avoid both decrementing the size and incrementing the buffer
     pointer.

   * Use the intrinsic wrappers defined in <arm_acle.h> because GCC and
     Clang name them differently.

   * Minor spacing and comment changes.
2024-02-01 20:09:11 +08:00
Jia Tan 455a08609c liblzma: Refactor crc_common.h.
The CRC_GENERIC is now split into CRC32_GENERIC and CRC64_GENERIC, since
the ARM64 optimizations will be different between CRC32 and CRC64.

For the same reason, CRC_ARCH_OPTIMIZED is split into
CRC32_ARCH_OPTIMIZED and CRC64_ARCH_OPTIMIZED.

ifunc will only be used with x86-64 CLMUL because the runtime detection
methods needed with ARM64 are not compatible with ifunc.
2024-02-01 20:09:11 +08:00
Jia Tan 61908e8160 CMake: Add support for ARM64 CRC32 instruction detection. 2024-02-01 20:09:11 +08:00
Jia Tan c5f6d79cc9 Build: Add support for ARM64 CRC32 instruction detection.
This adds --enable-arm64-crc32/--disable-arm64-crc32 (enabled by
default) for using the ARM64 CRC32 instruction. This can be disabled if
one knows the binary will never need to run on an ARM64 machine
with this instruction extension.
2024-02-01 20:09:09 +08:00
Chenxi Mao 849d0f282a Speed up CRC32 calculation on ARM64
The CRC32 instructions in ARM64 can calculate the CRC32 result
for 8 bytes in a single operation, making the use of ARM64
instructions much faster compared to the general CRC32 algorithm.

Optimized CRC32 will be enabled if ARM64 has CRC extension
running on Linux.

Signed-off-by: Chenxi Mao <chenxi.mao2013@gmail.com>
2024-01-27 21:49:26 +08:00
Jia Tan b43c3e48bf Bump version number for 5.5.1alpha. 2024-01-26 19:05:51 +08:00
Jia Tan c7a7ae1500 Add NEWS for 5.5.1alpha 2024-01-26 19:00:52 +08:00
Jia Tan 0ef8192e8d Add NEWS for 5.4.6. 2024-01-26 18:54:24 +08:00
Lasse Collin 93de7e751d Move doc/logo/xz-logo.png to "doc" and Doxygen footer to "doxygen".
The footer isn't a complete HTML file so having it in the doxygen
directory is a tiny bit clearer.
2024-01-24 20:00:57 +02:00
Jia Tan 00fa01698d README: Add COPYING.CC-BY-SA-4.0 entry to section 1.1.
The Overall documentation section (1.1) table spacing had to be adjusted
since the filename was very long.
2024-01-25 01:39:35 +08:00
Jia Tan e280470040 Build: Add the logo and license to the release. 2024-01-25 01:39:35 +08:00
Jia Tan b1ee6cf259 COPYING: Add the license for the XZ logo. 2024-01-25 01:39:29 +08:00
Jia Tan 31293ae707 Doxygen: Added the XZ logo and copyright information.
The PROJECT_LOGO field is now used to include the XZ logo. The footer
of each page now lists the copyright information instead of the default
footer. The license is also copied to statisfy the copyright and so the
link in the documentation can be local.
2024-01-25 01:06:01 +08:00
Lasse Collin 6daa4d0ea4 xz: Use threaded mode by defaut (as if --threads=0 was used).
This hopefully does more good than bad:

  + It's faster by default.

  + Only the threaded compressor creates files that
    can be decompressed in threaded mode.

  - Compression ratio is worse, usually not too much though.
    When it matters, -T1 must be used.

  - Memory usage increases.

  - Scripts that assume single-threaded mode but don't use -T1 will
    possibly use too much resources, for example, if they run
    multiple xz processes in parallel to compress multiple files.

  - Output from single-threaded and multi-threaded compressors
    differ but such changes could happen for other reasons too
    (they just haven't happened since 5.0.0).
2024-01-23 18:29:28 +02:00
Jia Tan a2dd2dc8e5 CI: Use RISC-V filter when building with BCJ support. 2024-01-23 23:55:44 +08:00
Jia Tan 3060e1070b Tests: Use smaller dictionary size in RISC-V test files. 2024-01-23 23:55:44 +08:00
Jia Tan 44ff2fa5c9 Tests: Skip RISC-V test files if decoder was not built. 2024-01-23 23:55:39 +08:00
Lasse Collin 6133a3f300 xz: Man page: Add more examples of LZMA2 options with BCJ filters. 2024-01-23 23:05:47 +08:00
Lasse Collin 50255feeaa liblzma: RISC-V filter: Use byte-by-byte access.
Not all RISC-V processors support fast unaligned access so
it's better to read only one byte in the main loop. This can
be faster even on x86-64 when compared to reading 32 bits at
a time as half the time the address is only 16-bit aligned.

The downside is larger code size on archs that do support
fast unaligned access.
2024-01-23 23:05:47 +08:00
Jia Tan db5eb5f563 xz: Update xz -lvv for RISC-V filter.
Version 5.6.0 will be shown, even though upcoming alphas and betas
will be able to support this filter. 5.6.0 looks nicer in the output and
people shouldn't be encouraged to use an unstable version in production
in any way.
2024-01-23 23:05:47 +08:00
Jia Tan e2870db5be Tests: Add two RISC-V Filter test files.
These test files achieve 100% code coverage in
src/liblzma/simple/riscv.c. They contain all of the instructions that
should be filtered and a few cases that should not.
2024-01-23 23:05:47 +08:00
Jia Tan b26a898693 xz: Update message in --long-help for RISC-V Filter. 2024-01-23 23:05:47 +08:00
Jia Tan 283f778908 xz: Update the man page for the RISC-V Filter.
A special note was added to suggest using four-byte alignment when the
compressed instruction extension is not present in a RISC-V binary.
2024-01-23 23:05:47 +08:00
Jia Tan ac3691ccca Tests: Add RISC-V Filter test in test_compress.sh. 2024-01-23 23:05:47 +08:00
Jia Tan 2959dbc735 liblzma: Update string_conversion.c to support RISC-V Filter. 2024-01-23 23:05:47 +08:00
Jia Tan 34372a5adb CMake: Support RISC-V BCJ Filter for encoding and decoding. 2024-01-23 23:05:47 +08:00
Jia Tan 440a2eccb0 liblzma: Add RISC-V BCJ filter.
The new Filter ID is 0x0B.

Thanks to Chien Wong <m@xv97.com> for the initial version of the Filter,
the xz CLI updates, and the Autotools build system modifications.

Thanks to Igor Pavlov for his many contributions to the design of
the filter.
2024-01-23 23:05:41 +08:00
Jia Tan 5540f4329b Docs: Update .xz file format specification to 1.2.0.
The new RISC-V filter was added to the specification, in addition to
updating the specification URL.
2024-01-19 23:08:14 +08:00
Jia Tan 22d86192f8 xz: Update website URLs in the man pages. 2024-01-19 23:08:14 +08:00
Jia Tan 6b63c4c613 liblzma: Update website URL. 2024-01-19 23:08:14 +08:00
Jia Tan fce4758018 Docs: Update website URLs. 2024-01-19 23:08:14 +08:00
Jia Tan c26812c5b2 Build: Update website URL. 2024-01-19 23:08:14 +08:00
Lasse Collin fbb3ce541e liblzma: CRC: Add a comment to crc_x86_clmul.h about BUILDING_ macros. 2024-01-11 15:25:00 +02:00
Lasse Collin 4f518c1b6b liblzma: CRC: Remove crc_always_inline, use lzma_always_inline instead.
Now crc_simd_body() in crc_x86_clmul.h is only called once
in a translation unit, we no longer need to be so cautious
about ensuring the always-inline behavior.
2024-01-11 15:24:35 +02:00
Lasse Collin 35c03ec6bf liblzma: CRC: Update CLMUL comments to more generic wording. 2024-01-11 14:39:46 +02:00
Lasse Collin 66f080e801 liblzma: Rename arch-specific CRC functions and macros.
CRC_CLMUL was split to CRC_ARCH_OPTIMIZED and CRC_X86_CLMUL.
CRC_ARCH_OPTIMIZED is defined when an arch-optimized version is used.
Currently the x86 CLMUL implementations are the only arch-optimized
versions, and these also use the CRC_x86_CLMUL macro to tell when
crc_x86_clmul.h needs to be included.

is_clmul_supported() was renamed to is_arch_extension_supported().
crc32_clmul() and crc64_clmul() were renamed to
crc32_arch_optimized() and crc64_arch_optimized().
This way the names make sense with arch-specific non-CLMUL
implementations as well.
2024-01-11 14:29:42 +02:00
Lasse Collin 3dbed75b0b liblzma: Fix a comment in crc_common.h. 2024-01-11 14:29:42 +02:00
Lasse Collin 419f55f9df liblzma: Avoid extern lzma_crc32_clmul() and lzma_crc64_clmul().
A CLMUL-only build will have the crcxx_clmul() inlined into
lzma_crcxx(). Previously a jump to the extern lzma_crcxx_clmul()
was needed. Notes about shared liblzma on ELF platforms:

  - On platforms that support ifunc and -fvisibility=hidden, this
    was silly because CLMUL-only build would have that single extra
    jump instruction of extra overhead.

  - On platforms that support neither -fvisibility=hidden nor linker
    version script (liblzma*.map), jumping to lzma_crcxx_clmul()
    would go via PLT so a few more instructions of overhead (still
    not a big issue but silly nevertheless).

There was a downside with static liblzma too: if an application only
needs lzma_crc64(), static linking would make the linker include the
CLMUL code for both CRC32 and CRC64 from crc_x86_clmul.o even though
the CRC32 code wouldn't be needed, thus increasing code size of the
executable (assuming that -ffunction-sections isn't used).

Also, now compilers are likely to inline crc_simd_body()
even if they don't support the always_inline attribute
(or MSVC's __forceinline). Quite possibly all compilers
that build the code do support such an attribute. But now
it likely isn't a problem even if the attribute wasn't supported.

Now all x86-specific stuff is in crc_x86_clmul.h. If other archs
The other archs can then have their own headers with their own
is_clmul_supported() and crcxx_clmul().

Another bonus is that the build system doesn't need to care if
crc_clmul.c is needed.

is_clmul_supported() stays as inline function as it's not needed
when doing a CLMUL-only build (avoids a warning about unused function).
2024-01-11 14:29:42 +02:00
Lasse Collin e3833e297d liblzma: crc_clmul.c: Add crc_attr_target macro.
This reduces the number of the complex #if directives.
2024-01-11 14:29:42 +02:00
Lasse Collin d164ac0e62 liblzma: Simplify existing cases with lzma_attr_no_sanitize_address. 2024-01-11 14:29:42 +02:00
Lasse Collin 9523c1300d liblzma: #define crc_attr_no_sanitize_address in crc_common.h. 2024-01-11 14:29:38 +02:00
Lasse Collin 93d144f093 liblzma: CRC: Add empty lines.
And remove one too.
2024-01-10 17:19:03 +02:00
Lasse Collin 0c7e854ffd liblzma: crc_clmul.c: Tidy up the location of MSVC pragma.
It makes no difference in practice.
2024-01-10 17:19:03 +02:00
Lasse Collin 15cf3f04f2 Update THANKS. 2023-12-28 17:17:39 +02:00
Lasse Collin cd64dd70d5 liblzma: Use 8-byte method in memcmplen.h on ARM64.
It requires fast unaligned access to 64-bit integers
and a fast instruction to count leading zeros in
a 64-bit integer (__builtin_ctzll()). This perhaps
should be enabled on some other archs too.

Thanks to Chenxi Mao for the original patch:
https://github.com/tukaani-project/xz/pull/75 (the first commit)
According to the numbers there, this may improve encoding
speed by about 3-5 %.

This enables the 8-byte method on MSVC ARM64 too which
should work but wasn't tested.
2023-12-28 17:17:39 +02:00
Lasse Collin 12c90c00f0 liblzma: Check also for __clang__ in memcmplen.h.
This change hopefully makes no practical difference as Clang
likely was detected via __GNUC__ or _MSC_VER already.
2023-12-28 17:17:39 +02:00
Jia Tan 133c5851eb Translations: Update the French translation. 2023-12-21 21:39:08 +08:00
Jia Tan 710cbc186c xz: Add a comment to Capsicum sandbox setup.
This comment is repeated in xzdec.c to help remind us why all the
capabilities are removed from stdin in certain situations.
2023-12-21 20:53:27 +08:00
Jia Tan 4e1c695676 Docs: Update --enable-sandbox option in INSTALL.
xzdec now also uses the sandbox when its configured.
2023-12-21 20:53:27 +08:00
Jia Tan ebddf20214 CMake: Move sandbox detection outside of xz section.
The sandbox is now enabled for xzdec as well, so it no longer belongs
in just the xz section. xz and xzdec are always built, except for older
MSVC versions, so there isn't a need to conditionally show the sandbox
configuration. CMake will do a little unecessary work on older MSVC
versions that can't build xz or xzdec, but this is a very small
downside.
2023-12-21 20:53:23 +08:00
Jia Tan 5feb09266f Build: Allow sandbox to be configured for just xzdec.
If xz is disabled, then xzdec can still use the sandbox.
2023-12-20 22:43:44 +08:00
Jia Tan d74fb5f060 xzdec: Add sandbox support for Pledge, Capsicum, and Landlock.
A very strict sandbox is used when the last file is decompressed. The
likely most common use case of xzdec is to decompress a single file.
The Pledge sandbox is applied to the entire process with slightly more
relaxed promises, until the last file is processed.

Thanks to Christian Weisgerber for the initial patch adding Pledge
sandboxing.
2023-12-19 21:18:28 +08:00
Jia Tan b34b6a9912 liblzma: Initialize lzma_lz_encoder pointers with NULL.
This fixes the recent change to lzma_lz_encoder that used memzero
instead of the NULL constant. On some compilers the NULL constant
(always 0) may not equal the NULL pointer (this only needs to guarentee
to not point to valid memory address).

Later code compares the pointers to the NULL pointer so we must
initialize them with the NULL pointer instead of 0 to guarentee
code correctness.
2023-12-20 21:38:39 +08:00
Jia Tan 183a62f0b5 liblzma: Set all values in lzma_lz_encoder to NULL after allocation.
The first member of lzma_lz_encoder doesn't necessarily need to be set
to NULL since it will always be set before anything tries to use it.
However the function pointer members must be set to NULL since other
functions rely on this NULL value to determine if this behavior is
supported or not.

This fixes a somewhat serious bug, where the options_update() and
set_out_limit() function pointers are not set to NULL. This seems to
have been forgotten since these function pointers were added many years
after the original two (code() and end()).

The problem is that by not setting this to NULL we are relying on the
memory allocation to zero things out if lzma_filters_update() is called
on a LZMA1 encoder. The function pointer for set_out_limit() is less
serious because there is not an API function that could call this in an
incorrect way. set_out_limit() is only called by the MicroLZMA encoder,
which must use LZMA1 where set_out_limit() is always set. Its currently
not possible to call set_out_limit() on an LZMA2 encoder at this time.

So calling lzma_filters_update() on an LZMA1 encoder had undefined
behavior since its possible that memory could be manipulated so the
options_update member pointed to a different instruction sequence.

This is unlikely to be a bug in an existing application since it relies
on calling lzma_filters_update() on an LZMA1 encoder in the first place.
For instance, it does not affect xz because lzma_filters_update() can
only be used when encoding to the .xz format.

This is fixed by using memzero() to set all members of lzma_lz_encoder
to NULL after it is allocated. This ensures this mistake will not occur
here in the future if any additional function pointers are added.
2023-12-16 20:51:38 +08:00
Jia Tan 1a1bb381db liblzma: Tweak a comment. 2023-12-16 20:30:55 +08:00
Jia Tan 55810780e0 liblzma: Make parameter names in function definition match declaration.
lzma_raw_encoder() and lzma_raw_encoder_init() used "options" as the
parameter name instead of "filters" (used by the declaration). "filters"
is more clear since the parameter represents the list of filters passed
to the raw encoder, each of which contains filter options.
2023-12-16 20:28:21 +08:00
Jia Tan 5dad6f628a liblzma: Improve lzma encoder init function consistency.
lzma_encoder_init() did not check for NULL options, but
lzma2_encoder_init() did. This is more of a code style improvement than
anything else to help make lzma_encoder_init() and lzma2_encoder_init()
more similar.
2023-12-16 20:18:47 +08:00
Jia Tan e1b1a9d637 Docs: Update repository URL in Changelog. 2023-12-16 11:20:20 +08:00
Jia Tan f9b82bc64a CI: Update Upload Artifact Action. 2023-12-15 16:56:31 +08:00
Jia Tan d0b24efe6c Tests: Silence -Wsign-conversion warning on GCC version < 10.
Since GCC version 10, GCC no longer complains about simple implicit
integer conversions with Arithmetic operators.

For instance:

    uint8_t a = 5;
    uint32_t b = a + 5;

Give a warning on GCC 9 and earlier but this:

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

Gives a warning with GCC 10+.
2023-12-07 21:48:07 +08:00
Jia Tan 4a972a8ee3 Update THANKS. 2023-12-07 20:06:57 +08:00
Jia Tan ee2f483500 Tests: Minor cleanups to OSS-Fuzz files.
Most of these fixes are small typos and tweaks. A few were caused by bad
advice from me. Here is the summary of what is changed:

- Author line edits

- Small comment changes/additions

- Using the return value in the error messages in the fuzz targets'
  coder initialization code

- Removed fuzz_encode_stream.options. This set a max length, which may
  prevent some worthwhile code paths from being properly exercised.

- Removed the max_len option from fuzz_decode_stream.options for the
  same reason as fuzz_encode_stream. The alone decoder fuzz target still
  has this restriction.

- Altered the dictionary contents for fuzz_lzma.dict. Instead of keeping
  the properties static and varying the dictionary size, the properties
  are varied and the dictionary size is kept small. The dictionary size
  doesn't have much impact on the code paths but the properties do.

Closes: https://github.com/tukaani-project/xz/pull/73
2023-12-07 20:06:57 +08:00
Maksym Vatsyk 483bb90eec Tests: Add fuzz_encode_stream ossfuzz target.
This fuzz target handles .xz stream encoding. The first byte of input
is used to dynamically set the preset level in order to increase the
fuzz coverage of complex critical code paths.
2023-12-07 20:06:57 +08:00
Maksym Vatsyk 7ca8c9869d Tests: Add fuzz_decode_alone OSS-Fuzz target
This fuzz target that handles LZMA alone decoding. A new fuzz
dictionary .dict was also created with common LZMA header values to
help speed up the discovery of valid headers.
2023-12-07 20:06:57 +08:00
Maksym Vatsyk 37581a77ad Tests: Update OSS-Fuzz Makefile.
All .c files can be built as separate fuzz targets. This simplifies
the Makefile by allowing us to use wildcards instead of having a
Makefile target for each fuzz target.
2023-12-07 20:06:54 +08:00
Maksym Vatsyk 28ce6a1c2a Tests: Move common OSS-Fuzz target code to .h file. 2023-12-07 20:06:54 +08:00
Maksym Vatsyk bf0521ea15 Tests: Rename OSS-Fuzz files. 2023-12-07 20:06:51 +08:00
Jia Tan 685094b8e1 Update THANKS. 2023-11-30 23:10:43 +08:00
Kian-Meng Ang 3b3023e00b Tests: Fix typos 2023-11-30 23:08:05 +08:00
Kian-Meng Ang 424d46ead8 xz: Fix typo 2023-11-30 23:08:05 +08:00
Jia Tan 35558adf9c Update THANKS. 2023-11-30 20:41:00 +08:00
Jia Tan fd170e8557 CI: Test musl libc builds on Ubuntu runner. 2023-11-30 20:09:46 +08:00
Jia Tan db2b4aa068 CI: Allow ci_build.sh to set a different C compiler. 2023-11-30 20:09:46 +08:00
Jia Tan ff7badef53 CMake: Use consistent indentation with check_c_source_compiles(). 2023-11-30 20:09:46 +08:00
Jia Tan d4af167570 CMake: Change __attribute__((__ifunc__())) detection.
This renames ALLOW_ATTR_IFUNC to USE_ATTR_IFUNC and applies the ifunc
detection changes that were made to the Autotools build.

Fixes: https://github.com/tukaani-project/xz/issues/70
2023-11-30 20:07:34 +08:00
Jia Tan 20ecee40a0 Docs: Update INSTALL for --enable_ifunc change. 2023-11-30 20:05:09 +08:00
Jia Tan ffb456593d Build: Change --enable-ifunc handling.
Some compilers support __attribute__((__ifunc__())) even though the
dynamic linker does not. The compiler is able to create the binary
but it will fail on startup. So it is not enough to just test if
the attribute is supported.

The default value for enable_ifunc is now auto, which will attempt
to compile a program using __attribute__((__ifunc__())). There are
additional checks in this program if glibc is being used or if it
is running on FreeBSD.

Setting --enable-ifunc will skip this test and always enable
__attribute__((__ifunc__())), even if is not supported.
2023-11-30 20:04:42 +08:00
Lasse Collin 12b89bcc99 xz: Tweak a comment. 2023-11-23 17:39:10 +02:00
Jia Tan 2ab2e4b5a5 xz: Use is_tty() in message.c. 2023-11-23 22:40:27 +08:00
Jia Tan 584e3a258f xz: Create separate is_tty() function.
The new is_tty() will report if a file descriptor is a terminal or not.
On POSIX systems, it is a wrapper around isatty(). However, the native
Windows implementation of isatty() will return true for all character
devices, not just terminals. So is_tty() has a special case for Windows
so it can use alternative Windows API functions to determine if a file
descriptor is a terminal.

This fixes a bug with MSVC and MinGW-w64 builds that refused to read from
or write to non-terminal character devices because xz thought it was a
terminal. For instance:

    xz foo -c > /dev/null

would fail because /dev/null was assumed to be a terminal.
2023-11-23 22:40:20 +08:00
Jia Tan 6b05f827f5 tuklib_integer: Fix typo discovered by codespell.
Based on internet dictionary searches, 'choise' is an outdated spelling
of 'choice'.
2023-11-22 20:39:41 +08:00
Lasse Collin 659aca0d69 xz: Move the check for --suffix with --format=raw a few lines earlier.
Now it reads from argv[] instead of args->arg_names.
2023-11-18 01:56:09 +08:00
Jia Tan ca278eb2b7 Tests: Create test_suffix.sh.
This tests some complicated interactions with the --suffix= option.
The suffix option must be used with --format=raw, but can optionally
be used to override the default .xz suffix.

This test also verifies some recent bugs have been correctly solved
and to hopefully avoid further regressions in the future.
2023-11-18 01:56:05 +08:00
Jia Tan 2a732aba22 xz: Fix a bug with --files and --files0 in raw mode without a suffix.
The following command caused a segmentation fault:

    xz -Fraw --lzma1 --files=foo

when foo was a valid file. The usage of --files or --files0 was not
being checked when compressing or decompressing in raw mode without a
suffix. The suffix checking code was meant to validate that all files
to be processed are "-" (if not writing to standard out), meaning the
data is only coming from standard in. In this case, there were no file
names to check since --files and --files0 store their file name in a
different place.

Later code assumed the suffix was set and caused a segmentation fault.
Now, the above command results in an error.
2023-11-17 23:16:55 +08:00
Jia Tan 299920bab9 Tests: Fix typo in a comment. 2023-11-17 20:04:58 +08:00
Jia Tan f481523baa xz: Refactor suffix test with raw format.
The previous version set opt_stdout, but this caused an issue with
copying an input file to standard out when decompressing an unknown file
type. The following needs to result in an error:

    echo foo | xz -df

since -c, --stdout is not used. This fixes the previous error by not
setting opt_stdout.
2023-11-15 23:40:13 +08:00
Jia Tan 837ea40b1c xz: Move suffix check after stdout mode is detected.
This fixes a bug introduced in cc5aa9ab13
when the suffix check was initially moved. This caused a situation that
previously worked:

    echo foo | xz -Fraw --lzma1 | wc -c

to fail because the old code knew that this would write to standard out
so a suffix was not needed.
2023-11-14 20:27:46 +08:00
Jia Tan d4f4a4d040 xz: Detect when all data will be written to standard out earlier.
If the -c, --stdout argument is not used, then we can still detect when
the data will be written to standard out if all of the provided
filenames are "-" (denoting standard in) or if no filenames are
provided.
2023-11-14 20:27:04 +08:00
Jia Tan 2ade7246e7 liblzma: Add missing comments to lz_encoder.h. 2023-11-09 01:21:53 +08:00
Jia Tan 5fe1450603 Add NEWS for 5.4.5. 2023-11-01 20:58:58 +08:00
Lasse Collin 46007049cd liblzma: Fix compilation of fastpos_tablegen.c.
The macro lzma_attr_visibility_hidden has to be defined to make
fastpos.h usable. The visibility attribute is irrelevant to
fastpos_tablegen.c so simply #define the macro to an empty value.

fastpos_tablegen.c is never built by the included build systems
and so the problem wasn't noticed earlier. It's just a standalone
program for generating fastpos_table.c.

Fixes: https://github.com/tukaani-project/xz/pull/69
Thanks to GitHub user Jamaika1.
2023-10-31 21:41:09 +02:00
Jia Tan 148e20607e Build: Fix text wrapping in an output message. 2023-10-31 21:54:11 +08:00
Lasse Collin 8c36ab79cb liblzma: Add a note why crc_always_inline exists for now.
Solaris Studio is a possible example (not tested) which
supports the always_inline attribute but might not get
detected by the common.h #ifdefs.
2023-10-30 18:44:32 +02:00
Lasse Collin e7a86b94cd liblzma: Use lzma_always_inline in memcmplen.h. 2023-10-30 18:44:32 +02:00
Lasse Collin dcfe563299 liblzma: #define lzma_always_inline in common.h. 2023-10-30 18:44:32 +02:00
Lasse Collin 41113fe30a liblzma: Use lzma_attr_visibility_hidden on private extern declarations.
These variables are internal to liblzma and not exposed in the API.
2023-10-30 18:06:25 +02:00
Lasse Collin a2f5ca706a liblzma: #define lzma_attr_visibility_hidden in common.h.
In ELF shared libs:

-fvisibility=hidden affects definitions of symbols but not
declarations.[*] This doesn't affect direct calls to functions
inside liblzma as a linker can replace a call to lzma_foo@plt
with a call directly to lzma_foo when -fvisibility=hidden is used.

[*] It has to be like this because otherwise every installed
    header file would need to explictly set the symbol visibility
    to default.

When accessing extern variables that aren't defined in the
same translation unit, compiler assumes that the variable has
the default visibility and thus indirection is needed. Unlike
function calls, linker cannot optimize this.

Using __attribute__((__visibility__("hidden"))) with the extern
variable declarations tells the compiler that indirection isn't
needed because the definition is in the same shared library.

About 15+ years ago, someone told me that it would be good if
the CRC tables would be defined in the same translation unit
as the C code of the CRC functions. While I understood that it
could help a tiny amount, I didn't want to change the code because
a separate translation unit for the CRC tables was needed for the
x86 assembly code anyway. But when visibility attributes are
supported, simply marking the extern declaration with the
hidden attribute will get identical result. When there are only
a few affected variables, this is trivial to do. I wish I had
understood this back then already.
2023-10-30 18:03:39 +02:00
Lasse Collin 2c7ee92e44 liblzma: Refer to MinGW-w64 instead of MinGW in the API headers.
MinGW (formely a MinGW.org Project, later the MinGW.OSDN Project
at <https://osdn.net/projects/mingw/>) has GCC 9.2.0 as the
most recent GCC package (released 2021-02-02). The project might
still be alive but majority of people have switched to MinGW-w64.
Thus it seems clearer to refer to MinGW-w64 in our API headers too.
Building with MinGW is likely to still work but I haven't tested it
in the recent years.
2023-10-26 21:46:06 +03:00
Lasse Collin 597f49b614 CMake: Use -D_FILE_OFFSET_BITS=64 if (and only if) needed.
A CMake option LARGE_FILE_SUPPORT is created if and only if
-D_FILE_OFFSET_BITS=64 affects sizeof(off_t).

This is needed on many 32-bit platforms and even with 64-bit builds
with MinGW-w64 to get support for files larger than 2 GiB.
2023-10-26 21:46:06 +03:00
Lasse Collin 1bc548b821 CMake: Generate and install liblzma.pc if not using MSVC.
Autotools based build uses -pthread and thus adds it to Libs.private
in liblzma.pc. CMake doesn't use -pthread at all if pthread functions
are available in libc so Libs.private doesn't get -pthread either.
2023-10-26 21:46:06 +03:00
Lasse Collin 2add71966f CMake: Rearrange the PACKAGE_ variables.
The windres workaround now replaces spaces with \x20 so
the package name isn't repeated.

These changes will help with creation of liblzma.pc.
2023-10-26 21:46:06 +03:00
Lasse Collin a7d1b2825c liblzma: Add Cflags.private to liblzma.pc.in for MSYS2.
It properly adds -DLZMA_API_STATIC when compiling code that
will be linked against static liblzma. Having it there on
systems other than Windows does no harm.

See: https://www.msys2.org/docs/pkgconfig/
2023-10-26 21:46:06 +03:00
Lasse Collin 80e0750e39 CMake: Create liblzma.def when building liblzma.dll with MinGW-w64. 2023-10-26 21:46:06 +03:00
Lasse Collin 08d12595f4 CMake: Change one CMAKE_CURRENT_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR.
In this case they have identical values.
2023-10-26 21:46:06 +03:00
Lasse Collin e67aaf698d CMake/Windows: Fix the import library filename.
Both PREFIX and IMPORT_PERFIX have to be set to "" to get
liblzma.dll and liblzma.dll.a.
2023-10-26 18:58:21 +03:00
Lasse Collin 88588b1246 Build: Detect -fsanitize= in CFLAGS and incompatible build options.
Now configure will fail if -fsanitize= is found in CFLAGS
and sanitizer-incompatible ifunc or Landlock sandboxing
would be used. These are incompatible with one or more sanitizers.
It's simpler to reject all -fsanitize= uses instead of trying to
pass those that might not cause problems.

CMake-based build was updated similarly. It lets the configuration
finish (SEND_ERROR instead of FATAL_ERROR) so that both error
messages can be seen at once.
2023-10-25 20:18:04 +03:00
Jia Tan 5e3d890f88 CI: Disable sandboxing in fsanitize=address,undefined job.
The sandboxing on Linux now supports Landlock, which restricts all
supported filesystem actions after xz opens the files it needs. The
sandbox is only enabled when one file is input and we are writing to
standard out. With fsanitize=address,undefined, the instrumentation
needs to read additional files after the sandbox is in place. This
forces all xz based test to fail, so the sandbox must instead be
disabled.
2023-10-24 00:50:08 +08:00
Jia Tan b1408987ea CI: Allow disabling the sandbox in ci_build.sh. 2023-10-24 00:15:39 +08:00
Lasse Collin 91c435cf1c CMake: Don't shadow the cache entry ENABLE_THREADS with a normal variable.
Using set(ENABLE_THREADS "posix") is confusing because it sets
a new normal variable and leaves the cache entry with the same
name unchanged. The intent wasn't to change the cache entry so
this switches to a different variable name.
2023-10-22 19:03:52 +03:00
Lasse Collin fa1609eb93 Docs: Update INSTALL about sandboxing support. 2023-10-22 19:03:52 +03:00
Lasse Collin 8276c7f41c xz: Support basic sandboxing with Linux Landlock (ABI versions 1-3).
It is enabled only when decompressing one file to stdout,
similar to how Capsicum is used.

Landlock was added in Linux 5.13.
2023-10-22 19:03:52 +03:00
Lasse Collin 3a1e9fd031 CMake: Edit threading related messages.
It's mostly to change from "thread method" to "threading method".
2023-10-22 19:03:52 +03:00
Lasse Collin bf01135252 CMake: Use FATAL_ERROR if user-supplied options aren't understood.
This way typos are caught quickly and compounding error messages
are avoided (a single typo could cause more than one error).

This keeps using SEND_ERROR when the system is lacking a feature
(like threading library or sandboxing method). This way the whole
configuration log will be generated in case someone wishes to
report a problem upstream.
2023-10-22 19:03:52 +03:00
Lasse Collin 3f53870c24 CMake: Add sandboxing support. 2023-10-22 19:03:52 +03:00
Lasse Collin 2e2cd11535 Simplify detection of Capsicum support.
This removes support for FreeBSD 10.0 and 10.1 which used
<sys/capability.h> instead of <sys/capsicum.h>. Support for
FreeBSD 10.1 ended on 2016-12-31. So now FreeBSD >= 10.2 is
required to enable Capsicum support.

This also removes support for Capsicum on Linux (libcaprights)
which seems to have been unmaintained since 2017 and Linux 4.11:
https://github.com/google/capsicum-linux
2023-10-22 19:03:52 +03:00
Lasse Collin c57858b60e xz/Windows: Allow clock_gettime with POSIX threads.
If winpthreads are used for threading, it's OK to use clock_gettime()
from winpthreads too.
2023-10-22 18:59:45 +03:00
Lasse Collin dd32f628bb mythread.h: Make MYTHREAD_POSIX compatible with MinGW-w64's winpthreads.
This might be almost useless but it doesn't need much extra code either.
2023-10-22 18:59:45 +03:00
Lasse Collin 680e52cdd0 CMake: Check for clock_gettime() even on Windows.
This mirrors configure.ac although currently MinGW-w64 builds
don't use clock_gettime() even if it is found.
2023-10-22 18:59:45 +03:00
Lasse Collin 1c1a8c3ee4 Build: Check for clock_gettime() even if not using POSIX threads.
See the new comment in the code.

This also makes the check for clock_gettime() run with MinGW-w64
with which we don't want to use clock_gettime(). The previous
commit already took care of this situation.
2023-10-22 18:59:45 +03:00
Lasse Collin 46fd991cd2 xz/Windows: Ensure that clock_gettime() isn't used with MinGW-w64.
This commit alone doesn't change anything in the real-world:

  - configure.ac currently checks for clock_gettime() only
    when using pthreads.

  - CMakeLists.txt doesn't check for clock_gettime() on Windows.

So clock_gettime() wasn't used with MinGW-w64 before either.

clock_gettime() provides monotonic time and it's better than
gettimeofday() in this sense. But clock_gettime() is defined
in winpthreads, and liblzma or xz needs nothing else from
winpthreads. By avoiding clock_gettime(), we avoid the dependency on
libwinpthread-1.dll or the need to link against the static version.

As a bonus, GetTickCount64() and MinGW-w64's gettimeofday() can be
faster than clock_gettime(CLOCK_MONOTONIC, &tv). The resolution
is more than good enough for the progress indicator in xz.
2023-10-22 18:59:45 +03:00
Lasse Collin cdb4d91f24 xz/Windows: Use GetTickCount64() with MinGW-w64 if using Vista threads. 2023-10-22 18:59:45 +03:00
Jia Tan 988e09f27b liblzma: Move is_clmul_supported() back to crc_common.h.
This partially reverts creating crc_clmul.c
(8c0f9376f5) where is_clmul_supported()
was moved, extern'ed, and renamed to lzma_is_clmul_supported(). This
caused a problem when the function call to lzma_is_clmul_supported()
results in a call through the PLT. ifunc resolvers run very early in
the dynamic loading sequence, so the PLT may not be setup properly at
this point. Whether the PLT is used or not for
lzma_is_clmul_supported() depened upon the compiler-toolchain used and
flags.

In liblzma compiled with GCC, for instance, GCC will go through the PLT
for function calls internal to liblzma if the version scripts and
symbol visibility hiding are not used. If lazy-binding is disabled,
then it would have made any program linked with liblzma fail during
dynamic loading in the ifunc resolver.
2023-10-21 00:01:29 +08:00
Jia Tan 105c7ca90d Build: Remove check for COND_CHECK_CRC32 in check/Makefile.inc.
Currently crc32 is always enabled, so COND_CHECK_CRC32 must always be
set. Because of this, it makes the recent change to conditionally
compile check/crc_clmul.c appear wrong since that file has CLMUL
implementations for both CRC32 and CRC64.
2023-10-19 16:23:32 +08:00
Jia Tan 1397571704 CMake: Add ALLOW_CLMUL_CRC option to enable/disable CLMUL.
The option is enabled by default, but will only be visible to a user
listing cache variables or using a CMake GUI application if the
immintrin.h header file is found.

This mirrors our Autotools build --disable-clmul-crc functionality.
2023-10-19 16:09:01 +08:00
Jia Tan c60b25569d liblzma: Fix -fsanitize=address failure with crc_clmul functions.
After forcing crc_simd_body() to always be inlined it caused
-fsanitize=address to fail for lzma_crc32_clmul() and
lzma_crc64_clmul(). The __no_sanitize_address__ attribute was added
to lzma_crc32_clmul() and lzma_crc64_clmul(), but not removed from
crc_simd_body(). ASAN and inline functions behavior has changed over
the years for GCC specifically, so while strictly required we will
keep __attribute__((__no_sanitize_address__)) on crc_simd_body() in
case this becomes a requirement in the future.

Older GCC versions refuse to inline a function with ASAN if the
caller and callee do not agree on sanitization flags
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89124#c3). If the
function was forced to be inlined, it will not compile if the callee
function has __no_sanitize_address__ but the caller doesn't.
2023-10-19 01:15:20 +08:00
Lasse Collin 9a78971261 tuklib_integer: Update the CMake test for fast unaligned access. 2023-10-18 19:02:45 +03:00
Lasse Collin 2f81ac852b Build: Enabled unaligned access by default on PowerPC64LE and some RISC-V.
PowerPC64LE wasn't tested but it seems like a safe change.
POWER8 supports unaligned access in little endian mode. Testing
on godbolt.org shows that GCC uses unaligned access by default.

The RISC-V macro __riscv_misaligned_fast is very new and not
in any stable compiler release yet.

Documentation in INSTALL was updated to match.

Documentation about an autodetection bug when using ARM64 GCC
with -mstrict-align was added to INSTALL.

CMake files weren't updated yet.
2023-10-18 19:02:45 +03:00
Lasse Collin c8f715f1bc tuklib_integer: Revise unaligned reads and writes on strict-align archs.
In XZ Utils context this doesn't matter much because
unaligned reads and writes aren't used in hot code
when TUKLIB_FAST_UNALIGNED_ACCESS isn't #defined.
2023-10-18 19:02:45 +03:00
Lasse Collin 6828242735 tuklib_integer: Add missing write64be and write64le fallback functions. 2023-10-18 19:02:45 +03:00
Jia Tan 1c8884f0af liblzma: Set the MSVC optimization fix to only cover lzma_crc64_clmul().
After testing a 32-bit Release build on MSVC, only lzma_crc64_clmul()
has the bug. crc_simd_body() and lzma_crc32_clmul() do not need the
optimizations disabled.
2023-10-18 23:54:41 +08:00
Lasse Collin 5ce0f7a48b liblzma: CRC_USE_GENERIC_FOR_SMALL_INPUTS cannot be used with ifunc. 2023-10-18 23:54:41 +08:00
Lasse Collin 2773538049 liblzma: Include common.h in crc_common.h.
crc_common.h depends on common.h. The headers include common.h except
when there is a reason to not do so.
2023-10-18 23:54:41 +08:00
Jia Tan e13b7947b9 liblzma: Add include guards to crc_common.h. 2023-10-18 23:54:41 +08:00
Jia Tan 40abd88afc liblzma: Add the crc_always_inline macro to crc_simd_body().
Forcing this to be inline has a significant speed improvement at the
cost of a few repeated instructions. The compilers tested on did not
inline this function since it is large and is used twice in the same
translation unit.
2023-10-18 23:54:41 +08:00
Jia Tan a5966c276b liblzma: Create crc_always_inline macro.
This macro must be used instead of the inline keyword. On MSVC, it is
a replacement for __forceinline which is an MSVC specific keyword that
should not be used with inline (it will issue a warning if it is).

It does not use a build system check to determine if
__attribute__((__always_inline__)) since all compilers that can use
CLMUL extensions (except the special case for MSVC) should support this
attribute. If this assumption is incorrect then it will result in a bug
report instead of silently producing slow code.
2023-10-18 23:54:41 +08:00
Jia Tan 96b663f67c liblzma: Refactor CRC comments.
A detailed description of the three dispatch methods was added. Also,
duplicated comments now only appear in crc32_fast.c or were removed from
both crc32_fast.c and crc64_fast.c if they appeared in crc_clmul.c.
2023-10-18 23:54:41 +08:00
Jia Tan 8c0f9376f5 liblzma: Create crc_clmul.c.
Both crc32_clmul() and crc64_clmul() are now exported from
crc32_clmul.c as lzma_crc32_clmul() and lzma_crc64_clmul(). This
ensures that is_clmul_supported() (now lzma_is_clmul_supported()) is
not duplicated between crc32_fast.c and crc64_fast.c.

Also, it encapsulates the complexity of the CLMUL implementations into a
single file and reduces the complexity of crc32_fast.c and crc64_fast.c.
Before, CLMUL code was present in crc32_fast.c, crc64_fast.c, and
crc_common.h.

During the conversion, various cleanups were applied to code (thanks to
Lasse Collin) including:

- Require using semicolons with MASK_/L/H/LH macros.
- Variable typing and const handling improvements.
- Improvements to comments.
- Fixes to the pragmas used.
- Removed unneeded variables.
- Whitespace improvements.
- Fixed CRC_USE_GENERIC_FOR_SMALL_INPUTS handling.
- Silenced warnings and removed the need for some #pragmas
2023-10-18 23:54:36 +08:00
Jia Tan a3ebc2c516 liblzma: Define CRC_USE_IFUNC in crc_common.h.
When ifunc is supported, we can define a simpler macro instead of
repeating the more complex check in both crc32_fast.c and crc64_fast.c.
2023-10-18 20:41:11 +08:00
394 changed files with 25163 additions and 13407 deletions

10
.github/SECURITY.md vendored
View File

@ -4,7 +4,7 @@
We provide security updates to the development branch and the stable
branches. Security patches for old releases are available on the
[project website](https://tukaani.org/xz).
[project website](https://xz.tukaani.org/xz-utils/).
## Reporting a Vulnerability
@ -16,13 +16,7 @@ the chance that the exploit will be used before a patch is released.
You may submit a report by emailing us at
[xz@tukaani.org](mailto:xz@tukaani.org), or through
[Security Advisories](https://github.com/tukaani-project/xz/security/advisories/new).
While both options are available, we prefer email. In any case, please
provide a clear description of the vulnerability including:
- Affected versions of XZ Utils
- Estimated severity (low, moderate, high, critical)
- Steps to recreate the vulnerability
- All relevant files (core dumps, build logs, input files, etc.)
While both options are available, we prefer email.
This project is maintained by a team of volunteers on a reasonable-effort
basis. As such, please give us 90 days to work on a fix before

View File

@ -1,10 +1,9 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
name: CI
@ -38,7 +37,7 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools
# Install Autotools on Mac
- name: Install Dependencies
@ -50,7 +49,7 @@ jobs:
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'cmake' }}
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
sudo apt-get install -y build-essential cmake musl-tools
# Install CMake on Mac
- name: Install Dependencies
@ -80,15 +79,34 @@ jobs:
# ifunc must be disabled for this test because __attribute__ ifunc is
# incompatible with -fsanitize=address.
#
# The sandbox must also be disabled because it will prevent access to
# the /proc/ filesystem on Linux, which is used by the sanitizer's
# instrumentation.
- name: Build with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: ./build-aux/ci_build.sh -b autotools -p build -f "-fsanitize=address,undefined" -d ifunc
run: ./build-aux/ci_build.sh -b autotools -p build -f "-fsanitize=address,undefined" -d ifunc,sandbox
- name: Test with -fsanitize=address,undefined
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: |
./build-aux/ci_build.sh -b autotools -p test -f "-fsanitize=address,undefined" -d ifunc
./build-aux/ci_build.sh -b autotools -p test -f "-fsanitize=address,undefined" -d ifunc,sandbox
cd ../xz_build && make distclean
# musl libc has some slight differences compared to glibc, including
# the lack of ifunc support. This tests if the ifunc detection
# functions properly since musl-gcc can compile with ifunc support,
# but will fail at runtime.
- name: Build with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}}
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
- name: Test with musl libc
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
- name: Clean up musl libc run
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
run: cd ../xz_build && make distclean
- name: Build with full features
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build
- name: Test with full features
@ -135,7 +153,7 @@ jobs:
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d small -p test -n small
# Attempt to upload the test logs as artifacts if any step has failed
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
if: ${{ failure() }}
with:
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs

View File

@ -1,10 +1,9 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
name: Windows-CI
@ -118,7 +117,7 @@ jobs:
###############
# Upload the test logs as artifacts if any step has failed.
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
if: ${{ failure() }}
with:
name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs

1
.gitignore vendored
View File

@ -67,6 +67,7 @@ coverage
/tests/test_index
/tests/test_index_hash
/tests/test_lzip_decoder
/tests/test_microlzma
/tests/test_memlimit
/tests/test_stream_flags
/tests/test_vli

40
AUTHORS
View File

@ -9,15 +9,13 @@ Authors of XZ Utils
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
this code, XZ Utils wouldn't exist.
The SHA-256 implementation in liblzma is based on the code found from
7-Zip <https://7-zip.org/>, which has a modified version of the SHA-256
code found from Crypto++ <https://www.cryptopp.com/>. The SHA-256 code
in Crypto++ was written by Kevin Springle and Wei Dai.
The SHA-256 implementation in liblzma is based on code written by
Wei Dai in Crypto++ Library <https://www.cryptopp.com/>.
Some scripts have been adapted from gzip. The original versions
were written by Jean-loup Gailly, Charles Levert, and Paul Eggert.
Andrew Dudman helped adapting the scripts and their man pages for
XZ Utils.
A few scripts have been adapted from GNU gzip. The original
versions were written by Jean-loup Gailly, Charles Levert, and
Paul Eggert. Andrew Dudman helped adapting the scripts and their
man pages for XZ Utils.
The initial version of the threaded .xz decompressor was written
by Sebastian Andrzej Siewior.
@ -25,15 +23,31 @@ Authors of XZ Utils
The initial version of the .lz (lzip) decoder was written
by Michał Górny.
CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov.
Architecture-specific CRC optimizations were contributed by
Ilya Kurdyukov, Hans Jansen, and Chenxi Mao.
Other authors:
- Jonathan Nieder
- Joachim Henke
The GNU Autotools-based build system contains files from many authors,
which I'm not trying to list here.
Many people have contributed improvements or reported bugs.
Most of these people are mentioned in the file THANKS.
Several people have contributed fixes or reported bugs. Most of them
are mentioned in the file THANKS.
The translations of the command line tools and man pages have been
contributed by many people via the Translation Project:
- https://translationproject.org/domain/xz.html
- https://translationproject.org/domain/xz-man.html
The authors of the translated man pages are in the header comments
of the man page files. In the source package, the authors of the
translations are in po/*.po and po4a/*.po files.
Third-party code whose authors aren't listed here:
- GNU getopt_long() in the 'lib' directory is included for
platforms that don't have a usable getopt_long().
- The build system files from GNU Autoconf, GNU Automake,
GNU Libtool, GNU Gettext, Autoconf Archive, and related files.

File diff suppressed because it is too large Load Diff

110
COPYING
View File

@ -6,71 +6,95 @@ XZ Utils Licensing
is a rough summary of which licenses apply to which parts of this
package (but check the individual files to be sure!):
- liblzma is in the public domain.
- liblzma is under the BSD Zero Clause License (0BSD).
- xz, xzdec, and lzmadec command line tools are in the public
domain unless GNU getopt_long had to be compiled and linked
in from the lib directory. The getopt_long code is under
GNU LGPLv2.1+.
- The command line tools xz, xzdec, lzmadec, and lzmainfo are
under 0BSD except that, on systems that don't have a usable
getopt_long, GNU getopt_long is compiled and linked in from the
'lib' directory. The getopt_long code is under GNU LGPLv2.1+.
- The scripts to grep, diff, and view compressed files have been
adapted from gzip. These scripts and their documentation are
under GNU GPLv2+.
adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless,
and xzmore) are under GNU GPLv2+. The man pages of the scripts
are under 0BSD; they aren't based on the man pages of GNU gzip.
- All the documentation in the doc directory and most of the
XZ Utils specific documentation files in other directories
are in the public domain.
- Most of the XZ Utils specific documentation that is in
plain text files (like README, INSTALL, PACKAGERS, NEWS,
and ChangeLog) are under 0BSD unless stated otherwise in
the file itself. The files xz-file-format.txt and
lzma-file-format.xt are in the public domain but may
be distributed under the terms of 0BSD too.
- Doxygen-generated HTML version of the liblzma API documentation:
While Doxygen is under the GNU GPLv2, the license information
in Doxygen includes the following exception:
Documents produced by doxygen are derivative works
derived from the input used in their production;
they are not affected by this license.
Note: The JavaScript files (under the MIT license) have
been removed from the Doxygen-generated HTML version of the
liblzma API documentation. Doxygen itself is under the GNU GPL
but the remaining files generated by Doxygen are not affected
by the licenses used in Doxygen because Doxygen licensing has
the following exception:
been removed from the Doxygen output.
"Documents produced by doxygen are derivative works
derived from the input used in their production;
they are not affected by this license."
- The XZ logo (xz-logo.png) included in the Doxygen-generated
documentation is under the Creative Commons BY-SA 4.0 license.
- Translated messages are in the public domain.
- Translated messages and man pages are under 0BSD except that
some old translations are in the public domain.
- The build system contains public domain files, and files that
are under GNU GPLv2+ or GNU GPLv3+. None of these files end up
in the binaries being built.
- Test files and test code in the 'tests' directory, and
debugging utilities in the 'debug' directory are under
the BSD Zero Clause License (0BSD).
- Test files and test code in the tests directory, and debugging
utilities in the debug directory are in the public domain.
- The GNU Autotools based build system contains files that are
under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses.
These files don't affect the licensing of the binaries being
built.
- The extra directory may contain public domain files, and files
that are under various free software licenses.
- The extra directory contain files that are under various
free software licenses.
You can do whatever you want with the files that have been put into
the public domain. If you find public domain legally problematic,
take the previous sentence as a license grant. If you still find
the lack of copyright legally problematic, you have too many
lawyers.
For the files under the BSD Zero Clause License (0BSD), if
a copyright notice is needed, the following is sufficient:
As usual, this software is provided "as is", without any warranty.
Copyright (C) The XZ Utils authors and contributors
If you copy significant amounts of public domain code from XZ Utils
If you copy significant amounts of 0BSD-licensed code from XZ Utils
into your project, acknowledging this somewhere in your software is
polite (especially if it is proprietary, non-free software), but
naturally it is not legally required. Here is an example of a good
notice to put into "about box" or into documentation:
it is not legally required by the license terms. Here is an example
of a good notice to put into "about box" or into documentation:
This software includes code from XZ Utils <https://tukaani.org/xz/>.
This software includes code from XZ Utils
<https://xz.tukaani.org/xz-utils/>.
The following license texts are included in the following files:
- COPYING.0BSD: BSD Zero Clause License
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
- COPYING.GPLv2: GNU General Public License version 2
- COPYING.GPLv3: GNU General Public License version 3
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
International Public License
Note that the toolchain (compiler, linker etc.) may add some code
pieces that are copyrighted. Thus, it is possible that e.g. liblzma
binary wouldn't actually be in the public domain in its entirety
even though it contains no copyrighted code from the XZ Utils source
package.
A note about old XZ Utils releases:
If you have questions, don't hesitate to ask the author(s) for more
information.
XZ Utils releases 5.4.6 and older and 5.5.1alpha have a
significant amount of code put into the public domain and
that obviously remains so. The switch from public domain to
0BSD for newer releases was made in Febrary 2024 because
public domain has (real or perceived) legal ambiguities in
some jurisdictions.
There is very little *practical* difference between public
domain and 0BSD. The main difference likely is that one
shouldn't claim that 0BSD-licensed code is in the public
domain; 0BSD-licensed code is copyrighted but available under
an extremely permissive license. Neither 0BSD nor public domain
require retaining or reproducing author, copyright holder, or
license notices when distributing the software. (Compare to,
for example, BSD 2-Clause "Simplified" License which does have
such requirements.)
If you have questions, don't hesitate to ask for more information.
The contact information is in the README file.

11
COPYING.0BSD Normal file
View File

@ -0,0 +1,11 @@
Permission to use, copy, modify, and/or distribute this
software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

427
COPYING.CC-BY-SA-4.0 Normal file
View File

@ -0,0 +1,427 @@
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@ -1,6 +1,6 @@
See the commit log in the git repository:
git clone https://git.tukaani.org/xz.git
git clone https://github.com/tukaani-project/xz
Note that "make dist" doesn't put this tiny file into the package.
Instead, the git commit log is used as ChangeLog. See dist-hook in

200
INSTALL
View File

@ -143,43 +143,37 @@ XZ Utils Installation
1.2.7. Windows
If it is enough to build liblzma (no command line tools):
The "windows" directory contains instructions for a few types
of builds:
- There is CMake support. It should be good enough to build
static liblzma or liblzma.dll with Visual Studio. The CMake
support may work with MinGW or MinGW-w64. Read the comment
in the beginning of CMakeLists.txt before running CMake!
- INSTALL-MinGW-w64_with_CMake.txt
Simple instructions how to build XZ Utils natively on
Windows using only CMake and a prebuilt toolchain
(GCC + MinGW-w64 or Clang/LLVM + MinGW-w64).
- There are Visual Studio project files under the "windows"
directory. See windows/INSTALL-MSVC.txt. In the future the
project files will be removed when CMake support is good
enough. Thus, please test the CMake version and help fix
possible issues.
- INSTALL-MinGW-w64_with_Autotools.txt
Native build under MSYS2 or cross-compilation from
GNU/Linux using a bash script that creates a .zip
and .7z archives of the binaries and documentation.
The related file README-Windows.txt is for the
resulting binary package.
To build also the command line tools:
- INSTALL-MSVC.txt
Building with MSVC / Visual Studio and CMake.
- MinGW-w64 + MSYS (32-bit and 64-bit x86): This is used
for building the official binary packages for Windows.
There is windows/build.bash to ease packaging XZ Utils with
MinGW(-w64) + MSYS into a redistributable .zip or .7z file.
See windows/INSTALL-MinGW.txt for more information.
- liblzma-crt-mixing.txt
Documentation what to take into account as a programmer
if liblzma.dll and the application don't use the same
CRT (MSVCRT or UCRT).
- MinGW + MSYS (32-bit x86): I haven't recently tested this.
Other choices:
- Cygwin 1.7.35 and later: NOTE that using XZ Utils >= 5.2.0
under Cygwin older than 1.7.35 can lead to DATA LOSS! If
you must use an old Cygwin version, stick to XZ Utils 5.0.x
which is safe under older Cygwin versions. You can check
the Cygwin version with the command "cygcheck -V".
- Cygwin: https://cygwin.com/
Building on Cygwin can be done like on many POSIX operating
systems. XZ Utils >= 5.2.0 isn't compatible with Cygwin older
than 1.7.35 (data loss!). 1.7.35 was released on 2015-03-04.
It may be possible to build liblzma with other toolchains too, but
that will probably require writing a separate makefile. Building
the command line tools with non-GNU toolchains will be harder than
building only liblzma.
Even if liblzma is built with MinGW(-w64), the resulting DLL can
be used by other compilers and linkers, including MSVC. See
windows/README-Windows.txt for details.
- MSYS2: https://www.msys2.org/
1.2.8. DOS
@ -359,20 +353,20 @@ XZ Utils Installation
with --docdir=DIR.
--disable-assembler
liblzma includes some assembler optimizations. Currently
there is only assembler code for CRC32 and CRC64 for
32-bit x86.
This disables CRC32 and CRC64 assembly code on
32-bit x86. This option currently does nothing
on other architectures (not even on x86-64).
All the assembler code in liblzma is position-independent
code, which is suitable for use in shared libraries and
position-independent executables. So far only i386
instructions are used, but the code is optimized for i686
class CPUs. If you are compiling liblzma exclusively for
The 32-bit x86 assembly is position-independent code
which is suitable for use in shared libraries and
position-independent executables. It uses only i386
instructions but the code is optimized for i686 class
CPUs. If you are compiling liblzma exclusively for
pre-i686 systems, you may want to disable the assembler
code.
--disable-clmul-crc
Disable the use carryless multiplication for CRC
Disable the use of carryless multiplication for CRC
calculation even if compiler support for it is detected.
The code uses runtime detection of SSSE3, SSE4.1, and
CLMUL instructions on x86. On 32-bit x86 this currently
@ -383,13 +377,15 @@ XZ Utils Installation
required extensions (-msse4.1 -mpclmul) then runtime
detection isn't used and the generic code is omitted.
--disable-ifunc
Disable the use of __attribute__((__ifunc__())) for
function dispatching even if support is detected.
--disable-arm64-crc32
Disable the use of the ARM64 CRC32 instruction extension
even if compiler support for it is detected. The code will
detect support for the instruction at runtime.
The ifunc attribute is incompatible with
-fsanitize=address so it may need to be disabled in
debug builds with extra instrumentation.
If using compiler options that unconditionally allow the
required extensions (-march=armv8-a+crc or -march=armv8.1-a
and later) then runtime detection isn't used and the
generic code is omitted.
--enable-unaligned-access
Allow liblzma to use unaligned memory access for 16-bit,
@ -400,8 +396,43 @@ XZ Utils Installation
slow. This option shouldn't be used on systems that
rely on such emulation.
Unaligned access is enabled by default on x86, x86-64,
big endian PowerPC, some ARM, and some ARM64 systems.
Unaligned access is enabled by default on these:
- 32-bit x86
- 64-bit x86-64
- 32-bit big endian PowerPC
- 64-bit big endian PowerPC
- 64-bit little endian PowerPC
- some RISC-V [1]
- some 32-bit ARM [2]
- some 64-bit ARM64 [2] (NOTE: Autodetection bug
if using GCC -mstrict-align, see below.)
[1] Unaligned access is enabled by default if
configure sees that the C compiler
#defines __riscv_misaligned_fast.
[2] Unaligned access is enabled by default if
configure sees that the C compiler
#defines __ARM_FEATURE_UNALIGNED:
- ARMv7 + GCC or Clang: It works. The options
-munaligned-access and -mno-unaligned-access
affect this macro correctly.
- ARM64 + Clang: It works. The options
-munaligned-access, -mno-unaligned-access,
and -mstrict-align affect this macro correctly.
Clang >= 17 supports -mno-strict-align too.
- ARM64 + GCC: It partially works. The macro
is always #defined by GCC versions at least
up to 13.2, even when using -mstrict-align.
If building for strict-align ARM64, the
configure option --disable-unaligned-access
should be used if using a GCC version that has
this issue because otherwise the performance
may be degraded. It likely won't crash due to
how unaligned access is done in the C code.
--enable-unsafe-type-punning
This enables use of code like
@ -487,14 +518,25 @@ XZ Utils Installation
calls any liblzma functions from more than
one thread, something bad may happen.
--enable-ifunc
Use __attribute__((__ifunc__())) in liblzma. This is
enabled by default on GNU/Linux and FreeBSD.
The ifunc attribute is incompatible with
-fsanitize=address. --disable-ifunc must be used
if any -fsanitize= option is specified in CFLAGS.
--enable-sandbox=METHOD
There is limited sandboxing support in the xz tool. If
built with sandbox support, it's used automatically when
(de)compressing exactly one file to standard output and
the options --files or --files0 weren't used. This is a
common use case, for example, (de)compressing .tar.xz
files via GNU tar. The sandbox is also used for
single-file 'xz --test' or 'xz --list'.
There is limited sandboxing support in the xz and xzdec
tools. If built with sandbox support, xz uses it
automatically when (de)compressing exactly one file to
standard output when the options --files or --files0 aren't
used. This is a common use case, for example,
(de)compressing .tar.xz files via GNU tar. The sandbox is
also used for single-file 'xz --test' or 'xz --list'.
xzdec always uses the sandbox, except when more than one
file are decompressed. In this case it will enable the
sandbox for the last file that is decompressed.
Supported METHODs:
@ -506,7 +548,7 @@ XZ Utils Installation
no Disable sandboxing support.
capsicum
Use Capsicum (FreeBSD >= 10) for
Use Capsicum (FreeBSD >= 10.2) for
sandboxing. If no Capsicum support
is found, configure will give an error.
@ -514,10 +556,50 @@ XZ Utils Installation
sandboxing. If pledge(2) isn't found,
configure will give an error.
--enable-symbol-versions
Use symbol versioning for liblzma. This is enabled by
default on GNU/Linux, other GNU-based systems, and
FreeBSD.
landlock
Use Landlock (Linux >= 5.13) for
sandboxing. If no Landlock support
is found, configure will give an error.
--enable-symbol-versions[=VARIANT]
Use symbol versioning for liblzma shared library.
This is enabled by default on GNU/Linux (glibc only),
other GNU-based systems, and FreeBSD.
Symbol versioning is never used for static liblzma. This
option is ignored when not building a shared library.
Supported VARIANTs:
no Disable symbol versioning. This is the
same as using --disable-symbol-versions.
auto Autodetect between "no", "linux",
and "generic".
yes Autodetect between "linux" and
"generic". This forces symbol
versioning to be used when
building a shared library.
generic Generic version is the default for
FreeBSD and GNU/Linux on MicroBlaze.
This is also used on GNU/Linux when
building with NVIDIA HPC Compiler
because the compiler doesn't support
the features required for the "linux"
variant below.
linux Special version for GNU/Linux (glibc
only). This adds a few extra symbol
versions for compatibility with binaries
that have been linked against a liblzma
version that has been patched with
"xz-5.2.2-compat-libs.patch" from
RHEL/CentOS 7. That patch was used
by some build tools outside of
RHEL/CentOS 7 too.
--enable-debug
This enables the assert() macro and possibly some other

View File

@ -1,9 +1,5 @@
##
## SPDX-License-Identifier: 0BSD
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
# Use -n to prevent gzip from adding a timestamp to the .gz headers.
GZIP_ENV = -9n
@ -21,11 +17,11 @@ if COND_DOC
dist_doc_DATA = \
AUTHORS \
COPYING \
COPYING.0BSD \
COPYING.GPLv2 \
NEWS \
README \
THANKS \
TODO \
doc/faq.txt \
doc/history.txt \
doc/xz-file-format.txt \
@ -38,13 +34,9 @@ dist_examples_DATA = \
doc/examples/02_decompress.c \
doc/examples/03_compress_custom.c \
doc/examples/04_compress_easy_mt.c \
doc/examples/11_file_info.c \
doc/examples/Makefile
examplesolddir = $(docdir)/examples_old
dist_examplesold_DATA = \
doc/examples_old/xz_pipe_comp.c \
doc/examples_old/xz_pipe_decomp.c
# Install the Doxygen generated documentation if they were built.
install-data-local:
if test -d "$(srcdir)/doc/api" ; then \
@ -59,22 +51,25 @@ uninstall-local:
endif
EXTRA_DIST = \
po4a \
extra \
cmake \
dos \
doxygen \
extra \
po4a \
windows \
macosx \
cmake \
CMakeLists.txt \
autogen.sh \
COPYING.CC-BY-SA-4.0 \
COPYING.GPLv2 \
COPYING.GPLv3 \
COPYING.LGPLv2.1 \
INSTALL.generic \
PACKAGERS \
TODO \
autogen.sh \
build-aux/manconv.sh \
build-aux/version.sh
build-aux/version.sh \
doc/xz-logo.png \
po/xz.pot-header
ACLOCAL_AMFLAGS = -I m4
@ -93,7 +88,7 @@ manfiles = \
dist-hook:
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
( cd "$(srcdir)" && git log --date=iso --stat \
6060f7dc76fd6c2a8a1f8e85d0e4d86bb78273e6^..HEAD ) \
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
> "$(distdir)/ChangeLog"; \
fi
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \

409
NEWS
View File

@ -2,6 +2,415 @@
XZ Utils Release Notes
======================
5.6.1 (2024-03-09)
* liblzma: Fixed two bugs relating to GNU indirect function (IFUNC)
with GCC. The more serious bug caused a program linked with
liblzma to crash on start up if the flag -fprofile-generate was
used to build liblzma. The second bug caused liblzma to falsely
report an invalid write to Valgrind when loading liblzma.
* xz: Changed the messages for thread reduction due to memory
constraints to only appear under the highest verbosity level.
* Build:
- Fixed a build issue when the header file <linux/landlock.h>
was present on the system but the Landlock system calls were
not defined in <sys/syscall.h>.
- The CMake build now warns and disables NLS if both gettext
tools and pre-created .gmo files are missing. Previously,
this caused the CMake build to fail.
* Minor improvements to man pages.
* Minor improvements to tests.
5.6.0 (2024-02-24)
This bumps the minor version of liblzma because new features were
added. The API and ABI are still backward compatible with liblzma
5.4.x and 5.2.x and 5.0.x.
NOTE: As described in the NEWS for 5.5.2beta, the core components
are now under the BSD Zero Clause License (0BSD).
Since 5.5.2beta:
* liblzma:
- Disabled the branchless C variant in the LZMA decoder based
on the benchmark results from the community.
- Disabled x86-64 inline assembly on x32 to fix the build.
* Sandboxing support in xz:
- Landlock is now used even when xz needs to create files.
In this case the sandbox has to be more permissive than
when no files need to be created. A similar thing was
already in use with pledge(2) since 5.3.4alpha.
- Landlock and pledge(2) are now stricter when reading from
more than one input file and only writing to standard output.
- Added support for Landlock ABI version 4.
* CMake:
- Default to -O2 instead of -O3 with CMAKE_BUILD_TYPE=Release.
-O3 is not useful for speed and makes the code larger.
- Now builds lzmainfo and lzmadec.
- xzdiff, xzgrep, xzless, xzmore, and their symlinks are now
installed. The scripts are also tested during "make test".
- Added translation support for xz, lzmainfo, and the
man pages.
- Applied the symbol versioning workaround for MicroBlaze that
is used in the Autotools build.
- The general XZ Utils and liblzma API documentation is now
installed.
- The CMake component names were changed a little and several
were added. liblzma_Runtime and liblzma_Development are
unchanged.
- Minimum required CMake version is now 3.14. However,
translation support is disabled with CMake versions
older than 3.20.
- The CMake-based build is now close to feature parity with the
Autotools-based build. Most importantly a few tests aren't
run yet. Testing the CMake-based build on different operating
systems would be welcome now. See the comment at the top of
CMakeLists.txt.
* Fixed a bug in the Autotools feature test for ARM64 CRC32
instruction support for old versions of Clang. This did not
affect the CMake build.
* Windows:
- The build instructions in INSTALL and windows/INSTALL*.txt
were revised completely.
- windows/build-with-cmake.bat along with the instructions
in windows/INSTALL-MinGW-w64_with_CMake.txt should make
it very easy to build liblzma.dll and xz.exe on Windows
using CMake and MinGW-w64 with either GCC or Clang/LLVM.
- windows/build.bash was updated. It now works on MSYS2 and
on GNU/Linux (cross-compiling) to create a .zip and .7z
package for 32-bit and 64-bit x86 using GCC + MinGW-w64.
* The TODO file is no longer installed as part of the
documentation. The file is out of date and does not reflect
the actual tasks that will be completed in the future.
* Translations:
- Translated lzmainfo man pages are now installed. These
had been forgotten in earlier versions.
- Updated Croatian, Esperanto, German, Hungarian, Korean,
Polish, Romanian, Spanish, Swedish, Vietnamese, and Ukrainian
translations.
- Updated German, Korean, Romanian, and Ukrainian man page
translations.
* Added a few tests.
Summary of new features added in the 5.5.x development releases:
* liblzma:
- LZMA decoder: Speed optimizations to the C code and
added GCC & Clang compatible inline assembly for x86-64.
- Added lzma_mt_block_size() to recommend a Block size for
multithreaded encoding.
- Added CLMUL-based CRC32 on x86-64 and E2K with runtime
processor detection. Similar to CRC64, on 32-bit x86 it
isn't available unless --disable-assembler is used.
- Optimized the CRC32 calculation on ARM64 platforms using the
CRC32 instructions. Runtime detection for the instruction is
used on GNU/Linux, FreeBSD, Windows, and macOS. If the
compiler flags indicate unconditional CRC32 instruction
support (+crc) then the generic version is not built.
- Added definitions of mask values like
LZMA_INDEX_CHECK_MASK_CRC32 to <lzma/index.h>.
* xz:
- Multithreaded mode is now the default. This improves
compression speed and creates .xz files that can be
decompressed in multithreaded mode. The downsides are
increased memory usage and slightly worse compression ratio.
- Added a new command line option --filters to set the filter
chain using the liblzma filter string syntax.
- Added new command line options --filters1 ... --filters9 to
set additional filter chains using the liblzma filter string
syntax. The --block-list option now allows specifying filter
chains that were set using these new options.
- Ported the command line tools to Windows MSVC.
Visual Studio 2015 or later is required.
* Added lz4 support to xzdiff/xzcmp and xzgrep.
5.5.2beta (2024-02-14)
* Licensing change: The core components are now under the
BSD Zero Clause License (0BSD). In XZ Utils 5.4.6 and older
and 5.5.1alpha these components are in the public domain and
obviously remain so; the change affects the new releases only.
0BSD is an extremely permissive license which doesn't require
retaining or reproducing copyright or license notices when
distributing the code, thus in practice there is extremely
little difference to public domain.
* liblzma
- Significant speed optimizations to the LZMA decoder were
made. There are now three variants that can be chosen at
build time:
* Basic C version: This is a few percent faster than
5.4.x due to some new optimizations.
* Branchless C: This is currently the default on platforms
for which there is no assembly code. This should be a few
percent faster than the basic C version.
* x86-64 inline assembly. This works with GCC and Clang.
The default choice can currently be overridden by setting
LZMA_RANGE_DECODER_CONFIG in CPPFLAGS: 0 means the basic
version and 3 means that branchless C version.
- Optimized the CRC32 calculation on ARM64 platforms using the
CRC32 instructions. The instructions are optional in ARMv8.0
and are required in ARMv8.1 and later. Runtime detection for
the instruction is used on GNU/Linux, FreeBSD, Windows, and
macOS. If the compiler flags indicate unconditional CRC32
instruction support (+crc) then the generic version is not
built.
* Added lz4 support to xzdiff/xzcmp and xzgrep.
* Man pages of xzdiff/xzcmp, xzgrep, and xzmore were rewritten
to simplify licensing of the man page translations.
* Translations:
- Updated Chinese (simplified), German, Korean, Polish,
Romanian, Spanish, Swedish, and Ukrainian translations.
- Updated German, Korean, Romanian, and Ukrainian man page
translations.
* Small improvements to the tests.
* Added doc/examples/11_file_info.c. It was added to the Git
repository in 2017 but forgotten to be added into distribution
tarballs.
* Removed doc/examples_old. These were from 2012.
* Removed the macos/build.sh script. It had not been updated
since 2013.
5.5.1alpha (2024-01-26)
* Added a new filter for RISC-V binaries. The filter can be used
for 32-bit and 64-bit binaries with either little or big
endianness. In liblzma, the Filter ID is LZMA_FILTER_RISCV (0x0B)
and the xz option is --riscv. liblzma filter string syntax
recognizes this filter as "riscv".
* liblzma:
- Added lzma_mt_block_size() to recommend a Block size for
multithreaded encoding
- Added CLMUL-based CRC32 on x86-64 and E2K with runtime
processor detection. Similar to CRC64, on 32-bit x86 it
isn't available unless --disable-assembler is used.
- Implemented GNU indirect function (IFUNC) as a runtime
function dispatching method for CRC32 and CRC64 fast
implementations on x86. Only GNU/Linux (glibc) and FreeBSD
builds will use IFUNC, unless --enable-ifunc is specified to
configure.
- Added definitions of mask values like
LZMA_INDEX_CHECK_MASK_CRC32 to <lzma/index.h>.
- The XZ logo is now included in the Doxygen generated
documentation. It is licensed under Creative Commons
Attribution-ShareAlike 4.0.
* xz:
- Multithreaded mode is now the default. This improves
compression speed and creates .xz files that can be
decompressed multithreaded at the cost of increased memory
usage and slightly worse compression ratio.
- Added new command line option --filters to set the filter
chain using liblzma filter string syntax.
- Added new command line options --filters1 ... --filters9 to
set additional filter chains using liblzma filter string
syntax. The --block-list option now allows specifying filter
chains that were set using these new options.
- Added support for Linux Landlock as a sandboxing method.
- xzdec now supports pledge(2), Capsicum, and Linux Landlock as
sandboxing methods.
- Progress indicator time stats remain accurate after pausing
xz with SIGTSTP.
- Ported xz and xzdec to Windows MSVC. Visual Studio 2015 or
later is required.
* CMake Build:
- Supports pledge(2), Capsicum, and Linux Landlock sandboxing
methods.
- Replacement functions for getopt_long() are used on platforms
that do not have it.
* Enabled unaligned access by default on PowerPC64LE and on RISC-V
targets that define __riscv_misaligned_fast.
* Tests:
- Added two new fuzz targets to OSS-Fuzz.
- Implemented Continuous Integration (CI) testing using
GitHub Actions.
* Changed quoting style from `...' to '...' in all messages,
scripts, and documentation.
* Added basic Codespell support to help catch typo errors.
5.4.6 (2024-01-26)
* Fixed a bug involving internal function pointers in liblzma not
being initialized to NULL. The bug can only be triggered if
lzma_filters_update() is called on a LZMA1 encoder, so it does
not affect xz or any application known to us that uses liblzma.
* xz:
- Fixed a regression introduced in 5.4.2 that caused encoding
in the raw format to unnecessarily fail if --suffix was not
used. For instance, the following command no longer reports
that --suffix must be used:
echo foo | xz --format=raw --lzma2 | wc -c
- Fixed an issue on MinGW-w64 builds that prevented reading
from or writing to non-terminal character devices like NUL.
* Added a new test.
5.4.5 (2023-11-31)
* liblzma:
- Use __attribute__((__no_sanitize_address__)) to avoid address
sanitization with CRC64 CLMUL. It uses 16-byte-aligned reads
which can extend past the bounds of the input buffer and
inherently trigger address sanitization errors. This isn't
a bug.
- Fixed an assertion failure that could be triggered by a large
unpadded_size argument. It was verified that there was no
other bug than the assertion failure.
- Fixed a bug that prevented building with Windows Vista
threading when __attribute__((__constructor__)) is not
supported.
* xz now properly handles special files such as "con" or "nul" on
Windows. Before this fix, the following wrote "foo" to the
console and deleted the input file "con_xz":
echo foo | xz > con_xz
xz --suffix=_xz --decompress con_xz
* Build systems:
- Allow builds with Windows win95 threading and small mode when
__attribute__((__constructor__)) is supported.
- Added a new line to liblzma.pc for MSYS2 (Windows):
Cflags.private: -DLZMA_API_STATIC
When compiling code that will link against static liblzma,
the LZMA_API_STATIC macro needs to be defined on Windows.
- CMake specific changes:
* Fixed a bug that allowed CLOCK_MONOTONIC to be used even
if the check for it failed.
* Fixed a bug where configuring CMake multiple times
resulted in HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC
not being set.
* Fixed the build with MinGW-w64-based Clang/LLVM 17.
llvm-windres now has more accurate GNU windres emulation
so the GNU windres workaround from 5.4.1 is needed with
llvm-windres version 17 too.
* The import library on Windows is now properly named
"liblzma.dll.a" instead of "libliblzma.dll.a"
* Fixed a bug causing the Ninja Generator to fail on
UNIX-like systems. This bug was introduced in 5.4.0.
* Added a new option to disable CLMUL CRC64.
* A module-definition (.def) file is now created when
building liblzma.dll with MinGW-w64.
* The pkg-config liblzma.pc file is now installed on all
builds except when using MSVC on Windows.
* Added large file support by default for platforms that
need it to handle files larger than 2 GiB. This includes
MinGW-w64, even 64-bit builds.
* Small fixes and improvements to the tests.
* Updated translations: Chinese (simplified) and Esperanto.
5.4.4 (2023-08-02)
* liblzma and xzdec can now build against WASI SDK when threading

View File

@ -124,14 +124,15 @@ Information to packagers of XZ Utils
If the package manager supports a license field, you probably should
put GPLv2+ there (GNU GPL v2 or later). The interesting parts of
XZ Utils are in the public domain, but some less important files
ending up into the binary package are under GPLv2+. So it is simplest
to just say GPLv2+ if you cannot specify "public domain and GPLv2+".
XZ Utils are under the BSD Zero Clause License (0BSD), but some less
important files ending up into the binary package are under GPLv2+.
So it is simplest to just say GPLv2+ if you cannot specify
"BSD0 and GPLv2+".
If you split XZ Utils into multiple packages as described earlier
in this file, liblzma and liblzma-dev packages will contain only
public domain code (from XZ Utils at least; compiler or linker may
add some third-party code, which may be copyrighted).
0BSD-licensed code from XZ Utils (compiler or linker may add some
third-party code which may have other licenses).
4. configure options

37
README
View File

@ -67,24 +67,27 @@ XZ Utils
1.1. Overall documentation
README This file
README This file
INSTALL.generic Generic install instructions for those not familiar
with packages using GNU Autotools
INSTALL Installation instructions specific to XZ Utils
PACKAGERS Information to packagers of XZ Utils
INSTALL.generic Generic install instructions for those not
familiar with packages using GNU Autotools
INSTALL Installation instructions specific to XZ Utils
PACKAGERS Information to packagers of XZ Utils
COPYING XZ Utils copyright and license information
COPYING.GPLv2 GNU General Public License version 2
COPYING.GPLv3 GNU General Public License version 3
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
COPYING XZ Utils copyright and license information
COPYING.0BSD BSD Zero Clause License
COPYING.GPLv2 GNU General Public License version 2
COPYING.GPLv3 GNU General Public License version 3
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
COPYING.CC-BY-SA-4.0 Creative Commons Attribution-ShareAlike 4.0
International Public License
AUTHORS The main authors of XZ Utils
THANKS Incomplete list of people who have helped making
this software
NEWS User-visible changes between XZ Utils releases
ChangeLog Detailed list of changes (commit log)
TODO Known bugs and some sort of to-do list
AUTHORS The main authors of XZ Utils
THANKS Incomplete list of people who have helped making
this software
NEWS User-visible changes between XZ Utils releases
ChangeLog Detailed list of changes (commit log)
TODO Known bugs and some sort of to-do list
Note that only some of the above files are included in binary
packages.
@ -287,11 +290,11 @@ XZ Utils
XZ Embedded is a limited implementation written for use in the Linux
kernel, but it is also suitable for other embedded use.
https://tukaani.org/xz/embedded.html
https://xz.tukaani.org/xz-embedded/
XZ for Java is a complete implementation written in pure Java.
https://tukaani.org/xz/java.html
https://xz.tukaani.org/xz-for-java/
6. Contact information

8
THANKS
View File

@ -5,6 +5,7 @@ Thanks
Some people have helped more, some less, but nevertheless everyone's help
has been important. :-) In alphabetical order:
- Mark Adler
- Kian-Meng Ang
- H. Peter Anvin
- Jeff Bastian
- Nelson H. F. Beebe
@ -51,6 +52,7 @@ has been important. :-) In alphabetical order:
- Bjarni Ingi Gislason
- John Paul Adrian Glaubitz
- Bill Glessner
- Matthew Good
- Michał Górny
- Jason Gorski
- Juan Manuel Guerrero
@ -74,6 +76,7 @@ has been important. :-) In alphabetical order:
- Richard Koch
- Anton Kochkov
- Ville Koskinen
- Sergey Kosukhin
- Marcin Kowalczyk
- Jan Kratochvil
- Christian Kujau
@ -92,6 +95,7 @@ has been important. :-) In alphabetical order:
- Lorenzo De Liso
- H.J. Lu
- Bela Lubkin
- Chenxi Mao
- Gregory Margo
- Julien Marrec
- Ed Maste
@ -149,10 +153,11 @@ has been important. :-) In alphabetical order:
- Dan Stromberg
- Jia Tan
- Vincent Torri
- Alexey Tourbin
- Paul Townsend
- Mohammed Adnène Trojette
- Alexey Tourbin
- Taiki Tsunekawa
- Maksym Vatsyk
- Loganaden Velvindron
- Patrick J. Volkerding
- Martin Väth
@ -167,6 +172,7 @@ has been important. :-) In alphabetical order:
- Charles Wilson
- Lars Wirzenius
- Pilorz Wojciech
- Chien Wong
- Ryan Young
- Andreas Zieringer

View File

@ -1,12 +1,10 @@
#!/bin/sh
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
set -e -x

View File

@ -1,5 +1,6 @@
#!/bin/bash
#
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Script meant to be used for Continuous Integration automation for POSIX
@ -9,9 +10,6 @@
#
# Author: Jia Tan
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
set -e
@ -20,9 +18,10 @@ USAGE="Usage: $0
-a [autogen flags]
-b [autotools|cmake]
-c [crc32|crc64|sha256]
-d [encoders|decoders|bcj|delta|threads|shared|nls|small|ifunc|clmul]
-d [encoders|decoders|bcj|delta|threads|shared|nls|small|ifunc|clmul|sandbox]
-f [CFLAGS]
-l [destdir]
-m [compiler]
-n [ARTIFACTS_DIR_NAME]
-p [all|build|test]
-s [srcdir]"
@ -44,6 +43,7 @@ NATIVE_LANG_SUPPORT="y"
SMALL="n"
IFUNC="y"
CLMUL="y"
SANDBOX="y"
SRC_DIR="$ABS_DIR/../"
DEST_DIR="$SRC_DIR/../xz_build"
PHASE="all"
@ -54,7 +54,7 @@ ARTIFACTS_DIR_NAME="output"
# Parse arguments #
###################
while getopts a:b:c:d:l:n:s:p:f:h opt; do
while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
# b option can have either value "autotools" OR "cmake"
case ${opt} in
h)
@ -89,12 +89,17 @@ while getopts a:b:c:d:l:n:s:p:f:h opt; do
small) SMALL="y";;
ifunc) IFUNC="n";;
clmul) CLMUL="n";;
sandbox) SANDBOX="n";;
*) echo "Invalid disable value: $disable_arg"; exit 1 ;;
esac
done
;;
l) DEST_DIR="$OPTARG"
;;
m)
CC="$OPTARG"
export CC
;;
n) ARTIFACTS_DIR_NAME="$OPTARG"
;;
s) SRC_DIR="$OPTARG"
@ -197,7 +202,7 @@ then
cd "$DEST_DIR"
add_to_filter_list "$BCJ" ",x86,powerpc,ia64,arm,armthumb,arm64,sparc"
add_to_filter_list "$BCJ" ",x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv"
add_to_filter_list "$DELTA" ",delta"
add_extra_option "$ENCODERS" "--enable-encoders=$FILTER_LIST" "--disable-encoders"
@ -208,6 +213,7 @@ then
add_extra_option "$SMALL" "--enable-small" ""
add_extra_option "$IFUNC" "" "--disable-ifunc"
add_extra_option "$CLMUL" "" "--disable-clmul-crc"
add_extra_option "$SANDBOX" "" "--enable-sandbox=no"
# Run configure script
"$SRC_DIR"/configure --enable-werror --enable-checks="$CHECK_TYPE" $EXTRA_OPTIONS --config-cache
@ -218,7 +224,7 @@ then
cmake)
cd "$DEST_DIR"
add_to_filter_list "$BCJ" ";x86;powerpc;ia64;arm;armthumb;arm64;sparc"
add_to_filter_list "$BCJ" ";x86;powerpc;ia64;arm;armthumb;arm64;sparc;riscv"
add_to_filter_list "$DELTA" ";delta"
add_extra_option "$THREADS" "-DENABLE_THREADS=ON" "-DENABLE_THREADS=OFF"
@ -234,6 +240,10 @@ then
add_extra_option "$SMALL" "-DHAVE_SMALL=ON" ""
if test -n "$CC" ; then
EXTRA_OPTIONS="$EXTRA_OPTIONS -DCMAKE_C_COMPILER=$CC"
fi
# Remove old cache file to clear previous settings.
rm -f "CMakeCache.txt"
cmake "$SRC_DIR/CMakeLists.txt" -B "$DEST_DIR" $EXTRA_OPTIONS -DADDITIONAL_CHECK_TYPES="$CHECK_TYPE" -G "Unix Makefiles"

View File

@ -1,5 +1,6 @@
#!/bin/sh
#
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Wrapper for GNU groff to convert man pages to a few formats
@ -17,9 +18,6 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
FORMAT=$1

View File

@ -1,5 +1,6 @@
#!/bin/sh
#
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Get the version string from version.h and print it out without
@ -9,9 +10,6 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/

View File

@ -0,0 +1,25 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# remove-ordinals.cmake
#
# Removes the ordinal numbers from a DEF file that has been created by
# GNU ld or LLVM lld option --output-def (when creating a Windows DLL).
# This should be equivalent: sed 's/ \+@ *[0-9]\+//'
#
# Usage:
#
# cmake -DINPUT_FILE=infile.def.in \
# -DOUTPUT_FILE=outfile.def \
# -P remove-ordinals.cmake
#
#############################################################################
#
# Author: Lasse Collin
#
#############################################################################
file(READ "${INPUT_FILE}" STR)
string(REGEX REPLACE " +@ *[0-9]+" "" STR "${STR}")
file(WRITE "${OUTPUT_FILE}" "${STR}")

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_common.cmake - common functions and macros for tuklib_*.cmake files
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
function(tuklib_add_definitions TARGET_OR_ALL DEFINITIONS)
# DEFINITIONS may be an empty string/list but it's fine here. There is

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_cpucores.cmake - see tuklib_cpucores.m4 for description and comments
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_integer.cmake - see tuklib_integer.m4 for description and comments
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(TestBigEndian)
@ -59,25 +60,64 @@ function(tuklib_integer TARGET_OR_ALL)
endif()
endif()
# Unaligned access is fast on x86(-64), big endian PowerPC, and usually on
# 32/64-bit ARM too. There are others too and ARM could be a false match.
# Guess that unaligned access is fast on these archs:
# - 32/64-bit x86 / x86-64
# - 32/64-bit big endian PowerPC
# - 64-bit little endian PowerPC
# - Some 32-bit ARM
# - Some 64-bit ARM64 (AArch64)
# - Some 32/64-bit RISC-V
#
# Guess the default value for the option.
# CMake's ability to give info about the target arch seems bad.
# The the same arch can have different name depending on the OS.
#
# FIXME: The regex is based on guessing, not on factual information!
#
# NOTE: Compared to the Autoconf test, this lacks the GCC/Clang test
# on ARM and always assumes that unaligned is fast on ARM.
# 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)
if(CMAKE_SYSTEM_PROCESSOR MATCHES
"[Xx3456]86|^[Xx]64|^[Aa][Mm][Dd]64|^[Aa][Rr][Mm]|^aarch|^powerpc|^ppc")
if(NOT WORDS_BIGENDIAN OR
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc|^ppc")
set(FAST_UNALIGNED_GUESS ON)
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" PROCESSOR)
# There is no ^ in the first regex branch to allow "i" at the beginning
# so it can match "i386" to "i786", and "x86_64".
if(PROCESSOR MATCHES "[x34567]86|^x64|^amd64|^em64t")
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|^aarch64|^riscv")
# On 32-bit and 64-bit ARM, GCC and Clang
# #define __ARM_FEATURE_UNALIGNED 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
# __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)
endif()
endif()
option(TUKLIB_FAST_UNALIGNED_ACCESS
"Enable if the system supports *fast* unaligned memory access \
with 16-bit, 32-bit, and 64-bit integers."

View File

@ -0,0 +1,53 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_large_file_support.cmake
#
# If off_t is less than 64 bits by default and -D_FILE_OFFSET_BITS=64
# makes off_t become 64-bit, the CMake option LARGE_FILE_SUPPORT is
# provided (ON by default) and -D_FILE_OFFSET_BITS=64 is added to
# the compile definitions if LARGE_FILE_SUPPORT is ON.
#
# Author: Lasse Collin
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)
function(tuklib_large_file_support TARGET_OR_ALL)
# MSVC must be handled specially in the C code.
if(MSVC)
return()
endif()
set(TUKLIB_LARGE_FILE_SUPPORT_TEST
"#include <sys/types.h>
int foo[sizeof(off_t) >= 8 ? 1 : -1];
int main(void) { return 0; }")
check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}"
TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT)
if(NOT TUKLIB_LARGE_FILE_SUPPORT_BY_DEFAULT)
cmake_push_check_state()
# This needs -D.
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64")
check_c_source_compiles("${TUKLIB_LARGE_FILE_SUPPORT_TEST}"
TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64)
cmake_pop_check_state()
endif()
if(TUKLIB_LARGE_FILE_SUPPORT_WITH_FOB64)
# Show the option only when _FILE_OFFSET_BITS=64 affects sizeof(off_t).
option(LARGE_FILE_SUPPORT
"Use -D_FILE_OFFSET_BITS=64 to support files larger than 2 GiB."
ON)
if(LARGE_FILE_SUPPORT)
# This must not use -D.
tuklib_add_definitions("${TARGET_OR_ALL}" "_FILE_OFFSET_BITS=64")
endif()
endif()
endfunction()

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_mbstr.cmake - see tuklib_mbstr.m4 for description and comments
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_physmem.cmake - see tuklib_physmem.m4 for description and comments
#
@ -6,9 +9,7 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckCSourceCompiles)

View File

@ -1,11 +1,12 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# tuklib_progname.cmake - see tuklib_progname.m4 for description and comments
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
include("${CMAKE_CURRENT_LIST_DIR}/tuklib_common.cmake")
include(CheckSymbolExists)

View File

@ -1,12 +1,11 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Author: Lasse Collin
# Process this file with autoconf to produce a configure script.
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
###############################################################################
@ -18,7 +17,7 @@
AC_PREREQ([2.69])
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
[xz@tukaani.org], [xz], [https://tukaani.org/xz/])
[xz@tukaani.org], [xz], [https://xz.tukaani.org/xz-utils/])
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
@ -79,8 +78,8 @@ fi
# Filters #
###########
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc])dnl
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc])
m4_define([SUPPORTED_FILTERS], [lzma1,lzma2,delta,x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])dnl
m4_define([SIMPLE_FILTERS], [x86,powerpc,ia64,arm,armthumb,arm64,sparc,riscv])
m4_define([LZ_FILTERS], [lzma1,lzma2])
m4_foreach([NAME], [SUPPORTED_FILTERS],
@ -380,6 +379,16 @@ AC_ARG_ENABLE([clmul-crc], AS_HELP_STRING([--disable-clmul-crc],
[], [enable_clmul_crc=yes])
############################
# ARM64 CRC32 Instructions #
############################
AC_ARG_ENABLE([arm64-crc32], AS_HELP_STRING([--disable-arm64-crc32],
[Do not use ARM64 CRC32 instructions even if support for it
is detected.]),
[], [enable_arm64_crc32=yes])
#####################
# Size optimization #
#####################
@ -519,20 +528,24 @@ AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
AC_MSG_CHECKING([if sandboxing should be used])
AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD],
[Sandboxing METHOD can be
'auto', 'no', 'capsicum', or 'pledge'.
'auto', 'no', 'capsicum', 'pledge', or 'landlock'.
The default is 'auto' which enables sandboxing if
a supported sandboxing method is found.])],
[], [enable_sandbox=auto])
case $enable_sandbox in
auto)
case $enable_xzdec-$enable_xz-$enable_sandbox in
no-no-*)
enable_sandbox=no
AC_MSG_RESULT([no, --disable-xz and --disable-xzdec was used])
;;
*-*-auto)
AC_MSG_RESULT([maybe (autodetect)])
;;
no | capsicum | pledge)
*-*-no | *-*-capsicum | *-*-pledge | *-*-landlock)
AC_MSG_RESULT([$enable_sandbox])
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([--enable-sandbox only accepts 'auto', 'no', 'capsicum', or 'pledge'.])
AC_MSG_ERROR([--enable-sandbox only accepts 'auto', 'no', 'capsicum', 'pledge', or 'landlock'.])
;;
esac
@ -622,21 +635,10 @@ AS_CASE([$enable_threads],
AC_DEFINE([MYTHREAD_POSIX], [1],
[Define to 1 when using POSIX threads (pthreads).])
# These are nice to have but not mandatory.
#
# FIXME: xz uses clock_gettime if it is available and can do
# it even when threading is disabled. Moving this outside
# of pthread detection may be undesirable because then
# liblzma may get linked against librt even when librt isn't
# needed by liblzma.
# This is nice to have but not mandatory.
OLD_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([clock_gettime pthread_condattr_setclock])
AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE(
[HAVE_CLOCK_MONOTONIC], [1], [Define to 1 if
`CLOCK_MONOTONIC' is declared in <time.h>.])], [],
[[#include <time.h>]])
AC_CHECK_FUNCS([pthread_condattr_setclock])
CFLAGS=$OLD_CFLAGS
],
[win95], [
@ -707,61 +709,80 @@ fi
# --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
# being built for a shared library.
if test "x$enable_symbol_versions" = xno ; then
AS_IF([test "x$enable_symbol_versions" = xno], [
enable_symbol_versions=no
AC_MSG_RESULT([no])
elif test "x$enable_shared" = xno ; then
], [test "x$enable_shared" = xno], [
enable_symbol_versions=no
AC_MSG_RESULT([no (not building a shared library)])
else
case "$host_cpu-$host_os" in
microblaze*)
# GCC 12 on MicroBlaze doesn't support __symver__
# attribute. It's simplest and safest to use the
# generic version on that platform since then only
# the linker script is needed. The RHEL/CentOS 7
# compatibility symbols don't matter on MicroBlaze.
enable_symbol_versions=generic
;;
*-linux*)
case "$pic_mode-$enable_static" in
default-*)
# Use symvers if PIC is defined.
have_symbol_versions_linux=2
;;
*-no)
# Not building static library.
# Use symvers unconditionally.
have_symbol_versions_linux=1
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([
], [
# "yes" means that symbol version are to be used but we need to
# autodetect which variant to use.
if test "x$enable_symbol_versions" = xyes ; then
case "$host_cpu-$host_os" in
microblaze*)
# GCC 12 on MicroBlaze doesn't support
# __symver__ attribute. It's simplest and
# safest to use the generic version on that
# platform since then only the linker script
# is needed. The RHEL/CentOS 7 compatibility
# symbols don't matter on MicroBlaze.
enable_symbol_versions=generic
;;
*-linux*)
# NVIDIA HPC Compiler doesn't support symbol
# versioning but the linker script can still
# be used.
AC_EGREP_CPP([use_generic_symbol_versioning],
[#ifdef __NVCOMPILER
use_generic_symbol_versioning
#endif],
[enable_symbol_versions=generic],
[enable_symbol_versions=linux])
;;
*)
enable_symbol_versions=generic
;;
esac
fi
if test "x$enable_symbol_versions" = xlinux ; then
case "$pic_mode-$enable_static" in
default-*)
# Use symvers if PIC is defined.
have_symbol_versions_linux=2
;;
*-no)
# Not building static library.
# Use symvers unconditionally.
have_symbol_versions_linux=1
;;
*)
AC_MSG_RESULT([])
AC_MSG_ERROR([
On GNU/Linux, building both shared and static library at the same time
is not supported if --with-pic or --without-pic is used.
Use either --disable-shared or --disable-static to build one type
of library at a time. If both types are needed, build one at a time,
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
;;
esac
enable_symbol_versions=linux
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
[$have_symbol_versions_linux],
[Define to 1 to if GNU/Linux-specific details
are unconditionally wanted for symbol
versioning. Define to 2 to if these are wanted
only if also PIC is defined (allows building
both shared and static liblzma at the same
time with Libtool if neither --with-pic nor
--without-pic is used). This define must be
used together with liblzma_linux.map.])
;;
*)
enable_symbol_versions=generic
;;
esac
;;
esac
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
[$have_symbol_versions_linux],
[Define to 1 to if GNU/Linux-specific details
are unconditionally wanted for symbol
versioning. Define to 2 to if these are wanted
only if also PIC is defined (allows building
both shared and static liblzma at the same
time with Libtool if neither --with-pic nor
--without-pic is used). This define must be
used together with liblzma_linux.map.])
elif test "x$enable_symbol_versions" != xgeneric ; then
AC_MSG_RESULT([])
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
fi
AC_MSG_RESULT([yes ($enable_symbol_versions)])
fi
])
AM_CONDITIONAL([COND_SYMVERS_LINUX],
[test "x$enable_symbol_versions" = xlinux])
@ -864,27 +885,57 @@ CFLAGS="$OLD_CFLAGS"
# win95, and the compiler does not support attribute constructor, then we
# would end up with a multithreaded build that is thread-unsafe. As a
# result this configuration is not allowed.
if test "x$enable_small$enable_threads$have_func_attribute_constructor"\
if test "x$enable_small$enable_threads$have_func_attribute_constructor" \
= xyeswin95no; then
AC_MSG_ERROR([--enable-threads=win95 and --enable-small cannot be
used at the same time with a compiler that doesn't support
__attribute__((__constructor__))])
AC_MSG_ERROR([
--enable-threads=win95 and --enable-small cannot be used
at the same time with a compiler that doesn't support
__attribute__((__constructor__))])
fi
# __attribute__((__ifunc__())) can be used to choose between different
# implementations of the same function at runtime. This is slightly more
# efficient than using __attribute__((__constructor__)) and setting
# a function pointer.
AC_ARG_ENABLE([ifunc], [AS_HELP_STRING([--disable-ifunc],
[do not use __attribute__((__ifunc__()))])],
[], [enable_ifunc=yes])
AC_ARG_ENABLE([ifunc], [AS_HELP_STRING([--enable-ifunc],
[Use __attribute__((__ifunc__())). Enabled by default on
GNU/Linux (glibc) and FreeBSD.])],
[], [enable_ifunc=auto])
if test "x$enable_ifunc" = xyes ; then
# When enable_ifunc is 'auto', allow the use of __attribute__((__ifunc__()))
# if compiler support is detected and we are building for GNU/Linux (glibc)
# or FreeBSD. uClibc and musl don't support ifunc in their dynamic linkers
# but some compilers still accept the attribute when compiling for these
# C libraries, which results in broken binaries. That's why we need to
# check which libc is being used.
if test "x$enable_ifunc" = xauto ; then
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_MSG_CHECKING([if __attribute__((__ifunc__())) can be used])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
/*
* Force a compilation error when not using glibc on Linux
* or if we are not using FreeBSD. uClibc will define
* __GLIBC__ but does not support ifunc, so we must have
* an extra check to disable with uClibc.
*/
#if defined(__linux__)
# include <features.h>
# if !defined(__GLIBC__) || defined(__UCLIBC__)
compile error
# endif
#elif !defined(__FreeBSD__)
compile error
#endif
static void func(void) { return; }
/*
* The attribute __no_profile_instrument_function__ is
* needed with GCC to prevent improper instrumentation in
* the ifunc resolver.
*/
__attribute__((__no_profile_instrument_function__))
static void (*resolve_func (void)) (void) { return func; }
void func_ifunc (void)
__attribute__((__ifunc__("resolve_func")));
@ -897,17 +948,30 @@ if test "x$enable_ifunc" = xyes ; then
void make_clang_quiet(void);
void make_clang_quiet(void) { resolve_func()(); }
]])], [
AC_DEFINE([HAVE_FUNC_ATTRIBUTE_IFUNC], [1],
[Define to 1 if __attribute__((__ifunc__()))
is supported for functions.])
AC_MSG_RESULT([yes])
enable_ifunc=yes
], [
AC_MSG_RESULT([no])
enable_ifunc=no
])
AC_MSG_RESULT([$enable_ifunc])
CFLAGS="$OLD_CFLAGS"
fi
if test "x$enable_ifunc" = xyes ; then
AC_DEFINE([HAVE_FUNC_ATTRIBUTE_IFUNC], [1],
[Define to 1 if __attribute__((__ifunc__()))
is supported for functions.])
# ifunc explicitly does not work with -fsanitize=address.
# If configured, it will result in a liblzma build that will fail
# when liblzma is loaded at runtime (when the ifunc resolver
# executes).
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
CFLAGS contains '-fsanitize=' which is incompatible with ifunc.
Use --disable-ifunc when using '-fsanitize'.])])
fi
###############################################################################
# Checks for library functions.
@ -916,6 +980,22 @@ fi
# Gnulib replacements as needed
gl_GETOPT
# If clock_gettime() is available, liblzma with pthreads may use it, and
# xz may use it even when threading support is disabled. In XZ Utils 5.4.x
# and older, configure checked for clock_gettime() only when using pthreads.
# This way non-threaded builds of liblzma didn't get a useless dependency on
# librt which further had a dependency on libpthread. Avoiding these was
# useful when a small build was needed, for example, for initramfs use.
#
# The above reasoning is thoroughly obsolete: On GNU/Linux, librt hasn't
# been needed for clock_gettime() since glibc 2.17 (2012-12-25).
# Solaris 10 needs librt but Solaris 11 doesn't anymore.
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_DECL([CLOCK_MONOTONIC], [AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1],
[Define to 1 if 'CLOCK_MONOTONIC' is declared in <time.h>.])], [],
[[#include <time.h>]])
# Find the best function to set timestamps.
AC_CHECK_FUNCS([futimens futimes futimesat utimes _futime utime], [break])
@ -1035,21 +1115,121 @@ __m128i my_clmul(__m128i a)
[Define to 1 if _mm_set_epi64x and
_mm_clmulepi64_si128 are usable.
See configure.ac for details.])
AC_MSG_RESULT([yes])
enable_clmul_crc=yes
], [
AC_MSG_RESULT([no])
enable_clmul_crc=no
])
AC_MSG_RESULT([$enable_clmul_crc])
])
# ARM64 C Language Extensions define CRC32 functions in arm_acle.h.
# These are supported by at least GCC and Clang which both need
# __attribute__((__target__("+crc"))), unless the needed compiler flags
# are used to support the CRC instruction.
AC_MSG_CHECKING([if ARM64 CRC32 instruction is usable])
AS_IF([test "x$enable_arm64_crc32" = xno], [
AC_MSG_RESULT([no, --disable-arm64-crc32 was used])
], [
# Set -Werror here because some versions of Clang (14 and older)
# do not report the unsupported __attribute__((__target__("+crc")))
# or __crc32d() as an error, only as a warning. This does not need
# to be done with CMake because tests will attempt to link and the
# error will be reported then.
OLD_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <arm_acle.h>
#include <stdint.h>
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
__attribute__((__target__("+crc")))
#endif
uint32_t my_crc(uint32_t a, uint64_t b)
{
return __crc32d(a, b);
}
]])], [
AC_DEFINE([HAVE_ARM64_CRC32], [1],
[Define to 1 if ARM64 CRC32 instruction is supported.
See configure.ac for details.])
enable_arm64_crc32=yes
], [
enable_arm64_crc32=no
])
AC_MSG_RESULT([$enable_arm64_crc32])
CFLAGS="$OLD_CFLAGS"
])
# Check for ARM64 CRC32 instruction runtime detection.
# getauxval() is supported on Linux, elf_aux_info() on FreeBSD, and
# sysctlbyname("hw.optional.armv8_crc32", ...) is supported on Darwin
# (macOS, iOS, etc.). Note that sysctlbyname() is supported on FreeBSD,
# NetBSD, and possibly others too but the string is specific to Apple OSes.
# The C code is responsible for checking defined(__APPLE__) before using
# sysctlbyname("hw.optional.armv8_crc32", ...).
AS_IF([test "x$enable_arm64_crc32" = xyes], [
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname])
])
# Check for sandbox support. If one is found, set enable_sandbox=found.
#
# About -fsanitize: Of our three sandbox methods, only Landlock is
# incompatible with -fsanitize. FreeBSD 13.2 with Capsicum was tested with
# -fsanitize=address,undefined and had no issues. OpenBSD (as of version
# 7.4) has minimal support for process instrumentation. OpenBSD does not
# distribute the additional libraries needed (libasan, libubsan, etc.) with
# GCC or Clang needed for runtime sanitization support and instead only
# support -fsanitize-minimal-runtime for minimal undefined behavior
# sanitization. This minimal support is compatible with our use of the
# Pledge sandbox. So only Landlock will result in a build that cannot
# compress or decompress a single file to standard out.
AS_CASE([$enable_sandbox],
[auto | capsicum], [
AX_CHECK_CAPSICUM([enable_sandbox=found], [:])
AC_CHECK_FUNCS([cap_rights_limit], [enable_sandbox=found])
]
)
AS_CASE([$enable_sandbox],
[auto | pledge], [
AC_CHECK_FUNCS([pledge], [enable_sandbox=found ; break])
AC_CHECK_FUNCS([pledge], [enable_sandbox=found])
]
)
AS_CASE([$enable_sandbox],
[auto | landlock], [
AC_MSG_CHECKING([if Linux Landlock is usable])
# A compile check is done here because some systems have
# linux/landlock.h, but do not have the syscalls defined
# in order to actually use Linux Landlock.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include <linux/landlock.h>
#include <sys/syscall.h>
#include <sys/prctl.h>
void my_sandbox(void)
{
(void)prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0);
(void)SYS_landlock_create_ruleset;
(void)SYS_landlock_restrict_self;
(void)LANDLOCK_CREATE_RULESET_VERSION;
return;
}
]])], [
enable_sandbox=found
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
AC_DEFINE([HAVE_LINUX_LANDLOCK], [1],
[Define to 1 if Linux Landlock is supported.
See configure.ac for details.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
]
)

View File

@ -1,9 +1,5 @@
##
## SPDX-License-Identifier: 0BSD
## Author: Lasse Collin
##
## This file has been put into the public domain.
## You can do whatever you want with this file.
##
EXTRA_DIST = \
translation.bash

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file crc32.c
@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file full_flush.c
@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file hex2bin.c
@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file known_sizes.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file memusage.c
@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file repeat.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file sync_flush.c
@ -5,9 +7,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include "sysdefs.h"

View File

@ -1,4 +1,5 @@
#!/bin/bash
# SPDX-License-Identifier: 0BSD
###############################################################################
#
@ -20,9 +21,6 @@
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
set -e

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 01_compress_easy.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 02_decompress.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 03_compress_custom.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 04_compress_easy_mt.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,3 +1,5 @@
// SPDX-License-Identifier: 0BSD
///////////////////////////////////////////////////////////////////////////////
//
/// \file 11_file_info.c
@ -9,9 +11,6 @@
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdbool.h>

View File

@ -1,9 +1,5 @@
#
# SPDX-License-Identifier: 0BSD
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
CC = c99
CFLAGS = -g

View File

@ -1,127 +0,0 @@
/*
* xz_pipe_comp.c
* A simple example of pipe-only xz compressor implementation.
* version: 2010-07-12 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_comp.c -o xz_pipe_comp
*
* Usage example:
* $ cat some_file | ./xz_pipe_comp > some_file.xz
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* COMPRESSION SETTINGS */
/* analogous to xz CLI options: -0 to -9 */
#define COMPRESSION_LEVEL 6
/* boolean setting, analogous to xz CLI option: -e */
#define COMPRESSION_EXTREME true
/* see: /usr/include/lzma/check.h LZMA_CHECK_* */
#define INTEGRITY_CHECK LZMA_CHECK_CRC64
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_COMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_compress (FILE *in_file, FILE *out_file)
{
uint32_t preset = COMPRESSION_LEVEL | (COMPRESSION_EXTREME ? LZMA_PRESET_EXTREME : 0);
lzma_check check = INTEGRITY_CHECK;
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz encoder */
ret_xz = lzma_easy_encoder (&strm, preset, check);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_easy_encoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the xz data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending compressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* compress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_COMPRESSION;
} else {
/* write compressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_compress (stdin, stdout);
return ret;
}

View File

@ -1,123 +0,0 @@
/*
* xz_pipe_decomp.c
* A simple example of pipe-only xz decompressor implementation.
* version: 2012-06-14 - by Daniel Mealha Cabrita
* Not copyrighted -- provided to the public domain.
*
* Compiling:
* Link with liblzma. GCC example:
* $ gcc -llzma xz_pipe_decomp.c -o xz_pipe_decomp
*
* Usage example:
* $ cat some_file.xz | ./xz_pipe_decomp > some_file
*/
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdbool.h>
#include <lzma.h>
/* read/write buffer sizes */
#define IN_BUF_MAX 4096
#define OUT_BUF_MAX 4096
/* error codes */
#define RET_OK 0
#define RET_ERROR_INIT 1
#define RET_ERROR_INPUT 2
#define RET_ERROR_OUTPUT 3
#define RET_ERROR_DECOMPRESSION 4
/* note: in_file and out_file must be open already */
int xz_decompress (FILE *in_file, FILE *out_file)
{
lzma_stream strm = LZMA_STREAM_INIT; /* alloc and init lzma_stream struct */
const uint32_t flags = LZMA_TELL_UNSUPPORTED_CHECK | LZMA_CONCATENATED;
const uint64_t memory_limit = UINT64_MAX; /* no memory limit */
uint8_t in_buf [IN_BUF_MAX];
uint8_t out_buf [OUT_BUF_MAX];
size_t in_len; /* length of useful data in in_buf */
size_t out_len; /* length of useful data in out_buf */
bool in_finished = false;
bool out_finished = false;
lzma_action action;
lzma_ret ret_xz;
int ret;
ret = RET_OK;
/* initialize xz decoder */
ret_xz = lzma_stream_decoder (&strm, memory_limit, flags);
if (ret_xz != LZMA_OK) {
fprintf (stderr, "lzma_stream_decoder error: %d\n", (int) ret_xz);
return RET_ERROR_INIT;
}
while ((! in_finished) && (! out_finished)) {
/* read incoming data */
in_len = fread (in_buf, 1, IN_BUF_MAX, in_file);
if (feof (in_file)) {
in_finished = true;
}
if (ferror (in_file)) {
in_finished = true;
ret = RET_ERROR_INPUT;
}
strm.next_in = in_buf;
strm.avail_in = in_len;
/* if no more data from in_buf, flushes the
internal xz buffers and closes the decompressed data
with LZMA_FINISH */
action = in_finished ? LZMA_FINISH : LZMA_RUN;
/* loop until there's no pending decompressed output */
do {
/* out_buf is clean at this point */
strm.next_out = out_buf;
strm.avail_out = OUT_BUF_MAX;
/* decompress data */
ret_xz = lzma_code (&strm, action);
if ((ret_xz != LZMA_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "lzma_code error: %d\n", (int) ret_xz);
out_finished = true;
ret = RET_ERROR_DECOMPRESSION;
} else {
/* write decompressed data */
out_len = OUT_BUF_MAX - strm.avail_out;
fwrite (out_buf, 1, out_len, out_file);
if (ferror (out_file)) {
out_finished = true;
ret = RET_ERROR_OUTPUT;
}
}
} while (strm.avail_out == 0);
}
/* Bug fix (2012-06-14): If no errors were detected, check
that the last lzma_code() call returned LZMA_STREAM_END.
If not, the file is probably truncated. */
if ((ret == RET_OK) && (ret_xz != LZMA_STREAM_END)) {
fprintf (stderr, "Input truncated or corrupt\n");
ret = RET_ERROR_DECOMPRESSION;
}
lzma_end (&strm);
return ret;
}
int main ()
{
int ret;
ret = xz_decompress (stdin, stdout);
return ret;
}

View File

@ -240,5 +240,5 @@ A: Give --enable-small to the configure script. Use also appropriate
If the result is still too big, take a look at XZ Embedded. It is
a separate project, which provides a limited but significantly
smaller XZ decoder implementation than XZ Utils. You can find it
at <https://tukaani.org/xz/embedded.html>.
at <https://xz.tukaani.org/xz-embedded/>.

View File

@ -40,11 +40,11 @@ The .lzma File Format
0.2. Changes
Last modified: 2022-07-13 21:00+0300
Last modified: 2024-01-16 18:00+0800
Compared to the previous version (2011-04-12 11:55+0300)
the section 1.1.3 was modified to allow End of Payload Marker
with a known Uncompressed Size.
Compared to the previous version (2022-07-13 21:00+0300)
the section 2 was modified to change links from http to
https and to update XZ links.
1. File Format
@ -157,17 +157,17 @@ The .lzma File Format
2. References
LZMA SDK - The original LZMA implementation
http://7-zip.org/sdk.html
https://7-zip.org/sdk.html
7-Zip
http://7-zip.org/
https://7-zip.org/
LZMA Utils - LZMA adapted to POSIX-like systems
http://tukaani.org/lzma/
https://tukaani.org/lzma/
XZ Utils - The next generation of LZMA Utils
http://tukaani.org/xz/
https://xz.tukaani.org/xz-utils/
The .xz file format - The successor of the .lzma format
http://tukaani.org/xz/xz-file-format.txt
https://xz.tukaani.org/format/xz-file-format.txt

View File

@ -2,7 +2,7 @@
The .xz File Format
===================
Version 1.1.0 (2022-12-11)
Version 1.2.0 (2024-01-19)
0. Preface
@ -81,18 +81,22 @@ Version 1.1.0 (2022-12-11)
0.2. Getting the Latest Version
The latest official version of this document can be downloaded
from <http://tukaani.org/xz/xz-file-format.txt>.
from <https://xz.tukaani.org/format/xz-file-format.txt>.
Specific versions of this document have a filename
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
For example, the version 1.0.0 of this document is available
at <http://tukaani.org/xz/xz-file-format-1.0.0.txt>.
at <https://xz.tukaani.org/format/xz-file-format-1.0.0.txt>.
0.3. Version History
Version Date Description
1.2.0 2024-01-19 Added RISC-V filter and updated URLs in
Sections 0.2 and 7. The URL of this
specification was changed.
1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit
ARM endianness in Section 5.3.2,
language improvements in Section 5.4
@ -923,6 +927,7 @@ Version 1.1.0 (2022-12-11)
0x08 2 bytes ARM Thumb filter [1]
0x09 4 bytes SPARC filter
0x0A 4 bytes ARM64 filter [2]
0x0B 2 bytes RISC-V filter
[1] These are for little endian instruction encoding.
This must not be confused with data endianness.
@ -1136,30 +1141,30 @@ Version 1.1.0 (2022-12-11)
7. References
LZMA SDK - The original LZMA implementation
http://7-zip.org/sdk.html
https://7-zip.org/sdk.html
LZMA Utils - LZMA adapted to POSIX-like systems
http://tukaani.org/lzma/
https://tukaani.org/lzma/
XZ Utils - The next generation of LZMA Utils
http://tukaani.org/xz/
https://xz.tukaani.org/xz-utils/
[RFC-1952]
GZIP file format specification version 4.3
http://www.ietf.org/rfc/rfc1952.txt
https://www.ietf.org/rfc/rfc1952.txt
- Notation of byte boxes in section "2.1. Overall conventions"
[RFC-2119]
Key words for use in RFCs to Indicate Requirement Levels
http://www.ietf.org/rfc/rfc2119.txt
https://www.ietf.org/rfc/rfc2119.txt
[GNU-tar]
GNU tar 1.21 manual
http://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
GNU tar 1.35 manual
https://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html
- Node 9.4.2 "Blocking Factor", paragraph that begins
"gzip will complain about trailing garbage"
- Note that this URL points to the latest version of the
manual, and may some day not contain the note which is in
1.21. For the exact version of the manual, download GNU
tar 1.21: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.21.tar.gz
1.35. For the exact version of the manual, download GNU
tar 1.35: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.35.tar.gz

BIN
doc/xz-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -1,12 +1,11 @@
# SPDX-License-Identifier: 0BSD
###############################################################################
#
# Makefile to build XZ Utils using DJGPP
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
###############################################################################
# For debugging, set comment "#define NDEBUG 1" from config.h to enable

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: 0BSD */
/* How many MiB of RAM to assume if the real amount cannot be determined. */
#define ASSUME_RAM 32
@ -143,7 +145,7 @@
#define PACKAGE_NAME "XZ Utils"
/* Define to the home page for this package. */
#define PACKAGE_URL "https://tukaani.org/xz/"
#define PACKAGE_URL "https://xz.tukaani.org/xz-utils/"
/* The size of 'size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4

View File

@ -61,7 +61,7 @@ PROJECT_BRIEF =
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
PROJECT_LOGO =
PROJECT_LOGO = ../doc/xz-logo.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@ -1246,7 +1246,7 @@ HTML_HEADER =
# that doxygen normally uses.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER =
HTML_FOOTER = footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
# sheet that is used by each HTML page. It can be used to fine-tune the look of
@ -1286,7 +1286,7 @@ HTML_EXTRA_STYLESHEET =
# files will be copied as-is; there are no commands or markers available.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES =
HTML_EXTRA_FILES = ../COPYING.CC-BY-SA-4.0
# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
# should be rendered with a dark or light theme.

13
doxygen/footer.html Normal file
View File

@ -0,0 +1,13 @@
<hr class="footer"/>
<p style="text-align: right;padding-right: 12px;">
XZ logo &copy; 2023 by Jia Tan is licensed under
<a href="COPYING.CC-BY-SA-4.0"
rel="license"
style="display:inline-block;">
CC BY-SA 4.0
</a>
</p>
</body>
</html>

View File

@ -1,5 +1,6 @@
#!/bin/sh
#
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# Updates the Doxygen generated documentation files in the source tree.
@ -16,9 +17,6 @@
# Authors: Jia Tan
# Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
set -e

View File

@ -1,5 +1,6 @@
#!/bin/bash
#
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# 7z2lzma.bash is very primitive .7z to .lzma converter. The input file must
@ -17,9 +18,6 @@
#
# Author: Lasse Collin <lasse.collin@tukaani.org>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
#############################################################################
# You can use 7z or 7za, both will work.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
scanlzma, scan for lzma compressed data in stdin and echo it to stdout.
Copyright (C) 2006 Timo Lindfors

View File

@ -1,3 +1,5 @@
## SPDX-License-Identifier: GPL-2.0-or-later
##
## Copyright (C) 2004-2007 Free Software Foundation, Inc.
##

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt-on-non-glibc compatibility macros.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (basic, portable features only).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt (GNU extensions).
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (basic, portable features) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt (GNU extensions) gnulib wrapper header.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Getopt for GNU.
Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

View File

@ -1,3 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/* Internal declarations for getopt.
Copyright (C) 1989-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library and is also part of gnulib.

1
m4/.gitignore vendored
View File

@ -1,3 +1,4 @@
build-to-host.m4
codeset.m4
extern-inline.m4
fcntl-o.m4

View File

@ -1,85 +0,0 @@
# -*- Autoconf -*-
# SYNOPSIS
#
# AX_CHECK_CAPSICUM([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro searches for an installed Capsicum header and library,
# and if found:
# - AC_DEFINE([HAVE_CAPSICUM]) is called.
# - AC_DEFINE([HAVE_SYS_CAPSICUM_H]) is called if <sys/capsicum.h>
# is present (otherwise <sys/capability.h> must be used).
# - CAPSICUM_LIB is set to the -l option needed to link Capsicum support,
# and AC_SUBST([CAPSICUM_LIB]) is called.
# - The shell commands in ACTION-IF-FOUND are run. The default
# ACTION-IF-FOUND prepends ${CAPSICUM_LIB} into LIBS. If you don't
# want to modify LIBS and don't need to run any other commands either,
# use a colon as ACTION-IF-FOUND.
#
# If Capsicum support isn't found:
# - The shell commands in ACTION-IF-NOT-FOUND are run. The default
# ACTION-IF-NOT-FOUND calls AC_MSG_WARN to print a warning that
# Capsicum support wasn't found.
#
# You should use autoheader to include a definition for the symbols above
# in a config.h file.
#
# Sample usage in a C/C++ source is as follows:
#
# #ifdef HAVE_CAPSICUM
# # ifdef HAVE_SYS_CAPSICUM_H
# # include <sys/capsicum.h>
# # else
# # include <sys/capability.h>
# # endif
# #endif /* HAVE_CAPSICUM */
#
# LICENSE
#
# Copyright (c) 2014 Google Inc.
# Copyright (c) 2015 Lasse Collin <lasse.collin@tukaani.org>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
#serial 2
AC_DEFUN([AX_CHECK_CAPSICUM], [
# On FreeBSD >= 11.x and Linux, Capsicum is uses <sys/capsicum.h>.
# If this header is found, it is assumed to be the right one.
capsicum_header_found=no
AC_CHECK_HEADERS([sys/capsicum.h], [capsicum_header_found=yes])
if test "$capsicum_header_found" = no ; then
# On FreeBSD 10.x Capsicum uses <sys/capability.h>. Such a header exists
# on Linux too but it describes POSIX.1e capabilities. Look for the
# declaration of cap_rights_limit to check if <sys/capability.h> is
# a Capsicum header.
AC_CHECK_DECL([cap_rights_limit], [capsicum_header_found=yes], [],
[#include <sys/capability.h>])
fi
capsicum_lib_found=no
CAPSICUM_LIB=
if test "$capsicum_header_found" = yes ; then
AC_LANG_PUSH([C])
# FreeBSD >= 10.x has Capsicum functions in libc.
AC_LINK_IFELSE([AC_LANG_CALL([], [cap_rights_limit])],
[capsicum_lib_found=yes], [])
# Linux has Capsicum functions in libcaprights.
AC_CHECK_LIB([caprights], [cap_rights_limit],
[CAPSICUM_LIB=-lcaprights
capsicum_lib_found=yes], [])
AC_LANG_POP([C])
fi
AC_SUBST([CAPSICUM_LIB])
if test "$capsicum_lib_found" = yes ; then
AC_DEFINE([HAVE_CAPSICUM], [1], [Define to 1 if Capsicum is available.])
m4_default([$1], [LIBS="${CAPSICUM_LIB} $LIBS"])
else
m4_default([$2], [AC_MSG_WARN([Capsicum support not found])])
fi])

View File

@ -1,3 +1,5 @@
dnl SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-macro
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================

View File

@ -1,3 +1,5 @@
dnl SPDX-License-Identifier: FSFULLR
# getopt.m4 serial 49 (modified version)
dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation

View File

@ -1,3 +1,5 @@
dnl SPDX-License-Identifier: FSFULLR
# Find a POSIX-conforming shell.
# Copyright (C) 2007-2008 Free Software Foundation, Inc.

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -7,13 +10,11 @@
#
# Common checks for tuklib.
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_COMMON], [
AC_REQUIRE([AC_CANONICAL_HOST])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -17,13 +20,11 @@
# GetSystemInfo() is used on Cygwin)
# - pstat_getdynamic(): HP-UX
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_CPUCORES], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -11,13 +14,11 @@
# - Does the hardware support fast unaligned access to 16-bit, 32-bit,
# and 64-bit integers
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON])
@ -65,22 +66,42 @@ AC_MSG_CHECKING([if unaligned memory access should be used])
AC_ARG_ENABLE([unaligned-access], AS_HELP_STRING([--enable-unaligned-access],
[Enable if the system supports *fast* unaligned memory access
with 16-bit, 32-bit, and 64-bit integers. By default,
this is enabled only on x86, x86_64, big endian PowerPC,
and some ARM systems.]),
this is enabled on x86, x86-64,
32/64-bit big endian PowerPC,
64-bit little endian PowerPC,
and some ARM, ARM64, and RISC-V systems.]),
[], [enable_unaligned_access=auto])
if test "x$enable_unaligned_access" = xauto ; then
# TODO: There may be other architectures, on which unaligned access
# is OK.
# NOTE: There might be other architectures on which unaligned access
# is fast.
case $host_cpu in
i?86|x86_64|powerpc|powerpc64)
i?86|x86_64|powerpc|powerpc64|powerpc64le)
enable_unaligned_access=yes
;;
arm*|aarch64*)
arm*|aarch64*|riscv*)
# On 32-bit and 64-bit ARM, GCC and Clang
# #define __ARM_FEATURE_UNALIGNED 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
# __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.
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#ifndef __ARM_FEATURE_UNALIGNED
#if !defined(__ARM_FEATURE_UNALIGNED) \
&& !defined(__riscv_misaligned_fast) \
&& !defined(_MSC_VER)
compile error
#endif
int main(void) { return 0; }

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -15,13 +18,11 @@
# functions, but each function is put into a separate .c file so
# that it is possible to pick only what is strictly needed.
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_MBSTR], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -29,13 +32,11 @@
# - sysinfo() works on Linux/dietlibc and probably on other Linux
# systems whose libc may lack sysconf().
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PHYSMEM], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,6 @@
# SPDX-License-Identifier: 0BSD
#############################################################################
#
# SYNOPSIS
#
@ -11,13 +14,11 @@
# This .m4 file is needed allow this module to use glibc's
# program_invocation_name.
#
# COPYING
#############################################################################
#
# Author: Lasse Collin
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
# Author: Lasse Collin
#
#############################################################################
AC_DEFUN_ONCE([TUKLIB_PROGNAME], [
AC_REQUIRE([TUKLIB_COMMON])

View File

@ -1,3 +1,5 @@
dnl SPDX-License-Identifier: FSFULLR
# visibility.m4 serial 8
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation

View File

@ -1,113 +0,0 @@
#!/bin/sh
###############################################################################
# Author: Anders F Björklund <afb@users.sourceforge.net>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
###############################################################################
mkdir -p Root
mkdir -p Resources
# Abort immediately if something goes wrong.
set -e
GCC="gcc-4.2"
SDK="/Developer/SDKs/MacOSX10.5.sdk"
MDT="10.5"
GTT=i686-apple-darwin9
ARCHES1="-arch ppc -arch ppc64 -arch i386 -arch x86_64"
ARCHES2="-arch ppc -arch i386"
PKGFORMAT="10.5" # xar
# avoid "unknown required load command: 0x80000022" from linking on Snow Leopard
uname -r | grep ^1 >/dev/null && LDFLAGS="$LDFLAGS -Wl,-no_compact_linkedit"
# Clean up if it was already configured.
[ -f Makefile ] && make distclean
# Build the regular fat program
CC="$GCC" \
CFLAGS="-O2 -g $ARCHES1 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-xzdec --disable-lzmadec $GTT
make
make check
make DESTDIR=`pwd`/Root install
make distclean
# Build the size-optimized program
CC="$GCC" \
CFLAGS="-Os -g $ARCHES2 -isysroot $SDK -mmacosx-version-min=$MDT" \
../configure --disable-dependency-tracking --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads $GTT
make -C src/liblzma
make -C src/xzdec
make -C src/xzdec DESTDIR=`pwd`/Root install
cp -a ../extra Root/usr/local/share/doc/xz
make distclean
# Move development files to different package
test -d liblzma && rm -r liblzma
mkdir -p liblzma/usr/local
mv Root/usr/local/include liblzma/usr/local
mv Root/usr/local/lib liblzma/usr/local
mkdir -p Root/usr/local/lib
cp -p liblzma/usr/local/lib/liblzma.5.dylib Root/usr/local/lib
mkdir -p liblzma/usr/local/share/doc/xz
mv Root/usr/local/share/doc/xz/examples* liblzma/usr/local/share/doc/xz
# Strip debugging symbols and make relocatable
for bin in xz lzmainfo xzdec lzmadec; do
strip -S Root/usr/local/bin/$bin
install_name_tool -change /usr/local/lib/liblzma.5.dylib @executable_path/../lib/liblzma.5.dylib Root/usr/local/bin/$bin
done
for lib in liblzma.5.dylib; do
strip -S Root/usr/local/lib/$lib
install_name_tool -id @executable_path/../lib/liblzma.5.dylib Root/usr/local/lib/$lib
done
# Create tarball, but without the HFS+ attrib
rmdir debug lib po src/liblzma/api src/liblzma src/lzmainfo src/scripts src/xz src/xzdec src tests
( cd Root/usr/local; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../../../XZ.tbz * )
( cd liblzma; COPY_EXTENDED_ATTRIBUTES_DISABLE=true COPYFILE_DISABLE=true tar cvjf ../liblzma.tbz ./usr/local )
# Include documentation files for package
cp -p ../README Resources/ReadMe.txt
cp -p ../COPYING Resources/License.txt
# Make an Installer.app package
ID="org.tukaani.xz"
VERSION=`cd ..; sh build-aux/version.sh`
PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
$PACKAGEMAKER -r Root/usr/local -l /usr/local -e Resources -i $ID -n $VERSION -t XZ -o XZ.pkg -g $PKGFORMAT --verbose
$PACKAGEMAKER -r liblzma -w -k -i $ID.liblzma -n $VERSION -o liblzma.pkg -g $PKGFORMAT --verbose
# Put the package in a disk image
if [ "$PKGFORMAT" != "10.5" ]; then
hdiutil create -fs HFS+ -format UDZO -quiet -srcfolder XZ.pkg -ov XZ.dmg
hdiutil internet-enable -yes -quiet XZ.dmg
fi
echo
echo "Build completed successfully."
echo

View File

@ -1,4 +1,10 @@
# SPDX-License-Identifier: FSFUL
# Makefile variables for PO directory in any package using GNU gettext.
#
# Copyright (C) 2003-2019 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation gives
# unlimited permission to use, copy, distribute, and modify it.
# Usually the message domain is the same as the package name.
DOMAIN = $(PACKAGE)
@ -8,7 +14,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
@ -18,7 +24,14 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
# or entity, or to disclaim their copyright. The empty string stands for
# the public domain; in this case the translators are expected to disclaim
# their copyright.
COPYRIGHT_HOLDER =
COPYRIGHT_HOLDER = The XZ Utils authors and contributors
# This tells whether or not to prepend "GNU " prefix to the package
# name that gets inserted into the header of the $(DOMAIN).pot file.
# Possible values are "yes", "no", or empty. If it is empty, try to
# detect it automatically by scanning the files in $(top_srcdir) for
# "GNU packagename" string.
PACKAGE_GNU = no
# This is the email address or URL to which the translators shall report
# bugs in the untranslated strings:
@ -40,7 +53,35 @@ MSGID_BUGS_ADDRESS =
# message catalogs shall be used. It is usually empty.
EXTRA_LOCALE_CATEGORIES =
# Although you may need slightly wider terminal than 80 chars, it is
# much nicer to edit the output of --help when this is set.
XGETTEXT_OPTIONS += --no-wrap
MSGMERGE += --no-wrap
# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
# context. Possible values are "yes" and "no". Set this to yes if the
# package uses functions taking also a message context, like pgettext(), or
# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
USE_MSGCTXT = no
# These options get passed to msgmerge.
# Useful options are in particular:
# --previous to keep previous msgids of translated messages,
# --quiet to reduce the verbosity.
MSGMERGE_OPTIONS = --no-wrap
# These options get passed to msginit.
# If you want to disable line wrapping when writing PO files, add
# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
# MSGINIT_OPTIONS.
#
# Although one may need slightly wider terminal than 80 chars, it is
# much nicer to edit the output of --help when --no-wrap is set.
MSGINIT_OPTIONS = --no-wrap
# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
# has changed. Possible values are "yes" and "no". Set this to no if
# the POT file is checked in the repository and the version control
# program ignores timestamps.
PO_DEPENDS_ON_POT = yes
# This tells whether or not to forcibly update $(DOMAIN).pot and
# regenerate PO files on "make dist". Possible values are "yes" and
# "no". Set this to no if the POT file and PO files are maintained
# externally.
DIST_DEPENDS_ON_UPDATE_PO = yes

View File

@ -1,3 +1,5 @@
# SPDX-License-Identifier: 0BSD
# List of source files which contain translatable strings.
src/xz/args.c
src/xz/coder.c
@ -6,8 +8,10 @@ src/xz/hardware.c
src/xz/list.c
src/xz/main.c
src/xz/message.c
src/xz/mytime.c
src/xz/options.c
src/xz/signals.c
src/xz/suffix.c
src/xz/util.c
src/lzmainfo/lzmainfo.c
src/common/tuklib_exit.c

469
po/de.po

File diff suppressed because it is too large Load Diff

504
po/eo.po

File diff suppressed because it is too large Load Diff

510
po/es.po

File diff suppressed because it is too large Load Diff

634
po/fr.po

File diff suppressed because it is too large Load Diff

650
po/hr.po

File diff suppressed because it is too large Load Diff

558
po/hu.po

File diff suppressed because it is too large Load Diff

597
po/ko.po

File diff suppressed because it is too large Load Diff

483
po/pl.po

File diff suppressed because it is too large Load Diff

534
po/ro.po

File diff suppressed because it is too large Load Diff

500
po/sv.po

File diff suppressed because it is too large Load Diff

511
po/uk.po

File diff suppressed because it is too large Load Diff

509
po/vi.po

File diff suppressed because it is too large Load Diff

7
po/xz.pot-header Normal file
View File

@ -0,0 +1,7 @@
# SPDX-License-Identifier: 0BSD
#
# SOME DESCRIPTIVE TITLE.
# Copyright (C) The XZ Utils authors and contributors
# This file is published under the BSD Zero Clause License.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#

View File

@ -1,14 +1,14 @@
# Chinese translations for xz package
# xz 软件包的简体中文翻译。
# This file is put in the public domain.
# Boyuan Yang <073plan@gmail.com>, 2019, 2022, 2023.
# Boyuan Yang <073plan@gmail.com>, 2019, 2022, 2023, 2024.
#
msgid ""
msgstr ""
"Project-Id-Version: xz 5.4.4-pre1\n"
"Project-Id-Version: xz 5.6.0-pre1\n"
"Report-Msgid-Bugs-To: xz@tukaani.org\n"
"POT-Creation-Date: 2023-07-18 23:34+0800\n"
"PO-Revision-Date: 2023-07-19 14:24-0400\n"
"POT-Creation-Date: 2024-01-26 19:40+0800\n"
"PO-Revision-Date: 2024-02-05 15:15-0500\n"
"Last-Translator: Boyuan Yang <073plan@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
@ -17,144 +17,181 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Generator: Poedit 3.2.2\n"
"X-Generator: Poedit 3.4.2\n"
#: src/xz/args.c:77
#: src/xz/args.c:78
#, c-format
msgid "%s: Invalid argument to --block-list"
msgstr "%s--block-list 的无效参数"
#: src/xz/args.c:87
#: src/xz/args.c:88
#, c-format
msgid "%s: Too many arguments to --block-list"
msgstr "%s--block-list 得到过多参数"
#: src/xz/args.c:116
#: src/xz/args.c:125
#, c-format
msgid "In --block-list, block size is missing after filter chain number '%c:'"
msgstr "在 --block-list 中,块大小在过滤器链编号 '%c:' 之后缺失"
#: src/xz/args.c:151
msgid "0 can only be used as the last element in --block-list"
msgstr "0 仅可用于 --block-list 的最后一个元素"
#: src/xz/args.c:451
#: src/xz/args.c:540
#, c-format
msgid "%s: Unknown file format type"
msgstr "%s未知文件格式类型"
#: src/xz/args.c:474 src/xz/args.c:482
#: src/xz/args.c:563 src/xz/args.c:571
#, c-format
msgid "%s: Unsupported integrity check type"
msgstr "%s不支持的完整性检查类型"
#: src/xz/args.c:518
msgid "Only one file can be specified with `--files' or `--files0'."
msgstr "仅可使用“--files”或“--files0”指定一个文件。"
#: src/xz/args.c:607
msgid "Only one file can be specified with '--files' or '--files0'."
msgstr "仅可使用 '--files' 或 '--files0' 指定单个文件。"
#. TRANSLATORS: This is a translatable
#. string because French needs a space
#. before the colon ("%s : %s").
#: src/xz/args.c:533 src/xz/coder.c:691 src/xz/coder.c:707 src/xz/coder.c:967
#: src/xz/coder.c:970 src/xz/file_io.c:605 src/xz/file_io.c:679
#: src/xz/file_io.c:769 src/xz/file_io.c:940 src/xz/list.c:369
#: src/xz/list.c:415 src/xz/list.c:477 src/xz/list.c:581 src/xz/list.c:590
#: src/xz/args.c:622 src/xz/coder.c:1059 src/xz/coder.c:1075
#: src/xz/coder.c:1375 src/xz/coder.c:1378 src/xz/file_io.c:686
#: src/xz/file_io.c:760 src/xz/file_io.c:850 src/xz/file_io.c:1021
#: src/xz/list.c:369 src/xz/list.c:415 src/xz/list.c:477 src/xz/list.c:591
#: src/xz/list.c:600
#, c-format
msgid "%s: %s"
msgstr "%s%s"
#: src/xz/args.c:589
#: src/xz/args.c:678
#, c-format
msgid "The environment variable %s contains too many arguments"
msgstr "环境变量 %s 包含过多参数"
#: src/xz/args.c:691
#: src/xz/args.c:780
msgid "Compression support was disabled at build time"
msgstr "压缩支持已在构建时禁用"
#: src/xz/args.c:698
#: src/xz/args.c:787
msgid "Decompression support was disabled at build time"
msgstr "解压支持已在构建时禁用"
#: src/xz/args.c:704
#: src/xz/args.c:793
msgid "Compression of lzip files (.lz) is not supported"
msgstr "不支持对 lzip 文件 (.lz) 的压缩"
#: src/xz/args.c:735
#: src/xz/args.c:815
msgid "--block-list is ignored unless compressing to the .xz format"
msgstr "除非压缩为 .xz 格式,--block-list 将被忽略"
#: src/xz/args.c:828 src/xz/args.c:837
msgid "With --format=raw, --suffix=.SUF is required unless writing to stdout"
msgstr "启用 --format-raw 选项时,必须指定 --suffix=.SUF 获知写入至标准输出"
#: src/xz/coder.c:115
#: src/xz/coder.c:141
msgid "Maximum number of filters is four"
msgstr "过滤器最多数量为四"
#: src/xz/coder.c:134
#: src/xz/coder.c:179
#, c-format
msgid "Error in --filters%s=FILTERS option:"
msgstr "在 --filters%s=过滤器 选项中出现错误:"
#: src/xz/coder.c:229
msgid "Memory usage limit is too low for the given filter setup."
msgstr "内存用量限制对指定过滤器设置过低。"
#: src/xz/coder.c:169
#: src/xz/coder.c:244
#, c-format
msgid "filter chain %u used by --block-list but not specified with --filters%u="
msgstr "--block-list 使用了过滤器链 %u但未经由 --filters%u= 指定"
#: src/xz/coder.c:375
msgid "Using a preset in raw mode is discouraged."
msgstr "不推荐在 raw 模式使用预设等级。"
#: src/xz/coder.c:171
#: src/xz/coder.c:377
msgid "The exact options of the presets may vary between software versions."
msgstr "各个预设等级所使用的准确选项列表在不同软件版本之间可能不同。"
#: src/xz/coder.c:194
#: src/xz/coder.c:403
msgid "The .lzma format supports only the LZMA1 filter"
msgstr ".lzma 格式只支持 LZMA1 过滤器"
#: src/xz/coder.c:202
#: src/xz/coder.c:411
msgid "LZMA1 cannot be used with the .xz format"
msgstr "LZMA1 无法用于 .xz 格式"
#: src/xz/coder.c:219
msgid "The filter chain is incompatible with --flush-timeout"
msgstr "过滤器链和 --flush-timeout 不兼容"
#: src/xz/coder.c:435
#, c-format
msgid "Filter chain %u is incompatible with --flush-timeout"
msgstr "过滤器链 %u 和 --flush-timeout 不兼容"
#: src/xz/coder.c:225
#: src/xz/coder.c:444
msgid "Switching to single-threaded mode due to --flush-timeout"
msgstr "因 --flush-timeout 而切换至单线程模式"
#: src/xz/coder.c:249
#: src/xz/coder.c:485
#, c-format
msgid "Unsupported options in filter chain %u"
msgstr "过滤器链 %u 中存在不支持的选项"
#: src/xz/coder.c:516
#, c-format
msgid "Using up to %<PRIu32> threads."
msgstr "使用最多 %<PRIu32> 个线程。"
#: src/xz/coder.c:265
#: src/xz/coder.c:532
msgid "Unsupported filter chain or filter options"
msgstr "不支持的过滤器链或过滤器选项"
#: src/xz/coder.c:277
#: src/xz/coder.c:553
#, c-format
msgid "Decompression will need %s MiB of memory."
msgstr "解压缩需要 %s MiB 的内存。"
#: src/xz/coder.c:309
#: src/xz/coder.c:585
#, c-format
msgid "Reduced the number of threads from %s to %s to not exceed the memory usage limit of %s MiB"
msgstr "已将所使用的线程数从 %s 减小为 %s以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:329
#: src/xz/coder.c:605
#, c-format
msgid "Reduced the number of threads from %s to one. The automatic memory usage limit of %s MiB is still being exceeded. %s MiB of memory is required. Continuing anyway."
msgstr "已将所使用的线程数从 %s 减小为 1。这仍然超出了自动的内存使用限制 %s MiB。需要 %s MiB 的内存。继续操作。"
#: src/xz/coder.c:356
#: src/xz/coder.c:632
#, c-format
msgid "Switching to single-threaded mode to not exceed the memory usage limit of %s MiB"
msgstr "正在切换到单线程模式以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:411
#: src/xz/coder.c:757
#, c-format
msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "已调整 LZMA%c 字典大小(从 %s MiB 调整为 %s MiB以不超出 %s MiB 的内存用量限制"
#: src/xz/file_io.c:110 src/xz/file_io.c:118
#: src/xz/coder.c:767
#, fuzzy, c-format
#| msgid "Adjusted LZMA%c dictionary size from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgid "Adjusted LZMA%c dictionary size for --filters%u from %s MiB to %s MiB to not exceed the memory usage limit of %s MiB"
msgstr "已调整 LZMA%c 字典大小(从 %s MiB 调整为 %s MiB以不超出 %s MiB 的内存用量限制"
#: src/xz/coder.c:1141
#, c-format
msgid "Error changing to filter chain %u: %s"
msgstr "更改为过滤器链 %u 时出错:%s"
#: src/xz/file_io.c:137 src/xz/file_io.c:145
#, c-format
msgid "Error creating a pipe: %s"
msgstr "创建管道时出错:%s"
#: src/xz/file_io.c:252
#: src/xz/file_io.c:333
msgid "Failed to enable the sandbox"
msgstr "沙盒启用失败"
#: src/xz/file_io.c:294
#: src/xz/file_io.c:375
#, c-format
msgid "%s: poll() failed: %s"
msgstr "%spoll() 失败:%s"
@ -169,111 +206,111 @@ msgstr "%spoll() 失败:%s"
#. it is possible that the user has put a new file in place
#. of the original file, and in that case it obviously
#. shouldn't be removed.
#: src/xz/file_io.c:361
#: src/xz/file_io.c:442
#, c-format
msgid "%s: File seems to have been moved, not removing"
msgstr "%s文件似乎已移动不再进行删除操作"
#: src/xz/file_io.c:368 src/xz/file_io.c:924
#: src/xz/file_io.c:449 src/xz/file_io.c:1005
#, c-format
msgid "%s: Cannot remove: %s"
msgstr "%s无法删除%s"
#: src/xz/file_io.c:394
#: src/xz/file_io.c:475
#, c-format
msgid "%s: Cannot set the file owner: %s"
msgstr "%s无法设置文件所有者%s"
#: src/xz/file_io.c:407
#: src/xz/file_io.c:488
#, c-format
msgid "%s: Cannot set the file group: %s"
msgstr "%s无法设置文件所有组%s"
#: src/xz/file_io.c:426
#: src/xz/file_io.c:507
#, c-format
msgid "%s: Cannot set the file permissions: %s"
msgstr "%s无法设置文件权限%s"
#: src/xz/file_io.c:552
#: src/xz/file_io.c:633
#, c-format
msgid "Error getting the file status flags from standard input: %s"
msgstr "从标准输入获取文件状态标志出错:%s"
#: src/xz/file_io.c:610 src/xz/file_io.c:672
#: src/xz/file_io.c:691 src/xz/file_io.c:753
#, c-format
msgid "%s: Is a symbolic link, skipping"
msgstr "%s是符号链接跳过"
#: src/xz/file_io.c:701
#: src/xz/file_io.c:782
#, c-format
msgid "%s: Is a directory, skipping"
msgstr "%s是目录跳过"
#: src/xz/file_io.c:707
#: src/xz/file_io.c:788
#, c-format
msgid "%s: Not a regular file, skipping"
msgstr "%s不是标准文件跳过"
#: src/xz/file_io.c:724
#: src/xz/file_io.c:805
#, c-format
msgid "%s: File has setuid or setgid bit set, skipping"
msgstr "%s文件有设置用户ID或设置组ID标识跳过"
#: src/xz/file_io.c:731
#: src/xz/file_io.c:812
#, c-format
msgid "%s: File has sticky bit set, skipping"
msgstr "%s文件有粘滞位标识跳过"
#: src/xz/file_io.c:738
#: src/xz/file_io.c:819
#, c-format
msgid "%s: Input file has more than one hard link, skipping"
msgstr "%s输入文件有多于一个硬链接跳过"
#: src/xz/file_io.c:780
#: src/xz/file_io.c:861
msgid "Empty filename, skipping"
msgstr "空文件名,跳过"
#: src/xz/file_io.c:834
#: src/xz/file_io.c:915
#, c-format
msgid "Error restoring the status flags to standard input: %s"
msgstr "回复标准输入的状态标志时出错:%s"
#: src/xz/file_io.c:882
#: src/xz/file_io.c:963
#, c-format
msgid "Error getting the file status flags from standard output: %s"
msgstr "获取标准输出的文件状态标志时出错:%s"
#: src/xz/file_io.c:1060
#: src/xz/file_io.c:1162
#, c-format
msgid "Error restoring the O_APPEND flag to standard output: %s"
msgstr "恢复标准输出的 O_APPEND 标志时出错:%s"
#: src/xz/file_io.c:1072
#: src/xz/file_io.c:1174
#, c-format
msgid "%s: Closing the file failed: %s"
msgstr "%s关闭文件失败%s"
#: src/xz/file_io.c:1108 src/xz/file_io.c:1371
#: src/xz/file_io.c:1210 src/xz/file_io.c:1472
#, c-format
msgid "%s: Seeking failed when trying to create a sparse file: %s"
msgstr "%s尝试创建稀疏文件时 seek 失败:%s"
#: src/xz/file_io.c:1209
#: src/xz/file_io.c:1310
#, c-format
msgid "%s: Read error: %s"
msgstr "%s读取错误%s"
#: src/xz/file_io.c:1239
#: src/xz/file_io.c:1340
#, c-format
msgid "%s: Error seeking the file: %s"
msgstr "%sseek 文件时出错:%s"
#: src/xz/file_io.c:1263
#: src/xz/file_io.c:1364
#, c-format
msgid "%s: Unexpected end of file"
msgstr "%s未预期的文件结束"
#: src/xz/file_io.c:1322
#: src/xz/file_io.c:1423
#, c-format
msgid "%s: Write error: %s"
msgstr "%s写入错误%s"
@ -492,63 +529,63 @@ msgstr "%s过小而不是有效的 .xz 文件"
#. to Ratio, the columns are right aligned. Check and Filename
#. are left aligned. If you need longer words, it's OK to
#. use two lines here. Test with "xz -l foo.xz".
#: src/xz/list.c:731
#: src/xz/list.c:741
msgid "Strms Blocks Compressed Uncompressed Ratio Check Filename"
msgstr " 流 块 压缩大小 解压大小 比例 校验 文件名"
#: src/xz/list.c:1026 src/xz/list.c:1204
#: src/xz/list.c:1036 src/xz/list.c:1214
msgid "Yes"
msgstr "是"
#: src/xz/list.c:1026 src/xz/list.c:1204
#: src/xz/list.c:1036 src/xz/list.c:1214
msgid "No"
msgstr "否"
#: src/xz/list.c:1028 src/xz/list.c:1206
#: src/xz/list.c:1038 src/xz/list.c:1216
#, c-format
msgid " Minimum XZ Utils version: %s\n"
msgstr " 最低 XZ Utils 版本:%s\n"
#. TRANSLATORS: %s is an integer. Only the plural form of this
#. message is used (e.g. "2 files"). Test with "xz -l foo.xz bar.xz".
#: src/xz/list.c:1179
#: src/xz/list.c:1189
#, c-format
msgid "%s file\n"
msgid_plural "%s files\n"
msgstr[0] "%s 文件\n"
#: src/xz/list.c:1192
#: src/xz/list.c:1202
msgid "Totals:"
msgstr "总计:"
#: src/xz/list.c:1270
#: src/xz/list.c:1280
msgid "--list works only on .xz files (--format=xz or --format=auto)"
msgstr "--list 仅适用于 .xz 文件(--format=xz 或 --format=auto"
#: src/xz/list.c:1276
#: src/xz/list.c:1286
msgid "--list does not support reading from standard input"
msgstr "--list 不支持从标准输入读取"
#: src/xz/main.c:89
#: src/xz/main.c:96
#, c-format
msgid "%s: Error reading filenames: %s"
msgstr "%s读取文件名列表时出错%s"
#: src/xz/main.c:96
#: src/xz/main.c:103
#, c-format
msgid "%s: Unexpected end of input when reading filenames"
msgstr "%s读取文件名列表时遇到未预期的输入结束"
#: src/xz/main.c:120
#: src/xz/main.c:127
#, c-format
msgid "%s: Null character found when reading filenames; maybe you meant to use `--files0' instead of `--files'?"
msgstr "%s读取文件名列表时获得了空字符您可能想要使用“--files0”而非“--files”"
msgid "%s: Null character found when reading filenames; maybe you meant to use '--files0' instead of '--files'?"
msgstr "%s读取文件名列表时获得了空字符您可能想要使用 '--files0' 而非 '--files'"
#: src/xz/main.c:188
#: src/xz/main.c:207
msgid "Compression and decompression with --robot are not supported yet."
msgstr "尚不支持带 --robot 的压缩和解压缩。"
#: src/xz/main.c:266
#: src/xz/main.c:285
msgid "Cannot read data from standard input when reading filenames from standard input"
msgstr "无法同时从标准输入读取数据和文件名列表"
@ -556,68 +593,68 @@ msgstr "无法同时从标准输入读取数据和文件名列表"
#. of the line in messages. Usually it becomes "xz: ".
#. This is a translatable string because French needs
#. a space before a colon.
#: src/xz/message.c:670 src/xz/message.c:725
#: src/xz/message.c:671 src/xz/message.c:726
#, c-format
msgid "%s: "
msgstr "%s"
#: src/xz/message.c:797 src/xz/message.c:856
#: src/xz/message.c:798 src/xz/message.c:857
msgid "Internal error (bug)"
msgstr "内部错误bug"
#: src/xz/message.c:804
#: src/xz/message.c:805
msgid "Cannot establish signal handlers"
msgstr "无法建立信号处理器"
#: src/xz/message.c:813
#: src/xz/message.c:814
msgid "No integrity check; not verifying file integrity"
msgstr "无完整性检查;将不验证文件完整性"
#: src/xz/message.c:816
#: src/xz/message.c:817
msgid "Unsupported type of integrity check; not verifying file integrity"
msgstr "不支持的完整性检查类型;将不验证文件完整性"
#: src/xz/message.c:823
#: src/xz/message.c:824
msgid "Memory usage limit reached"
msgstr "达到内存使用限制"
#: src/xz/message.c:826
#: src/xz/message.c:827
msgid "File format not recognized"
msgstr "无法识别文件格式"
#: src/xz/message.c:829
#: src/xz/message.c:830
msgid "Unsupported options"
msgstr "不支持的选项"
#: src/xz/message.c:832
#: src/xz/message.c:833
msgid "Compressed data is corrupt"
msgstr "压缩数据已损坏"
#: src/xz/message.c:835
#: src/xz/message.c:836
msgid "Unexpected end of input"
msgstr "输入意外结束"
#: src/xz/message.c:877
#: src/xz/message.c:878
#, c-format
msgid "%s MiB of memory is required. The limiter is disabled."
msgstr "需要 %s MiB 的内存空间。限制已禁用。"
#: src/xz/message.c:905
#: src/xz/message.c:906
#, c-format
msgid "%s MiB of memory is required. The limit is %s."
msgstr "需要 %s MiB 的内存空间。限制为 %s。"
#: src/xz/message.c:924
#: src/xz/message.c:925
#, c-format
msgid "%s: Filter chain: %s\n"
msgstr "%s过滤器链%s\n"
#: src/xz/message.c:935
#: src/xz/message.c:936
#, c-format
msgid "Try `%s --help' for more information."
msgstr "请尝试执行“%s --help”来获取更多信息。"
msgid "Try '%s --help' for more information."
msgstr "请尝试执行 '%s --help' 来获取更多信息。"
#: src/xz/message.c:961
#: src/xz/message.c:962
#, c-format
msgid ""
"Usage: %s [OPTION]... [FILE]...\n"
@ -628,15 +665,15 @@ msgstr ""
"使用 .xz 格式压缩或解压缩文件。\n"
"\n"
#: src/xz/message.c:968
#: src/xz/message.c:969
msgid "Mandatory arguments to long options are mandatory for short options too.\n"
msgstr "必选参数对长短选项同时适用。\n"
#: src/xz/message.c:972
#: src/xz/message.c:973
msgid " Operation mode:\n"
msgstr " 操作模式:\n"
#: src/xz/message.c:975
#: src/xz/message.c:976
msgid ""
" -z, --compress force compression\n"
" -d, --decompress force decompression\n"
@ -648,7 +685,7 @@ msgstr ""
" -t, --test 测试压缩文件完整性\n"
" -l, --list 列出 .xz 文件的信息"
#: src/xz/message.c:981
#: src/xz/message.c:982
msgid ""
"\n"
" Operation modifiers:\n"
@ -656,7 +693,7 @@ msgstr ""
"\n"
" 操作修饰符:\n"
#: src/xz/message.c:984
#: src/xz/message.c:985
msgid ""
" -k, --keep keep (don't delete) input files\n"
" -f, --force force overwrite of output file and (de)compress links\n"
@ -666,16 +703,24 @@ msgstr ""
" -f, --force 强制覆写输出文件和(解)压缩链接\n"
" -c, --stdout 向标准输出写入,同时不要删除输入文件"
#: src/xz/message.c:993
#: src/xz/message.c:994
msgid ""
" --single-stream decompress only the first stream, and silently\n"
" ignore possible remaining input data"
msgstr " --single-stream 仅解压缩第一个流,忽略其后可能继续出现的输入数据"
#: src/xz/message.c:996
#: src/xz/message.c:997
#, fuzzy
#| msgid ""
#| " --no-sparse do not create sparse files when decompressing\n"
#| " -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
#| " --files[=FILE] read filenames to process from FILE; if FILE is\n"
#| " omitted, filenames are read from the standard input;\n"
#| " filenames must be terminated with the newline character\n"
#| " --files0[=FILE] like --files but use the null character as terminator"
msgid ""
" --no-sparse do not create sparse files when decompressing\n"
" -S, --suffix=.SUF use the suffix `.SUF' on compressed files\n"
" -S, --suffix=.SUF use the suffix '.SUF' on compressed files\n"
" --files[=FILE] read filenames to process from FILE; if FILE is\n"
" omitted, filenames are read from the standard input;\n"
" filenames must be terminated with the newline character\n"
@ -687,7 +732,7 @@ msgstr ""
" 将从标准输入读取文件名列表;文件名必须使用换行符分隔\n"
" --files0[=文件] 类似 --files但使用空字符进行分隔"
#: src/xz/message.c:1005
#: src/xz/message.c:1006
msgid ""
"\n"
" Basic file format and compression options:\n"
@ -695,12 +740,18 @@ msgstr ""
"\n"
" 基本文件格式和压缩选项:\n"
#: src/xz/message.c:1007
#: src/xz/message.c:1008
#, fuzzy
#| msgid ""
#| " -F, --format=FMT file format to encode or decode; possible values are\n"
#| " `auto' (default), `xz', `lzma', `lzip', and `raw'\n"
#| " -C, --check=CHECK integrity check type: `none' (use with caution),\n"
#| " `crc32', `crc64' (default), or `sha256'"
msgid ""
" -F, --format=FMT file format to encode or decode; possible values are\n"
" `auto' (default), `xz', `lzma', `lzip', and `raw'\n"
" -C, --check=CHECK integrity check type: `none' (use with caution),\n"
" `crc32', `crc64' (default), or `sha256'"
" 'auto' (default), 'xz', 'lzma', 'lzip', and 'raw'\n"
" -C, --check=CHECK integrity check type: 'none' (use with caution),\n"
" 'crc32', 'crc64' (default), or 'sha256'"
msgstr ""
" -F, --format=格式 要编码或解码的文件格式;可能的值包括\n"
" “auto”默认、“xz”、“lzma”、\n"
@ -708,11 +759,11 @@ msgstr ""
" -C, --check=类型 完整性检查类型“none”请谨慎使用、\n"
" “crc32”、“crc64”默认或“sha256”"
#: src/xz/message.c:1012
#: src/xz/message.c:1013
msgid " --ignore-check don't verify the integrity check when decompressing"
msgstr " --ignore-check 解压缩时不要进行完整性检查验证"
#: src/xz/message.c:1016
#: src/xz/message.c:1017
msgid ""
" -0 ... -9 compression preset; default is 6; take compressor *and*\n"
" decompressor memory usage into account before using 7-9!"
@ -720,7 +771,7 @@ msgstr ""
" -0 ... -9 压缩预设等级;默认为 6使用 7-9 的等级之前,请先考虑\n"
" 压缩和解压缩所需的内存用量!(会占用大量内存空间)"
#: src/xz/message.c:1020
#: src/xz/message.c:1021
msgid ""
" -e, --extreme try to improve compression ratio by using more CPU time;\n"
" does not affect decompressor memory requirements"
@ -728,15 +779,19 @@ msgstr ""
" -e, --extreme 尝试使用更多 CPU 时间来改进压缩比率;\n"
" 不会影响解压缩的内存需求量"
#: src/xz/message.c:1024
#: src/xz/message.c:1025
#, fuzzy
#| msgid ""
#| " -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
#| " to use as many threads as there are processor cores"
msgid ""
" -T, --threads=NUM use at most NUM threads; the default is 1; set to 0\n"
" to use as many threads as there are processor cores"
" -T, --threads=NUM use at most NUM threads; the default is 0 which uses\n"
" as many threads as there are processor cores"
msgstr ""
" -T, --threads=数量 使用最多指定数量的线程;默认值为 1设置为 0\n"
" 可以使用与处理器内核数量相同的线程数"
#: src/xz/message.c:1029
#: src/xz/message.c:1030
msgid ""
" --block-size=SIZE\n"
" start a new .xz block after every SIZE bytes of input;\n"
@ -746,17 +801,24 @@ msgstr ""
" 输入每读取指定块大小的数据后即开始一个新的 .xz 块;\n"
" 使用该选项可以设置多线程压缩中的块大小"
#: src/xz/message.c:1033
#: src/xz/message.c:1034
#, fuzzy
#| msgid ""
#| " --block-list=SIZES\n"
#| " start a new .xz block after the given comma-separated\n"
#| " intervals of uncompressed data"
msgid ""
" --block-list=SIZES\n"
" --block-list=BLOCKS\n"
" start a new .xz block after the given comma-separated\n"
" intervals of uncompressed data"
" intervals of uncompressed data; optionally, specify a\n"
" filter chain number (0-9) followed by a ':' before the\n"
" uncompressed data size"
msgstr ""
" --block-list=块大小列表\n"
" 在所给出的未压缩数据间隔大小的数据之后开始一个新的\n"
" .xz 块(使用逗号分隔)"
#: src/xz/message.c:1037
#: src/xz/message.c:1040
msgid ""
" --flush-timeout=TIMEOUT\n"
" when compressing, if more than TIMEOUT milliseconds has\n"
@ -767,7 +829,7 @@ msgstr ""
" 进行压缩时,如果从上次刷洗输出之后经过了指定的超时时间\n"
" 且读取更多数据会被阻塞,则刷洗输出所有缓冲数据"
#: src/xz/message.c:1043
#: src/xz/message.c:1046
#, no-c-format
msgid ""
" --memlimit-compress=LIMIT\n"
@ -786,13 +848,13 @@ msgstr ""
" 所指定限制量单位为字节,或以百分号 % 结尾表示内存比例,\n"
" 或者指定 0 取软件默认值"
#: src/xz/message.c:1052
#: src/xz/message.c:1055
msgid ""
" --no-adjust if compression settings exceed the memory usage limit,\n"
" give an error instead of adjusting the settings downwards"
msgstr " --no-adjust 如果压缩设置超出内存用量限制,不调整设置而直接报错"
#: src/xz/message.c:1058
#: src/xz/message.c:1061
msgid ""
"\n"
" Custom filter chain for compression (alternative for using presets):"
@ -800,7 +862,27 @@ msgstr ""
"\n"
" 用于压缩的自定义过滤器链(不使用预设等级时的备选用法):"
#: src/xz/message.c:1067
#: src/xz/message.c:1064
msgid ""
"\n"
" --filters=FILTERS set the filter chain using the liblzma filter string\n"
" syntax; use --filters-help for more information"
msgstr ""
#: src/xz/message.c:1070
msgid ""
" --filters1=FILTERS ... --filters9=FILTERS\n"
" set additional filter chains using the liblzma filter\n"
" string syntax to use with --block-list"
msgstr ""
#: src/xz/message.c:1076
msgid ""
" --filters-help display more information about the liblzma filter string\n"
" syntax and exit."
msgstr ""
#: src/xz/message.c:1087
msgid ""
"\n"
" --lzma1[=OPTS] LZMA1 or LZMA2; OPTS is a comma-separated list of zero or\n"
@ -829,7 +911,19 @@ msgstr ""
" (hc3, hc4, bt2, bt3, bt4; bt4)\n"
" depth=数字 最大搜索深度; 0=自动(默认)"
#: src/xz/message.c:1082
#: src/xz/message.c:1102
#, fuzzy
#| msgid ""
#| "\n"
#| " --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
#| " --arm[=OPTS] ARM BCJ filter\n"
#| " --armthumb[=OPTS] ARM-Thumb BCJ filter\n"
#| " --arm64[=OPTS] ARM64 BCJ filter\n"
#| " --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
#| " --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
#| " --sparc[=OPTS] SPARC BCJ filter\n"
#| " Valid OPTS for all BCJ filters:\n"
#| " start=NUM start offset for conversions (default=0)"
msgid ""
"\n"
" --x86[=OPTS] x86 BCJ filter (32-bit and 64-bit)\n"
@ -839,6 +933,7 @@ msgid ""
" --powerpc[=OPTS] PowerPC BCJ filter (big endian only)\n"
" --ia64[=OPTS] IA-64 (Itanium) BCJ filter\n"
" --sparc[=OPTS] SPARC BCJ filter\n"
" --riscv[=OPTS] RISC-V BCJ filter\n"
" Valid OPTS for all BCJ filters:\n"
" start=NUM start offset for conversions (default=0)"
msgstr ""
@ -853,7 +948,7 @@ msgstr ""
" 所有过滤器可用选项:\n"
" start=数字 转换的起始偏移量(默认=0"
#: src/xz/message.c:1095
#: src/xz/message.c:1116
msgid ""
"\n"
" --delta[=OPTS] Delta filter; valid OPTS (valid values; default):\n"
@ -864,7 +959,7 @@ msgstr ""
" --delta[=选项] 增量过滤器;有效选项(有效值;默认值):\n"
" dist=NUM 相减的字节之间的距离 (1-256; 1)"
#: src/xz/message.c:1103
#: src/xz/message.c:1124
msgid ""
"\n"
" Other options:\n"
@ -872,7 +967,7 @@ msgstr ""
"\n"
" 其它选项:\n"
#: src/xz/message.c:1106
#: src/xz/message.c:1127
msgid ""
" -q, --quiet suppress warnings; specify twice to suppress errors too\n"
" -v, --verbose be verbose; specify twice for even more verbose"
@ -880,21 +975,21 @@ msgstr ""
" -q, --quiet 不显示警告信息;指定两次可不显示错误信息\n"
" -v, --verbose 输出详细信息;指定两次可以输出更详细的信息"
#: src/xz/message.c:1111
#: src/xz/message.c:1132
msgid " -Q, --no-warn make warnings not affect the exit status"
msgstr " -Q, --no-warn 使得警告信息不影响程序退出返回值"
#: src/xz/message.c:1113
#: src/xz/message.c:1134
msgid " --robot use machine-parsable messages (useful for scripts)"
msgstr " --robot 使用机器可解析的信息(对于脚本有用)"
#: src/xz/message.c:1116
#: src/xz/message.c:1137
msgid ""
" --info-memory display the total amount of RAM and the currently active\n"
" memory usage limits, and exit"
msgstr " --info-memory 显示 RAM 总量和当前配置的内存用量限制,然后退出"
#: src/xz/message.c:1119
#: src/xz/message.c:1140
msgid ""
" -h, --help display the short help (lists only the basic options)\n"
" -H, --long-help display this long help and exit"
@ -902,7 +997,7 @@ msgstr ""
" -h, --help 显示短帮助信息(仅列出基本选项)\n"
" -H, --long-help 显示本长帮助信息"
#: src/xz/message.c:1123
#: src/xz/message.c:1144
msgid ""
" -h, --help display this short help and exit\n"
" -H, --long-help display the long help (lists also the advanced options)"
@ -910,11 +1005,11 @@ msgstr ""
" -h, --help 显示本短帮助信息并退出\n"
" -H, --long-help 显示长帮助信息(同时列出高级选项)"
#: src/xz/message.c:1128
#: src/xz/message.c:1149
msgid " -V, --version display the version number and exit"
msgstr " -V, --version 显示软件版本号并退出"
#: src/xz/message.c:1130
#: src/xz/message.c:1151
msgid ""
"\n"
"With no FILE, or when FILE is -, read standard input.\n"
@ -926,7 +1021,7 @@ msgstr ""
#. for this package. Please add _another line_ saying
#. "Report translation bugs to <...>\n" with the email or WWW
#. address for translation bugs. Thanks.
#: src/xz/message.c:1136
#: src/xz/message.c:1157
#, c-format
msgid "Report bugs to <%s> (in English or Finnish).\n"
msgstr ""
@ -934,19 +1029,33 @@ msgstr ""
"请使用中文向 TP 简体中文翻译团队 <i18n-zh@googlegroups.com>\n"
"报告软件的简体中文翻译错误。\n"
#: src/xz/message.c:1138
#: src/xz/message.c:1159
#, c-format
msgid "%s home page: <%s>\n"
msgstr "%s 主页:<%s>\n"
#: src/xz/message.c:1142
#: src/xz/message.c:1163
msgid "THIS IS A DEVELOPMENT VERSION NOT INTENDED FOR PRODUCTION USE."
msgstr "这是开发版本,不适用于生产环境使用。"
#: src/xz/message.c:1180
msgid ""
"Filter chains are set using the --filters=FILTERS or\n"
"--filters1=FILTERS ... --filters9=FILTERS options. Each filter in the chain\n"
"can be separated by spaces or '--'. Alternatively a preset <0-9>[e] can be\n"
"specified instead of a filter chain.\n"
msgstr ""
#: src/xz/message.c:1186
#, fuzzy
#| msgid "Unsupported filter chain or filter options"
msgid "The supported filters and their options are:"
msgstr "不支持的过滤器链或过滤器选项"
#: src/xz/options.c:86
#, c-format
msgid "%s: Options must be `name=value' pairs separated with commas"
msgstr "%s选项必须按照“名称=值”的格式成对出现,使用半角逗号分隔"
msgid "%s: Options must be 'name=value' pairs separated with commas"
msgstr "%s选项必须按照 '名称=值' 的格式成对出现,使用半角逗号分隔"
#: src/xz/options.c:93
#, c-format
@ -958,54 +1067,57 @@ msgstr "%s无效的选项名称"
msgid "%s: Invalid option value"
msgstr "%s无效的选项值"
#: src/xz/options.c:247
#: src/xz/options.c:248
#, c-format
msgid "Unsupported LZMA1/LZMA2 preset: %s"
msgstr "不支持的 LZMA1/LZMA2 预设等级:%s"
#: src/xz/options.c:355
#: src/xz/options.c:356
msgid "The sum of lc and lp must not exceed 4"
msgstr "lc 和 lp 的和必须不大于 4"
#: src/xz/suffix.c:160
#: src/xz/suffix.c:166
#, c-format
msgid "%s: Filename has an unknown suffix, skipping"
msgstr "%s文件名有未知后缀跳过"
#: src/xz/suffix.c:181
#: src/xz/suffix.c:187
#, c-format
msgid "%s: File already has `%s' suffix, skipping"
msgstr "%s文件已有“%s”后缀名,跳过"
msgid "%s: File already has '%s' suffix, skipping"
msgstr "%s文件已有 '%s' 后缀名,跳过"
#: src/xz/suffix.c:388
#: src/xz/suffix.c:394
#, c-format
msgid "%s: Invalid filename suffix"
msgstr "%s无效的文件名后缀"
#: src/xz/util.c:71
#: src/xz/util.c:107
#, c-format
msgid "%s: Value is not a non-negative decimal integer"
msgstr "%s值不是非负十进制整数"
#: src/xz/util.c:113
#: src/xz/util.c:149
#, c-format
msgid "%s: Invalid multiplier suffix"
msgstr "%s无效的乘数后缀"
#: src/xz/util.c:115
msgid "Valid suffixes are `KiB' (2^10), `MiB' (2^20), and `GiB' (2^30)."
#: src/xz/util.c:151
#, fuzzy
#| 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)."
msgstr "有效的后缀包括“KiB”2^10、“MiB”2^20和“GiB”2^30。"
#: src/xz/util.c:132
#, c-format
msgid "Value of the option `%s' must be in the range [%<PRIu64>, %<PRIu64>]"
#: src/xz/util.c:168
#, fuzzy, 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 "选项“%s”的值必须位于 [%<PRIu64>, %<PRIu64>] 范围内"
#: src/xz/util.c:269
#: src/xz/util.c:291
msgid "Compressed data cannot be read from a terminal"
msgstr "压缩数据不能从终端读取"
#: src/xz/util.c:282
#: src/xz/util.c:304
msgid "Compressed data cannot be written to a terminal"
msgstr "压缩数据不能向终端写入"

1
po4a/.gitignore vendored
View File

@ -1,2 +1,3 @@
/man
/xz-man.pot
/*.po.authors

2115
po4a/de.po

File diff suppressed because it is too large Load Diff

4747
po4a/fr.po

File diff suppressed because it is too large Load Diff

2122
po4a/ko.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More