mirror of
https://git.tukaani.org/xz.git
synced 2025-04-20 14:40:50 +00:00
Compare commits
203 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3ec664d3f6 | ||
|
3cc0aa702e | ||
|
526d3f7f2c | ||
|
660b09279e | ||
|
7d76282dac | ||
|
4470c3f7d8 | ||
|
33b8a85fac | ||
|
09daebd66b | ||
|
51ad72dae4 | ||
|
18463917f9 | ||
|
26bbcb13cd | ||
|
c35ee804b8 | ||
|
0f4429d47f | ||
|
a93e2c2d1d | ||
|
d438989559 | ||
|
5781414b6e | ||
|
3670e0616e | ||
|
c1b001b09e | ||
|
7213fe39c7 | ||
|
15358be94a | ||
|
1aa92c7ffd | ||
|
3c7e400fdc | ||
|
8a99272d4a | ||
|
c35259c9e2 | ||
|
30982a2153 | ||
|
3a8f81e0ad | ||
|
0644675c82 | ||
|
dcc02a6ca0 | ||
|
c761b7051f | ||
|
a71bc2d75b | ||
|
8fda5ce872 | ||
|
2729079bcb | ||
|
a289c4dfeb | ||
|
6f0db31713 | ||
|
d7e2bf7e2d | ||
|
58f200b6d1 | ||
|
41bdc9fa5c | ||
|
52e40c1912 | ||
|
8a01963331 | ||
|
e3ad7eda74 | ||
|
09cabae2ab | ||
|
c10b66fbf9 | ||
|
9132ce3564 | ||
|
d642e13874 | ||
|
47599f3b73 | ||
|
8f5ab75c45 | ||
|
3eb7cf9dd5 | ||
|
067961ee0e | ||
|
6822f6f891 | ||
|
0e5e3e7bdc | ||
|
77bcf6b76a | ||
|
df3efc058a | ||
|
4ebfe11cd3 | ||
|
bfea691361 | ||
|
d4e33e7392 | ||
|
3c130737c9 | ||
|
40c8513b4e | ||
|
cacaf25aa7 | ||
|
3495a6b291 | ||
|
2861d856de | ||
|
54546babc3 | ||
|
a7e58d1fdb | ||
|
07a9cda037 | ||
|
1b4e7dca24 | ||
|
18683525a7 | ||
|
005f039864 | ||
|
34be4e6aa6 | ||
|
79e329b771 | ||
|
86f33bb90c | ||
|
1e243ab378 | ||
|
8595b5ab3b | ||
|
a3f163a4ad | ||
|
cb0e847fe0 | ||
|
c3c854dc75 | ||
|
3216301aa2 | ||
|
f99e7c69ad | ||
|
bfe9be7a46 | ||
|
882eadc5b8 | ||
|
ec5458e1c9 | ||
|
8c93ced56b | ||
|
f7c9bab037 | ||
|
28e7d130cb | ||
|
cca7e6c05b | ||
|
8090d3dc7f | ||
|
0721b8bfe5 | ||
|
1ddb40f6fd | ||
|
092af76234 | ||
|
77bce9a0a2 | ||
|
3a2fc62f59 | ||
|
b04c16f9a5 | ||
|
d4dd3c8f61 | ||
|
be90720d6c | ||
|
f724552d0c | ||
|
00e774819c | ||
|
51133ad71e | ||
|
85b5595b67 | ||
|
d8228d1ea0 | ||
|
2358ef8238 | ||
|
54f4a4162a | ||
|
85ab59a6b7 | ||
|
fb42599e44 | ||
|
20cac20f63 | ||
|
91e3ea8735 | ||
|
df1659a6c8 | ||
|
e083e95dbf | ||
|
b0d3b86ecf | ||
|
bae288ea6f | ||
|
f10cb93f33 | ||
|
59055d70cd | ||
|
812c1f95f3 | ||
|
d2a4f963c2 | ||
|
493bc57c33 | ||
|
cede418d4f | ||
|
6e76a25df2 | ||
|
0ca14871f3 | ||
|
94a462850b | ||
|
72058ca22a | ||
|
c59ebbe1c6 | ||
|
ceda860934 | ||
|
2234b7cc47 | ||
|
3ba3ef57f9 | ||
|
57ad820e15 | ||
|
ba0b5bfe7c | ||
|
d2ed675959 | ||
|
9a70e93fef | ||
|
dc4740f720 | ||
|
6e210d5766 | ||
|
4019b012f2 | ||
|
09a0311a1e | ||
|
3117336a02 | ||
|
f78081eb12 | ||
|
7413383e42 | ||
|
eed2f26c0e | ||
|
2633d8df61 | ||
|
50fb269c7a | ||
|
3e2ff2d38c | ||
|
ebc8b8de19 | ||
|
1e63f7d536 | ||
|
aea54a4724 | ||
|
4381fcf00b | ||
|
752ba5ed99 | ||
|
cc21af1715 | ||
|
2d2d5f14b3 | ||
|
5d20a61205 | ||
|
2a80827e23 | ||
|
a541173771 | ||
|
9223ad6e78 | ||
|
32ceb2c36a | ||
|
42915101e9 | ||
|
42a9482b48 | ||
|
38a3ec5a7e | ||
|
34d1252f09 | ||
|
a594b39685 | ||
|
fa76e3ef59 | ||
|
112fa0aba6 | ||
|
1a1f3d0323 | ||
|
9f9203f574 | ||
|
12876b33c7 | ||
|
879295d91f | ||
|
859617d30d | ||
|
eeb74fba1f | ||
|
a7b9cd7000 | ||
|
ebe9d6d8cb | ||
|
78ab47d65d | ||
|
5f178c364c | ||
|
b3a7561880 | ||
|
94939a145f | ||
|
fa14c8aaf0 | ||
|
73baa8d99b | ||
|
886633f423 | ||
|
760f622f0d | ||
|
403b4c78b8 | ||
|
1888fb49f6 | ||
|
4b3c84e8ee | ||
|
69d1e20208 | ||
|
051d6b5c85 | ||
|
95dcea4b5d | ||
|
1107712e37 | ||
|
fd1b975b78 | ||
|
a2cda57249 | ||
|
8583c60211 | ||
|
74b138d2a6 | ||
|
3ec6dfd656 | ||
|
a67dcce610 | ||
|
058337b0f1 | ||
|
cd5de9c1bb | ||
|
651a1545c8 | ||
|
6e97b299f1 | ||
|
4e1c97052b | ||
|
ed957d3942 | ||
|
e98ddaf85a | ||
|
319cec142f | ||
|
46c3e113d8 | ||
|
86bec8334b | ||
|
5c91b454c2 | ||
|
d0e57b2f15 | ||
|
d416be55ac | ||
|
f06b33edd2 | ||
|
a100f9111c | ||
|
d85efdc891 | ||
|
42ee425673 | ||
|
c83349dfd9 | ||
|
2d7d862e3f |
@ -1,9 +1,12 @@
|
|||||||
|
# SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
[codespell]
|
[codespell]
|
||||||
|
|
||||||
# Skip all translation files and a few other autogenerated files.
|
# Skip all translation files and a few other autogenerated files.
|
||||||
# The autotool files should have their typos fixed in the upstream, but
|
# The autotool files should have their typos fixed in the upstream, but
|
||||||
# until then we will blacklist them here.
|
# until then we will blacklist them here.
|
||||||
skip = *.po,*.pot,./po4a/man,./doc/api,./configure,./autom4te.cache,./m4/libtool.m4,./build-aux/depcomp,./build-aux/ltmain.sh,./build-aux/config.guess,./build-aux/config.rpath,./m4/po.m4,./build-aux/config.sub
|
# THANKS contains names, some do trigger codespell.
|
||||||
|
skip = *.po,*.pot,./po4a/man,./doc/api,./configure,./autom4te.cache,./m4/libtool.m4,./build-aux/depcomp,./build-aux/ltmain.sh,./build-aux/config.guess,./build-aux/config.rpath,./m4/po.m4,./build-aux/config.sub,THANKS
|
||||||
|
|
||||||
# Ignore false positive matching words. Ideally codespell would allow
|
# Ignore false positive matching words. Ideally codespell would allow
|
||||||
# ignoring words for specific files, but that does not appear to be
|
# ignoring words for specific files, but that does not appear to be
|
||||||
@ -22,3 +25,6 @@ builtin = clear,rare,informal,usage,names
|
|||||||
# Always default to highest interactive level to avoid accidentally
|
# Always default to highest interactive level to avoid accidentally
|
||||||
# changing a false positive or picking the wrong replacement.
|
# changing a false positive or picking the wrong replacement.
|
||||||
interactive = 3
|
interactive = 3
|
||||||
|
|
||||||
|
# Ignore a URL with debbugs.
|
||||||
|
ignore-regex = \bhttps://debbugs\.gnu\.org\b
|
||||||
|
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.gitattributes export-ignore
|
||||||
|
.gitignore export-ignore
|
||||||
|
|
||||||
|
/.codespellrc export-ignore
|
||||||
|
/.github export-ignore
|
||||||
|
|
||||||
|
/build-aux/ci_build.bash export-ignore
|
29
.github/SECURITY.md
vendored
29
.github/SECURITY.md
vendored
@ -1,29 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
We provide security updates to the development branch and the stable
|
|
||||||
branches. Security patches for old releases are available on the
|
|
||||||
[project website](https://xz.tukaani.org/xz-utils/).
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
If you discover a security vulnerability in this project, please
|
|
||||||
report it privately. **Do not disclose it as a public issue.** This gives
|
|
||||||
us time to work with you to fix the issue before public exposure, reducing
|
|
||||||
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.)
|
|
||||||
|
|
||||||
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
|
|
||||||
public exposure.
|
|
69
.github/workflows/ci.yml
vendored
69
.github/workflows/ci.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
|||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools
|
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools valgrind
|
||||||
|
|
||||||
# Install Autotools on Mac
|
# Install Autotools on Mac
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
@ -70,87 +70,90 @@ jobs:
|
|||||||
# done first.
|
# done first.
|
||||||
- name: Build 32-bit
|
- name: Build 32-bit
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: ./build-aux/ci_build.sh -b autotools -p build -f "-m32"
|
run: ./build-aux/ci_build.bash -b autotools -p build -f "-m32"
|
||||||
- name: Test 32-bit
|
- name: Test 32-bit
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: |
|
run: |
|
||||||
./build-aux/ci_build.sh -b autotools -p test -f "-m32" -n 32_bit
|
./build-aux/ci_build.bash -b autotools -p test -f "-m32" -n 32_bit
|
||||||
cd ../xz_build && make distclean
|
cd ../xz_build && make distclean
|
||||||
|
|
||||||
# ifunc must be disabled for this test because __attribute__ ifunc is
|
# The sandbox must be disabled because it will prevent access to
|
||||||
# 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
|
# the /proc/ filesystem on Linux, which is used by the sanitizer's
|
||||||
# instrumentation.
|
# instrumentation.
|
||||||
- name: Build with -fsanitize=address,undefined
|
- name: Build with -fsanitize=address,undefined
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: ./build-aux/ci_build.sh -b autotools -p build -f "-fsanitize=address,undefined" -d ifunc,sandbox
|
run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox
|
||||||
- name: Test with -fsanitize=address,undefined
|
- name: Test with -fsanitize=address,undefined
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: |
|
run: |
|
||||||
./build-aux/ci_build.sh -b autotools -p test -f "-fsanitize=address,undefined" -d ifunc,sandbox
|
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
|
||||||
|
./build-aux/ci_build.bash -b autotools -p test -f "-fsanitize=address,undefined" -d sandbox
|
||||||
|
cd ../xz_build && make distclean
|
||||||
|
|
||||||
|
- name: Build with Valgrind
|
||||||
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
|
run: ./build-aux/ci_build.bash -b autotools -p build -d sandbox
|
||||||
|
- name: Test with Valgrind
|
||||||
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
|
run: |
|
||||||
|
./build-aux/ci_build.bash -b autotools -p test -d sandbox -w "valgrind --quiet --trace-children=yes --exit-on-first-error=yes --error-exitcode=1"
|
||||||
cd ../xz_build && make distclean
|
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
|
- name: Build with musl libc
|
||||||
if: ${{ matrix.os == 'ubuntu-latest'}}
|
if: ${{ matrix.os == 'ubuntu-latest'}}
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
|
||||||
- name: Test with musl libc
|
- name: Test with musl libc
|
||||||
if: ${{ matrix.os == 'ubuntu-latest'}}
|
if: ${{ matrix.os == 'ubuntu-latest'}}
|
||||||
run: |
|
run: |
|
||||||
./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
|
./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
|
||||||
- name: Clean up musl libc run
|
- name: Clean up musl libc run
|
||||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||||
run: cd ../xz_build && make distclean
|
run: cd ../xz_build && make distclean
|
||||||
|
|
||||||
- name: Build with full features
|
- name: Build with full features
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build
|
||||||
- name: Test with full features
|
- name: Test with full features
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -n full_features
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -n full_features
|
||||||
|
|
||||||
- name: Build without encoders
|
- name: Build without encoders
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d encoders,shared -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p build
|
||||||
- name: Test without encoders
|
- name: Test without encoders
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
||||||
|
|
||||||
- name: Build without decoders
|
- name: Build without decoders
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d decoders,shared -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p build
|
||||||
- name: Test without decoders
|
- name: Test without decoders
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
||||||
|
|
||||||
- name: Build without threads
|
- name: Build without threads
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d threads,shared -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p build
|
||||||
- name: Test without threads
|
- name: Test without threads
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
||||||
|
|
||||||
- name: Build without BCJ filters
|
- name: Build without BCJ filters
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d bcj,shared,nls -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p build
|
||||||
- name: Test without BCJ filters
|
- name: Test without BCJ filters
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d bcj,shared,nls -p test -n no_bcj
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d bcj,shared,nls -p test -n no_bcj
|
||||||
|
|
||||||
- name: Build without Delta filters
|
- name: Build without Delta filters
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d delta,shared,nls -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p build
|
||||||
- name: Test without Delta filters
|
- name: Test without Delta filters
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d delta,shared,nls -p test -n no_delta
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d delta,shared,nls -p test -n no_delta
|
||||||
|
|
||||||
- name: Build without sha256 check
|
- name: Build without sha256 check
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p build
|
||||||
- name: Test without sha256 check
|
- name: Test without sha256 check
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p test -n no_sha256
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,crc64 -d shared,nls -p test -n no_sha256
|
||||||
|
|
||||||
- name: Build without crc64 check
|
- name: Build without crc64 check
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p build
|
||||||
- name: Test without crc64 check
|
- name: Test without crc64 check
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p test -n no_crc64
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -c crc32,sha256 -d shared,nls -p test -n no_crc64
|
||||||
|
|
||||||
- name: Build small
|
- name: Build small
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d small -p build
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p build
|
||||||
- name: Test small
|
- name: Test small
|
||||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -d small -p test -n small
|
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -d small -p test -n small
|
||||||
|
|
||||||
# Attempt to upload the test logs as artifacts if any step has failed
|
# Attempt to upload the test logs as artifacts if any step has failed
|
||||||
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
|
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
|
||||||
|
31
.github/workflows/freebsd.yml
vendored
Normal file
31
.github/workflows/freebsd.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
|
name: FreeBSD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
FreeBSD-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test xz on FreeBSD
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4
|
||||||
|
- name: Test in FreeBSD
|
||||||
|
id: test
|
||||||
|
uses: vmactions/FreeBSD-vm@f8be330398166d1eb0601f01353839d4052367b2 #v1.0.7
|
||||||
|
with:
|
||||||
|
usesh: true
|
||||||
|
prepare: |
|
||||||
|
pkg install -y autoconf automake gmake gettext-tools gtar libtool m4 po4a
|
||||||
|
run: |
|
||||||
|
export LC_ALL=C LANG=C
|
||||||
|
uname -a
|
||||||
|
./autogen.sh
|
||||||
|
./configure --enable-werror
|
||||||
|
make
|
||||||
|
make check VERBOSE=1
|
31
.github/workflows/netbsd.yml
vendored
Normal file
31
.github/workflows/netbsd.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
|
name: NetBSD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
NetBSD-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test xz on NetBSD
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4
|
||||||
|
- name: Test in NetBSD
|
||||||
|
id: test
|
||||||
|
uses: vmactions/NetBSD-vm@da9ed4d7cd0fb64f330e2342ac5c77ba529b6a11 #v1.0.7
|
||||||
|
with:
|
||||||
|
usesh: true
|
||||||
|
prepare: |
|
||||||
|
/usr/sbin/pkg_add -v autoconf automake gmake gettext-tools gtar-base libtool-base m4
|
||||||
|
run: |
|
||||||
|
export LC_ALL=C LANG=C
|
||||||
|
uname -a
|
||||||
|
./autogen.sh
|
||||||
|
./configure --enable-werror
|
||||||
|
make
|
||||||
|
make check VERBOSE=1
|
33
.github/workflows/openbsd.yml
vendored
Normal file
33
.github/workflows/openbsd.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
|
name: OpenBSD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
OpenBSD-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test xz on OpenBSD
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4
|
||||||
|
- name: Test in OpenBSD
|
||||||
|
id: test
|
||||||
|
uses: vmactions/OpenBSD-vm@eaa3d3f695a5a52971c23958f6dd4cd3397f959d #v1.0.8
|
||||||
|
with:
|
||||||
|
usesh: true
|
||||||
|
prepare: |
|
||||||
|
/usr/sbin/pkg_add -I -v autoconf-2.71 automake-1.16.5 gmake gettext-tools gtar libtool m4
|
||||||
|
run: |
|
||||||
|
export LC_ALL=C LANG=C
|
||||||
|
export AUTOCONF_VERSION=2.71
|
||||||
|
export AUTOMAKE_VERSION=1.16
|
||||||
|
uname -a
|
||||||
|
./autogen.sh
|
||||||
|
./configure --enable-werror
|
||||||
|
make
|
||||||
|
make check VERBOSE=1
|
20
.github/workflows/windows-ci.yml
vendored
20
.github/workflows/windows-ci.yml
vendored
@ -87,29 +87,29 @@ jobs:
|
|||||||
##################
|
##################
|
||||||
|
|
||||||
- name: Build with full features
|
- name: Build with full features
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p build
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p build
|
||||||
- name: Test with full features
|
- name: Test with full features
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features
|
||||||
|
|
||||||
- name: Build without threads
|
- name: Build without threads
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build
|
||||||
- name: Test without threads
|
- name: Test without threads
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
||||||
|
|
||||||
- name: Build without encoders
|
- name: Build without encoders
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build
|
||||||
- name: Test without encoders
|
- name: Test without encoders
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
||||||
|
|
||||||
- name: Build without decoders
|
- name: Build without decoders
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build
|
||||||
- name: Test without decoders
|
- name: Test without decoders
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
||||||
|
|
||||||
- name: Build with only crc32 check
|
- name: Build with only crc32 check
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build
|
||||||
- name: Test with only crc32 check
|
- name: Test with only crc32 check
|
||||||
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only
|
run: ./build-aux/ci_build.bash -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only
|
||||||
|
|
||||||
|
|
||||||
###############
|
###############
|
||||||
|
26
.gitignore
vendored
26
.gitignore
vendored
@ -15,7 +15,6 @@ Makefile.in
|
|||||||
|
|
||||||
/ABOUT-NLS
|
/ABOUT-NLS
|
||||||
/autom4te.cache
|
/autom4te.cache
|
||||||
/Doxyfile
|
|
||||||
/aclocal.m4
|
/aclocal.m4
|
||||||
/config.h
|
/config.h
|
||||||
/config.h.in
|
/config.h.in
|
||||||
@ -41,6 +40,10 @@ coverage
|
|||||||
/doc/internal
|
/doc/internal
|
||||||
/doc/api
|
/doc/api
|
||||||
|
|
||||||
|
/po4a/man
|
||||||
|
/po4a/xz-man.pot
|
||||||
|
/po4a/*.po.authors
|
||||||
|
|
||||||
/src/liblzma/liblzma.pc
|
/src/liblzma/liblzma.pc
|
||||||
/src/lzmainfo/lzmainfo
|
/src/lzmainfo/lzmainfo
|
||||||
/src/xz/xz
|
/src/xz/xz
|
||||||
@ -67,6 +70,7 @@ coverage
|
|||||||
/tests/test_index
|
/tests/test_index
|
||||||
/tests/test_index_hash
|
/tests/test_index_hash
|
||||||
/tests/test_lzip_decoder
|
/tests/test_lzip_decoder
|
||||||
|
/tests/test_microlzma
|
||||||
/tests/test_memlimit
|
/tests/test_memlimit
|
||||||
/tests/test_stream_flags
|
/tests/test_stream_flags
|
||||||
/tests/test_vli
|
/tests/test_vli
|
||||||
@ -93,21 +97,17 @@ coverage
|
|||||||
/DartConfiguration.tcl
|
/DartConfiguration.tcl
|
||||||
/liblzma-config-version.cmake
|
/liblzma-config-version.cmake
|
||||||
/liblzma-config.cmake
|
/liblzma-config.cmake
|
||||||
/lzcat
|
|
||||||
/lzcat.1
|
|
||||||
/lzma
|
|
||||||
/lzma.1
|
|
||||||
/Testing
|
/Testing
|
||||||
/tests_bin/
|
/tests_bin/
|
||||||
/unlzma
|
|
||||||
/unlzma.1
|
|
||||||
/unxz
|
|
||||||
/unxz.1
|
|
||||||
/xz
|
/xz
|
||||||
/xzcat
|
|
||||||
/xzcat.1
|
|
||||||
/xzdec
|
/xzdec
|
||||||
|
/lzmadec
|
||||||
|
/lzmainfo
|
||||||
|
/xzdiff
|
||||||
|
/xzgrep
|
||||||
|
/xzless
|
||||||
|
/xzmore
|
||||||
|
/liblzma.pc
|
||||||
|
/*.gmo
|
||||||
|
|
||||||
/windows/*/.vs
|
|
||||||
/windows/*/liblzma.vcxproj.user
|
|
||||||
/.vscode/
|
/.vscode/
|
||||||
|
9
AUTHORS
9
AUTHORS
@ -2,8 +2,8 @@
|
|||||||
Authors of XZ Utils
|
Authors of XZ Utils
|
||||||
===================
|
===================
|
||||||
|
|
||||||
XZ Utils is developed and maintained by Lasse Collin
|
XZ Utils is developed and maintained by
|
||||||
<lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>.
|
Lasse Collin <lasse.collin@tukaani.org>.
|
||||||
|
|
||||||
Major parts of liblzma are based on code written by Igor Pavlov,
|
Major parts of liblzma are based on code written by Igor Pavlov,
|
||||||
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
||||||
@ -30,6 +30,11 @@ Authors of XZ Utils
|
|||||||
- Jonathan Nieder
|
- Jonathan Nieder
|
||||||
- Joachim Henke
|
- Joachim Henke
|
||||||
|
|
||||||
|
Special author: Jia Tan was a co-maintainer in 2022-2024. He and
|
||||||
|
the team behind him inserted a backdoor (CVE-2024-3094) into
|
||||||
|
XZ Utils 5.6.0 and 5.6.1 releases. He suddenly disappeared when
|
||||||
|
this was discovered.
|
||||||
|
|
||||||
Many people have contributed improvements or reported bugs.
|
Many people have contributed improvements or reported bugs.
|
||||||
Most of these people are mentioned in the file THANKS.
|
Most of these people are mentioned in the file THANKS.
|
||||||
|
|
||||||
|
385
CMakeLists.txt
385
CMakeLists.txt
@ -10,9 +10,17 @@
|
|||||||
#
|
#
|
||||||
# A few things are still missing compared to the Autotools-based build:
|
# A few things are still missing compared to the Autotools-based build:
|
||||||
#
|
#
|
||||||
# - A few tests aren't CMake compatible yet and thus aren't run!
|
# - 32-bit x86 assembly code for CRC32 and CRC64 isn't used by default.
|
||||||
|
# Use the option -DENABLE_X86_ASM=ON on the CMake command line to
|
||||||
|
# enable the assembly files. They are compatible with Linux, *BSDs,
|
||||||
|
# Cygwin, MinGW-w64, and Darwin. They are NOT compatible with MSVC.
|
||||||
#
|
#
|
||||||
# - 32-bit x86 assembly code for CRC32 and CRC64 isn't used.
|
# NOTE: The C code includes a generic version compatible with all
|
||||||
|
# processors and CLMUL version that requires a new enough processor
|
||||||
|
# with the PCLMULQDQ instruction. If the 32-bit x86 assembly files
|
||||||
|
# are used, the CLMUL version in the C code is NOT built. On modern
|
||||||
|
# processors with CLMUL support, the C code should be faster than
|
||||||
|
# the assembly code while on old processors the assembly code wins.
|
||||||
#
|
#
|
||||||
# - External SHA-256 code isn't supported but it's disabled by
|
# - External SHA-256 code isn't supported but it's disabled by
|
||||||
# default in the Autotools build too (--enable-external-sha256).
|
# default in the Autotools build too (--enable-external-sha256).
|
||||||
@ -60,10 +68,6 @@
|
|||||||
# - To get translated man pages, run po4a/update-po which requires
|
# - To get translated man pages, run po4a/update-po which requires
|
||||||
# the po4a tool. The build works without this step too.
|
# the po4a tool. The build works without this step too.
|
||||||
#
|
#
|
||||||
# - To get Doxygen-generated liblzma API docs in HTML format,
|
|
||||||
# run doxygen/update-doxygen which requires the doxygen tool.
|
|
||||||
# The build works without this step too.
|
|
||||||
#
|
|
||||||
# This file provides the following installation components (if you only
|
# This file provides the following installation components (if you only
|
||||||
# need liblzma, install only its components!):
|
# need liblzma, install only its components!):
|
||||||
# - liblzma_Runtime (shared library only)
|
# - liblzma_Runtime (shared library only)
|
||||||
@ -95,7 +99,7 @@
|
|||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
# NOTE: Translation support is disabled with CMake older than 3.20.
|
# NOTE: Translation support is disabled with CMake older than 3.20.
|
||||||
cmake_minimum_required(VERSION 3.14...3.28 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.14...3.29 FATAL_ERROR)
|
||||||
|
|
||||||
include(CMakePushCheckState)
|
include(CMakePushCheckState)
|
||||||
include(CheckIncludeFile)
|
include(CheckIncludeFile)
|
||||||
@ -111,7 +115,7 @@ include(cmake/tuklib_mbstr.cmake)
|
|||||||
|
|
||||||
set(PACKAGE_NAME "XZ Utils")
|
set(PACKAGE_NAME "XZ Utils")
|
||||||
set(PACKAGE_BUGREPORT "xz@tukaani.org")
|
set(PACKAGE_BUGREPORT "xz@tukaani.org")
|
||||||
set(PACKAGE_URL "https://xz.tukaani.org/xz-utils/")
|
set(PACKAGE_URL "https://tukaani.org/xz/")
|
||||||
|
|
||||||
# Get the package version from version.h into PACKAGE_VERSION variable.
|
# Get the package version from version.h into PACKAGE_VERSION variable.
|
||||||
file(READ src/liblzma/api/lzma/version.h PACKAGE_VERSION)
|
file(READ src/liblzma/api/lzma/version.h PACKAGE_VERSION)
|
||||||
@ -155,6 +159,14 @@ endif()
|
|||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
# Support 32-bit x86 assembly files.
|
||||||
|
if(NOT MSVC)
|
||||||
|
option(ENABLE_X86_ASM "Enable 32-bit x86 assembly code" OFF)
|
||||||
|
if(ENABLE_X86_ASM)
|
||||||
|
enable_language(ASM)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# On Apple OSes, don't build executables as bundles:
|
# On Apple OSes, don't build executables as bundles:
|
||||||
set(CMAKE_MACOSX_BUNDLE OFF)
|
set(CMAKE_MACOSX_BUNDLE OFF)
|
||||||
|
|
||||||
@ -273,14 +285,48 @@ endif()
|
|||||||
# Translation support requires CMake 3.20 because it added the Intl::Intl
|
# Translation support requires CMake 3.20 because it added the Intl::Intl
|
||||||
# target so we don't need to play with the individual variables.
|
# target so we don't need to play with the individual variables.
|
||||||
#
|
#
|
||||||
# The defintion ENABLE_NLS is added only to those targets that use it, thus
|
# The definition ENABLE_NLS is added only to those targets that use it, thus
|
||||||
# it's not done here. (xz has translations, xzdec doesn't.)
|
# it's not done here. (xz has translations, xzdec doesn't.)
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
||||||
find_package(Intl)
|
find_package(Intl)
|
||||||
find_package(Gettext)
|
find_package(Gettext)
|
||||||
|
|
||||||
if(Intl_FOUND)
|
if(Intl_FOUND)
|
||||||
option(ENABLE_NLS "Native Language Support (translated messages)" ON)
|
option(ENABLE_NLS "Native Language Support (translated messages)" ON)
|
||||||
|
|
||||||
|
# If translation support is enabled but neither gettext tools or
|
||||||
|
# pre-generated .gmo files exist, translation support cannot be
|
||||||
|
# enabled.
|
||||||
|
#
|
||||||
|
# The detection of pre-generated .gmo files is done by only
|
||||||
|
# checking for the existence of a single .gmo file; Ukrainian
|
||||||
|
# is one of many translations that gets regular updates.
|
||||||
|
if(ENABLE_NLS AND NOT GETTEXT_FOUND AND
|
||||||
|
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po/uk.gmo")
|
||||||
|
# This only sets the variable, not the cache variable!
|
||||||
|
set(ENABLE_NLS OFF)
|
||||||
|
|
||||||
|
# This message is shown only when new enough CMake is used and
|
||||||
|
# library support for translations was found. The assumptions is
|
||||||
|
# that in this situation the user might have interest in the
|
||||||
|
# translations. This also keeps this code simpler.
|
||||||
|
message(WARNING "Native language support (NLS) has been disabled. "
|
||||||
|
"NLS support requires either gettext tools or "
|
||||||
|
"pre-generated .gmo files. The latter are only "
|
||||||
|
"available in distribution tarballs. "
|
||||||
|
"To avoid this warning, NLS can be explicitly "
|
||||||
|
"disabled by passing -DENABLE_NLS=OFF to cmake.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Warn if NLS is enabled but translated man pages are missing.
|
||||||
|
if(UNIX AND ENABLE_NLS AND
|
||||||
|
NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/po4a/man")
|
||||||
|
message(WARNING "Native language support (NLS) has been enabled "
|
||||||
|
"but pre-generated translated man pages "
|
||||||
|
"were not found and thus they won't be installed. "
|
||||||
|
"Run 'po4a/update-po' to generate them.")
|
||||||
|
endif()
|
||||||
|
|
||||||
# The *installed* name of the translation files is "xz.mo".
|
# The *installed* name of the translation files is "xz.mo".
|
||||||
set(TRANSLATION_DOMAIN "xz")
|
set(TRANSLATION_DOMAIN "xz")
|
||||||
endif()
|
endif()
|
||||||
@ -299,14 +345,69 @@ endif()
|
|||||||
|
|
||||||
option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static")
|
option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static")
|
||||||
|
|
||||||
add_library(liblzma
|
if(NOT WIN32)
|
||||||
src/common/mythread.h
|
# Symbol versioning only affects ELF shared libraries. The option is
|
||||||
src/common/sysdefs.h
|
# ignored for static libraries.
|
||||||
src/common/tuklib_common.h
|
#
|
||||||
src/common/tuklib_config.h
|
# Determine the default value so that it's always set with
|
||||||
src/common/tuklib_integer.h
|
# shared libraries in mind which helps if the build dir is reconfigured
|
||||||
src/common/tuklib_physmem.c
|
# from static to shared libs without resetting the cache variables.
|
||||||
src/common/tuklib_physmem.h
|
set(SYMBOL_VERSIONING_DEFAULT OFF)
|
||||||
|
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
||||||
|
(CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze" OR
|
||||||
|
CMAKE_C_COMPILER_ID STREQUAL "NVHPC"))
|
||||||
|
# As a special case, GNU/Linux on MicroBlaze gets the generic
|
||||||
|
# symbol versioning because GCC 12 doesn't support the __symver__
|
||||||
|
# attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
|
||||||
|
# from "uname -m" for native builds (should be "microblaze") or from
|
||||||
|
# the CMake toolchain file (not perfectly standardized but it very
|
||||||
|
# likely has "microblaze" in lower case or mixed case somewhere in
|
||||||
|
# the string).
|
||||||
|
#
|
||||||
|
# NVIDIA HPC Compiler doesn't support symbol versioning but
|
||||||
|
# it uses the linked from the system so the linker script
|
||||||
|
# can still be used to get the generic symbol versioning.
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "generic")
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
# GNU/Linux-specific symbol versioning for shared liblzma.
|
||||||
|
# This includes a few extra compatibility symbols for RHEL/CentOS 7
|
||||||
|
# which are pointless on non-glibc non-Linux systems.
|
||||||
|
#
|
||||||
|
# Avoid symvers on Linux with non-glibc like musl and uClibc.
|
||||||
|
# In Autoconf it's enough to check that $host_os equals linux-gnu
|
||||||
|
# instead of, for example, linux-musl. CMake doesn't provide such
|
||||||
|
# a method.
|
||||||
|
#
|
||||||
|
# This check is here for now since it's not strictly required
|
||||||
|
# by anything else.
|
||||||
|
check_c_source_compiles(
|
||||||
|
"#include <features.h>
|
||||||
|
#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
||||||
|
int main(void) { return 0; }
|
||||||
|
#else
|
||||||
|
compile error
|
||||||
|
#endif
|
||||||
|
"
|
||||||
|
IS_LINUX_WITH_GLIBC)
|
||||||
|
|
||||||
|
if(IS_LINUX_WITH_GLIBC)
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
|
set(SYMBOL_VERSIONING_DEFAULT "generic")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SYMBOL_VERSIONING "${SYMBOL_VERSIONING_DEFAULT}" CACHE STRING
|
||||||
|
"Enable ELF shared library symbol versioning (OFF, generic, linux)")
|
||||||
|
|
||||||
|
# Show a dropdown menu in CMake GUI:
|
||||||
|
set_property(CACHE SYMBOL_VERSIONING PROPERTY STRINGS "OFF;generic;linux")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(LIBLZMA_API_HEADERS
|
||||||
src/liblzma/api/lzma.h
|
src/liblzma/api/lzma.h
|
||||||
src/liblzma/api/lzma/base.h
|
src/liblzma/api/lzma/base.h
|
||||||
src/liblzma/api/lzma/bcj.h
|
src/liblzma/api/lzma/bcj.h
|
||||||
@ -322,6 +423,17 @@ add_library(liblzma
|
|||||||
src/liblzma/api/lzma/stream_flags.h
|
src/liblzma/api/lzma/stream_flags.h
|
||||||
src/liblzma/api/lzma/version.h
|
src/liblzma/api/lzma/version.h
|
||||||
src/liblzma/api/lzma/vli.h
|
src/liblzma/api/lzma/vli.h
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(liblzma
|
||||||
|
src/common/mythread.h
|
||||||
|
src/common/sysdefs.h
|
||||||
|
src/common/tuklib_common.h
|
||||||
|
src/common/tuklib_config.h
|
||||||
|
src/common/tuklib_integer.h
|
||||||
|
src/common/tuklib_physmem.c
|
||||||
|
src/common/tuklib_physmem.h
|
||||||
|
${LIBLZMA_API_HEADERS}
|
||||||
src/liblzma/check/check.c
|
src/liblzma/check/check.c
|
||||||
src/liblzma/check/check.h
|
src/liblzma/check/check.h
|
||||||
src/liblzma/check/crc_common.h
|
src/liblzma/check/crc_common.h
|
||||||
@ -388,11 +500,16 @@ if(ENABLE_SMALL)
|
|||||||
target_sources(liblzma PRIVATE src/liblzma/check/crc32_small.c)
|
target_sources(liblzma PRIVATE src/liblzma/check/crc32_small.c)
|
||||||
else()
|
else()
|
||||||
target_sources(liblzma PRIVATE
|
target_sources(liblzma PRIVATE
|
||||||
src/liblzma/check/crc32_fast.c
|
|
||||||
src/liblzma/check/crc32_table.c
|
src/liblzma/check/crc32_table.c
|
||||||
src/liblzma/check/crc32_table_be.h
|
src/liblzma/check/crc32_table_be.h
|
||||||
src/liblzma/check/crc32_table_le.h
|
src/liblzma/check/crc32_table_le.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_X86_ASM)
|
||||||
|
target_sources(liblzma PRIVATE src/liblzma/check/crc32_x86.S)
|
||||||
|
else()
|
||||||
|
target_sources(liblzma PRIVATE src/liblzma/check/crc32_fast.c)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES)
|
if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES)
|
||||||
@ -402,11 +519,16 @@ if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES)
|
|||||||
target_sources(liblzma PRIVATE src/liblzma/check/crc64_small.c)
|
target_sources(liblzma PRIVATE src/liblzma/check/crc64_small.c)
|
||||||
else()
|
else()
|
||||||
target_sources(liblzma PRIVATE
|
target_sources(liblzma PRIVATE
|
||||||
src/liblzma/check/crc64_fast.c
|
|
||||||
src/liblzma/check/crc64_table.c
|
src/liblzma/check/crc64_table.c
|
||||||
src/liblzma/check/crc64_table_be.h
|
src/liblzma/check/crc64_table_be.h
|
||||||
src/liblzma/check/crc64_table_le.h
|
src/liblzma/check/crc64_table_le.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(ENABLE_X86_ASM)
|
||||||
|
target_sources(liblzma PRIVATE src/liblzma/check/crc64_x86.S)
|
||||||
|
else()
|
||||||
|
target_sources(liblzma PRIVATE src/liblzma/check/crc64_fast.c)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -819,10 +941,6 @@ if(MICROLZMA_DECODER)
|
|||||||
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
|
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (MICROLZMA_ENCODER OR MICROLZMA_DECODER)
|
|
||||||
add_compile_definitions(HAVE_MICROLZMA)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# lzip (.lz) format support #
|
# lzip (.lz) format support #
|
||||||
@ -901,10 +1019,29 @@ endif()
|
|||||||
|
|
||||||
# Sandboxing: Landlock
|
# Sandboxing: Landlock
|
||||||
if(NOT SANDBOX_FOUND AND ENABLE_SANDBOX MATCHES "^ON$|^landlock$")
|
if(NOT SANDBOX_FOUND AND ENABLE_SANDBOX MATCHES "^ON$|^landlock$")
|
||||||
check_include_file(linux/landlock.h HAVE_LINUX_LANDLOCK_H)
|
# 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.
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <linux/landlock.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
#include <sys/prctl.h>
|
||||||
|
|
||||||
if(HAVE_LINUX_LANDLOCK_H)
|
void my_sandbox(void)
|
||||||
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK_H")
|
{
|
||||||
|
(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;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(void) { return 0; }
|
||||||
|
"
|
||||||
|
HAVE_LINUX_LANDLOCK)
|
||||||
|
|
||||||
|
if(HAVE_LINUX_LANDLOCK)
|
||||||
|
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK")
|
||||||
set(SANDBOX_FOUND ON)
|
set(SANDBOX_FOUND ON)
|
||||||
|
|
||||||
# Of our three sandbox methods, only Landlock is incompatible
|
# Of our three sandbox methods, only Landlock is incompatible
|
||||||
@ -987,78 +1124,6 @@ if(USE_WIN95_THREADS AND ENABLE_SMALL AND NOT HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Check for __attribute__((__ifunc__())) support.
|
|
||||||
# Supported values for USE_ATTR_IFUNC:
|
|
||||||
#
|
|
||||||
# auto (default) - Detect ifunc support with a compile test.
|
|
||||||
# ON - Always enable ifunc.
|
|
||||||
# OFF - Disable ifunc usage.
|
|
||||||
set(USE_ATTR_IFUNC "auto" CACHE STRING "Use __attribute__((__ifunc__())).")
|
|
||||||
|
|
||||||
set(SUPPORTED_USE_ATTR_IFUNC auto ON OFF)
|
|
||||||
|
|
||||||
if(NOT USE_ATTR_IFUNC IN_LIST SUPPORTED_USE_ATTR_IFUNC)
|
|
||||||
message(FATAL_ERROR "'${USE_ATTR_IFUNC}' is not a supported value for"
|
|
||||||
"USE_ATTR_IFUNC")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# When USE_ATTR_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(USE_ATTR_IFUNC STREQUAL "auto")
|
|
||||||
cmake_push_check_state()
|
|
||||||
set(CMAKE_REQUIRED_FLAGS "-Werror")
|
|
||||||
|
|
||||||
check_c_source_compiles("
|
|
||||||
/*
|
|
||||||
* 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; }
|
|
||||||
static void (*resolve_func(void)) (void) { return func; }
|
|
||||||
void func_ifunc(void)
|
|
||||||
__attribute__((__ifunc__(\"resolve_func\")));
|
|
||||||
int main(void) { return 0; }
|
|
||||||
/*
|
|
||||||
* 'clang -Wall' incorrectly warns that resolve_func is
|
|
||||||
* unused (-Wunused-function). Correct assembly output is
|
|
||||||
* still produced. This problem exists at least in Clang
|
|
||||||
* versions 4 to 17. The following silences the bogus warning:
|
|
||||||
*/
|
|
||||||
void make_clang_quiet(void);
|
|
||||||
void make_clang_quiet(void) { resolve_func()(); }
|
|
||||||
"
|
|
||||||
SYSTEM_SUPPORTS_IFUNC)
|
|
||||||
|
|
||||||
cmake_pop_check_state()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(USE_ATTR_IFUNC STREQUAL "ON" OR SYSTEM_SUPPORTS_IFUNC)
|
|
||||||
tuklib_add_definitions(liblzma HAVE_FUNC_ATTRIBUTE_IFUNC)
|
|
||||||
|
|
||||||
if(CMAKE_C_FLAGS MATCHES "-fsanitize=")
|
|
||||||
message(SEND_ERROR
|
|
||||||
"CMAKE_C_FLAGS or the environment variable CFLAGS "
|
|
||||||
"contains '-fsanitize=' which is incompatible "
|
|
||||||
"with ifunc. Use -DUSE_ATTR_IFUNC=OFF "
|
|
||||||
"as an argument to 'cmake' when using '-fsanitize'.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# cpuid.h
|
# cpuid.h
|
||||||
check_include_file(cpuid.h HAVE_CPUID_H)
|
check_include_file(cpuid.h HAVE_CPUID_H)
|
||||||
tuklib_add_definition_if(liblzma HAVE_CPUID_H)
|
tuklib_add_definition_if(liblzma HAVE_CPUID_H)
|
||||||
@ -1220,22 +1285,7 @@ if(WIN32)
|
|||||||
# Disable __declspec(dllimport) when linking against static liblzma.
|
# Disable __declspec(dllimport) when linking against static liblzma.
|
||||||
target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC)
|
target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC)
|
||||||
endif()
|
endif()
|
||||||
elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "linux")
|
||||||
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "[Mm]icro[Bb]laze")
|
|
||||||
# GNU/Linux-specific symbol versioning for shared liblzma.
|
|
||||||
# This includes a few extra compatibility symbols for RHEL/CentOS 7
|
|
||||||
# which are pointless on non-glibc non-Linux systems.
|
|
||||||
#
|
|
||||||
# As a special case, GNU/Linux on MicroBlaze gets the generic
|
|
||||||
# symbol versioning because GCC 12 doesn't support the __symver__
|
|
||||||
# attribute on MicroBlaze. On Linux, CMAKE_SYSTEM_PROCESSOR comes
|
|
||||||
# from "uname -m" for native builds (should be "microblaze") or from
|
|
||||||
# the CMake toolchain file (not perfectly standardized but it very
|
|
||||||
# likely has "microblaze" in lower case or mixed case somewhere in
|
|
||||||
# the string).
|
|
||||||
#
|
|
||||||
# FIXME? Avoid symvers on Linux with non-glibc like musl?
|
|
||||||
#
|
|
||||||
# Note that adding link options doesn't affect static builds
|
# Note that adding link options doesn't affect static builds
|
||||||
# but HAVE_SYMBOL_VERSIONS_LINUX must not be used with static builds
|
# but HAVE_SYMBOL_VERSIONS_LINUX must not be used with static builds
|
||||||
# because it would put symbol versions into the static library which
|
# because it would put symbol versions into the static library which
|
||||||
@ -1251,10 +1301,7 @@ elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
|||||||
set_target_properties(liblzma PROPERTIES
|
set_target_properties(liblzma PROPERTIES
|
||||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
|
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
|
||||||
)
|
)
|
||||||
elseif(BUILD_SHARED_LIBS AND (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "generic")
|
||||||
CMAKE_SYSTEM_NAME STREQUAL "Linux"))
|
|
||||||
# Generic symbol versioning for shared liblzma is used on FreeBSD and
|
|
||||||
# also on GNU/Linux on MicroBlaze.
|
|
||||||
target_link_options(liblzma PRIVATE
|
target_link_options(liblzma PRIVATE
|
||||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
|
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
|
||||||
)
|
)
|
||||||
@ -1940,12 +1987,38 @@ endif()
|
|||||||
# Documentation
|
# Documentation
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
# Use OPTIONAL because doc/api might not exist. The liblzma API docs
|
if(UNIX)
|
||||||
# can be generated by running "doxygen/update-doxygen".
|
option(ENABLE_DOXYGEN "Use Doxygen to generate liblzma API docs" OFF)
|
||||||
install(DIRECTORY doc/api doc/examples
|
|
||||||
|
if (ENABLE_DOXYGEN)
|
||||||
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc")
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
VERBATIM
|
||||||
|
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/doxygen/update-doxygen"
|
||||||
|
ARGS "api"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"${CMAKE_CURRENT_BINARY_DIR}/doc"
|
||||||
|
OUTPUT doc/api/index.html
|
||||||
|
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/doxygen/update-doxygen"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile"
|
||||||
|
${LIBLZMA_API_HEADERS}
|
||||||
|
)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
liblzma-doc-api ALL
|
||||||
|
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/api/index.html"
|
||||||
|
)
|
||||||
|
|
||||||
|
install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/api"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
||||||
|
COMPONENT liblzma_Documentation)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(DIRECTORY doc/examples
|
||||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
||||||
COMPONENT liblzma_Documentation
|
COMPONENT liblzma_Documentation)
|
||||||
OPTIONAL)
|
|
||||||
|
|
||||||
# GPLv2 applies to the scripts. If GNU getopt_long is used then
|
# GPLv2 applies to the scripts. If GNU getopt_long is used then
|
||||||
# LGPLv2.1 applies to the command line tools but, using the
|
# LGPLv2.1 applies to the command line tools but, using the
|
||||||
@ -1970,66 +2043,6 @@ install(FILES AUTHORS
|
|||||||
# Tests
|
# Tests
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(CTest)
|
# Tests are in a separate file so that it's possible to delete the whole
|
||||||
|
# "tests" directory and still have a working build, just without the tests.
|
||||||
if(BUILD_TESTING)
|
include(tests/tests.cmake OPTIONAL)
|
||||||
set(LIBLZMA_TESTS
|
|
||||||
test_bcj_exact_size
|
|
||||||
test_block_header
|
|
||||||
test_check
|
|
||||||
test_filter_flags
|
|
||||||
test_filter_str
|
|
||||||
test_hardware
|
|
||||||
test_index
|
|
||||||
test_index_hash
|
|
||||||
test_lzip_decoder
|
|
||||||
test_memlimit
|
|
||||||
test_stream_flags
|
|
||||||
test_vli
|
|
||||||
)
|
|
||||||
|
|
||||||
foreach(TEST IN LISTS LIBLZMA_TESTS)
|
|
||||||
add_executable("${TEST}" "tests/${TEST}.c")
|
|
||||||
|
|
||||||
target_include_directories("${TEST}" PRIVATE
|
|
||||||
src/common
|
|
||||||
src/liblzma/api
|
|
||||||
src/liblzma
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries("${TEST}" PRIVATE liblzma)
|
|
||||||
|
|
||||||
# Put the test programs into their own subdirectory so they don't
|
|
||||||
# pollute the top-level dir which might contain xz and xzdec.
|
|
||||||
set_target_properties("${TEST}" PROPERTIES
|
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tests_bin"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_test(NAME "${TEST}"
|
|
||||||
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/tests_bin/${TEST}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set srcdir environment variable so that the tests find their
|
|
||||||
# input files from the source tree.
|
|
||||||
#
|
|
||||||
# Set the return code for skipped tests to match Automake convention.
|
|
||||||
set_tests_properties("${TEST}" PROPERTIES
|
|
||||||
ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}/tests"
|
|
||||||
SKIP_RETURN_CODE 77
|
|
||||||
)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if(UNIX AND HAVE_DECODERS)
|
|
||||||
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_scripts")
|
|
||||||
|
|
||||||
add_test(NAME test_scripts.sh
|
|
||||||
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_scripts.sh" ".."
|
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_scripts"
|
|
||||||
)
|
|
||||||
|
|
||||||
set_tests_properties(test_scripts.sh PROPERTIES
|
|
||||||
ENVIRONMENT "srcdir=${CMAKE_CURRENT_SOURCE_DIR}/tests"
|
|
||||||
SKIP_RETURN_CODE 77
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
27
COPYING
27
COPYING
@ -3,8 +3,7 @@ XZ Utils Licensing
|
|||||||
==================
|
==================
|
||||||
|
|
||||||
Different licenses apply to different files in this package. Here
|
Different licenses apply to different files in this package. Here
|
||||||
is a rough summary of which licenses apply to which parts of this
|
is a summary of which licenses apply to which parts of this package:
|
||||||
package (but check the individual files to be sure!):
|
|
||||||
|
|
||||||
- liblzma is under the BSD Zero Clause License (0BSD).
|
- liblzma is under the BSD Zero Clause License (0BSD).
|
||||||
|
|
||||||
@ -25,20 +24,6 @@ XZ Utils Licensing
|
|||||||
lzma-file-format.xt are in the public domain but may
|
lzma-file-format.xt are in the public domain but may
|
||||||
be distributed under the terms of 0BSD too.
|
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 output.
|
|
||||||
|
|
||||||
- The XZ logo (xz-logo.png) included in the Doxygen-generated
|
|
||||||
documentation is under the Creative Commons BY-SA 4.0 license.
|
|
||||||
|
|
||||||
- Translated messages and man pages are under 0BSD except that
|
- Translated messages and man pages are under 0BSD except that
|
||||||
some old translations are in the public domain.
|
some old translations are in the public domain.
|
||||||
|
|
||||||
@ -51,8 +36,9 @@ XZ Utils Licensing
|
|||||||
These files don't affect the licensing of the binaries being
|
These files don't affect the licensing of the binaries being
|
||||||
built.
|
built.
|
||||||
|
|
||||||
- The extra directory contain files that are under various
|
- The 'extra' directory contains files that are under various
|
||||||
free software licenses.
|
free software licenses. These aren't built or installed as
|
||||||
|
part of XZ Utils.
|
||||||
|
|
||||||
For the files under the BSD Zero Clause License (0BSD), if
|
For the files under the BSD Zero Clause License (0BSD), if
|
||||||
a copyright notice is needed, the following is sufficient:
|
a copyright notice is needed, the following is sufficient:
|
||||||
@ -65,16 +51,13 @@ XZ Utils Licensing
|
|||||||
it is not legally required by the license terms. Here is an example
|
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:
|
of a good notice to put into "about box" or into documentation:
|
||||||
|
|
||||||
This software includes code from XZ Utils
|
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
||||||
<https://xz.tukaani.org/xz-utils/>.
|
|
||||||
|
|
||||||
The following license texts are included in the following files:
|
The following license texts are included in the following files:
|
||||||
- COPYING.0BSD: BSD Zero Clause License
|
- COPYING.0BSD: BSD Zero Clause License
|
||||||
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
||||||
- COPYING.GPLv2: GNU General Public License version 2
|
- COPYING.GPLv2: GNU General Public License version 2
|
||||||
- COPYING.GPLv3: GNU General Public License version 3
|
- COPYING.GPLv3: GNU General Public License version 3
|
||||||
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
|
|
||||||
International Public License
|
|
||||||
|
|
||||||
A note about old XZ Utils releases:
|
A note about old XZ Utils releases:
|
||||||
|
|
||||||
|
@ -1,427 +0,0 @@
|
|||||||
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.
|
|
77
INSTALL
77
INSTALL
@ -90,21 +90,15 @@ XZ Utils Installation
|
|||||||
|
|
||||||
1.2.3. MINIX 3
|
1.2.3. MINIX 3
|
||||||
|
|
||||||
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
Version 3.3.0 and later are supported.
|
||||||
which doesn't support C99. Install GCC to compile XZ Utils.
|
|
||||||
|
|
||||||
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
Multithreading isn't supported because MINIX 3 doesn't have
|
||||||
to be patched before XZ Utils can be compiled correctly. See
|
pthreads. The option --disable-threads must be passed to configure
|
||||||
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
as this isn't autodetected.
|
||||||
|
|
||||||
MINIX 3.2.0 and later use a different libc and aren't affected by
|
Note that disabling threads causes "make check" to show a few tests
|
||||||
the above bug.
|
as skipped ("SKIP"). It's only due to a few threading-dependent
|
||||||
|
subtests are skipped. See the matching tests/test_*.log files.
|
||||||
XZ Utils doesn't have code to detect the amount of physical RAM and
|
|
||||||
number of CPU cores on MINIX 3.
|
|
||||||
|
|
||||||
See section 5.4 in this file about symbol visibility warnings (you
|
|
||||||
may want to pass gl_cv_cc_visibility=no to configure).
|
|
||||||
|
|
||||||
|
|
||||||
1.2.4. OpenVMS
|
1.2.4. OpenVMS
|
||||||
@ -352,6 +346,12 @@ XZ Utils Installation
|
|||||||
will still be installed. The $docdir can be changed
|
will still be installed. The $docdir can be changed
|
||||||
with --docdir=DIR.
|
with --docdir=DIR.
|
||||||
|
|
||||||
|
--enable-doxygen
|
||||||
|
Enable generation of the HTML version of the liblzma API
|
||||||
|
documentation using Doxygen. The resulting files are
|
||||||
|
installed to $docdir/api. This option assumes that
|
||||||
|
the 'doxygen' tool is available.
|
||||||
|
|
||||||
--disable-assembler
|
--disable-assembler
|
||||||
This disables CRC32 and CRC64 assembly code on
|
This disables CRC32 and CRC64 assembly code on
|
||||||
32-bit x86. This option currently does nothing
|
32-bit x86. This option currently does nothing
|
||||||
@ -518,14 +518,6 @@ XZ Utils Installation
|
|||||||
calls any liblzma functions from more than
|
calls any liblzma functions from more than
|
||||||
one thread, something bad may happen.
|
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
|
--enable-sandbox=METHOD
|
||||||
There is limited sandboxing support in the xz and xzdec
|
There is limited sandboxing support in the xz and xzdec
|
||||||
tools. If built with sandbox support, xz uses it
|
tools. If built with sandbox support, xz uses it
|
||||||
@ -561,10 +553,45 @@ XZ Utils Installation
|
|||||||
sandboxing. If no Landlock support
|
sandboxing. If no Landlock support
|
||||||
is found, configure will give an error.
|
is found, configure will give an error.
|
||||||
|
|
||||||
--enable-symbol-versions
|
--enable-symbol-versions[=VARIANT]
|
||||||
Use symbol versioning for liblzma. This is enabled by
|
Use symbol versioning for liblzma shared library.
|
||||||
default on GNU/Linux, other GNU-based systems, and
|
This is enabled by default on GNU/Linux (glibc only),
|
||||||
FreeBSD.
|
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
|
--enable-debug
|
||||||
This enables the assert() macro and possibly some other
|
This enables the assert() macro and possibly some other
|
||||||
|
58
Makefile.am
58
Makefile.am
@ -36,18 +36,6 @@ dist_examples_DATA = \
|
|||||||
doc/examples/04_compress_easy_mt.c \
|
doc/examples/04_compress_easy_mt.c \
|
||||||
doc/examples/11_file_info.c \
|
doc/examples/11_file_info.c \
|
||||||
doc/examples/Makefile
|
doc/examples/Makefile
|
||||||
|
|
||||||
# Install the Doxygen generated documentation if they were built.
|
|
||||||
install-data-local:
|
|
||||||
if test -d "$(srcdir)/doc/api" ; then \
|
|
||||||
$(MKDIR_P) "$(DESTDIR)$(docdir)/api" && \
|
|
||||||
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
|
|
||||||
"$(DESTDIR)$(docdir)/api"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove the Doxygen generated documentation when uninstalling.
|
|
||||||
uninstall-local:
|
|
||||||
rm -rf "$(DESTDIR)$(docdir)/api"
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
@ -58,7 +46,6 @@ EXTRA_DIST = \
|
|||||||
po4a \
|
po4a \
|
||||||
windows \
|
windows \
|
||||||
CMakeLists.txt \
|
CMakeLists.txt \
|
||||||
COPYING.CC-BY-SA-4.0 \
|
|
||||||
COPYING.GPLv2 \
|
COPYING.GPLv2 \
|
||||||
COPYING.GPLv3 \
|
COPYING.GPLv3 \
|
||||||
COPYING.LGPLv2.1 \
|
COPYING.LGPLv2.1 \
|
||||||
@ -68,12 +55,12 @@ EXTRA_DIST = \
|
|||||||
autogen.sh \
|
autogen.sh \
|
||||||
build-aux/manconv.sh \
|
build-aux/manconv.sh \
|
||||||
build-aux/version.sh \
|
build-aux/version.sh \
|
||||||
doc/xz-logo.png \
|
|
||||||
po/xz.pot-header
|
po/xz.pot-header
|
||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
# List of man pages to convert to PDF and plain text in the dist-hook target.
|
# List of man pages to convert to plain text in the dist-hook target
|
||||||
|
# or to PDF in the pdf-local target.
|
||||||
manfiles = \
|
manfiles = \
|
||||||
src/xz/xz.1 \
|
src/xz/xz.1 \
|
||||||
src/xzdec/xzdec.1 \
|
src/xzdec/xzdec.1 \
|
||||||
@ -84,42 +71,31 @@ manfiles = \
|
|||||||
src/scripts/xzmore.1
|
src/scripts/xzmore.1
|
||||||
|
|
||||||
# Create ChangeLog from output of "git log --date=iso --stat".
|
# Create ChangeLog from output of "git log --date=iso --stat".
|
||||||
# Convert the man pages to PDF and plain text (ASCII only) formats.
|
# Convert the man pages to plain text (ASCII only) format.
|
||||||
dist-hook:
|
dist-hook:
|
||||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||||
( cd "$(srcdir)" && git log --date=iso --stat \
|
( cd "$(srcdir)" && git log --date=iso --stat \
|
||||||
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
|
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
|
||||||
> "$(distdir)/ChangeLog"; \
|
> "$(distdir)/ChangeLog"; \
|
||||||
fi
|
fi
|
||||||
if type groff > /dev/null 2>&1 && type ps2pdf > /dev/null 2>&1; then \
|
if type groff > /dev/null 2>&1; then \
|
||||||
dest="$(distdir)/doc/man" && \
|
dest="$(distdir)/doc/man" && \
|
||||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
$(MKDIR_P) "$$dest/txt" && \
|
||||||
for FILE in $(manfiles); do \
|
for FILE in $(manfiles); do \
|
||||||
BASE=`basename $$FILE .1` && \
|
BASE=`basename $$FILE .1` && \
|
||||||
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
$(SHELL) "$(srcdir)/build-aux/manconv.sh" ascii \
|
||||||
< "$(srcdir)/$$FILE" \
|
|
||||||
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
|
||||||
sh "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
|
||||||
< "$(srcdir)/$$FILE" \
|
|
||||||
> "$$dest/pdf-letter/$$BASE-letter.pdf" && \
|
|
||||||
sh "$(srcdir)/build-aux/manconv.sh" ascii \
|
|
||||||
< "$(srcdir)/$$FILE" \
|
< "$(srcdir)/$$FILE" \
|
||||||
> "$$dest/txt/$$BASE.txt"; \
|
> "$$dest/txt/$$BASE.txt"; \
|
||||||
done; \
|
done; \
|
||||||
fi
|
fi
|
||||||
if test -d "$(srcdir)/doc/api" ; then \
|
|
||||||
$(MKDIR_P) "$(distdir)/doc/api" && \
|
|
||||||
$(INSTALL_DATA) "$(srcdir)"/doc/api/* \
|
|
||||||
"$(distdir)/doc/api"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
# This works with GNU tar and gives cleaner package than normal 'make dist'.
|
||||||
# This also ensures that the man page translations are up to date (dist-hook
|
# This also ensures that the translations are up to date (dist-hook
|
||||||
# would be too late for that).
|
# would be too late for that).
|
||||||
mydist:
|
mydist:
|
||||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
$(SHELL) "$(srcdir)/src/liblzma/validate_map.sh"
|
||||||
cd "$(srcdir)/po4a" && sh update-po
|
cd po && $(MAKE) xz.pot-update
|
||||||
cd "$(srcdir)/doxygen" && sh update-doxygen
|
cd "$(srcdir)/po4a" && $(SHELL) update-po
|
||||||
VERSION=$(VERSION); \
|
VERSION=$(VERSION); \
|
||||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||||
@ -127,3 +103,17 @@ mydist:
|
|||||||
fi; \
|
fi; \
|
||||||
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
||||||
$(MAKE) VERSION="$$VERSION" dist-gzip
|
$(MAKE) VERSION="$$VERSION" dist-gzip
|
||||||
|
|
||||||
|
# NOTE: This only creates the PDFs. The install rules are missing.
|
||||||
|
pdf-local:
|
||||||
|
dest="doc/man" && \
|
||||||
|
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" && \
|
||||||
|
for FILE in $(manfiles); do \
|
||||||
|
BASE=`basename $$FILE .1` && \
|
||||||
|
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||||
|
< "$(srcdir)/$$FILE" \
|
||||||
|
> "$$dest/pdf-a4/$$BASE-a4.pdf" && \
|
||||||
|
$(SHELL) "$(srcdir)/build-aux/manconv.sh" pdf letter \
|
||||||
|
< "$(srcdir)/$$FILE" \
|
||||||
|
> "$$dest/pdf-letter/$$BASE-letter.pdf"; \
|
||||||
|
done
|
||||||
|
370
NEWS
370
NEWS
@ -2,8 +2,170 @@
|
|||||||
XZ Utils Release Notes
|
XZ Utils Release Notes
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
5.6.2 (2024-05-29)
|
||||||
|
|
||||||
|
* Remove the backdoor (CVE-2024-3094).
|
||||||
|
|
||||||
|
* Not changed: Memory sanitizer (MSAN) has a false positive
|
||||||
|
in the CRC CLMUL code which also makes OSS Fuzz unhappy.
|
||||||
|
Valgrind is smarter and doesn't complain.
|
||||||
|
|
||||||
|
A revision to the CLMUL code is coming anyway and this issue
|
||||||
|
will be cleaned up as part of it. It won't be backported to
|
||||||
|
5.6.x or 5.4.x because the old code isn't wrong. There is
|
||||||
|
no reason to risk introducing regressions in old branches
|
||||||
|
just to silence a false positive.
|
||||||
|
|
||||||
|
* liblzma:
|
||||||
|
|
||||||
|
- lzma_index_decoder() and lzma_index_buffer_decode(): Fix
|
||||||
|
a missing output pointer initialization (*i = NULL) if the
|
||||||
|
functions are called with invalid arguments. The API docs
|
||||||
|
say that such an initialization is always done. In practice
|
||||||
|
this matters very little because the problem can only occur
|
||||||
|
if the calling application has a bug and these functions
|
||||||
|
return LZMA_PROG_ERROR.
|
||||||
|
|
||||||
|
- lzma_str_to_filters(): Fix a missing output pointer
|
||||||
|
initialization (*error_pos = 0). This is very similar
|
||||||
|
to the fix above.
|
||||||
|
|
||||||
|
- Fix C standard conformance with function pointer types.
|
||||||
|
|
||||||
|
- Remove GNU indirect function (IFUNC) support. This is *NOT*
|
||||||
|
done for security reasons even though the backdoor relied on
|
||||||
|
this code. The performance benefits of IFUNC are too tiny in
|
||||||
|
this project to make the extra complexity worth it.
|
||||||
|
|
||||||
|
- FreeBSD on ARM64: Add error checking to CRC32 instruction
|
||||||
|
support detection.
|
||||||
|
|
||||||
|
- Fix building with NVIDIA HPC SDK.
|
||||||
|
|
||||||
|
* xz:
|
||||||
|
|
||||||
|
- Fix a C standard conformance issue in --block-list parsing
|
||||||
|
(arithmetic on a null pointer).
|
||||||
|
|
||||||
|
- Fix a warning from GNU groff when processing the man page:
|
||||||
|
"warning: cannot select font 'CW'"
|
||||||
|
|
||||||
|
* xzdec: Add support for Linux Landlock ABI version 4. xz already
|
||||||
|
had the v3-to-v4 change but it had been forgotten from xzdec.
|
||||||
|
|
||||||
|
* Autotools-based build system (configure):
|
||||||
|
|
||||||
|
- Symbol versioning variant can now be overridden with
|
||||||
|
--enable-symbol-versions. Documentation in INSTALL was
|
||||||
|
updated to match.
|
||||||
|
|
||||||
|
- Add new configure option --enable-doxygen to enable
|
||||||
|
generation and installation of the liblzma API documentation
|
||||||
|
using Doxygen. Documentation in INSTALL and PACKAGERS was
|
||||||
|
updated to match.
|
||||||
|
|
||||||
|
CMake:
|
||||||
|
|
||||||
|
- Fix detection of Linux Landlock support. The detection code
|
||||||
|
in CMakeLists.txt had been sabotaged.
|
||||||
|
|
||||||
|
- Disable symbol versioning on non-glibc Linux to match what
|
||||||
|
the Autotools build does. For example, symbol versioning
|
||||||
|
isn't enabled with musl.
|
||||||
|
|
||||||
|
- Symbol versioning variant can now be overridden by setting
|
||||||
|
SYMBOL_VERSIONING to "OFF", "generic", or "linux".
|
||||||
|
|
||||||
|
- Add support for all tests in typical build configurations.
|
||||||
|
Now the only difference to the tests coverage to Autotools
|
||||||
|
is that CMake-based build will skip more tests if features
|
||||||
|
are disabled. Such builds are only for special cases like
|
||||||
|
embedded systems.
|
||||||
|
|
||||||
|
- Separate the CMake code for the tests into tests/tests.cmake.
|
||||||
|
It is used conditionally, thus it is possible to
|
||||||
|
|
||||||
|
rm -rf tests
|
||||||
|
|
||||||
|
and the CMake-based build will still work normally except
|
||||||
|
that no tests are then available.
|
||||||
|
|
||||||
|
- Add a option ENABLE_DOXYGEN to enable generation and
|
||||||
|
installation of the liblzma API documentation using Doxygen.
|
||||||
|
|
||||||
|
* Documentation:
|
||||||
|
|
||||||
|
- Omit the Doxygen-generated liblzma API documentation from the
|
||||||
|
package. Instead, the generation and installation of the API
|
||||||
|
docs can be enabled with a configure or CMake option if
|
||||||
|
Doxygen is available.
|
||||||
|
|
||||||
|
- Remove the XZ logo which was used in the API documentation.
|
||||||
|
The logo has been retired and isn't used by the project
|
||||||
|
anymore. However, it's OK to use it in contexts that refer
|
||||||
|
to the backdoor incident.
|
||||||
|
|
||||||
|
- Remove the PDF versions of the man pages from the source
|
||||||
|
package. These existed primarily for users of operating
|
||||||
|
systems which don't come with tools to render man page
|
||||||
|
source files. The plain text versions are still included
|
||||||
|
in doc/man/txt. PDF files can still be generated to doc/man,
|
||||||
|
if the required tools are available, using "make pdf" after
|
||||||
|
running "configure".
|
||||||
|
|
||||||
|
- Update home page URLs back to their old locations on
|
||||||
|
tukaani.org.
|
||||||
|
|
||||||
|
- Update maintainer info.
|
||||||
|
|
||||||
|
* Tests:
|
||||||
|
|
||||||
|
- In tests/files/README, explain how to recreate the ARM64
|
||||||
|
test files.
|
||||||
|
|
||||||
|
- Remove two tests that used tiny x86 and SPARC object files
|
||||||
|
as the input files. The matching .c file was included but
|
||||||
|
the object files aren't easy to reproduce. The test cases
|
||||||
|
weren't great anyway; they were from the early days (2009)
|
||||||
|
of the project when the test suite had very few tests.
|
||||||
|
|
||||||
|
- Improve a few tests.
|
||||||
|
|
||||||
|
|
||||||
|
5.6.1 (2024-03-09)
|
||||||
|
|
||||||
|
IMPORTANT: This fixed bugs in the backdoor (CVE-2024-3094) (someone
|
||||||
|
had forgot to run Valgrind).
|
||||||
|
|
||||||
|
* 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)
|
5.6.0 (2024-02-24)
|
||||||
|
|
||||||
|
IMPORTANT: This added a backdoor (CVE-2024-3094). It's enabled only
|
||||||
|
in the release tarballs.
|
||||||
|
|
||||||
This bumps the minor version of liblzma because new features were
|
This bumps the minor version of liblzma because new features were
|
||||||
added. The API and ABI are still backward compatible with liblzma
|
added. The API and ABI are still backward compatible with liblzma
|
||||||
5.4.x and 5.2.x and 5.0.x.
|
5.4.x and 5.2.x and 5.0.x.
|
||||||
@ -23,7 +185,7 @@ XZ Utils Release Notes
|
|||||||
* Sandboxing support in xz:
|
* Sandboxing support in xz:
|
||||||
|
|
||||||
- Landlock is now used even when xz needs to create files.
|
- Landlock is now used even when xz needs to create files.
|
||||||
In this case the sandbox is has to be more permissive than
|
In this case the sandbox has to be more permissive than
|
||||||
when no files need to be created. A similar thing was
|
when no files need to be created. A similar thing was
|
||||||
already in use with pledge(2) since 5.3.4alpha.
|
already in use with pledge(2) since 5.3.4alpha.
|
||||||
|
|
||||||
@ -289,6 +451,95 @@ XZ Utils Release Notes
|
|||||||
* Added basic Codespell support to help catch typo errors.
|
* Added basic Codespell support to help catch typo errors.
|
||||||
|
|
||||||
|
|
||||||
|
5.4.7 (2024-05-29)
|
||||||
|
|
||||||
|
* Not changed: Memory sanitizer (MSAN) has a false positive
|
||||||
|
in the CRC CLMUL code which also makes OSS Fuzz unhappy.
|
||||||
|
Valgrind is smarter and doesn't complain.
|
||||||
|
|
||||||
|
A revision to the CLMUL code is coming anyway and this issue
|
||||||
|
will be cleaned up as part of it. It won't be backported to
|
||||||
|
5.6.x or 5.4.x because the old code isn't wrong. There is
|
||||||
|
no reason to risk introducing regressions in old branches
|
||||||
|
just to silence a false positive.
|
||||||
|
|
||||||
|
* liblzma:
|
||||||
|
|
||||||
|
- lzma_index_decoder() and lzma_index_buffer_decode(): Fix
|
||||||
|
a missing output pointer initialization (*i = NULL) if the
|
||||||
|
functions are called with invalid arguments. The API docs
|
||||||
|
say that such an initialization is always done. In practice
|
||||||
|
this matters very little because the problem can only occur
|
||||||
|
if the calling application has a bug and these functions
|
||||||
|
return LZMA_PROG_ERROR.
|
||||||
|
|
||||||
|
- lzma_str_to_filters(): Fix a missing output pointer
|
||||||
|
initialization (*error_pos = 0). This is very similar
|
||||||
|
to the fix above.
|
||||||
|
|
||||||
|
- Fix C standard conformance with function pointer types.
|
||||||
|
This newly showed up with Clang 17 with -fsanitize=undefined.
|
||||||
|
There are no bug reports about this.
|
||||||
|
|
||||||
|
- Fix building with NVIDIA HPC SDK.
|
||||||
|
|
||||||
|
* xz:
|
||||||
|
|
||||||
|
- Fix a C standard conformance issue in --block-list parsing
|
||||||
|
(arithmetic on a null pointer).
|
||||||
|
|
||||||
|
- Fix a warning from GNU groff when processing the man page:
|
||||||
|
"warning: cannot select font 'CW'"
|
||||||
|
|
||||||
|
- Fix outdated threading related information on the man page.
|
||||||
|
|
||||||
|
* xzless:
|
||||||
|
|
||||||
|
- With "less" version 451 and later, use "||-" instead of "|-"
|
||||||
|
in the environment variable LESSOPEN. This way compressed
|
||||||
|
files that contain no uncompressed data are shown correctly
|
||||||
|
as empty.
|
||||||
|
|
||||||
|
- With "less" version 632 and later, use --show-preproc-errors
|
||||||
|
to make "less" show a warning on decompression errors.
|
||||||
|
|
||||||
|
* Autotools-based build system (configure):
|
||||||
|
|
||||||
|
- Symbol versioning variant can now be overridden with
|
||||||
|
--enable-symbol-versions. Documentation in INSTALL was
|
||||||
|
updated to match.
|
||||||
|
|
||||||
|
CMake:
|
||||||
|
|
||||||
|
- Linux on MicroBlaze is handled specially now. This matches
|
||||||
|
the changes made to the Autotools-based build in XZ Utils
|
||||||
|
5.4.2 and 5.2.11.
|
||||||
|
|
||||||
|
- Disable symbol versioning on non-glibc Linux to match what
|
||||||
|
the Autotools build does. For example, symbol versioning
|
||||||
|
isn't enabled with musl.
|
||||||
|
|
||||||
|
- Symbol versioning variant can now be overridden by setting
|
||||||
|
SYMBOL_VERSIONING to "OFF", "generic", or "linux".
|
||||||
|
|
||||||
|
* Documentation:
|
||||||
|
|
||||||
|
- Clarify the description of --disable-assembler in INSTALL.
|
||||||
|
The option only affects 32-bit x86 assembly usage.
|
||||||
|
|
||||||
|
- Add doc/examples/11_file_info.c. It was added to the
|
||||||
|
Git repository in 2017 but forgotten to be added into
|
||||||
|
distribution tarballs.
|
||||||
|
|
||||||
|
- Don't install the TODO file as part of the documentation.
|
||||||
|
The file is out of date.
|
||||||
|
|
||||||
|
- Update home page URLs back to their old locations on
|
||||||
|
tukaani.org.
|
||||||
|
|
||||||
|
- Update maintainer info.
|
||||||
|
|
||||||
|
|
||||||
5.4.6 (2024-01-26)
|
5.4.6 (2024-01-26)
|
||||||
|
|
||||||
* Fixed a bug involving internal function pointers in liblzma not
|
* Fixed a bug involving internal function pointers in liblzma not
|
||||||
@ -311,7 +562,7 @@ XZ Utils Release Notes
|
|||||||
* Added a new test.
|
* Added a new test.
|
||||||
|
|
||||||
|
|
||||||
5.4.5 (2023-11-31)
|
5.4.5 (2023-11-01)
|
||||||
|
|
||||||
* liblzma:
|
* liblzma:
|
||||||
|
|
||||||
@ -1113,6 +1364,121 @@ XZ Utils Release Notes
|
|||||||
(FreeBSD >= 10).
|
(FreeBSD >= 10).
|
||||||
|
|
||||||
|
|
||||||
|
5.2.13 (2024-05-29)
|
||||||
|
|
||||||
|
* liblzma:
|
||||||
|
|
||||||
|
- lzma_index_append(): Fix 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.
|
||||||
|
|
||||||
|
- lzma_index_decoder() and lzma_index_buffer_decode(): Fix
|
||||||
|
a missing output pointer initialization (*i = NULL) if the
|
||||||
|
functions are called with invalid arguments. The API docs
|
||||||
|
say that such an initialization is always done. In practice
|
||||||
|
this matters very little because the problem can only occur
|
||||||
|
if the calling application has a bug and these functions
|
||||||
|
return LZMA_PROG_ERROR.
|
||||||
|
|
||||||
|
- Fix C standard conformance with function pointer types.
|
||||||
|
This newly showed up with Clang 17 with -fsanitize=undefined.
|
||||||
|
There are no bug reports about this.
|
||||||
|
|
||||||
|
- Fix building with NVIDIA HPC SDK.
|
||||||
|
|
||||||
|
- Fix building with Windows Vista threads and --enable-small.
|
||||||
|
(CMake build doesn't support ENABLE_SMALL in XZ Utils 5.2.x.)
|
||||||
|
|
||||||
|
* xz:
|
||||||
|
|
||||||
|
- Fix a C standard conformance issue in --block-list parsing
|
||||||
|
(arithmetic on a null pointer).
|
||||||
|
|
||||||
|
- Fix a warning from GNU groff when processing the man page:
|
||||||
|
"warning: cannot select font 'CW'"
|
||||||
|
|
||||||
|
- Windows: Handle special files such as "con" or "nul". Earlier
|
||||||
|
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
|
||||||
|
|
||||||
|
- Windows: Fix an issue that prevented reading from or writing
|
||||||
|
to non-terminal character devices like NUL.
|
||||||
|
|
||||||
|
* xzless:
|
||||||
|
|
||||||
|
- With "less" version 451 and later, use "||-" instead of "|-"
|
||||||
|
in the environment variable LESSOPEN. This way compressed
|
||||||
|
files that contain no uncompressed data are shown correctly
|
||||||
|
as empty.
|
||||||
|
|
||||||
|
- With "less" version 632 and later, use --show-preproc-errors
|
||||||
|
to make "less" show a warning on decompression errors.
|
||||||
|
|
||||||
|
* Build systems:
|
||||||
|
|
||||||
|
- Add 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.
|
||||||
|
|
||||||
|
- Autotools (configure):
|
||||||
|
|
||||||
|
* Symbol versioning variant can now be overridden with
|
||||||
|
--enable-symbol-versions. Documentation in INSTALL was
|
||||||
|
updated to match.
|
||||||
|
|
||||||
|
- CMake:
|
||||||
|
|
||||||
|
* Fix a bug that prevented other projects from including
|
||||||
|
liblzma multiple times using find_package().
|
||||||
|
|
||||||
|
* Fix a bug where configuring CMake multiple times resulted
|
||||||
|
in HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC not being
|
||||||
|
defined.
|
||||||
|
|
||||||
|
* Fix 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"
|
||||||
|
|
||||||
|
* Add 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.
|
||||||
|
|
||||||
|
* Linux on MicroBlaze is handled specially now. This
|
||||||
|
matches the changes made to the Autotools-based build
|
||||||
|
in XZ Utils 5.4.2 and 5.2.11.
|
||||||
|
|
||||||
|
* Disable symbol versioning on non-glibc Linux to match
|
||||||
|
what the Autotools build does. For example, symbol
|
||||||
|
versioning isn't enabled with musl.
|
||||||
|
|
||||||
|
* Symbol versioning variant can now be overridden by
|
||||||
|
setting SYMBOL_VERSIONING to "OFF", "generic", or
|
||||||
|
"linux".
|
||||||
|
|
||||||
|
* Documentation:
|
||||||
|
|
||||||
|
- Clarify the description of --disable-assembler in INSTALL.
|
||||||
|
The option only affects 32-bit x86 assembly usage.
|
||||||
|
|
||||||
|
- Don't install the TODO file as part of the documentation.
|
||||||
|
The file is out of date.
|
||||||
|
|
||||||
|
- Update home page URLs back to their old locations on
|
||||||
|
tukaani.org.
|
||||||
|
|
||||||
|
- Update maintainer info.
|
||||||
|
|
||||||
|
|
||||||
5.2.12 (2023-05-04)
|
5.2.12 (2023-05-04)
|
||||||
|
|
||||||
* Fixed a build system bug that prevented building liblzma as a
|
* Fixed a build system bug that prevented building liblzma as a
|
||||||
|
19
PACKAGERS
19
PACKAGERS
@ -44,8 +44,8 @@ Information to packagers of XZ Utils
|
|||||||
lzmadec binary for compatibility with LZMA Utils
|
lzmadec binary for compatibility with LZMA Utils
|
||||||
liblzma liblzma.so.*
|
liblzma liblzma.so.*
|
||||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||||
liblzma-doc Doxygen-generated liblzma API docs (HTML),
|
liblzma-doc Example programs and, if enabled at build time,
|
||||||
example programs
|
Doxygen-generated liblzma API docs (HTML)
|
||||||
|
|
||||||
|
|
||||||
2. Package description
|
2. Package description
|
||||||
@ -170,13 +170,14 @@ Information to packagers of XZ Utils
|
|||||||
can be replaced with a symlink if your distro ships with shared
|
can be replaced with a symlink if your distro ships with shared
|
||||||
copies of the common license texts.
|
copies of the common license texts.
|
||||||
|
|
||||||
The Doxygen-generated documentation (HTML) for the liblzma API
|
The Doxygen-generated liblzma API documentation (HTML) is built and
|
||||||
headers is included in the source release and will be installed by
|
installed if the configure option --enable-doxygen is used (it's
|
||||||
"make install" to $docdir/api. All JavaScript is removed to
|
disabled by default). This requires that Doxygen is available. The
|
||||||
simplify license compliance and to reduce the install size. If the
|
API documentation is installed by "make install" to $docdir/api.
|
||||||
liblzma API documentation is not desired, either run configure with
|
|
||||||
--disable-doc or remove the doc/api directory before running
|
NOTE: The files generated by Doxygen include content from
|
||||||
"make install".
|
Doxygen itself. Check the license info before distributing
|
||||||
|
the Doxygen-generated files.
|
||||||
|
|
||||||
|
|
||||||
6. Extra files
|
6. Extra files
|
||||||
|
26
README
26
README
@ -79,8 +79,6 @@ XZ Utils
|
|||||||
COPYING.GPLv2 GNU General Public License version 2
|
COPYING.GPLv2 GNU General Public License version 2
|
||||||
COPYING.GPLv3 GNU General Public License version 3
|
COPYING.GPLv3 GNU General Public License version 3
|
||||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
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
|
AUTHORS The main authors of XZ Utils
|
||||||
THANKS Incomplete list of people who have helped making
|
THANKS Incomplete list of people who have helped making
|
||||||
@ -97,9 +95,9 @@ XZ Utils
|
|||||||
|
|
||||||
The command-line tools are documented as man pages. In source code
|
The command-line tools are documented as man pages. In source code
|
||||||
releases (and possibly also in some binary packages), the man pages
|
releases (and possibly also in some binary packages), the man pages
|
||||||
are also provided in plain text (ASCII only) and PDF formats in the
|
are also provided in plain text (ASCII only) format in the directory
|
||||||
directory "doc/man" to make the man pages more accessible to those
|
"doc/man" to make the man pages more accessible to those whose
|
||||||
whose operating system doesn't provide an easy way to view man pages.
|
operating system doesn't provide an easy way to view man pages.
|
||||||
|
|
||||||
|
|
||||||
1.3. Documentation for liblzma
|
1.3. Documentation for liblzma
|
||||||
@ -290,21 +288,23 @@ XZ Utils
|
|||||||
XZ Embedded is a limited implementation written for use in the Linux
|
XZ Embedded is a limited implementation written for use in the Linux
|
||||||
kernel, but it is also suitable for other embedded use.
|
kernel, but it is also suitable for other embedded use.
|
||||||
|
|
||||||
https://xz.tukaani.org/xz-embedded/
|
https://tukaani.org/xz/embedded.html
|
||||||
|
|
||||||
XZ for Java is a complete implementation written in pure Java.
|
XZ for Java is a complete implementation written in pure Java.
|
||||||
|
|
||||||
https://xz.tukaani.org/xz-for-java/
|
https://tukaani.org/xz/java.html
|
||||||
|
|
||||||
|
|
||||||
6. Contact information
|
6. Contact information
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
If you have questions, bug reports, patches etc. related to XZ Utils,
|
XZ Utils in general:
|
||||||
the project maintainers Lasse Collin and Jia Tan can be reached via
|
- Home page: https://tukaani.org/xz/
|
||||||
<xz@tukaani.org>.
|
- Email to maintainer(s): xz@tukaani.org
|
||||||
|
- IRC: #tukaani on Libera Chat
|
||||||
|
- GitHub: https://github.com/tukaani-project/xz
|
||||||
|
|
||||||
You might find Lasse also from #tukaani on Libera Chat (IRC).
|
Lead maintainer:
|
||||||
The nick is Larhzu. The channel tends to be pretty quiet,
|
- Email: Lasse Collin <lasse.collin@tukaani.org>
|
||||||
so just ask your question and someone might wake up.
|
- IRC: Larhzu on Libera Chat
|
||||||
|
|
||||||
|
6
THANKS
6
THANKS
@ -46,6 +46,7 @@ has been important. :-) In alphabetical order:
|
|||||||
- Vincent Fazio
|
- Vincent Fazio
|
||||||
- Michael Felt
|
- Michael Felt
|
||||||
- Michael Fox
|
- Michael Fox
|
||||||
|
- Andres Freund
|
||||||
- Mike Frysinger
|
- Mike Frysinger
|
||||||
- Daniel Richard G.
|
- Daniel Richard G.
|
||||||
- Tomasz Gajc
|
- Tomasz Gajc
|
||||||
@ -76,6 +77,7 @@ has been important. :-) In alphabetical order:
|
|||||||
- Richard Koch
|
- Richard Koch
|
||||||
- Anton Kochkov
|
- Anton Kochkov
|
||||||
- Ville Koskinen
|
- Ville Koskinen
|
||||||
|
- Sergey Kosukhin
|
||||||
- Marcin Kowalczyk
|
- Marcin Kowalczyk
|
||||||
- Jan Kratochvil
|
- Jan Kratochvil
|
||||||
- Christian Kujau
|
- Christian Kujau
|
||||||
@ -150,11 +152,10 @@ has been important. :-) In alphabetical order:
|
|||||||
- Martin Storsjö
|
- Martin Storsjö
|
||||||
- Jonathan Stott
|
- Jonathan Stott
|
||||||
- Dan Stromberg
|
- Dan Stromberg
|
||||||
- Jia Tan
|
|
||||||
- Vincent Torri
|
- Vincent Torri
|
||||||
|
- Alexey Tourbin
|
||||||
- Paul Townsend
|
- Paul Townsend
|
||||||
- Mohammed Adnène Trojette
|
- Mohammed Adnène Trojette
|
||||||
- Alexey Tourbin
|
|
||||||
- Taiki Tsunekawa
|
- Taiki Tsunekawa
|
||||||
- Maksym Vatsyk
|
- Maksym Vatsyk
|
||||||
- Loganaden Velvindron
|
- Loganaden Velvindron
|
||||||
@ -171,6 +172,7 @@ has been important. :-) In alphabetical order:
|
|||||||
- Charles Wilson
|
- Charles Wilson
|
||||||
- Lars Wirzenius
|
- Lars Wirzenius
|
||||||
- Pilorz Wojciech
|
- Pilorz Wojciech
|
||||||
|
- Chien Wong
|
||||||
- Ryan Young
|
- Ryan Young
|
||||||
- Andreas Zieringer
|
- Andreas Zieringer
|
||||||
|
|
||||||
|
18
autogen.sh
18
autogen.sh
@ -17,14 +17,12 @@ ${AUTOCONF:-autoconf}
|
|||||||
${AUTOHEADER:-autoheader}
|
${AUTOHEADER:-autoheader}
|
||||||
${AUTOMAKE:-automake} -acf --foreign
|
${AUTOMAKE:-automake} -acf --foreign
|
||||||
|
|
||||||
# Generate the translated man pages and the doxygen documentation if the
|
# Generate the translated man pages if the "po4a" tool is available.
|
||||||
# "po4a" and "doxygen" tools are available.
|
|
||||||
# This is *NOT* done by "autoreconf -fi" or when "make" is run.
|
# This is *NOT* done by "autoreconf -fi" or when "make" is run.
|
||||||
# Pass --no-po4a or --no-doxygen to this script to skip these steps.
|
# Pass --no-po4a o this script to skip this step.
|
||||||
# It can be useful when you know that po4a or doxygen aren't available and
|
# It can be useful when you know that po4a isn't available and
|
||||||
# don't want autogen.sh to exit with non-zero exit status.
|
# don't want autogen.sh to exit with non-zero exit status.
|
||||||
generate_po4a="y"
|
generate_po4a="y"
|
||||||
generate_doxygen="y"
|
|
||||||
|
|
||||||
for arg in "$@"
|
for arg in "$@"
|
||||||
do
|
do
|
||||||
@ -32,10 +30,6 @@ do
|
|||||||
"--no-po4a")
|
"--no-po4a")
|
||||||
generate_po4a="n"
|
generate_po4a="n"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"--no-doxygen")
|
|
||||||
generate_doxygen="n"
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -45,10 +39,4 @@ if test "$generate_po4a" != "n"; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$generate_doxygen" != "n"; then
|
|
||||||
cd doxygen
|
|
||||||
sh update-doxygen
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -18,7 +18,7 @@ USAGE="Usage: $0
|
|||||||
-a [autogen flags]
|
-a [autogen flags]
|
||||||
-b [autotools|cmake]
|
-b [autotools|cmake]
|
||||||
-c [crc32|crc64|sha256]
|
-c [crc32|crc64|sha256]
|
||||||
-d [encoders|decoders|bcj|delta|threads|shared|nls|small|ifunc|clmul|sandbox]
|
-d [encoders|decoders|bcj|delta|threads|shared|nls|small|clmul|sandbox]
|
||||||
-f [CFLAGS]
|
-f [CFLAGS]
|
||||||
-l [destdir]
|
-l [destdir]
|
||||||
-m [compiler]
|
-m [compiler]
|
||||||
@ -41,7 +41,6 @@ THREADS="y"
|
|||||||
SHARED="y"
|
SHARED="y"
|
||||||
NATIVE_LANG_SUPPORT="y"
|
NATIVE_LANG_SUPPORT="y"
|
||||||
SMALL="n"
|
SMALL="n"
|
||||||
IFUNC="y"
|
|
||||||
CLMUL="y"
|
CLMUL="y"
|
||||||
SANDBOX="y"
|
SANDBOX="y"
|
||||||
SRC_DIR="$ABS_DIR/../"
|
SRC_DIR="$ABS_DIR/../"
|
||||||
@ -49,12 +48,15 @@ DEST_DIR="$SRC_DIR/../xz_build"
|
|||||||
PHASE="all"
|
PHASE="all"
|
||||||
ARTIFACTS_DIR_NAME="output"
|
ARTIFACTS_DIR_NAME="output"
|
||||||
|
|
||||||
|
[[ -z ${CPU_COUNT} ]] && { CPU_COUNT=$(nproc 2>/dev/null || sysctl -n hw.activecpu); }
|
||||||
|
[[ -z ${MAKEFLAGS} ]] && export MAKEFLAGS="-j${CPU_COUNT} -l${CPU_COUNT}"
|
||||||
|
[[ -z ${CFLAGS} ]] && export CFLAGS="-O2"
|
||||||
|
|
||||||
###################
|
###################
|
||||||
# Parse arguments #
|
# Parse arguments #
|
||||||
###################
|
###################
|
||||||
|
|
||||||
while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
|
while getopts a:b:c:d:l:m:n:s:p:f:w:h opt; do
|
||||||
# b option can have either value "autotools" OR "cmake"
|
# b option can have either value "autotools" OR "cmake"
|
||||||
case ${opt} in
|
case ${opt} in
|
||||||
h)
|
h)
|
||||||
@ -87,7 +89,6 @@ while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
|
|||||||
shared) SHARED="n";;
|
shared) SHARED="n";;
|
||||||
nls) NATIVE_LANG_SUPPORT="n";;
|
nls) NATIVE_LANG_SUPPORT="n";;
|
||||||
small) SMALL="y";;
|
small) SMALL="y";;
|
||||||
ifunc) IFUNC="n";;
|
|
||||||
clmul) CLMUL="n";;
|
clmul) CLMUL="n";;
|
||||||
sandbox) SANDBOX="n";;
|
sandbox) SANDBOX="n";;
|
||||||
*) echo "Invalid disable value: $disable_arg"; exit 1 ;;
|
*) echo "Invalid disable value: $disable_arg"; exit 1 ;;
|
||||||
@ -107,9 +108,11 @@ while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
|
|||||||
p) PHASE="$OPTARG"
|
p) PHASE="$OPTARG"
|
||||||
;;
|
;;
|
||||||
f)
|
f)
|
||||||
CFLAGS="$OPTARG"
|
CFLAGS+=" $OPTARG"
|
||||||
export CFLAGS
|
export CFLAGS
|
||||||
;;
|
;;
|
||||||
|
w) WRAPPER="$OPTARG"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -211,7 +214,6 @@ then
|
|||||||
add_extra_option "$SHARED" "" "--disable-shared"
|
add_extra_option "$SHARED" "" "--disable-shared"
|
||||||
add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls"
|
add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls"
|
||||||
add_extra_option "$SMALL" "--enable-small" ""
|
add_extra_option "$SMALL" "--enable-small" ""
|
||||||
add_extra_option "$IFUNC" "" "--disable-ifunc"
|
|
||||||
add_extra_option "$CLMUL" "" "--disable-clmul-crc"
|
add_extra_option "$CLMUL" "" "--disable-clmul-crc"
|
||||||
add_extra_option "$SANDBOX" "" "--enable-sandbox=no"
|
add_extra_option "$SANDBOX" "" "--enable-sandbox=no"
|
||||||
|
|
||||||
@ -263,7 +265,7 @@ then
|
|||||||
autotools)
|
autotools)
|
||||||
cd "$DEST_DIR"
|
cd "$DEST_DIR"
|
||||||
# If the tests fail, copy the test logs into the artifacts folder
|
# If the tests fail, copy the test logs into the artifacts folder
|
||||||
if make check
|
if make check VERBOSE=1 LOG_COMPILER="$WRAPPER"
|
||||||
then
|
then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
@ -274,7 +276,7 @@ then
|
|||||||
;;
|
;;
|
||||||
cmake)
|
cmake)
|
||||||
cd "$DEST_DIR"
|
cd "$DEST_DIR"
|
||||||
if make test
|
if ${WRAPPER} make test
|
||||||
then
|
then
|
||||||
:
|
:
|
||||||
else
|
else
|
237
configure.ac
237
configure.ac
@ -17,7 +17,7 @@
|
|||||||
AC_PREREQ([2.69])
|
AC_PREREQ([2.69])
|
||||||
|
|
||||||
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
|
AC_INIT([XZ Utils], m4_esyscmd([/bin/sh build-aux/version.sh]),
|
||||||
[xz@tukaani.org], [xz], [https://xz.tukaani.org/xz-utils/])
|
[xz@tukaani.org], [xz], [https://tukaani.org/xz/])
|
||||||
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
AC_CONFIG_SRCDIR([src/liblzma/common/common.h])
|
||||||
AC_CONFIG_AUX_DIR([build-aux])
|
AC_CONFIG_AUX_DIR([build-aux])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
@ -304,13 +304,8 @@ AC_ARG_ENABLE([microlzma], AS_HELP_STRING([--disable-microlzma],
|
|||||||
for example, erofs-utils.]),
|
for example, erofs-utils.]),
|
||||||
[], [enable_microlzma=yes])
|
[], [enable_microlzma=yes])
|
||||||
case $enable_microlzma in
|
case $enable_microlzma in
|
||||||
yes)
|
yes | no)
|
||||||
AC_DEFINE([HAVE_MICROLZMA], [1],
|
AC_MSG_RESULT([$enable_microlzma])
|
||||||
[Define to 1 if MicroLZMA support is enabled.])
|
|
||||||
AC_MSG_RESULT([yes])
|
|
||||||
;;
|
|
||||||
no)
|
|
||||||
AC_MSG_RESULT([no])
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
AC_MSG_RESULT([])
|
AC_MSG_RESULT([])
|
||||||
@ -521,10 +516,18 @@ AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
|
|||||||
|
|
||||||
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
|
||||||
[do not install documentation files to docdir
|
[do not install documentation files to docdir
|
||||||
(man pages will still be installed)])],
|
(man pages are still installed and,
|
||||||
|
if --enable-doxygen is used,
|
||||||
|
liblzma API documentation is installed too)])],
|
||||||
[], [enable_doc=yes])
|
[], [enable_doc=yes])
|
||||||
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen],
|
||||||
|
[generate HTML version of the liblzma API documentation
|
||||||
|
using Doxygen and install the result to docdir])],
|
||||||
|
[], [enable_doxygen=no])
|
||||||
|
AM_CONDITIONAL([COND_DOXYGEN], [test x$enable_doxygen != xno])
|
||||||
|
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Sandboxing #
|
# Sandboxing #
|
||||||
@ -714,61 +717,80 @@ fi
|
|||||||
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
||||||
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
||||||
# being built for a shared library.
|
# being built for a shared library.
|
||||||
if test "x$enable_symbol_versions" = xno ; then
|
AS_IF([test "x$enable_symbol_versions" = xno], [
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
elif test "x$enable_shared" = xno ; then
|
], [test "x$enable_shared" = xno], [
|
||||||
enable_symbol_versions=no
|
enable_symbol_versions=no
|
||||||
AC_MSG_RESULT([no (not building a shared library)])
|
AC_MSG_RESULT([no (not building a shared library)])
|
||||||
else
|
], [
|
||||||
case "$host_cpu-$host_os" in
|
# "yes" means that symbol version are to be used but we need to
|
||||||
microblaze*)
|
# autodetect which variant to use.
|
||||||
# GCC 12 on MicroBlaze doesn't support __symver__
|
if test "x$enable_symbol_versions" = xyes ; then
|
||||||
# attribute. It's simplest and safest to use the
|
case "$host_cpu-$host_os" in
|
||||||
# generic version on that platform since then only
|
microblaze*)
|
||||||
# the linker script is needed. The RHEL/CentOS 7
|
# GCC 12 on MicroBlaze doesn't support
|
||||||
# compatibility symbols don't matter on MicroBlaze.
|
# __symver__ attribute. It's simplest and
|
||||||
enable_symbol_versions=generic
|
# safest to use the generic version on that
|
||||||
;;
|
# platform since then only the linker script
|
||||||
*-linux*)
|
# is needed. The RHEL/CentOS 7 compatibility
|
||||||
case "$pic_mode-$enable_static" in
|
# symbols don't matter on MicroBlaze.
|
||||||
default-*)
|
enable_symbol_versions=generic
|
||||||
# Use symvers if PIC is defined.
|
;;
|
||||||
have_symbol_versions_linux=2
|
*-linux*)
|
||||||
;;
|
# NVIDIA HPC Compiler doesn't support symbol
|
||||||
*-no)
|
# versioning but the linker script can still
|
||||||
# Not building static library.
|
# be used.
|
||||||
# Use symvers unconditionally.
|
AC_EGREP_CPP([use_generic_symbol_versioning],
|
||||||
have_symbol_versions_linux=1
|
[#ifdef __NVCOMPILER
|
||||||
;;
|
use_generic_symbol_versioning
|
||||||
*)
|
#endif],
|
||||||
AC_MSG_RESULT([])
|
[enable_symbol_versions=generic],
|
||||||
AC_MSG_ERROR([
|
[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
|
On GNU/Linux, building both shared and static library at the same time
|
||||||
is not supported if --with-pic or --without-pic is used.
|
is not supported if --with-pic or --without-pic is used.
|
||||||
Use either --disable-shared or --disable-static to build one type
|
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,
|
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.])
|
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
enable_symbol_versions=linux
|
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
[$have_symbol_versions_linux],
|
||||||
[$have_symbol_versions_linux],
|
[Define to 1 to if GNU/Linux-specific details
|
||||||
[Define to 1 to if GNU/Linux-specific details
|
are unconditionally wanted for symbol
|
||||||
are unconditionally wanted for symbol
|
versioning. Define to 2 to if these are wanted
|
||||||
versioning. Define to 2 to if these are wanted
|
only if also PIC is defined (allows building
|
||||||
only if also PIC is defined (allows building
|
both shared and static liblzma at the same
|
||||||
both shared and static liblzma at the same
|
time with Libtool if neither --with-pic nor
|
||||||
time with Libtool if neither --with-pic nor
|
--without-pic is used). This define must be
|
||||||
--without-pic is used). This define must be
|
used together with liblzma_linux.map.])
|
||||||
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'])
|
||||||
enable_symbol_versions=generic
|
fi
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
||||||
fi
|
])
|
||||||
|
|
||||||
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
||||||
[test "x$enable_symbol_versions" = xlinux])
|
[test "x$enable_symbol_versions" = xlinux])
|
||||||
@ -797,12 +819,6 @@ AM_GNU_GETTEXT([external])
|
|||||||
echo
|
echo
|
||||||
echo "System headers and functions:"
|
echo "System headers and functions:"
|
||||||
|
|
||||||
# There is currently no workarounds in this package if some of
|
|
||||||
# these headers are missing.
|
|
||||||
AC_CHECK_HEADERS([fcntl.h limits.h sys/time.h],
|
|
||||||
[],
|
|
||||||
[AC_MSG_ERROR([Required header file(s) are missing.])])
|
|
||||||
|
|
||||||
# immintrin.h allows the use of the intrinsic functions if they are available.
|
# immintrin.h allows the use of the intrinsic functions if they are available.
|
||||||
# cpuid.h may be used for detecting x86 processor features at runtime.
|
# cpuid.h may be used for detecting x86 processor features at runtime.
|
||||||
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
||||||
@ -879,78 +895,6 @@ if test "x$enable_small$enable_threads$have_func_attribute_constructor" \
|
|||||||
__attribute__((__constructor__))])
|
__attribute__((__constructor__))])
|
||||||
fi
|
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([--enable-ifunc],
|
|
||||||
[Use __attribute__((__ifunc__())). Enabled by default on
|
|
||||||
GNU/Linux (glibc) and FreeBSD.])],
|
|
||||||
[], [enable_ifunc=auto])
|
|
||||||
|
|
||||||
# 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; }
|
|
||||||
static void (*resolve_func (void)) (void) { return func; }
|
|
||||||
void func_ifunc (void)
|
|
||||||
__attribute__((__ifunc__("resolve_func")));
|
|
||||||
/*
|
|
||||||
* 'clang -Wall' incorrectly warns that resolve_func is
|
|
||||||
* unused (-Wunused-function). Correct assembly output is
|
|
||||||
* still produced. This problem exists at least in Clang
|
|
||||||
* versions 4 to 17. The following silences the bogus warning:
|
|
||||||
*/
|
|
||||||
void make_clang_quiet(void);
|
|
||||||
void make_clang_quiet(void) { resolve_func()(); }
|
|
||||||
]])], [
|
|
||||||
enable_ifunc=yes
|
|
||||||
], [
|
|
||||||
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.
|
# Checks for library functions.
|
||||||
@ -1149,7 +1093,7 @@ uint32_t my_crc(uint32_t a, uint64_t b)
|
|||||||
# The C code is responsible for checking defined(__APPLE__) before using
|
# The C code is responsible for checking defined(__APPLE__) before using
|
||||||
# sysctlbyname("hw.optional.armv8_crc32", ...).
|
# sysctlbyname("hw.optional.armv8_crc32", ...).
|
||||||
AS_IF([test "x$enable_arm64_crc32" = xyes], [
|
AS_IF([test "x$enable_arm64_crc32" = xyes], [
|
||||||
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname])
|
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname], [break])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@ -1177,12 +1121,37 @@ AS_CASE([$enable_sandbox],
|
|||||||
)
|
)
|
||||||
AS_CASE([$enable_sandbox],
|
AS_CASE([$enable_sandbox],
|
||||||
[auto | landlock], [
|
[auto | landlock], [
|
||||||
AC_CHECK_HEADERS([linux/landlock.h], [
|
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
|
enable_sandbox=found
|
||||||
|
|
||||||
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
||||||
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
||||||
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
|
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])
|
||||||
])
|
])
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -11,7 +11,8 @@ noinst_PROGRAMS = \
|
|||||||
memusage \
|
memusage \
|
||||||
crc32 \
|
crc32 \
|
||||||
known_sizes \
|
known_sizes \
|
||||||
hex2bin
|
hex2bin \
|
||||||
|
testfilegen-arm64
|
||||||
|
|
||||||
AM_CPPFLAGS = \
|
AM_CPPFLAGS = \
|
||||||
-I$(top_srcdir)/src/common \
|
-I$(top_srcdir)/src/common \
|
||||||
|
116
debug/testfilegen-arm64.c
Normal file
116
debug/testfilegen-arm64.c
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
// SPDX-License-Identifier: 0BSD
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
/// \file testfilegen-arm64.c
|
||||||
|
/// \brief Generates uncompressed test file for the ARM64 filter
|
||||||
|
//
|
||||||
|
// Author: Lasse Collin
|
||||||
|
//
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
static uint32_t pc4 = 0;
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
put32le(uint32_t v)
|
||||||
|
{
|
||||||
|
putchar((v >> 0) & 0xFF);
|
||||||
|
putchar((v >> 8) & 0xFF);
|
||||||
|
putchar((v >> 16) & 0xFF);
|
||||||
|
putchar((v >> 24) & 0xFF);
|
||||||
|
++pc4;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
putbl(uint32_t imm)
|
||||||
|
{
|
||||||
|
imm &= (1U << 26) - 1;
|
||||||
|
imm |= 0x25U << 26;
|
||||||
|
put32le(imm);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
putadrp32(uint32_t imm)
|
||||||
|
{
|
||||||
|
imm &= 0x1FFFFFU;
|
||||||
|
|
||||||
|
// fprintf(stderr, "ADRP 0x%08X\n", imm);
|
||||||
|
|
||||||
|
uint32_t instr = 0x90000000;
|
||||||
|
instr |= (pc4 * 5 + 11) & 0x1F;
|
||||||
|
instr |= (imm & 3) << 29;
|
||||||
|
instr |= (imm >> 2) << 5;
|
||||||
|
|
||||||
|
put32le(instr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern int
|
||||||
|
main(void)
|
||||||
|
{
|
||||||
|
putbl(0);
|
||||||
|
putbl(0x03FFFFFF);
|
||||||
|
putbl(0x03FFFFFE);
|
||||||
|
putbl(0x03FFFFFD);
|
||||||
|
|
||||||
|
putbl(3);
|
||||||
|
putbl(2);
|
||||||
|
putbl(1);
|
||||||
|
putbl(0);
|
||||||
|
|
||||||
|
|
||||||
|
putbl(0x02000001);
|
||||||
|
putbl(0x02000000);
|
||||||
|
putbl(0x01FFFFFF);
|
||||||
|
putbl(0x01FFFFFE);
|
||||||
|
|
||||||
|
putbl(0x01111117);
|
||||||
|
putbl(0x01111116);
|
||||||
|
putbl(0x01111115);
|
||||||
|
putbl(0x01111114);
|
||||||
|
|
||||||
|
|
||||||
|
putbl(0x02222227);
|
||||||
|
putbl(0x02222226);
|
||||||
|
putbl(0x02222225);
|
||||||
|
putbl(0x02222224);
|
||||||
|
|
||||||
|
putbl(0U - pc4);
|
||||||
|
putbl(0U - pc4);
|
||||||
|
putbl(0U - pc4);
|
||||||
|
putbl(0U - pc4);
|
||||||
|
|
||||||
|
putadrp32(0x00);
|
||||||
|
putadrp32(0x05);
|
||||||
|
putadrp32(0x15);
|
||||||
|
putadrp32(0x25);
|
||||||
|
|
||||||
|
for (unsigned rep = 0; rep < 2; ++rep) {
|
||||||
|
while ((pc4 << 2) & 4095)
|
||||||
|
put32le(0x55555555U);
|
||||||
|
|
||||||
|
for (unsigned i = 10; i <= 21; ++i) {
|
||||||
|
const uint32_t neg = (0x1FFF00 >> (21 - i)) & ~255U;
|
||||||
|
const uint32_t plus = 1U << (i - 1);
|
||||||
|
putadrp32(0x000000 | plus);
|
||||||
|
putadrp32(0x000005 | plus);
|
||||||
|
putadrp32(0x0000FE | plus);
|
||||||
|
putadrp32(0x0000FF | plus);
|
||||||
|
|
||||||
|
putadrp32(0x000000 | neg);
|
||||||
|
putadrp32(0x000005 | neg);
|
||||||
|
putadrp32(0x0000FE | neg);
|
||||||
|
putadrp32(0x0000FF | neg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@ -78,7 +78,6 @@ for CMD in \
|
|||||||
"xz --lzma2=foobarbaz=abcd" \
|
"xz --lzma2=foobarbaz=abcd" \
|
||||||
"xz --lzma2=mf=abcd" \
|
"xz --lzma2=mf=abcd" \
|
||||||
"xz --lzma2=preset=foobarbaz" \
|
"xz --lzma2=preset=foobarbaz" \
|
||||||
"xz --lzma2=mf=bt4,nice=2" \
|
|
||||||
"xz --lzma2=nice=50000" \
|
"xz --lzma2=nice=50000" \
|
||||||
"xz --help" \
|
"xz --help" \
|
||||||
"xz --long-help" \
|
"xz --long-help" \
|
||||||
|
@ -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
|
If the result is still too big, take a look at XZ Embedded. It is
|
||||||
a separate project, which provides a limited but significantly
|
a separate project, which provides a limited but significantly
|
||||||
smaller XZ decoder implementation than XZ Utils. You can find it
|
smaller XZ decoder implementation than XZ Utils. You can find it
|
||||||
at <https://xz.tukaani.org/xz-embedded/>.
|
at <https://tukaani.org/xz/embedded.html>.
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@ The .lzma File Format
|
|||||||
|
|
||||||
0.2. Changes
|
0.2. Changes
|
||||||
|
|
||||||
Last modified: 2024-01-16 18:00+0800
|
Last modified: 2024-04-08 17:35+0300
|
||||||
|
|
||||||
Compared to the previous version (2022-07-13 21:00+0300)
|
From version 2011-04-12 11:55+0300 to 2022-07-13 21:00+0300:
|
||||||
the section 2 was modified to change links from http to
|
The section 1.1.3 was modified to allow End of Payload Marker
|
||||||
https and to update XZ links.
|
with a known Uncompressed Size.
|
||||||
|
|
||||||
|
|
||||||
1. File Format
|
1. File Format
|
||||||
@ -166,8 +166,8 @@ The .lzma File Format
|
|||||||
https://tukaani.org/lzma/
|
https://tukaani.org/lzma/
|
||||||
|
|
||||||
XZ Utils - The next generation of LZMA Utils
|
XZ Utils - The next generation of LZMA Utils
|
||||||
https://xz.tukaani.org/xz-utils/
|
https://tukaani.org/xz/
|
||||||
|
|
||||||
The .xz file format - The successor of the .lzma format
|
The .xz file format - The successor of the .lzma format
|
||||||
https://xz.tukaani.org/format/xz-file-format.txt
|
https://tukaani.org/xz/xz-file-format.txt
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
The .xz File Format
|
The .xz File Format
|
||||||
===================
|
===================
|
||||||
|
|
||||||
Version 1.2.0 (2024-01-19)
|
Version 1.2.1 (2024-04-08)
|
||||||
|
|
||||||
|
|
||||||
0. Preface
|
0. Preface
|
||||||
@ -81,18 +81,22 @@ Version 1.2.0 (2024-01-19)
|
|||||||
0.2. Getting the Latest Version
|
0.2. Getting the Latest Version
|
||||||
|
|
||||||
The latest official version of this document can be downloaded
|
The latest official version of this document can be downloaded
|
||||||
from <https://xz.tukaani.org/format/xz-file-format.txt>.
|
from <https://tukaani.org/xz/xz-file-format.txt>.
|
||||||
|
|
||||||
Specific versions of this document have a filename
|
Specific versions of this document have a filename
|
||||||
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
|
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
|
For example, the version 1.0.0 of this document is available
|
||||||
at <https://xz.tukaani.org/format/xz-file-format-1.0.0.txt>.
|
at <https://tukaani.org/xz/xz-file-format-1.0.0.txt>.
|
||||||
|
|
||||||
|
|
||||||
0.3. Version History
|
0.3. Version History
|
||||||
|
|
||||||
Version Date Description
|
Version Date Description
|
||||||
|
|
||||||
|
1.2.1 2024-04-08 The URLs of this specification and
|
||||||
|
XZ Utils were changed back to the
|
||||||
|
original ones in Sections 0.2 and 7.
|
||||||
|
|
||||||
1.2.0 2024-01-19 Added RISC-V filter and updated URLs in
|
1.2.0 2024-01-19 Added RISC-V filter and updated URLs in
|
||||||
Sections 0.2 and 7. The URL of this
|
Sections 0.2 and 7. The URL of this
|
||||||
specification was changed.
|
specification was changed.
|
||||||
@ -1147,7 +1151,7 @@ Version 1.2.0 (2024-01-19)
|
|||||||
https://tukaani.org/lzma/
|
https://tukaani.org/lzma/
|
||||||
|
|
||||||
XZ Utils - The next generation of LZMA Utils
|
XZ Utils - The next generation of LZMA Utils
|
||||||
https://xz.tukaani.org/xz-utils/
|
https://tukaani.org/xz/
|
||||||
|
|
||||||
[RFC-1952]
|
[RFC-1952]
|
||||||
GZIP file format specification version 4.3
|
GZIP file format specification version 4.3
|
||||||
|
BIN
doc/xz-logo.png
BIN
doc/xz-logo.png
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
14
dos/config.h
14
dos/config.h
@ -81,9 +81,6 @@
|
|||||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||||
#define HAVE_INTTYPES_H 1
|
#define HAVE_INTTYPES_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <limits.h> header file. */
|
|
||||||
#define HAVE_LIMITS_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if .lz (lzip) decompression support is enabled. */
|
/* Define to 1 if .lz (lzip) decompression support is enabled. */
|
||||||
#define HAVE_LZIP_DECODER 1
|
#define HAVE_LZIP_DECODER 1
|
||||||
|
|
||||||
@ -108,15 +105,6 @@
|
|||||||
/* Define to 1 if you have the <stdint.h> header file. */
|
/* Define to 1 if you have the <stdint.h> header file. */
|
||||||
#define HAVE_STDINT_H 1
|
#define HAVE_STDINT_H 1
|
||||||
|
|
||||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
|
||||||
#define HAVE_STDLIB_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <string.h> header file. */
|
|
||||||
#define HAVE_STRING_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
|
||||||
#define HAVE_SYS_TIME_H 1
|
|
||||||
|
|
||||||
/* Define to 1 if you have the 'utimes' function. */
|
/* Define to 1 if you have the 'utimes' function. */
|
||||||
#define HAVE_UTIMES 1
|
#define HAVE_UTIMES 1
|
||||||
|
|
||||||
@ -145,7 +133,7 @@
|
|||||||
#define PACKAGE_NAME "XZ Utils"
|
#define PACKAGE_NAME "XZ Utils"
|
||||||
|
|
||||||
/* Define to the home page for this package. */
|
/* Define to the home page for this package. */
|
||||||
#define PACKAGE_URL "https://xz.tukaani.org/xz-utils/"
|
#define PACKAGE_URL "https://tukaani.org/xz/"
|
||||||
|
|
||||||
/* The size of 'size_t', as computed by sizeof. */
|
/* The size of 'size_t', as computed by sizeof. */
|
||||||
#define SIZEOF_SIZE_T 4
|
#define SIZEOF_SIZE_T 4
|
||||||
|
2672
doxygen/Doxyfile
2672
doxygen/Doxyfile
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
|||||||
<hr class="footer"/>
|
|
||||||
|
|
||||||
<p style="text-align: right;padding-right: 12px;">
|
|
||||||
XZ logo © 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>
|
|
@ -3,14 +3,13 @@
|
|||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
# Updates the Doxygen generated documentation files in the source tree.
|
# While it's possible to use the Doxyfile as is to generate liblzma API
|
||||||
# If the doxygen command is not installed, it will exit with an error.
|
# documentation, it is recommended to use this script because this adds
|
||||||
# This script can generate Doxygen documentation for all source files or for
|
# the XZ Utils version number to the generated HTML.
|
||||||
# just liblzma API header files.
|
|
||||||
#
|
#
|
||||||
# It is recommended to use this script to update the Doxygen-generated HTML
|
# Other features:
|
||||||
# files since this will include the package version in the output and,
|
# - Generate documentation of the XZ Utils internals.
|
||||||
# in case of liblzma API docs, strip JavaScript files from the output.
|
# - Set input and output paths for out-of-tree builds.
|
||||||
#
|
#
|
||||||
#############################################################################
|
#############################################################################
|
||||||
#
|
#
|
||||||
@ -21,31 +20,67 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
show_usage()
|
||||||
|
{
|
||||||
|
echo "Usage: $0 <api|internal> [ABS_TOP_SRCDIR ABS_OUTDIR]"
|
||||||
|
echo
|
||||||
|
echo "Supported modes:"
|
||||||
|
echo " - 'api' (default): liblzma API docs into doc/api"
|
||||||
|
echo " - 'internal': internal docs into doc/internal"
|
||||||
|
echo
|
||||||
|
echo "Absolute source and output dirs may be set" \
|
||||||
|
"to do an out-of-tree build."
|
||||||
|
echo "The output directory must already exist."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
api|internal)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if type doxygen > /dev/null 2>&1; then
|
if type doxygen > /dev/null 2>&1; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
echo "doxygen/update-doxygen: 'doxygen' command not found." >&2
|
echo "$0: 'doxygen' command not found" >&2
|
||||||
echo "doxygen/update-doxygen: Skipping Doxygen docs generation." >&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test ! -f Doxyfile; then
|
case $# in
|
||||||
cd `dirname "$0"` || exit 1
|
1)
|
||||||
if test ! -f Doxyfile; then
|
# One argument: Building inside the source tree
|
||||||
echo "doxygen/update-doxygen: Cannot find Doxyfile" >&2
|
ABS_TOP_SRCDIR=`dirname "$0"`/..
|
||||||
exit 1
|
ABS_OUTDIR=$ABS_TOP_SRCDIR/doc
|
||||||
fi
|
;;
|
||||||
|
3)
|
||||||
|
# Three arguments: Possibly an out of tree build
|
||||||
|
ABS_TOP_SRCDIR=$2
|
||||||
|
ABS_OUTDIR=$3
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
show_usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if test ! -f "$ABS_TOP_SRCDIR/doxygen/Doxyfile"; then
|
||||||
|
echo "$0: Source dir '$ABS_TOP_SRCDIR/doxygen/Doxyfile' not found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if test ! -d "$ABS_OUTDIR"; then
|
||||||
|
echo "$0: Output dir '$ABS_OUTDIR' not found" >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the package version so that it can be included in the generated docs.
|
# Get the package version so that it can be included in the generated docs.
|
||||||
PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
|
PACKAGE_VERSION=`cd "$ABS_TOP_SRCDIR" && sh build-aux/version.sh`
|
||||||
|
|
||||||
# If no arguments are specified, default to generating liblzma API header
|
|
||||||
# documentation only.
|
|
||||||
case $1 in
|
case $1 in
|
||||||
'' | api)
|
api)
|
||||||
# Remove old documentation before re-generating the new.
|
# Remove old documentation before re-generating the new.
|
||||||
rm -rf ../doc/api
|
rm -rf "$ABS_OUTDIR/api"
|
||||||
|
|
||||||
# Generate the HTML documentation by preparing the Doxyfile
|
# Generate the HTML documentation by preparing the Doxyfile
|
||||||
# in stdin and piping the result to the doxygen command.
|
# in stdin and piping the result to the doxygen command.
|
||||||
@ -53,57 +88,27 @@ case $1 in
|
|||||||
# override any earlier assignment. So, we can use this
|
# override any earlier assignment. So, we can use this
|
||||||
# feature to override the tags that need to change between
|
# feature to override the tags that need to change between
|
||||||
# "api" and "internal" modes.
|
# "api" and "internal" modes.
|
||||||
|
ABS_SRCDIR=$ABS_TOP_SRCDIR/src/liblzma/api
|
||||||
(
|
(
|
||||||
cat Doxyfile
|
cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
|
||||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||||
) | doxygen -
|
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
||||||
|
echo "STRIP_FROM_PATH = $ABS_SRCDIR"
|
||||||
# As of Doxygen 1.8.0 - 1.9.6 and the Doxyfile options we use,
|
echo "INPUT = $ABS_SRCDIR"
|
||||||
# the output is good without any JavaScript. Unfortunately
|
) | doxygen -q -
|
||||||
# Doxygen doesn't have an option to disable JavaScript usage
|
|
||||||
# completely so we strip it away with the hack below.
|
|
||||||
#
|
|
||||||
# Omitting the JavaScript code avoids some license hassle
|
|
||||||
# as jquery.js is fairly big, it contains more than jQuery
|
|
||||||
# itself, and doesn't include the actual license text (it
|
|
||||||
# only refers to the MIT license by name).
|
|
||||||
echo "Stripping JavaScript from Doxygen output..."
|
|
||||||
for F in ../doc/api/*.html
|
|
||||||
do
|
|
||||||
sed 's/<script [^>]*><\/script>//g
|
|
||||||
s/onclick="[^"]*"//g' \
|
|
||||||
"$F" > ../doc/api/tmp
|
|
||||||
mv -f ../doc/api/tmp "$F"
|
|
||||||
done
|
|
||||||
rm -f ../doc/api/*.js
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
internal)
|
internal)
|
||||||
# The docs from internal aren't for distribution so
|
rm -rf "$ABS_OUTDIR/internal"
|
||||||
# the JavaScript files aren't an issue here.
|
|
||||||
rm -rf ../doc/internal
|
|
||||||
(
|
(
|
||||||
cat Doxyfile
|
cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
|
||||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
|
||||||
echo 'PROJECT_NAME = "XZ Utils"'
|
echo 'PROJECT_NAME = "XZ Utils"'
|
||||||
echo 'STRIP_FROM_PATH = ../src'
|
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||||
echo 'INPUT = ../src'
|
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
||||||
|
echo "STRIP_FROM_PATH = $ABS_TOP_SRCDIR"
|
||||||
|
echo "INPUT = $ABS_TOP_SRCDIR/src"
|
||||||
echo 'HTML_OUTPUT = internal'
|
echo 'HTML_OUTPUT = internal'
|
||||||
echo 'EXTRACT_PRIVATE = YES'
|
|
||||||
echo 'EXTRACT_STATIC = YES'
|
|
||||||
echo 'EXTRACT_LOCAL_CLASSES = YES'
|
|
||||||
echo 'SEARCHENGINE = YES'
|
echo 'SEARCHENGINE = YES'
|
||||||
) | doxygen -
|
) | doxygen -q -
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "doxygen/update-doxygen: Error: mode argument '$1'" \
|
|
||||||
"is not supported." >&2
|
|
||||||
echo "doxygen/update-doxygen: Supported modes:" >&2
|
|
||||||
echo "doxygen/update-doxygen: - 'api' (default):" \
|
|
||||||
"liblzma API docs into doc/api" >&2
|
|
||||||
echo "doxygen/update-doxygen: - 'internal':"\
|
|
||||||
"internal docs into doc/internal" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
dnl SPDX-License-Identifier: FSFULLR
|
dnl SPDX-License-Identifier: FSFULLR
|
||||||
|
|
||||||
# visibility.m4 serial 8
|
# visibility.m4
|
||||||
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
|
# serial 9
|
||||||
|
dnl Copyright (C) 2005, 2008, 2010-2024 Free Software Foundation, Inc.
|
||||||
dnl This file is free software; the Free Software Foundation
|
dnl This file is free software; the Free Software Foundation
|
||||||
dnl gives unlimited permission to copy and/or distribute it,
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
dnl with or without modifications, as long as this notice is preserved.
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
@ -33,18 +34,18 @@ AC_DEFUN([gl_VISIBILITY],
|
|||||||
dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
||||||
AC_CACHE_CHECK([whether the -Werror option is usable],
|
AC_CACHE_CHECK([whether the -Werror option is usable],
|
||||||
[gl_cv_cc_vis_werror],
|
[gl_cv_cc_vis_werror],
|
||||||
[gl_save_CFLAGS="$CFLAGS"
|
[gl_saved_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -Werror"
|
CFLAGS="$CFLAGS -Werror"
|
||||||
AC_COMPILE_IFELSE(
|
AC_COMPILE_IFELSE(
|
||||||
[AC_LANG_PROGRAM([[]], [[]])],
|
[AC_LANG_PROGRAM([[]], [[]])],
|
||||||
[gl_cv_cc_vis_werror=yes],
|
[gl_cv_cc_vis_werror=yes],
|
||||||
[gl_cv_cc_vis_werror=no])
|
[gl_cv_cc_vis_werror=no])
|
||||||
CFLAGS="$gl_save_CFLAGS"
|
CFLAGS="$gl_saved_CFLAGS"
|
||||||
])
|
])
|
||||||
dnl Now check whether visibility declarations are supported.
|
dnl Now check whether visibility declarations are supported.
|
||||||
AC_CACHE_CHECK([for simple visibility declarations],
|
AC_CACHE_CHECK([for simple visibility declarations],
|
||||||
[gl_cv_cc_visibility],
|
[gl_cv_cc_visibility],
|
||||||
[gl_save_CFLAGS="$CFLAGS"
|
[gl_saved_CFLAGS="$CFLAGS"
|
||||||
CFLAGS="$CFLAGS -fvisibility=hidden"
|
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||||
dnl We use the option -Werror and a function dummyfunc, because on some
|
dnl We use the option -Werror and a function dummyfunc, because on some
|
||||||
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
||||||
@ -70,7 +71,7 @@ AC_DEFUN([gl_VISIBILITY],
|
|||||||
[[]])],
|
[[]])],
|
||||||
[gl_cv_cc_visibility=yes],
|
[gl_cv_cc_visibility=yes],
|
||||||
[gl_cv_cc_visibility=no])
|
[gl_cv_cc_visibility=no])
|
||||||
CFLAGS="$gl_save_CFLAGS"
|
CFLAGS="$gl_saved_CFLAGS"
|
||||||
])
|
])
|
||||||
if test $gl_cv_cc_visibility = yes; then
|
if test $gl_cv_cc_visibility = yes; then
|
||||||
CFLAG_VISIBILITY="-fvisibility=hidden"
|
CFLAG_VISIBILITY="-fvisibility=hidden"
|
||||||
|
10
po/Makevars
10
po/Makevars
@ -14,7 +14,7 @@ subdir = po
|
|||||||
top_builddir = ..
|
top_builddir = ..
|
||||||
|
|
||||||
# These options get passed to xgettext.
|
# These options get passed to xgettext.
|
||||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-wrap --package-name='XZ Utils'
|
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --add-location=file --no-wrap
|
||||||
|
|
||||||
# This is the copyright holder that gets inserted into the header of the
|
# 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
|
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||||
@ -63,7 +63,7 @@ USE_MSGCTXT = no
|
|||||||
# Useful options are in particular:
|
# Useful options are in particular:
|
||||||
# --previous to keep previous msgids of translated messages,
|
# --previous to keep previous msgids of translated messages,
|
||||||
# --quiet to reduce the verbosity.
|
# --quiet to reduce the verbosity.
|
||||||
MSGMERGE_OPTIONS = --no-wrap
|
MSGMERGE_OPTIONS = --add-location=file --no-wrap
|
||||||
|
|
||||||
# These options get passed to msginit.
|
# These options get passed to msginit.
|
||||||
# If you want to disable line wrapping when writing PO files, add
|
# If you want to disable line wrapping when writing PO files, add
|
||||||
@ -84,4 +84,8 @@ PO_DEPENDS_ON_POT = yes
|
|||||||
# regenerate PO files on "make dist". Possible values are "yes" 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
|
# "no". Set this to no if the POT file and PO files are maintained
|
||||||
# externally.
|
# externally.
|
||||||
DIST_DEPENDS_ON_UPDATE_PO = yes
|
#
|
||||||
|
# NOTE: The the custom "mydist" target in ../Makefile.am updates xz.pot.
|
||||||
|
# An updated xz.pot will cause the .po files to be updated too but
|
||||||
|
# only when updating would change more than the POT-Creation-Date line.
|
||||||
|
DIST_DEPENDS_ON_UPDATE_PO = no
|
||||||
|
567
po/pt_BR.po
567
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
417
po/zh_CN.po
417
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
558
po/zh_TW.po
558
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
3
po4a/.gitignore
vendored
3
po4a/.gitignore
vendored
@ -1,3 +0,0 @@
|
|||||||
/man
|
|
||||||
/xz-man.pot
|
|
||||||
/*.po.authors
|
|
1610
po4a/de.po
1610
po4a/de.po
File diff suppressed because it is too large
Load Diff
4419
po4a/fr.po
4419
po4a/fr.po
File diff suppressed because it is too large
Load Diff
1606
po4a/ko.po
1606
po4a/ko.po
File diff suppressed because it is too large
Load Diff
4834
po4a/pt_BR.po
4834
po4a/pt_BR.po
File diff suppressed because it is too large
Load Diff
1610
po4a/ro.po
1610
po4a/ro.po
File diff suppressed because it is too large
Load Diff
1610
po4a/uk.po
1610
po4a/uk.po
File diff suppressed because it is too large
Load Diff
@ -54,13 +54,36 @@ done
|
|||||||
# when nothing else has changed. This makes it slower but it's fine
|
# when nothing else has changed. This makes it slower but it's fine
|
||||||
# as long as this isn't run every time when "make" is run at the
|
# as long as this isn't run every time when "make" is run at the
|
||||||
# top level directory. (po4a isn't super-fast even without --force).
|
# top level directory. (po4a isn't super-fast even without --force).
|
||||||
|
#
|
||||||
|
# Make diffing the .pot and .po files easier:
|
||||||
|
#
|
||||||
|
# --porefs file Put only the input filenames, not line numbers,
|
||||||
|
# into the .pot file. This way they won't get
|
||||||
|
# copied to the .po files either.
|
||||||
|
#
|
||||||
|
# --wrap-po newlines Wrap msgids only at \n in the .pot file.
|
||||||
|
#
|
||||||
|
# --msgmerge-opt "--no-wrap"
|
||||||
|
# Wrap msgids and msgstrs only at \n in the .po files.
|
||||||
|
#
|
||||||
|
# The values from --package-name and --package-version are used to create
|
||||||
|
# the Project-Id-Version field. It likely makes sense that its value isn't
|
||||||
|
# identical to the value in the program message translations. In practice
|
||||||
|
# it seems that the .po files from many (but not all) translators will use
|
||||||
|
# "xz-man" no matter what is specified here and in xz-man.pot. Thus it's
|
||||||
|
# best to use "xz-man" here to get the most consistent results.
|
||||||
set -x
|
set -x
|
||||||
po4a --force --verbose \
|
po4a --force --verbose \
|
||||||
--package-name="XZ Utils" \
|
--porefs file --wrap-po newlines --msgmerge-opt "--no-wrap" \
|
||||||
|
--package-name="xz-man" \
|
||||||
--package-version="$PACKAGE_VERSION" \
|
--package-version="$PACKAGE_VERSION" \
|
||||||
--copyright-holder="The XZ Utils authors and contributors" \
|
--copyright-holder="The XZ Utils authors and contributors" \
|
||||||
po4a.conf
|
po4a.conf
|
||||||
|
|
||||||
|
# Remove the *.po.authors files that were generated above.
|
||||||
|
# This way they won't get included in distribution tarballs.
|
||||||
|
rm -f *.po.authors
|
||||||
|
|
||||||
# Add the customized POT header which contains the SPDX license
|
# Add the customized POT header which contains the SPDX license
|
||||||
# identifier and spells out the license name instead of saying
|
# identifier and spells out the license name instead of saying
|
||||||
# "the same license as the XZ Utils package".
|
# "the same license as the XZ Utils package".
|
||||||
|
@ -200,7 +200,7 @@ mythread_join(mythread thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Initiatlizes a mutex. Returns zero on success and non-zero on error.
|
// Initializes a mutex. Returns zero on success and non-zero on error.
|
||||||
static inline int
|
static inline int
|
||||||
mythread_mutex_init(mythread_mutex *mutex)
|
mythread_mutex_init(mythread_mutex *mutex)
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
///
|
///
|
||||||
/// Endianness-converting integer operations (these can be macros!)
|
/// Endianness-converting integer operations (these can be macros!)
|
||||||
/// (XX = 16, 32, or 64; Y = b or l):
|
/// (XX = 16, 32, or 64; Y = b or l):
|
||||||
/// - Byte swapping: bswapXX(num)
|
/// - Byte swapping: byteswapXX(num)
|
||||||
/// - Byte order conversions to/from native (byteswaps if Y isn't
|
/// - Byte order conversions to/from native (byteswaps if Y isn't
|
||||||
/// the native endianness): convXXYe(num)
|
/// the native endianness): convXXYe(num)
|
||||||
/// - Unaligned reads: readXXYe(ptr)
|
/// - Unaligned reads: readXXYe(ptr)
|
||||||
@ -66,38 +66,41 @@
|
|||||||
|
|
||||||
#if defined(HAVE___BUILTIN_BSWAPXX)
|
#if defined(HAVE___BUILTIN_BSWAPXX)
|
||||||
// GCC >= 4.8 and Clang
|
// GCC >= 4.8 and Clang
|
||||||
# define bswap16(n) __builtin_bswap16(n)
|
# define byteswap16(num) __builtin_bswap16(num)
|
||||||
# define bswap32(n) __builtin_bswap32(n)
|
# define byteswap32(num) __builtin_bswap32(num)
|
||||||
# define bswap64(n) __builtin_bswap64(n)
|
# define byteswap64(num) __builtin_bswap64(num)
|
||||||
|
|
||||||
#elif defined(HAVE_BYTESWAP_H)
|
#elif defined(HAVE_BYTESWAP_H)
|
||||||
// glibc, uClibc, dietlibc
|
// glibc, uClibc, dietlibc
|
||||||
# include <byteswap.h>
|
# include <byteswap.h>
|
||||||
# ifdef HAVE_BSWAP_16
|
# ifdef HAVE_BSWAP_16
|
||||||
# define bswap16(num) bswap_16(num)
|
# define byteswap16(num) bswap_16(num)
|
||||||
# endif
|
# endif
|
||||||
# ifdef HAVE_BSWAP_32
|
# ifdef HAVE_BSWAP_32
|
||||||
# define bswap32(num) bswap_32(num)
|
# define byteswap32(num) bswap_32(num)
|
||||||
# endif
|
# endif
|
||||||
# ifdef HAVE_BSWAP_64
|
# ifdef HAVE_BSWAP_64
|
||||||
# define bswap64(num) bswap_64(num)
|
# define byteswap64(num) bswap_64(num)
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||||
// *BSDs and Darwin
|
// *BSDs and Darwin
|
||||||
# include <sys/endian.h>
|
# include <sys/endian.h>
|
||||||
|
# define byteswap16(num) bswap16(num)
|
||||||
|
# define byteswap32(num) bswap32(num)
|
||||||
|
# define byteswap64(num) bswap64(num)
|
||||||
|
|
||||||
#elif defined(HAVE_SYS_BYTEORDER_H)
|
#elif defined(HAVE_SYS_BYTEORDER_H)
|
||||||
// Solaris
|
// Solaris
|
||||||
# include <sys/byteorder.h>
|
# include <sys/byteorder.h>
|
||||||
# ifdef BSWAP_16
|
# ifdef BSWAP_16
|
||||||
# define bswap16(num) BSWAP_16(num)
|
# define byteswap16(num) BSWAP_16(num)
|
||||||
# endif
|
# endif
|
||||||
# ifdef BSWAP_32
|
# ifdef BSWAP_32
|
||||||
# define bswap32(num) BSWAP_32(num)
|
# define byteswap32(num) BSWAP_32(num)
|
||||||
# endif
|
# endif
|
||||||
# ifdef BSWAP_64
|
# ifdef BSWAP_64
|
||||||
# define bswap64(num) BSWAP_64(num)
|
# define byteswap64(num) BSWAP_64(num)
|
||||||
# endif
|
# endif
|
||||||
# ifdef BE_16
|
# ifdef BE_16
|
||||||
# define conv16be(num) BE_16(num)
|
# define conv16be(num) BE_16(num)
|
||||||
@ -119,15 +122,15 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef bswap16
|
#ifndef byteswap16
|
||||||
# define bswap16(n) (uint16_t)( \
|
# define byteswap16(n) (uint16_t)( \
|
||||||
(((n) & 0x00FFU) << 8) \
|
(((n) & 0x00FFU) << 8) \
|
||||||
| (((n) & 0xFF00U) >> 8) \
|
| (((n) & 0xFF00U) >> 8) \
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef bswap32
|
#ifndef byteswap32
|
||||||
# define bswap32(n) (uint32_t)( \
|
# define byteswap32(n) (uint32_t)( \
|
||||||
(((n) & UINT32_C(0x000000FF)) << 24) \
|
(((n) & UINT32_C(0x000000FF)) << 24) \
|
||||||
| (((n) & UINT32_C(0x0000FF00)) << 8) \
|
| (((n) & UINT32_C(0x0000FF00)) << 8) \
|
||||||
| (((n) & UINT32_C(0x00FF0000)) >> 8) \
|
| (((n) & UINT32_C(0x00FF0000)) >> 8) \
|
||||||
@ -135,8 +138,8 @@
|
|||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef bswap64
|
#ifndef byteswap64
|
||||||
# define bswap64(n) (uint64_t)( \
|
# define byteswap64(n) (uint64_t)( \
|
||||||
(((n) & UINT64_C(0x00000000000000FF)) << 56) \
|
(((n) & UINT64_C(0x00000000000000FF)) << 56) \
|
||||||
| (((n) & UINT64_C(0x000000000000FF00)) << 40) \
|
| (((n) & UINT64_C(0x000000000000FF00)) << 40) \
|
||||||
| (((n) & UINT64_C(0x0000000000FF0000)) << 24) \
|
| (((n) & UINT64_C(0x0000000000FF0000)) << 24) \
|
||||||
@ -160,23 +163,23 @@
|
|||||||
# define conv64be(num) ((uint64_t)(num))
|
# define conv64be(num) ((uint64_t)(num))
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv16le
|
# ifndef conv16le
|
||||||
# define conv16le(num) bswap16(num)
|
# define conv16le(num) byteswap16(num)
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv32le
|
# ifndef conv32le
|
||||||
# define conv32le(num) bswap32(num)
|
# define conv32le(num) byteswap32(num)
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv64le
|
# ifndef conv64le
|
||||||
# define conv64le(num) bswap64(num)
|
# define conv64le(num) byteswap64(num)
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
# ifndef conv16be
|
# ifndef conv16be
|
||||||
# define conv16be(num) bswap16(num)
|
# define conv16be(num) byteswap16(num)
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv32be
|
# ifndef conv32be
|
||||||
# define conv32be(num) bswap32(num)
|
# define conv32be(num) byteswap32(num)
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv64be
|
# ifndef conv64be
|
||||||
# define conv64be(num) bswap64(num)
|
# define conv64be(num) byteswap64(num)
|
||||||
# endif
|
# endif
|
||||||
# ifndef conv16le
|
# ifndef conv16le
|
||||||
# define conv16le(num) ((uint16_t)(num))
|
# define conv16le(num) ((uint16_t)(num))
|
||||||
@ -624,7 +627,7 @@ write64le(uint8_t *buf, uint64_t num)
|
|||||||
// aligned but some compilers have language extensions to do that. With
|
// aligned but some compilers have language extensions to do that. With
|
||||||
// such language extensions the memcpy() method gives excellent results.
|
// such language extensions the memcpy() method gives excellent results.
|
||||||
//
|
//
|
||||||
// What to do on a strict-align system when no known language extentensions
|
// What to do on a strict-align system when no known language extensions
|
||||||
// are available? Falling back to byte-by-byte access would be safe but ruin
|
// are available? Falling back to byte-by-byte access would be safe but ruin
|
||||||
// optimizations that have been made specifically with aligned access in mind.
|
// optimizations that have been made specifically with aligned access in mind.
|
||||||
// As a compromise, aligned reads will fall back to non-compliant type punning
|
// As a compromise, aligned reads will fall back to non-compliant type punning
|
||||||
|
@ -20,7 +20,7 @@ liblzma_la_CPPFLAGS = \
|
|||||||
-I$(top_srcdir)/src/liblzma/simple \
|
-I$(top_srcdir)/src/liblzma/simple \
|
||||||
-I$(top_srcdir)/src/common \
|
-I$(top_srcdir)/src/common \
|
||||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||||
liblzma_la_LDFLAGS = -no-undefined -version-info 10:99:5
|
liblzma_la_LDFLAGS = -no-undefined -version-info 11:2:6
|
||||||
|
|
||||||
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
||||||
if COND_SYMVERS_GENERIC
|
if COND_SYMVERS_GENERIC
|
||||||
|
@ -17,3 +17,22 @@ nobase_include_HEADERS = \
|
|||||||
lzma/stream_flags.h \
|
lzma/stream_flags.h \
|
||||||
lzma/version.h \
|
lzma/version.h \
|
||||||
lzma/vli.h
|
lzma/vli.h
|
||||||
|
|
||||||
|
if COND_DOXYGEN
|
||||||
|
$(top_builddir)/doc/api/index.html: $(top_srcdir)/doxygen/update-doxygen $(top_srcdir)/doxygen/Doxyfile $(nobase_include_HEADERS)
|
||||||
|
$(MKDIR_P) "$(top_builddir)/doc"
|
||||||
|
"$(top_srcdir)/doxygen/update-doxygen" api \
|
||||||
|
"$(top_srcdir)" "$(top_builddir)/doc"
|
||||||
|
|
||||||
|
all-local: $(top_builddir)/doc/api/index.html
|
||||||
|
|
||||||
|
install-data-local:
|
||||||
|
$(MKDIR_P) "$(DESTDIR)$(docdir)/api"
|
||||||
|
$(INSTALL_DATA) "$(top_builddir)"/doc/api/* "$(DESTDIR)$(docdir)/api"
|
||||||
|
|
||||||
|
uninstall-local:
|
||||||
|
rm -rf "$(DESTDIR)$(docdir)/api"
|
||||||
|
|
||||||
|
clean-local:
|
||||||
|
rm -rf "$(top_builddir)/doc/api"
|
||||||
|
endif
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
* headers) streams are supported. Multiple compression algorithms (filters)
|
* headers) streams are supported. Multiple compression algorithms (filters)
|
||||||
* are supported. Currently LZMA2 is the primary filter.
|
* are supported. Currently LZMA2 is the primary filter.
|
||||||
*
|
*
|
||||||
* liblzma is part of XZ Utils <https://xz.tukaani.org/xz-utils/>. XZ Utils
|
* liblzma is part of XZ Utils <https://tukaani.org/xz/>. XZ Utils
|
||||||
* includes a gzip-like command line tool named xz and some other tools.
|
* includes a gzip-like command line tool named xz and some other tools.
|
||||||
* XZ Utils is developed and maintained by Lasse Collin and Jia Tan.
|
* XZ Utils is developed and maintained by Lasse Collin.
|
||||||
*
|
*
|
||||||
* Major parts of liblzma are based on code written by Igor Pavlov,
|
* Major parts of liblzma are based on code written by Igor Pavlov,
|
||||||
* specifically the LZMA SDK <https://7-zip.org/sdk.html>.
|
* specifically the LZMA SDK <https://7-zip.org/sdk.html>.
|
||||||
|
@ -257,7 +257,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These eumerations may be used internally by liblzma
|
* These enumerations may be used internally by liblzma
|
||||||
* but they will never be returned to applications.
|
* but they will never be returned to applications.
|
||||||
*/
|
*/
|
||||||
LZMA_RET_INTERNAL1 = 101,
|
LZMA_RET_INTERNAL1 = 101,
|
||||||
|
@ -792,7 +792,7 @@ extern LZMA_API(lzma_ret) lzma_stream_decoder_mt(
|
|||||||
* as it doesn't support any decoder flags. It will return LZMA_STREAM_END
|
* as it doesn't support any decoder flags. It will return LZMA_STREAM_END
|
||||||
* after one .lzma stream.)
|
* after one .lzma stream.)
|
||||||
*
|
*
|
||||||
* \param strm Pointer to lzma_stream that is at least initialized
|
* \param strm Pointer to lzma_stream that is at least initialized
|
||||||
* with LZMA_STREAM_INIT.
|
* with LZMA_STREAM_INIT.
|
||||||
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
|
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
|
||||||
* to effectively disable the limiter. liblzma
|
* to effectively disable the limiter. liblzma
|
||||||
|
@ -233,7 +233,7 @@ typedef struct {
|
|||||||
} block;
|
} block;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \private Internal struct.
|
* \private Internal data
|
||||||
*
|
*
|
||||||
* Internal data which is used to store the state of the iterator.
|
* Internal data which is used to store the state of the iterator.
|
||||||
* The exact format may vary between liblzma versions, so don't
|
* The exact format may vary between liblzma versions, so don't
|
||||||
@ -673,7 +673,7 @@ extern LZMA_API(lzma_bool) lzma_index_iter_locate(
|
|||||||
* function succeeds, the memory allocated for src
|
* function succeeds, the memory allocated for src
|
||||||
* is freed or moved to be part of dest, and all
|
* is freed or moved to be part of dest, and all
|
||||||
* iterators pointing to src will become invalid.
|
* iterators pointing to src will become invalid.
|
||||||
* \param allocator lzma_allocator for custom allocator functions.
|
* \param allocator lzma_allocator for custom allocator functions.
|
||||||
* Set to NULL to use malloc() and free().
|
* Set to NULL to use malloc() and free().
|
||||||
*
|
*
|
||||||
* \return Possible lzma_ret values:
|
* \return Possible lzma_ret values:
|
||||||
@ -793,7 +793,7 @@ extern LZMA_API(lzma_ret) lzma_index_buffer_encode(const lzma_index *i,
|
|||||||
* lzma_index is allowed to require. The value
|
* lzma_index is allowed to require. The value
|
||||||
* pointed by this pointer is modified if and only
|
* pointed by this pointer is modified if and only
|
||||||
* if LZMA_MEMLIMIT_ERROR is returned.
|
* if LZMA_MEMLIMIT_ERROR is returned.
|
||||||
* \param allocator lzma_allocator for custom allocator functions.
|
* \param allocator lzma_allocator for custom allocator functions.
|
||||||
* Set to NULL to use malloc() and free().
|
* Set to NULL to use malloc() and free().
|
||||||
* \param in Beginning of the input buffer
|
* \param in Beginning of the input buffer
|
||||||
* \param in_pos The next byte will be read from in[*in_pos].
|
* \param in_pos The next byte will be read from in[*in_pos].
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#define LZMA_VERSION_MAJOR 5
|
#define LZMA_VERSION_MAJOR 5
|
||||||
|
|
||||||
/** \brief Minor version number of the liblzma release. */
|
/** \brief Minor version number of the liblzma release. */
|
||||||
#define LZMA_VERSION_MINOR 5
|
#define LZMA_VERSION_MINOR 6
|
||||||
|
|
||||||
/** \brief Patch version number of the liblzma release. */
|
/** \brief Patch version number of the liblzma release. */
|
||||||
#define LZMA_VERSION_PATCH 2
|
#define LZMA_VERSION_PATCH 2
|
||||||
@ -32,7 +32,7 @@
|
|||||||
* - LZMA_VERSION_STABILITY_BETA
|
* - LZMA_VERSION_STABILITY_BETA
|
||||||
* - LZMA_VERSION_STABILITY_STABLE
|
* - LZMA_VERSION_STABILITY_STABLE
|
||||||
*/
|
*/
|
||||||
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_BETA
|
#define LZMA_VERSION_STABILITY LZMA_VERSION_STABILITY_STABLE
|
||||||
|
|
||||||
/** \brief Commit version number of the liblzma release */
|
/** \brief Commit version number of the liblzma release */
|
||||||
#ifndef LZMA_VERSION_COMMIT
|
#ifndef LZMA_VERSION_COMMIT
|
||||||
|
@ -67,9 +67,8 @@ typedef uint64_t lzma_vli;
|
|||||||
* This is useful to test that application has given acceptable values
|
* This is useful to test that application has given acceptable values
|
||||||
* for example in the uncompressed_size and compressed_size variables.
|
* for example in the uncompressed_size and compressed_size variables.
|
||||||
*
|
*
|
||||||
* \return True if the integer is representable as VLI or if it
|
* \return True if the integer is representable as a VLI or if it
|
||||||
* indicates unknown value. False if the integer cannot be
|
* indicates an unknown value. False otherwise.
|
||||||
* represented as VLI.
|
|
||||||
*/
|
*/
|
||||||
#define lzma_vli_is_valid(vli) \
|
#define lzma_vli_is_valid(vli) \
|
||||||
((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
|
((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifndef LZMA_CRC32_ARM64_H
|
#ifndef LZMA_CRC32_ARM64_H
|
||||||
#define LZMA_CRC32_ARM64_H
|
#define LZMA_CRC32_ARM64_H
|
||||||
|
|
||||||
@ -21,6 +20,8 @@
|
|||||||
# include <arm_acle.h>
|
# include <arm_acle.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// If both versions are going to be built, we need runtime detection
|
||||||
|
// to check if the instructions are supported.
|
||||||
#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
|
#if defined(CRC32_GENERIC) && defined(CRC32_ARCH_OPTIMIZED)
|
||||||
# if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
|
# if defined(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
|
||||||
# include <sys/auxv.h>
|
# include <sys/auxv.h>
|
||||||
@ -36,8 +37,7 @@
|
|||||||
//
|
//
|
||||||
// NOTE: Build systems check for this too, keep them in sync with this.
|
// NOTE: Build systems check for this too, keep them in sync with this.
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||||
# define crc_attr_target \
|
# define crc_attr_target __attribute__((__target__("+crc")))
|
||||||
__attribute__((__target__("+crc")))
|
|
||||||
#else
|
#else
|
||||||
# define crc_attr_target
|
# define crc_attr_target
|
||||||
#endif
|
#endif
|
||||||
@ -51,7 +51,7 @@ crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
|
|
||||||
// Align the input buffer because this was shown to be
|
// Align the input buffer because this was shown to be
|
||||||
// significantly faster than unaligned accesses.
|
// significantly faster than unaligned accesses.
|
||||||
const size_t align_amount = my_min(size, (8 - (uintptr_t)buf) & 7);
|
const size_t align_amount = my_min(size, (0U - (uintptr_t)buf) & 7);
|
||||||
|
|
||||||
for (const uint8_t *limit = buf + align_amount; buf < limit; ++buf)
|
for (const uint8_t *limit = buf + align_amount; buf < limit; ++buf)
|
||||||
crc = __crc32b(crc, *buf);
|
crc = __crc32b(crc, *buf);
|
||||||
@ -62,7 +62,7 @@ crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
// ignoring the least significant three bits of size to ensure
|
// ignoring the least significant three bits of size to ensure
|
||||||
// we do not process past the bounds of the buffer. This guarantees
|
// we do not process past the bounds of the buffer. This guarantees
|
||||||
// that limit is a multiple of 8 and is strictly less than size.
|
// that limit is a multiple of 8 and is strictly less than size.
|
||||||
for (const uint8_t *limit = buf + (size & ~((size_t)7));
|
for (const uint8_t *limit = buf + (size & ~(size_t)7);
|
||||||
buf < limit; buf += 8)
|
buf < limit; buf += 8)
|
||||||
crc = __crc32d(crc, aligned_read64le(buf));
|
crc = __crc32d(crc, aligned_read64le(buf));
|
||||||
|
|
||||||
@ -84,8 +84,10 @@ is_arch_extension_supported(void)
|
|||||||
#elif defined(HAVE_ELF_AUX_INFO)
|
#elif defined(HAVE_ELF_AUX_INFO)
|
||||||
unsigned long feature_flags;
|
unsigned long feature_flags;
|
||||||
|
|
||||||
elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags));
|
if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0)
|
||||||
return feature_flags & HWCAP_CRC32 != 0;
|
return false;
|
||||||
|
|
||||||
|
return (feature_flags & HWCAP_CRC32) != 0;
|
||||||
|
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
return IsProcessorFeaturePresent(
|
return IsProcessorFeaturePresent(
|
||||||
@ -98,11 +100,12 @@ is_arch_extension_supported(void)
|
|||||||
// The sysctlbyname() function requires a string identifier for the
|
// The sysctlbyname() function requires a string identifier for the
|
||||||
// CPU feature it tests. The Apple documentation lists the string
|
// CPU feature it tests. The Apple documentation lists the string
|
||||||
// "hw.optional.armv8_crc32", which can be found here:
|
// "hw.optional.armv8_crc32", which can be found here:
|
||||||
// (https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619)
|
// https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619
|
||||||
int err = sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
|
if (sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
|
||||||
&size, NULL, 0);
|
&size, NULL, 0) != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
return !err && has_crc32;
|
return has_crc32;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// If a runtime detection method cannot be found, then this must
|
// If a runtime detection method cannot be found, then this must
|
||||||
|
@ -34,7 +34,7 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
crc = ~crc;
|
crc = ~crc;
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
crc = bswap32(crc);
|
crc = byteswap32(crc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (size > 8) {
|
if (size > 8) {
|
||||||
@ -80,7 +80,7 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc);
|
crc = lzma_crc32_table[0][*buf++ ^ A(crc)] ^ S8(crc);
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
crc = bswap32(crc);
|
crc = byteswap32(crc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ~crc;
|
return ~crc;
|
||||||
@ -97,24 +97,14 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
// If both the generic and arch-optimized implementations are built, then
|
// If both the generic and arch-optimized implementations are built, then
|
||||||
// the function to use is selected at runtime because the system running
|
// the function to use is selected at runtime because the system running
|
||||||
// the binary might not have the arch-specific instruction set extension(s)
|
// the binary might not have the arch-specific instruction set extension(s)
|
||||||
// available. The three dispatch methods in order of priority:
|
// available. The dispatch methods in order of priority:
|
||||||
//
|
//
|
||||||
// 1. Indirect function (ifunc). This method is slightly more efficient
|
// 1. Constructor. This method uses __attribute__((__constructor__)) to
|
||||||
// than the constructor method because it will change the entry in the
|
|
||||||
// Procedure Linkage Table (PLT) for the function either at load time or
|
|
||||||
// at the first call. This avoids having to call the function through a
|
|
||||||
// function pointer and will treat the function call like a regular call
|
|
||||||
// through the PLT. ifuncs are created by using
|
|
||||||
// __attribute__((__ifunc__("resolver"))) on a function which has no
|
|
||||||
// body. The "resolver" is the name of the function that chooses at
|
|
||||||
// runtime which implementation to use.
|
|
||||||
//
|
|
||||||
// 2. Constructor. This method uses __attribute__((__constructor__)) to
|
|
||||||
// set crc32_func at load time. This avoids extra computation (and any
|
// set crc32_func at load time. This avoids extra computation (and any
|
||||||
// unlikely threading bugs) on the first call to lzma_crc32() to decide
|
// unlikely threading bugs) on the first call to lzma_crc32() to decide
|
||||||
// which implementation should be used.
|
// which implementation should be used.
|
||||||
//
|
//
|
||||||
// 3. First Call Resolution. On the very first call to lzma_crc32(), the
|
// 2. First Call Resolution. On the very first call to lzma_crc32(), the
|
||||||
// call will be directed to crc32_dispatch() instead. This will set the
|
// call will be directed to crc32_dispatch() instead. This will set the
|
||||||
// appropriate implementation function and will not be called again.
|
// appropriate implementation function and will not be called again.
|
||||||
// This method does not use any kind of locking but is safe because if
|
// This method does not use any kind of locking but is safe because if
|
||||||
@ -124,17 +114,7 @@ crc32_generic(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
typedef uint32_t (*crc32_func_type)(
|
typedef uint32_t (*crc32_func_type)(
|
||||||
const uint8_t *buf, size_t size, uint32_t crc);
|
const uint8_t *buf, size_t size, uint32_t crc);
|
||||||
|
|
||||||
// Clang 16.0.0 and older has a bug where it marks the ifunc resolver
|
// This resolver is shared between all dispatch methods.
|
||||||
// function as unused since it is static and never used outside of
|
|
||||||
// __attribute__((__ifunc__())).
|
|
||||||
#if defined(CRC_USE_IFUNC) && defined(__clang__)
|
|
||||||
# pragma GCC diagnostic push
|
|
||||||
# pragma GCC diagnostic ignored "-Wunused-function"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This resolver is shared between all three dispatch methods. It serves as
|
|
||||||
// the ifunc resolver if ifunc is supported, otherwise it is called as a
|
|
||||||
// regular function by the constructor or first call resolution methods.
|
|
||||||
static crc32_func_type
|
static crc32_func_type
|
||||||
crc32_resolve(void)
|
crc32_resolve(void)
|
||||||
{
|
{
|
||||||
@ -142,11 +122,6 @@ crc32_resolve(void)
|
|||||||
? &crc32_arch_optimized : &crc32_generic;
|
? &crc32_arch_optimized : &crc32_generic;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CRC_USE_IFUNC) && defined(__clang__)
|
|
||||||
# pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CRC_USE_IFUNC
|
|
||||||
|
|
||||||
#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
|
#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
|
||||||
// Constructor method.
|
// Constructor method.
|
||||||
@ -171,8 +146,7 @@ crc32_set_func(void)
|
|||||||
static uint32_t
|
static uint32_t
|
||||||
crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc)
|
crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc)
|
||||||
{
|
{
|
||||||
// When __attribute__((__ifunc__(...))) and
|
// When __attribute__((__constructor__)) isn't supported, set the
|
||||||
// __attribute__((__constructor__)) isn't supported, set the
|
|
||||||
// function pointer without any locking. If multiple threads run
|
// function pointer without any locking. If multiple threads run
|
||||||
// the detection code in parallel, they will all end up setting
|
// the detection code in parallel, they will all end up setting
|
||||||
// the pointer to the same value. This avoids the use of
|
// the pointer to the same value. This avoids the use of
|
||||||
@ -184,14 +158,8 @@ crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CRC_USE_IFUNC
|
|
||||||
extern LZMA_API(uint32_t)
|
|
||||||
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
|
|
||||||
__attribute__((__ifunc__("crc32_resolve")));
|
|
||||||
#else
|
|
||||||
extern LZMA_API(uint32_t)
|
extern LZMA_API(uint32_t)
|
||||||
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
|
lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
|
||||||
{
|
{
|
||||||
@ -234,4 +202,3 @@ lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc)
|
|||||||
return crc32_generic(buf, size, crc);
|
return crc32_generic(buf, size, crc);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -17,18 +17,16 @@
|
|||||||
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
||||||
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
||||||
|| (defined(__e2k__) && __iset__ >= 6))
|
|| (defined(__e2k__) && __iset__ >= 6))
|
||||||
# define X86_CLMUL_NO_TABLE 1
|
# define NO_CRC32_TABLE
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_ARM64_CRC32) \
|
#elif defined(HAVE_ARM64_CRC32) \
|
||||||
&& !defined(WORDS_BIGENDIAN) \
|
&& !defined(WORDS_BIGENDIAN) \
|
||||||
&& defined(__ARM_FEATURE_CRC32)
|
&& defined(__ARM_FEATURE_CRC32)
|
||||||
# define ARM64_CRC32_NO_TABLE 1
|
# define NO_CRC32_TABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if !defined(HAVE_ENCODERS) && (defined(X86_CLMUL_NO_TABLE) \
|
#if !defined(HAVE_ENCODERS) && defined(NO_CRC32_TABLE)
|
||||||
|| defined(ARM64_CRC32_NO_TABLE_))
|
|
||||||
// No table needed. Use a typedef to avoid an empty translation unit.
|
// No table needed. Use a typedef to avoid an empty translation unit.
|
||||||
typedef void lzma_crc32_dummy;
|
typedef void lzma_crc32_dummy;
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ init_crc32_table(void)
|
|||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
for (size_t s = 0; s < 8; ++s)
|
for (size_t s = 0; s < 8; ++s)
|
||||||
for (size_t b = 0; b < 256; ++b)
|
for (size_t b = 0; b < 256; ++b)
|
||||||
crc32_table[s][b] = bswap32(crc32_table[s][b]);
|
crc32_table[s][b] = byteswap32(crc32_table[s][b]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -39,7 +39,7 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
crc = ~crc;
|
crc = ~crc;
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
crc = bswap64(crc);
|
crc = byteswap64(crc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (size > 4) {
|
if (size > 4) {
|
||||||
@ -73,7 +73,7 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc);
|
crc = lzma_crc64_table[0][*buf++ ^ A1(crc)] ^ S8(crc);
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
crc = bswap64(crc);
|
crc = byteswap64(crc);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ~crc;
|
return ~crc;
|
||||||
@ -93,11 +93,6 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
typedef uint64_t (*crc64_func_type)(
|
typedef uint64_t (*crc64_func_type)(
|
||||||
const uint8_t *buf, size_t size, uint64_t crc);
|
const uint8_t *buf, size_t size, uint64_t crc);
|
||||||
|
|
||||||
#if defined(CRC_USE_IFUNC) && defined(__clang__)
|
|
||||||
# pragma GCC diagnostic push
|
|
||||||
# pragma GCC diagnostic ignored "-Wunused-function"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static crc64_func_type
|
static crc64_func_type
|
||||||
crc64_resolve(void)
|
crc64_resolve(void)
|
||||||
{
|
{
|
||||||
@ -105,12 +100,6 @@ crc64_resolve(void)
|
|||||||
? &crc64_arch_optimized : &crc64_generic;
|
? &crc64_arch_optimized : &crc64_generic;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CRC_USE_IFUNC) && defined(__clang__)
|
|
||||||
# pragma GCC diagnostic pop
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef CRC_USE_IFUNC
|
|
||||||
|
|
||||||
#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
|
#ifdef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR
|
||||||
# define CRC64_SET_FUNC_ATTR __attribute__((__constructor__))
|
# define CRC64_SET_FUNC_ATTR __attribute__((__constructor__))
|
||||||
static crc64_func_type crc64_func;
|
static crc64_func_type crc64_func;
|
||||||
@ -139,14 +128,8 @@ crc64_dispatch(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef CRC_USE_IFUNC
|
|
||||||
extern LZMA_API(uint64_t)
|
|
||||||
lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
|
|
||||||
__attribute__((__ifunc__("crc64_resolve")));
|
|
||||||
#else
|
|
||||||
extern LZMA_API(uint64_t)
|
extern LZMA_API(uint64_t)
|
||||||
lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
|
lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
|
||||||
{
|
{
|
||||||
@ -171,4 +154,3 @@ lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
return crc64_generic(buf, size, crc);
|
return crc64_generic(buf, size, crc);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
@ -17,11 +17,11 @@
|
|||||||
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
||||||
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
||||||
|| (defined(__e2k__) && __iset__ >= 6))
|
|| (defined(__e2k__) && __iset__ >= 6))
|
||||||
# define X86_CLMUL_NO_TABLE 1
|
# define NO_CRC64_TABLE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef X86_CLMUL_NO_TABLE
|
#ifdef NO_CRC64_TABLE
|
||||||
// No table needed. Use a typedef to avoid an empty translation unit.
|
// No table needed. Use a typedef to avoid an empty translation unit.
|
||||||
typedef void lzma_crc64_dummy;
|
typedef void lzma_crc64_dummy;
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ init_crc64_table(void)
|
|||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
for (size_t s = 0; s < 4; ++s)
|
for (size_t s = 0; s < 4; ++s)
|
||||||
for (size_t b = 0; b < 256; ++b)
|
for (size_t b = 0; b < 256; ++b)
|
||||||
crc64_table[s][b] = bswap64(crc64_table[s][b]);
|
crc64_table[s][b] = byteswap64(crc64_table[s][b]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -67,8 +67,6 @@
|
|||||||
#undef CRC32_ARM64
|
#undef CRC32_ARM64
|
||||||
#undef CRC64_ARM64_CLMUL
|
#undef CRC64_ARM64_CLMUL
|
||||||
|
|
||||||
#undef CRC_USE_IFUNC
|
|
||||||
|
|
||||||
#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
|
#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
|
||||||
|
|
||||||
// ARM64 CRC32 instruction is only useful for CRC32. Currently, only
|
// ARM64 CRC32 instruction is only useful for CRC32. Currently, only
|
||||||
@ -76,7 +74,7 @@
|
|||||||
// endian machine.
|
// endian machine.
|
||||||
//
|
//
|
||||||
// NOTE: Keep this and the next check in sync with the macro
|
// NOTE: Keep this and the next check in sync with the macro
|
||||||
// ARM64_CRC32_NO_TABLE in crc32_table.c
|
// NO_CRC32_TABLE in crc32_table.c
|
||||||
#if defined(HAVE_ARM64_CRC32) && !defined(WORDS_BIGENDIAN)
|
#if defined(HAVE_ARM64_CRC32) && !defined(WORDS_BIGENDIAN)
|
||||||
// Allow ARM64 CRC32 instruction without a runtime check if
|
// Allow ARM64 CRC32 instruction without a runtime check if
|
||||||
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
|
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
|
||||||
@ -96,7 +94,8 @@
|
|||||||
// generic version can be omitted. Note that this doesn't work with MSVC
|
// generic version can be omitted. Note that this doesn't work with MSVC
|
||||||
// as I don't know how to detect the features here.
|
// as I don't know how to detect the features here.
|
||||||
//
|
//
|
||||||
// NOTE: Keep this in sync with the CLMUL_NO_TABLE macro in crc32_table.c.
|
// NOTE: Keep this in sync with the NO_CRC32_TABLE macro in crc32_table.c
|
||||||
|
// and NO_CRC64_TABLE in crc64_table.c.
|
||||||
# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
# if (defined(__SSSE3__) && defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
||||||
|| (defined(__e2k__) && __iset__ >= 6)
|
|| (defined(__e2k__) && __iset__ >= 6)
|
||||||
# define CRC32_ARCH_OPTIMIZED 1
|
# define CRC32_ARCH_OPTIMIZED 1
|
||||||
@ -109,9 +108,6 @@
|
|||||||
# define CRC64_ARCH_OPTIMIZED 1
|
# define CRC64_ARCH_OPTIMIZED 1
|
||||||
# define CRC_X86_CLMUL 1
|
# define CRC_X86_CLMUL 1
|
||||||
|
|
||||||
# ifdef HAVE_FUNC_ATTRIBUTE_IFUNC
|
|
||||||
# define CRC_USE_IFUNC 1
|
|
||||||
# endif
|
|
||||||
/*
|
/*
|
||||||
// The generic code is much faster with 1-8-byte inputs and
|
// The generic code is much faster with 1-8-byte inputs and
|
||||||
// has similar performance up to 16 bytes at least in
|
// has similar performance up to 16 bytes at least in
|
||||||
@ -121,9 +117,7 @@
|
|||||||
// for bigger inputs. It saves a little in code size since
|
// for bigger inputs. It saves a little in code size since
|
||||||
// the special cases for 0-16-byte inputs will be omitted
|
// the special cases for 0-16-byte inputs will be omitted
|
||||||
// from the CLMUL code.
|
// from the CLMUL code.
|
||||||
# ifndef CRC_USE_IFUNC
|
# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
|
||||||
# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
|
|
||||||
# endif
|
|
||||||
*/
|
*/
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -385,15 +385,8 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
|
|||||||
#endif // BUILDING_CRC64_CLMUL
|
#endif // BUILDING_CRC64_CLMUL
|
||||||
|
|
||||||
|
|
||||||
// is_arch_extension_supported() must be inlined in this header file because
|
// Inlining this function duplicates the function body in crc32_resolve() and
|
||||||
// the ifunc resolver function may not support calling a function in another
|
// crc64_resolve(), but this is acceptable because this is a tiny function.
|
||||||
// translation unit. Depending on compiler-toolchain and flags, a call to
|
|
||||||
// a function defined in another translation unit could result in a
|
|
||||||
// reference to the PLT, which is unsafe to do in an ifunc resolver. The
|
|
||||||
// ifunc resolver runs very early when loading a shared library, so the PLT
|
|
||||||
// entries may not be setup at that time. Inlining this function duplicates
|
|
||||||
// the function body in crc32_resolve() and crc64_resolve(), but this is
|
|
||||||
// acceptable because the function results in very few instructions.
|
|
||||||
static inline bool
|
static inline bool
|
||||||
is_arch_extension_supported(void)
|
is_arch_extension_supported(void)
|
||||||
{
|
{
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef LZMA_EASY_PRESET_H
|
||||||
|
#define LZMA_EASY_PRESET_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
|
||||||
@ -29,3 +32,5 @@ typedef struct {
|
|||||||
/// Set *easy to the settings given by the preset. Returns true on error,
|
/// Set *easy to the settings given by the preset. Returns true on error,
|
||||||
/// false on success.
|
/// false on success.
|
||||||
extern bool lzma_easy_preset(lzma_options_easy *easy, uint32_t preset);
|
extern bool lzma_easy_preset(lzma_options_easy *easy, uint32_t preset);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -23,7 +23,7 @@ lzma_raw_buffer_decode(
|
|||||||
|| out_pos == NULL || *out_pos > out_size)
|
|| out_pos == NULL || *out_pos > out_size)
|
||||||
return LZMA_PROG_ERROR;
|
return LZMA_PROG_ERROR;
|
||||||
|
|
||||||
// Initialize the decoer.
|
// Initialize the decoder.
|
||||||
lzma_next_coder next = LZMA_NEXT_CODER_INIT;
|
lzma_next_coder next = LZMA_NEXT_CODER_INIT;
|
||||||
return_if_error(lzma_raw_decoder_init(&next, allocator, filters));
|
return_if_error(lzma_raw_decoder_init(&next, allocator, filters));
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ lzma_filters_copy(const lzma_filter *src, lzma_filter *real_dest,
|
|||||||
return LZMA_PROG_ERROR;
|
return LZMA_PROG_ERROR;
|
||||||
|
|
||||||
// Use a temporary destination so that the real destination
|
// Use a temporary destination so that the real destination
|
||||||
// will never be modied if an error occurs.
|
// will never be modified if an error occurs.
|
||||||
lzma_filter dest[LZMA_FILTERS_MAX + 1];
|
lzma_filter dest[LZMA_FILTERS_MAX + 1];
|
||||||
|
|
||||||
lzma_ret ret;
|
lzma_ret ret;
|
||||||
|
@ -150,6 +150,16 @@ decoder_find(lzma_vli id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// lzma_filter_coder begins with the same members as lzma_filter_decoder.
|
||||||
|
// This function is a wrapper with a type that is compatible with the
|
||||||
|
// typedef of lzma_filter_find in filter_common.h.
|
||||||
|
static const lzma_filter_coder *
|
||||||
|
coder_find(lzma_vli id)
|
||||||
|
{
|
||||||
|
return (const lzma_filter_coder *)decoder_find(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern LZMA_API(lzma_bool)
|
extern LZMA_API(lzma_bool)
|
||||||
lzma_filter_decoder_is_supported(lzma_vli id)
|
lzma_filter_decoder_is_supported(lzma_vli id)
|
||||||
{
|
{
|
||||||
@ -162,7 +172,7 @@ lzma_raw_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
|||||||
const lzma_filter *options)
|
const lzma_filter *options)
|
||||||
{
|
{
|
||||||
return lzma_raw_coder_init(next, allocator,
|
return lzma_raw_coder_init(next, allocator,
|
||||||
options, (lzma_filter_find)(&decoder_find), false);
|
options, &coder_find, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -181,8 +191,7 @@ lzma_raw_decoder(lzma_stream *strm, const lzma_filter *options)
|
|||||||
extern LZMA_API(uint64_t)
|
extern LZMA_API(uint64_t)
|
||||||
lzma_raw_decoder_memusage(const lzma_filter *filters)
|
lzma_raw_decoder_memusage(const lzma_filter *filters)
|
||||||
{
|
{
|
||||||
return lzma_raw_coder_memusage(
|
return lzma_raw_coder_memusage(&coder_find, filters);
|
||||||
(lzma_filter_find)(&decoder_find), filters);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -193,6 +193,16 @@ encoder_find(lzma_vli id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// lzma_filter_coder begins with the same members as lzma_filter_encoder.
|
||||||
|
// This function is a wrapper with a type that is compatible with the
|
||||||
|
// typedef of lzma_filter_find in filter_common.h.
|
||||||
|
static const lzma_filter_coder *
|
||||||
|
coder_find(lzma_vli id)
|
||||||
|
{
|
||||||
|
return (const lzma_filter_coder *)encoder_find(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
extern LZMA_API(lzma_bool)
|
extern LZMA_API(lzma_bool)
|
||||||
lzma_filter_encoder_is_supported(lzma_vli id)
|
lzma_filter_encoder_is_supported(lzma_vli id)
|
||||||
{
|
{
|
||||||
@ -232,7 +242,7 @@ lzma_raw_encoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
|||||||
const lzma_filter *filters)
|
const lzma_filter *filters)
|
||||||
{
|
{
|
||||||
return lzma_raw_coder_init(next, allocator,
|
return lzma_raw_coder_init(next, allocator,
|
||||||
filters, (lzma_filter_find)(&encoder_find), true);
|
filters, &coder_find, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -240,7 +250,7 @@ extern LZMA_API(lzma_ret)
|
|||||||
lzma_raw_encoder(lzma_stream *strm, const lzma_filter *filters)
|
lzma_raw_encoder(lzma_stream *strm, const lzma_filter *filters)
|
||||||
{
|
{
|
||||||
lzma_next_strm_init(lzma_raw_coder_init, strm, filters,
|
lzma_next_strm_init(lzma_raw_coder_init, strm, filters,
|
||||||
(lzma_filter_find)(&encoder_find), true);
|
&coder_find, true);
|
||||||
|
|
||||||
strm->internal->supported_actions[LZMA_RUN] = true;
|
strm->internal->supported_actions[LZMA_RUN] = true;
|
||||||
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
|
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;
|
||||||
@ -253,8 +263,7 @@ lzma_raw_encoder(lzma_stream *strm, const lzma_filter *filters)
|
|||||||
extern LZMA_API(uint64_t)
|
extern LZMA_API(uint64_t)
|
||||||
lzma_raw_encoder_memusage(const lzma_filter *filters)
|
lzma_raw_encoder_memusage(const lzma_filter *filters)
|
||||||
{
|
{
|
||||||
return lzma_raw_coder_memusage(
|
return lzma_raw_coder_memusage(&coder_find, filters);
|
||||||
(lzma_filter_find)(&encoder_find), filters);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,6 +305,12 @@ lzma_index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
|
|||||||
extern LZMA_API(lzma_ret)
|
extern LZMA_API(lzma_ret)
|
||||||
lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit)
|
lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit)
|
||||||
{
|
{
|
||||||
|
// If i isn't NULL, *i must always be initialized due to
|
||||||
|
// the wording in the API docs. This way it is initialized
|
||||||
|
// if we return LZMA_PROG_ERROR due to strm == NULL.
|
||||||
|
if (i != NULL)
|
||||||
|
*i = NULL;
|
||||||
|
|
||||||
lzma_next_strm_init(lzma_index_decoder_init, strm, i, memlimit);
|
lzma_next_strm_init(lzma_index_decoder_init, strm, i, memlimit);
|
||||||
|
|
||||||
strm->internal->supported_actions[LZMA_RUN] = true;
|
strm->internal->supported_actions[LZMA_RUN] = true;
|
||||||
@ -319,6 +325,11 @@ lzma_index_buffer_decode(lzma_index **i, uint64_t *memlimit,
|
|||||||
const lzma_allocator *allocator,
|
const lzma_allocator *allocator,
|
||||||
const uint8_t *in, size_t *in_pos, size_t in_size)
|
const uint8_t *in, size_t *in_pos, size_t in_size)
|
||||||
{
|
{
|
||||||
|
// If i isn't NULL, *i must always be initialized due to
|
||||||
|
// the wording in the API docs.
|
||||||
|
if (i != NULL)
|
||||||
|
*i = NULL;
|
||||||
|
|
||||||
// Sanity checks
|
// Sanity checks
|
||||||
if (i == NULL || memlimit == NULL
|
if (i == NULL || memlimit == NULL
|
||||||
|| in == NULL || in_pos == NULL || *in_pos > in_size)
|
|| in == NULL || in_pos == NULL || *in_pos > in_size)
|
||||||
|
@ -67,6 +67,19 @@ lzma_memcmplen(const uint8_t *buf1, const uint8_t *buf2,
|
|||||||
// This is only for x86-64 and ARM64 for now. This might be fine on
|
// This is only for x86-64 and ARM64 for now. This might be fine on
|
||||||
// other 64-bit processors too. On big endian one should use xor
|
// other 64-bit processors too. On big endian one should use xor
|
||||||
// instead of subtraction and switch to __builtin_clzll().
|
// instead of subtraction and switch to __builtin_clzll().
|
||||||
|
//
|
||||||
|
// Reasons to use subtraction instead of xor:
|
||||||
|
//
|
||||||
|
// - On some x86-64 processors (Intel Sandy Bridge to Tiger Lake),
|
||||||
|
// sub+jz and sub+jnz can be fused but xor+jz or xor+jnz cannot.
|
||||||
|
// Thus using subtraction has potential to be a tiny amount faster
|
||||||
|
// since the code checks if the quotient is non-zero.
|
||||||
|
//
|
||||||
|
// - Some processors (Intel Pentium 4) used to have more ALU
|
||||||
|
// resources for add/sub instructions than and/or/xor.
|
||||||
|
//
|
||||||
|
// The processor info is based on Agner Fog's microarchitecture.pdf
|
||||||
|
// version 2023-05-26. https://www.agner.org/optimize/
|
||||||
#define LZMA_MEMCMPLEN_EXTRA 8
|
#define LZMA_MEMCMPLEN_EXTRA 8
|
||||||
while (len < limit) {
|
while (len < limit) {
|
||||||
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
|
const uint64_t x = read64ne(buf1 + len) - read64ne(buf2 + len);
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef LZMA_OUTQUEUE_H
|
||||||
|
#define LZMA_OUTQUEUE_H
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
|
||||||
@ -251,3 +254,5 @@ lzma_outq_outbuf_memusage(size_t buf_size)
|
|||||||
assert(buf_size <= SIZE_MAX - sizeof(lzma_outbuf));
|
assert(buf_size <= SIZE_MAX - sizeof(lzma_outbuf));
|
||||||
return sizeof(lzma_outbuf) + buf_size;
|
return sizeof(lzma_outbuf) + buf_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -217,12 +217,14 @@ typedef struct {
|
|||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
// NVHPC has problems with unions that contain pointers that
|
||||||
|
// are not the first members, so keep "map" at the top.
|
||||||
|
const name_value_map *map;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
uint32_t min;
|
uint32_t min;
|
||||||
uint32_t max;
|
uint32_t max;
|
||||||
} range;
|
} range;
|
||||||
|
|
||||||
const name_value_map *map;
|
|
||||||
} u;
|
} u;
|
||||||
} option_map;
|
} option_map;
|
||||||
|
|
||||||
@ -1000,6 +1002,12 @@ extern LZMA_API(const char *)
|
|||||||
lzma_str_to_filters(const char *str, int *error_pos, lzma_filter *filters,
|
lzma_str_to_filters(const char *str, int *error_pos, lzma_filter *filters,
|
||||||
uint32_t flags, const lzma_allocator *allocator)
|
uint32_t flags, const lzma_allocator *allocator)
|
||||||
{
|
{
|
||||||
|
// If error_pos isn't NULL, *error_pos must always be set.
|
||||||
|
// liblzma <= 5.4.6 and <= 5.6.1 have a bug and don't do this
|
||||||
|
// when str == NULL or filters == NULL or flags are unsupported.
|
||||||
|
if (error_pos != NULL)
|
||||||
|
*error_pos = 0;
|
||||||
|
|
||||||
if (str == NULL || filters == NULL)
|
if (str == NULL || filters == NULL)
|
||||||
return "Unexpected NULL pointer argument(s) "
|
return "Unexpected NULL pointer argument(s) "
|
||||||
"to lzma_str_to_filters()";
|
"to lzma_str_to_filters()";
|
||||||
|
@ -25,6 +25,11 @@ decode_buffer(lzma_delta_coder *coder, uint8_t *buffer, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// For an unknown reason NVIDIA HPC Compiler needs this pragma
|
||||||
|
// to produce working code.
|
||||||
|
#ifdef __NVCOMPILER
|
||||||
|
# pragma routine novector
|
||||||
|
#endif
|
||||||
static lzma_ret
|
static lzma_ret
|
||||||
delta_decode(void *coder_ptr, const lzma_allocator *allocator,
|
delta_decode(void *coder_ptr, const lzma_allocator *allocator,
|
||||||
const uint8_t *restrict in, size_t *restrict in_pos,
|
const uint8_t *restrict in, size_t *restrict in_pos,
|
||||||
|
@ -122,7 +122,7 @@ global:
|
|||||||
lzma_str_to_filters;
|
lzma_str_to_filters;
|
||||||
} XZ_5.2;
|
} XZ_5.2;
|
||||||
|
|
||||||
XZ_5.5.2beta {
|
XZ_5.6.0 {
|
||||||
global:
|
global:
|
||||||
lzma_mt_block_size;
|
lzma_mt_block_size;
|
||||||
} XZ_5.4;
|
} XZ_5.4;
|
||||||
|
@ -137,7 +137,7 @@ global:
|
|||||||
lzma_str_to_filters;
|
lzma_str_to_filters;
|
||||||
} XZ_5.2;
|
} XZ_5.2;
|
||||||
|
|
||||||
XZ_5.5.2beta {
|
XZ_5.6.0 {
|
||||||
global:
|
global:
|
||||||
lzma_mt_block_size;
|
lzma_mt_block_size;
|
||||||
} XZ_5.4;
|
} XZ_5.4;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
// changing this check.
|
// changing this check.
|
||||||
#define IS_ENC_DICT_SIZE_VALID(size) \
|
#define IS_ENC_DICT_SIZE_VALID(size) \
|
||||||
((size) >= LZMA_DICT_SIZE_MIN \
|
((size) >= LZMA_DICT_SIZE_MIN \
|
||||||
&& (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29))
|
&& (size) <= (UINT32_C(1) << 30) + (UINT32_C(1) << 29))
|
||||||
|
|
||||||
|
|
||||||
/// A table of these is used by the LZ-based encoder to hold
|
/// A table of these is used by the LZ-based encoder to hold
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
// and different processors. Overall 0x1F0 seems to be the best choice.
|
// and different processors. Overall 0x1F0 seems to be the best choice.
|
||||||
#ifndef LZMA_RANGE_DECODER_CONFIG
|
#ifndef LZMA_RANGE_DECODER_CONFIG
|
||||||
# if defined(__x86_64__) && !defined(__ILP32__) \
|
# if defined(__x86_64__) && !defined(__ILP32__) \
|
||||||
|
&& !defined(__NVCOMPILER) \
|
||||||
&& (defined(__GNUC__) || defined(__clang__))
|
&& (defined(__GNUC__) || defined(__clang__))
|
||||||
# define LZMA_RANGE_DECODER_CONFIG 0x1F0
|
# define LZMA_RANGE_DECODER_CONFIG 0x1F0
|
||||||
# else
|
# else
|
||||||
|
@ -116,7 +116,7 @@ AUIPC with rd != x0
|
|||||||
Zfh, F, D, and Q:
|
Zfh, F, D, and Q:
|
||||||
* RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
|
* RV32I: LB, LH, LW, LBU, LHU, SB, SH, SW
|
||||||
* RV64I has also: LD, LWU, SD
|
* RV64I has also: LD, LWU, SD
|
||||||
* Zhf: FLH, FSH
|
* Zfh: FLH, FSH
|
||||||
* F: FLW, FSW
|
* F: FLW, FSW
|
||||||
* D: FLD, FSD
|
* D: FLD, FSD
|
||||||
* Q: FLQ, FSQ
|
* Q: FLQ, FSQ
|
||||||
@ -320,11 +320,11 @@ AUIPC with rd == x0
|
|||||||
// The left-hand side takes care of (1) and (2).
|
// The left-hand side takes care of (1) and (2).
|
||||||
// (a) The lowest 7 bits are already known to be AUIPC so subtracting 0x17
|
// (a) The lowest 7 bits are already known to be AUIPC so subtracting 0x17
|
||||||
// makes those bits zeros.
|
// makes those bits zeros.
|
||||||
// (b) If AUIPC rd equals x2, subtracting 0x10 makes bits [11:7] zeros.
|
// (b) If AUIPC rd equals x2, subtracting 0x100 makes bits [11:7] zeros.
|
||||||
// If rd doesn't equal x2, then there will be at least one non-zero bit
|
// If rd doesn't equal x2, then there will be at least one non-zero bit
|
||||||
// and the next step (c) is irrelevant.
|
// and the next step (c) is irrelevant.
|
||||||
// (c) If the lowest two opcode bits of the packed inst2 are set in [13:12],
|
// (c) If the lowest two opcode bits of the packed inst2 are set in [13:12],
|
||||||
// then subtracting 0x300 will make those bits zeros. Otherwise there
|
// then subtracting 0x3000 will make those bits zeros. Otherwise there
|
||||||
// will be at least one non-zero bit.
|
// will be at least one non-zero bit.
|
||||||
//
|
//
|
||||||
// The shift by 18 removes the high bits from the final '>=' comparison and
|
// The shift by 18 removes the high bits from the final '>=' comparison and
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user