mirror of
https://git.tukaani.org/xz.git
synced 2025-04-16 12:40:50 +00:00
Compare commits
278 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9331ce4009 | ||
|
f52857ffde | ||
|
b8f52990b5 | ||
|
51f6f45587 | ||
|
bf518b9ba4 | ||
|
5718ce932e | ||
|
e77c0ca61d | ||
|
e0ba0f26d9 | ||
|
69637d0c32 | ||
|
af8533459c | ||
|
eca08e4c20 | ||
|
85801c96c3 | ||
|
a341d19c83 | ||
|
e69c0b9b2e | ||
|
aef9a25b32 | ||
|
40a7f163f5 | ||
|
c98714a570 | ||
|
4ed4495178 | ||
|
3b83577a15 | ||
|
06f4c7edda | ||
|
406cb5b669 | ||
|
3a4a05d75e | ||
|
4669f06d1a | ||
|
9edddda563 | ||
|
1a93ab55d1 | ||
|
cfe4465742 | ||
|
0f47db18d0 | ||
|
07f52c3528 | ||
|
eccb4d258b | ||
|
c9bd00327f | ||
|
495de6ec9d | ||
|
55bf3f49a8 | ||
|
b45270d88f | ||
|
2c3e4cbbdc | ||
|
809e69f1f5 | ||
|
52a8c87f37 | ||
|
1591747bf6 | ||
|
cc386f4ff4 | ||
|
65aaa0f870 | ||
|
810f1a8aee | ||
|
dde14ded9a | ||
|
85a55e1120 | ||
|
e24a762f1b | ||
|
99555b721b | ||
|
258bae30a2 | ||
|
a95a9601a1 | ||
|
65a10ddd43 | ||
|
6ad5739094 | ||
|
4107f20667 | ||
|
ff697eb154 | ||
|
4e4a568f6a | ||
|
849e757a8c | ||
|
1305056a54 | ||
|
a44493ec41 | ||
|
5e74a6a813 | ||
|
3f7edc673c | ||
|
8a9cc7ca08 | ||
|
b29b13082f | ||
|
6f66155e01 | ||
|
5522759d31 | ||
|
45aed6f37f | ||
|
198271a6ed | ||
|
92e5425979 | ||
|
0c089a33a5 | ||
|
83d3792711 | ||
|
9c64d4fd78 | ||
|
42754176bd | ||
|
9a5fee7022 | ||
|
a2d66de54f | ||
|
1bdc70176b | ||
|
4132277103 | ||
|
1575414636 | ||
|
c3e293037e | ||
|
dc6b6011b4 | ||
|
7ce2ac795a | ||
|
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]
|
||||
|
||||
# Skip all translation files and a few other autogenerated files.
|
||||
# The autotool files should have their typos fixed in the upstream, but
|
||||
# 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
|
||||
# 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
|
||||
# changing a false positive or picking the wrong replacement.
|
||||
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.
|
73
.github/workflows/ci.yml
vendored
73
.github/workflows/ci.yml
vendored
@ -26,7 +26,7 @@ jobs:
|
||||
build_system: [autotools, cmake]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
|
||||
- uses: actions/checkout@v4.1.6
|
||||
|
||||
########################
|
||||
# Install Dependencies #
|
||||
@ -37,7 +37,7 @@ jobs:
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools
|
||||
sudo apt-get install -y autoconf automake build-essential po4a autopoint gcc-multilib doxygen musl-tools valgrind
|
||||
|
||||
# Install Autotools on Mac
|
||||
- name: Install Dependencies
|
||||
@ -70,90 +70,93 @@ jobs:
|
||||
# done first.
|
||||
- name: Build 32-bit
|
||||
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 -m "gcc -m32"
|
||||
- name: Test 32-bit
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||
run: |
|
||||
./build-aux/ci_build.sh -b autotools -p test -f "-m32" -n 32_bit
|
||||
./build-aux/ci_build.bash -b autotools -p test -m "gcc -m32" -n 32_bit
|
||||
cd ../xz_build && make distclean
|
||||
|
||||
# ifunc must be disabled for this test because __attribute__ ifunc is
|
||||
# incompatible with -fsanitize=address.
|
||||
#
|
||||
# The sandbox must also be disabled because it will prevent access to
|
||||
# The sandbox must be disabled because it will prevent access to
|
||||
# the /proc/ filesystem on Linux, which is used by the sanitizer's
|
||||
# instrumentation.
|
||||
- name: Build with -fsanitize=address,undefined
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||
run: ./build-aux/ci_build.sh -b autotools -p build -f "-fsanitize=address,undefined" -d ifunc,sandbox
|
||||
run: ./build-aux/ci_build.bash -b autotools -p build -f "-fsanitize=address,undefined" -d sandbox
|
||||
- name: Test with -fsanitize=address,undefined
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||
run: |
|
||||
./build-aux/ci_build.sh -b autotools -p test -f "-fsanitize=address,undefined" -d ifunc,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 --trace-children-skip-by-arg=ls,cp,sed,grep,bash,sh --exit-on-first-error=yes --error-exitcode=1"
|
||||
cd ../xz_build && make distclean
|
||||
|
||||
# musl libc has some slight differences compared to glibc, including
|
||||
# the lack of ifunc support. This tests if the ifunc detection
|
||||
# functions properly since musl-gcc can compile with ifunc support,
|
||||
# but will fail at runtime.
|
||||
- name: Build with musl libc
|
||||
if: ${{ matrix.os == 'ubuntu-latest'}}
|
||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
|
||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build -m "/usr/bin/musl-gcc"
|
||||
- name: Test with musl libc
|
||||
if: ${{ matrix.os == 'ubuntu-latest'}}
|
||||
run: |
|
||||
./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
|
||||
./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p test -m "/usr/bin/musl-gcc"
|
||||
- name: Clean up musl libc run
|
||||
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build_system == 'autotools' }}
|
||||
run: cd ../xz_build && make distclean
|
||||
|
||||
- name: Build with full features
|
||||
run: ./build-aux/ci_build.sh -b ${{ matrix.build_system }} -p build
|
||||
run: ./build-aux/ci_build.bash -b ${{ matrix.build_system }} -p build
|
||||
- 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
|
||||
- uses: actions/upload-artifact@v4.3.3
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: ${{ matrix.os }} ${{ matrix.build_system }} Test Logs
|
||||
|
32
.github/workflows/freebsd.yml
vendored
Normal file
32
.github/workflows/freebsd.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
# 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@v4.1.6
|
||||
- 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: |
|
||||
set -e
|
||||
export LC_ALL=C LANG=C
|
||||
uname -a
|
||||
./autogen.sh
|
||||
./configure --enable-werror
|
||||
make
|
||||
make check VERBOSE=1
|
32
.github/workflows/netbsd.yml
vendored
Normal file
32
.github/workflows/netbsd.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
# 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@v4.1.6
|
||||
- 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 po4a
|
||||
run: |
|
||||
set -e
|
||||
export LC_ALL=C LANG=C
|
||||
uname -a
|
||||
./autogen.sh
|
||||
./configure --enable-werror
|
||||
make
|
||||
make check VERBOSE=1
|
35
.github/workflows/openbsd.yml
vendored
Normal file
35
.github/workflows/openbsd.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
# 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@v4.1.6
|
||||
- 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: |
|
||||
set -e
|
||||
export LC_ALL=C LANG=C
|
||||
export AUTOCONF_VERSION=2.71
|
||||
export AUTOMAKE_VERSION=1.16
|
||||
uname -a
|
||||
# OpenBSD ports lack po4a
|
||||
./autogen.sh --no-po4a
|
||||
./configure --enable-werror
|
||||
make
|
||||
make check VERBOSE=1
|
32
.github/workflows/solaris.yml
vendored
Normal file
32
.github/workflows/solaris.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
name: Solaris
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
solaris-test:
|
||||
runs-on: ubuntu-latest
|
||||
name: Test xz on Solaris
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.6
|
||||
- name: Test in Solaris
|
||||
id: test
|
||||
uses: vmactions/solaris-vm@548f790d1bc2b9342a76cbb47ddbb85875605559 #v1.0.2
|
||||
with:
|
||||
usesh: true
|
||||
prepare: |
|
||||
pkg install bash libtool automake gnu-m4 tree wget gcc autoconf //solaris/text/gawk pkg://solaris/text/gnu-diffutils pkg://solaris/text/gnu-grep pkg://solaris/text/gnu-sed
|
||||
run: |
|
||||
set -e
|
||||
export LC_ALL=C LANG=C
|
||||
uname -a
|
||||
./autogen.sh --no-po4a
|
||||
./configure --enable-werror
|
||||
make
|
||||
make check VERBOSE=1
|
26
.github/workflows/windows-ci.yml
vendored
26
.github/workflows/windows-ci.yml
vendored
@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
# Rely on the msys2 GitHub Action to set up the msys2 environment.
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@27b3aa77f672cb6b3054121cfd80c3d22ceebb1d #v2.20.1
|
||||
uses: msys2/setup-msys2@cc11e9188b693c2b100158c3322424c4cc1dadea #v2.22.0
|
||||
with:
|
||||
msystem: ${{ matrix.msys2_env }}
|
||||
update: true
|
||||
@ -55,7 +55,7 @@ jobs:
|
||||
# text file and will not match the output from xzgrep.
|
||||
run: git config --global core.autocrlf false
|
||||
|
||||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
|
||||
- uses: actions/checkout@v4.1.6
|
||||
|
||||
|
||||
########################
|
||||
@ -87,29 +87,29 @@ jobs:
|
||||
##################
|
||||
|
||||
- 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
###############
|
||||
@ -117,7 +117,7 @@ jobs:
|
||||
###############
|
||||
|
||||
# Upload the test logs as artifacts if any step has failed.
|
||||
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4.0.0
|
||||
- uses: actions/upload-artifact@v4.3.3
|
||||
if: ${{ failure() }}
|
||||
with:
|
||||
name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs
|
||||
|
26
.gitignore
vendored
26
.gitignore
vendored
@ -15,7 +15,6 @@ Makefile.in
|
||||
|
||||
/ABOUT-NLS
|
||||
/autom4te.cache
|
||||
/Doxyfile
|
||||
/aclocal.m4
|
||||
/config.h
|
||||
/config.h.in
|
||||
@ -41,6 +40,10 @@ coverage
|
||||
/doc/internal
|
||||
/doc/api
|
||||
|
||||
/po4a/man
|
||||
/po4a/xz-man.pot
|
||||
/po4a/*.po.authors
|
||||
|
||||
/src/liblzma/liblzma.pc
|
||||
/src/lzmainfo/lzmainfo
|
||||
/src/xz/xz
|
||||
@ -67,6 +70,7 @@ coverage
|
||||
/tests/test_index
|
||||
/tests/test_index_hash
|
||||
/tests/test_lzip_decoder
|
||||
/tests/test_microlzma
|
||||
/tests/test_memlimit
|
||||
/tests/test_stream_flags
|
||||
/tests/test_vli
|
||||
@ -93,21 +97,17 @@ coverage
|
||||
/DartConfiguration.tcl
|
||||
/liblzma-config-version.cmake
|
||||
/liblzma-config.cmake
|
||||
/lzcat
|
||||
/lzcat.1
|
||||
/lzma
|
||||
/lzma.1
|
||||
/Testing
|
||||
/tests_bin/
|
||||
/unlzma
|
||||
/unlzma.1
|
||||
/unxz
|
||||
/unxz.1
|
||||
/xz
|
||||
/xzcat
|
||||
/xzcat.1
|
||||
/xzdec
|
||||
/lzmadec
|
||||
/lzmainfo
|
||||
/xzdiff
|
||||
/xzgrep
|
||||
/xzless
|
||||
/xzmore
|
||||
/liblzma.pc
|
||||
/*.gmo
|
||||
|
||||
/windows/*/.vs
|
||||
/windows/*/liblzma.vcxproj.user
|
||||
/.vscode/
|
||||
|
9
AUTHORS
9
AUTHORS
@ -2,8 +2,8 @@
|
||||
Authors of XZ Utils
|
||||
===================
|
||||
|
||||
XZ Utils is developed and maintained by Lasse Collin
|
||||
<lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>.
|
||||
XZ Utils is developed and maintained by
|
||||
Lasse Collin <lasse.collin@tukaani.org>.
|
||||
|
||||
Major parts of liblzma are based on code written by Igor Pavlov,
|
||||
specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without
|
||||
@ -30,6 +30,11 @@ Authors of XZ Utils
|
||||
- Jonathan Nieder
|
||||
- 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.
|
||||
Most of these people are mentioned in the file THANKS.
|
||||
|
||||
|
600
CMakeLists.txt
600
CMakeLists.txt
@ -10,9 +10,17 @@
|
||||
#
|
||||
# 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
|
||||
# default in the Autotools build too (--enable-external-sha256).
|
||||
@ -60,10 +68,6 @@
|
||||
# - To get translated man pages, run po4a/update-po which requires
|
||||
# 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
|
||||
# need liblzma, install only its components!):
|
||||
# - liblzma_Runtime (shared library only)
|
||||
@ -95,7 +99,7 @@
|
||||
#############################################################################
|
||||
|
||||
# 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.30 FATAL_ERROR)
|
||||
|
||||
include(CMakePushCheckState)
|
||||
include(CheckIncludeFile)
|
||||
@ -111,7 +115,7 @@ include(cmake/tuklib_mbstr.cmake)
|
||||
|
||||
set(PACKAGE_NAME "XZ Utils")
|
||||
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.
|
||||
file(READ src/liblzma/api/lzma/version.h PACKAGE_VERSION)
|
||||
@ -148,12 +152,25 @@ if(OVERRIDE_O3_IN_C_FLAGS_RELEASE)
|
||||
endif()
|
||||
|
||||
# We need a compiler that supports enough C99 or newer (variable-length arrays
|
||||
# aren't needed, those are optional in C17). Setting CMAKE_C_STANDARD here
|
||||
# makes it the default for all targets. It doesn't affect the INTERFACE so
|
||||
# liblzma::liblzma won't end up with INTERFACE_COMPILE_FEATURES "c_std_99"
|
||||
# (the API headers are C89 and C++ compatible).
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
# aren't needed, those are optional in C11/C17). C11 is preferred since C11
|
||||
# features may be optionally used if they are available.
|
||||
#
|
||||
# Setting CMAKE_C_STANDARD here makes it the default for all targets.
|
||||
# It doesn't affect the INTERFACE so liblzma::liblzma won't end up with
|
||||
# INTERFACE_COMPILE_FEATURES "c_std_99" or such (the API headers are C89
|
||||
# and C++ compatible).
|
||||
#
|
||||
# Avoid set(CMAKE_C_STANDARD_REQUIRED ON) because it's fine to decay
|
||||
# to C99 if C11 isn't supported.
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
|
||||
# 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:
|
||||
set(CMAKE_MACOSX_BUNDLE OFF)
|
||||
@ -180,7 +197,7 @@ include(GNUInstallDirs)
|
||||
#
|
||||
# CMake 3.27 doesn't have CMAKE_RC_COMPILER_ID so we rely on
|
||||
# CMAKE_C_COMPILER_ID.
|
||||
if((MINGW OR CYGWIN OR MSYS) AND (
|
||||
if((MINGW OR CYGWIN) AND (
|
||||
NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "17"))
|
||||
# Use workarounds with GNU windres and llvm-windres >= 17.0.0. The \x20
|
||||
@ -200,6 +217,30 @@ else()
|
||||
set(LOCALEDIR_DEFINITION "${CMAKE_INSTALL_FULL_LOCALEDIR}")
|
||||
endif()
|
||||
|
||||
# When used with MSVC, CMake can merge .manifest files with
|
||||
# linker-generated manifests and embed the result in an executable.
|
||||
# However, when paired with MinGW-w64, CMake (3.30) ignores .manifest
|
||||
# files. Embedding a manifest with a resource file works with both
|
||||
# toochains. It's also the way to do it with Autotools.
|
||||
#
|
||||
# With MSVC, we need to disable the default manifest; attempting to add
|
||||
# two manifest entries would break the build. The flag /MANIFEST:NO
|
||||
# goes to the linker and it also affects behavior of CMake itself: it
|
||||
# looks what flags are being passed to the linker and when CMake sees
|
||||
# the /MANIFEST:NO option, other manifest-related linker flags are
|
||||
# no longer added (see the file Source/cmcmd.cxx in CMake).
|
||||
#
|
||||
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/23066
|
||||
if(MSVC)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
endif()
|
||||
|
||||
# Dependencies for all Windows resource files:
|
||||
set(W32RES_DEPENDENCIES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/w32_application.manifest"
|
||||
)
|
||||
|
||||
# Definitions common to all targets:
|
||||
add_compile_definitions(
|
||||
# Package info:
|
||||
@ -239,6 +280,12 @@ tuklib_large_file_support(ALL)
|
||||
tuklib_integer(ALL)
|
||||
|
||||
# This is used for liblzma.pc generation to add -lrt if needed.
|
||||
#
|
||||
# The variable name LIBS comes from Autoconf where AC_SEARCH_LIBS adds the
|
||||
# libraries it finds into the shell variable LIBS. These libraries need to
|
||||
# be put into liblzma.pc too, thus liblzma.pc.in has @LIBS@ because that
|
||||
# matches the Autoconf's variable. When CMake support was added, using
|
||||
# the same variable with configure_file() was the simplest method.
|
||||
set(LIBS)
|
||||
|
||||
# Check for clock_gettime(). Do this before checking for threading so
|
||||
@ -256,7 +303,7 @@ if(NOT HAVE_CLOCK_GETTIME)
|
||||
# CMAKE_REQUIRED_LIBRARIES for further tests too.
|
||||
if(HAVE_CLOCK_GETTIME_LIBRT)
|
||||
link_libraries(rt)
|
||||
set(LIBS "-lrt") # For liblzma.pc
|
||||
set(LIBS "-lrt ${LIBS}") # For liblzma.pc
|
||||
else()
|
||||
list(REMOVE_AT CMAKE_REQUIRED_LIBRARIES 0)
|
||||
endif()
|
||||
@ -273,14 +320,48 @@ endif()
|
||||
# Translation support requires CMake 3.20 because it added the Intl::Intl
|
||||
# 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.)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
||||
find_package(Intl)
|
||||
find_package(Gettext)
|
||||
|
||||
if(Intl_FOUND)
|
||||
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".
|
||||
set(TRANSLATION_DOMAIN "xz")
|
||||
endif()
|
||||
@ -299,14 +380,69 @@ endif()
|
||||
|
||||
option(BUILD_SHARED_LIBS "Build liblzma as a shared library instead of static")
|
||||
|
||||
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
|
||||
if(NOT WIN32)
|
||||
# Symbol versioning only affects ELF shared libraries. The option is
|
||||
# ignored for static libraries.
|
||||
#
|
||||
# Determine the default value so that it's always set with
|
||||
# shared libraries in mind which helps if the build dir is reconfigured
|
||||
# from static to shared libs without resetting the cache variables.
|
||||
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/base.h
|
||||
src/liblzma/api/lzma/bcj.h
|
||||
@ -322,6 +458,17 @@ add_library(liblzma
|
||||
src/liblzma/api/lzma/stream_flags.h
|
||||
src/liblzma/api/lzma/version.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.h
|
||||
src/liblzma/check/crc_common.h
|
||||
@ -388,11 +535,16 @@ if(ENABLE_SMALL)
|
||||
target_sources(liblzma PRIVATE src/liblzma/check/crc32_small.c)
|
||||
else()
|
||||
target_sources(liblzma PRIVATE
|
||||
src/liblzma/check/crc32_fast.c
|
||||
src/liblzma/check/crc32_table.c
|
||||
src/liblzma/check/crc32_table_be.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()
|
||||
|
||||
if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES)
|
||||
@ -402,11 +554,16 @@ if("crc64" IN_LIST ADDITIONAL_CHECK_TYPES)
|
||||
target_sources(liblzma PRIVATE src/liblzma/check/crc64_small.c)
|
||||
else()
|
||||
target_sources(liblzma PRIVATE
|
||||
src/liblzma/check/crc64_fast.c
|
||||
src/liblzma/check/crc64_table.c
|
||||
src/liblzma/check/crc64_table_be.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()
|
||||
|
||||
@ -502,14 +659,16 @@ if(ENABLE_THREADS)
|
||||
# liblzma-config.cmake later.
|
||||
set(USE_POSIX_THREADS ON)
|
||||
|
||||
target_link_libraries(liblzma Threads::Threads)
|
||||
target_link_libraries(liblzma PRIVATE Threads::Threads)
|
||||
add_compile_definitions(MYTHREAD_POSIX)
|
||||
|
||||
# Make the thread libs available in later checks. In practice
|
||||
# only pthread_condattr_setclock check should need this.
|
||||
list(INSERT CMAKE_REQUIRED_LIBRARIES 0 "${CMAKE_THREAD_LIBS_INIT}")
|
||||
|
||||
# Check if pthread_condattr_setclock() exists to
|
||||
# use CLOCK_MONOTONIC.
|
||||
if(HAVE_CLOCK_MONOTONIC)
|
||||
list(INSERT CMAKE_REQUIRED_LIBRARIES 0
|
||||
"${CMAKE_THREAD_LIBS_INIT}")
|
||||
check_symbol_exists(pthread_condattr_setclock pthread.h
|
||||
HAVE_PTHREAD_CONDATTR_SETCLOCK)
|
||||
tuklib_add_definition_if(ALL HAVE_PTHREAD_CONDATTR_SETCLOCK)
|
||||
@ -819,10 +978,6 @@ if(MICROLZMA_DECODER)
|
||||
target_sources(liblzma PRIVATE src/liblzma/common/microlzma_decoder.c)
|
||||
endif()
|
||||
|
||||
if (MICROLZMA_ENCODER OR MICROLZMA_DECODER)
|
||||
add_compile_definitions(HAVE_MICROLZMA)
|
||||
endif()
|
||||
|
||||
|
||||
#############################
|
||||
# lzip (.lz) format support #
|
||||
@ -901,10 +1056,27 @@ endif()
|
||||
|
||||
# Sandboxing: 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)
|
||||
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK_H")
|
||||
int main(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 0;
|
||||
}
|
||||
"
|
||||
HAVE_LINUX_LANDLOCK)
|
||||
|
||||
if(HAVE_LINUX_LANDLOCK)
|
||||
set(SANDBOX_COMPILE_DEFINITION "HAVE_LINUX_LANDLOCK")
|
||||
set(SANDBOX_FOUND ON)
|
||||
|
||||
# Of our three sandbox methods, only Landlock is incompatible
|
||||
@ -987,78 +1159,6 @@ if(USE_WIN95_THREADS AND ENABLE_SMALL AND NOT HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR)
|
||||
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
|
||||
check_include_file(cpuid.h HAVE_CPUID_H)
|
||||
tuklib_add_definition_if(liblzma HAVE_CPUID_H)
|
||||
@ -1095,12 +1195,12 @@ calculation if supported by the system" ON)
|
||||
&& !defined(__EDG__)
|
||||
__attribute__((__target__(\"ssse3,sse4.1,pclmul\")))
|
||||
#endif
|
||||
__m128i my_clmul(__m128i a)
|
||||
int main(void)
|
||||
{
|
||||
const __m128i b = _mm_set_epi64x(1, 2);
|
||||
return _mm_clmulepi64_si128(a, b, 0);
|
||||
__m128i a = _mm_set_epi64x(1, 2);
|
||||
a = _mm_clmulepi64_si128(a, a, 0);
|
||||
return 0;
|
||||
}
|
||||
int main(void) { return 0; }
|
||||
"
|
||||
HAVE_USABLE_CLMUL)
|
||||
tuklib_add_definition_if(liblzma HAVE_USABLE_CLMUL)
|
||||
@ -1125,11 +1225,10 @@ if(ALLOW_ARM64_CRC32)
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
__attribute__((__target__(\"+crc\")))
|
||||
#endif
|
||||
uint32_t my_crc(uint32_t a, uint64_t b)
|
||||
int main(void)
|
||||
{
|
||||
return __crc32d(a, b);
|
||||
return __crc32d(1, 2) != 0;
|
||||
}
|
||||
int main(void) { return 0; }
|
||||
"
|
||||
HAVE_ARM64_CRC32)
|
||||
|
||||
@ -1141,7 +1240,7 @@ if(ALLOW_ARM64_CRC32)
|
||||
check_symbol_exists(getauxval sys/auxv.h HAVE_GETAUXVAL)
|
||||
tuklib_add_definition_if(liblzma HAVE_GETAUXVAL)
|
||||
|
||||
# elf_aux_info() is supported on FreeBSD.
|
||||
# elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6.
|
||||
check_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO)
|
||||
tuklib_add_definition_if(liblzma HAVE_ELF_AUX_INFO)
|
||||
|
||||
@ -1185,20 +1284,24 @@ else()
|
||||
target_compile_definitions(liblzma PRIVATE HAVE_VISIBILITY=0)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR CYGWIN)
|
||||
if(BUILD_SHARED_LIBS)
|
||||
# Add the Windows resource file for liblzma.dll.
|
||||
target_sources(liblzma PRIVATE src/liblzma/liblzma_w32res.rc)
|
||||
|
||||
set_target_properties(liblzma PROPERTIES
|
||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc"
|
||||
set_source_files_properties(src/liblzma/liblzma_w32res.rc PROPERTIES
|
||||
OBJECT_DEPENDS "${W32RES_DEPENDENCIES}"
|
||||
)
|
||||
|
||||
# Export the public API symbols with __declspec(dllexport).
|
||||
target_compile_definitions(liblzma PRIVATE DLL_EXPORT)
|
||||
|
||||
if(NOT MSVC)
|
||||
# Create a DEF file. The linker puts the ordinal numbers there
|
||||
if(NOT MSVC AND NOT CYGWIN)
|
||||
# Create a DEF file. The Autotools-based build creates a DEF file
|
||||
# under Cygwin & MSYS2 too but it almost certainly is a useless
|
||||
# file in that context, so the CMake build omits it.
|
||||
#
|
||||
# The linker puts the ordinal numbers in the DEF file
|
||||
# too so the output from the linker isn't our final file.
|
||||
target_link_options(liblzma PRIVATE
|
||||
"-Wl,--output-def,liblzma.def.in")
|
||||
@ -1220,22 +1323,7 @@ if(WIN32)
|
||||
# Disable __declspec(dllimport) when linking against static liblzma.
|
||||
target_compile_definitions(liblzma INTERFACE LZMA_API_STATIC)
|
||||
endif()
|
||||
elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
||||
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?
|
||||
#
|
||||
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "linux")
|
||||
# Note that adding link options doesn't affect 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
|
||||
@ -1251,10 +1339,7 @@ elseif(BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Linux" AND
|
||||
set_target_properties(liblzma PROPERTIES
|
||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_linux.map"
|
||||
)
|
||||
elseif(BUILD_SHARED_LIBS AND (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
|
||||
CMAKE_SYSTEM_NAME STREQUAL "Linux"))
|
||||
# Generic symbol versioning for shared liblzma is used on FreeBSD and
|
||||
# also on GNU/Linux on MicroBlaze.
|
||||
elseif(BUILD_SHARED_LIBS AND SYMBOL_VERSIONING STREQUAL "generic")
|
||||
target_link_options(liblzma PRIVATE
|
||||
"-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/liblzma_generic.map"
|
||||
)
|
||||
@ -1270,12 +1355,38 @@ set_target_properties(liblzma PROPERTIES
|
||||
SOVERSION "${xz_VERSION_MAJOR}"
|
||||
VERSION "${xz_VERSION}"
|
||||
|
||||
# It's liblzma.so or liblzma.dll, not libliblzma.so or lzma.dll.
|
||||
# Avoid the name lzma.dll because it would conflict with LZMA SDK.
|
||||
PREFIX ""
|
||||
IMPORT_PREFIX ""
|
||||
# The name liblzma a mess because in many places "lib" is just a prefix
|
||||
# and not part of the actual name. (Don't name a new library this way!)
|
||||
# Cygwin uses "cyg", MSYS2 uses "msys-", and some platforms use no prefix.
|
||||
# However, we want to avoid lzma.dll on Windows as that would conflict
|
||||
# with LZMA SDK. liblzma has been liblzma.dll on Windows since the
|
||||
# beginning so try to stick with it.
|
||||
#
|
||||
# Up to XZ Utils 5.6.2 we set PREFIX and IMPORT_PREFIX properties to ""
|
||||
# while keeping the default "liblzma" OUTPUT_NAME that was derived from
|
||||
# the target name. But this broke naming on Cygwin and MSYS2.
|
||||
#
|
||||
# Setting OUTPUT_NAME without the "lib" prefix means that CMake will add
|
||||
# the platform-specific prefix as needed. So on most systems CMake will
|
||||
# add "lib" but on Cygwin and MSYS2 the naming will be correct too.
|
||||
#
|
||||
# On Windows, CMake uses the "lib" prefix with MinGW-w64 but not with
|
||||
# other toolchains. Those those need to be handled specially to get
|
||||
# the DLL file named liblzma.dll instead of lzma.dll.
|
||||
OUTPUT_NAME "lzma"
|
||||
)
|
||||
|
||||
if(WIN32 AND NOT MINGW)
|
||||
# Up to XZ Utils 5.6.2 and building with MSVC, we produced liblzma.dll
|
||||
# and liblzma.lib. The downside of liblzma.lib is that it's not
|
||||
# compatible with pkgconf usage. liblzma.pc contains "-llzma" which
|
||||
# "pkgconf --msvc-syntax --libs liblzma" converts to "lzma.lib".
|
||||
# So as a compromise, we can keep the liblzma.dll name but the import
|
||||
# library and static liblzma need to be named lzma.lib so that pkgconf
|
||||
# can be used with MSVC. (MinGW-w64 finds both names with "-llzma".)
|
||||
set_target_properties(liblzma PROPERTIES RUNTIME_OUTPUT_NAME "liblzma")
|
||||
endif()
|
||||
|
||||
# Create liblzma-config-version.cmake.
|
||||
#
|
||||
# FIXME: SameMajorVersion is correct for stable releases but it is wrong
|
||||
@ -1283,7 +1394,7 @@ set_target_properties(liblzma PROPERTIES
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/liblzma-config-version.cmake"
|
||||
VERSION "${liblzma_VERSION}"
|
||||
VERSION "${xz_VERSION}"
|
||||
COMPATIBILITY SameMajorVersion)
|
||||
|
||||
# Create liblzma-config.cmake. We use this spelling instead of
|
||||
@ -1319,15 +1430,31 @@ endif()
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake"
|
||||
"${LZMA_CONFIG_CONTENTS}")
|
||||
|
||||
# Create liblzma.pc.
|
||||
|
||||
# Create liblzma.pc. If using CMake >= 3.20 and CMAKE_INSTALL_<dir> paths
|
||||
# are relative to CMAKE_INSTALL_PREFIX, the .pc file will be relocatable
|
||||
# (that is, all paths will be relative to ${prefix}). Otherwise absolute
|
||||
# paths will be used.
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
set(PTHREAD_CFLAGS "${CMAKE_THREAD_LIBS_INIT}")
|
||||
configure_file(src/liblzma/liblzma.pc.in liblzma.pc
|
||||
@ONLY
|
||||
NEWLINE_STYLE LF)
|
||||
set(exec_prefix "\${prefix}")
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20")
|
||||
cmake_path(APPEND libdir "\${exec_prefix}" "${CMAKE_INSTALL_LIBDIR}")
|
||||
cmake_path(APPEND includedir "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
else()
|
||||
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
|
||||
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
# Threads::Threads is linked in only when using POSIX threads.
|
||||
# Use an empty value if using Windows threads or if threading is disabled.
|
||||
set(PTHREAD_CFLAGS)
|
||||
if(USE_POSIX_THREADS)
|
||||
set(PTHREAD_CFLAGS "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
|
||||
configure_file(src/liblzma/liblzma.pc.in liblzma.pc @ONLY)
|
||||
|
||||
|
||||
# Install the library binary. The INCLUDES specifies the include path that
|
||||
# is exported for other projects to use but it doesn't install any files.
|
||||
@ -1364,11 +1491,9 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake"
|
||||
DESTINATION "${liblzma_INSTALL_CMAKEDIR}"
|
||||
COMPONENT liblzma_Development)
|
||||
|
||||
if(NOT MSVC)
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
COMPONENT liblzma_Development)
|
||||
endif()
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma.pc"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
||||
COMPONENT liblzma_Development)
|
||||
|
||||
|
||||
#############################################################################
|
||||
@ -1481,17 +1606,14 @@ if(NOT HAVE_GETOPT_LONG)
|
||||
# the Autotools build (m4/getopt.m4).
|
||||
target_compile_definitions(libgnu PUBLIC "__GETOPT_PREFIX=rpl_")
|
||||
|
||||
# Create a custom copy command to copy the getopt header to the build
|
||||
# directory and re-copy it if it is updated. (Gnulib does it this way
|
||||
# because it allows choosing which .in.h files to actually use in the
|
||||
# build. We need just getopt.h so this is a bit overcomplicated for
|
||||
# Copy the getopt header to the build directory and re-copy it
|
||||
# if it is updated. (Gnulib does it this way because it allows
|
||||
# choosing which .in.h files to actually use in the build. We
|
||||
# need just getopt.h so this is a bit overcomplicated for
|
||||
# a single header file only.)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/lib/getopt.h"
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/lib/getopt.in.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/lib/getopt.h"
|
||||
MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/lib/getopt.in.h"
|
||||
VERBATIM)
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/getopt.in.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/lib/getopt.h"
|
||||
COPYONLY)
|
||||
|
||||
target_sources(libgnu PRIVATE
|
||||
lib/getopt1.c
|
||||
@ -1532,17 +1654,18 @@ if(HAVE_DECODERS AND (NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900))
|
||||
|
||||
target_link_libraries("${XZDEC}" PRIVATE liblzma libgnu)
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# Add the Windows resource file for xzdec.exe or lzmadec.exe.
|
||||
target_sources("${XZDEC}" PRIVATE src/xzdec/xzdec_w32res.rc)
|
||||
set_target_properties("${XZDEC}" PROPERTIES
|
||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc"
|
||||
target_sources("${XZDEC}" PRIVATE "src/xzdec/${XZDEC}_w32res.rc")
|
||||
set_source_files_properties(
|
||||
"src/xzdec/${XZDEC}_w32res.rc" PROPERTIES
|
||||
OBJECT_DEPENDS "${W32RES_DEPENDENCIES}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SANDBOX_COMPILE_DEFINITION)
|
||||
target_compile_definitions("${XZDEC}" PRIVATE
|
||||
"${SANDBOX_COMPILE_DEFINITION}")
|
||||
"${SANDBOX_COMPILE_DEFINITION}")
|
||||
endif()
|
||||
|
||||
tuklib_progname("${XZDEC}")
|
||||
@ -1588,11 +1711,11 @@ if(HAVE_DECODERS AND (NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900))
|
||||
|
||||
target_link_libraries(lzmainfo PRIVATE liblzma libgnu)
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# Add the Windows resource file for lzmainfo.exe.
|
||||
target_sources(lzmainfo PRIVATE src/lzmainfo/lzmainfo_w32res.rc)
|
||||
set_target_properties(lzmainfo PROPERTIES
|
||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc"
|
||||
set_source_files_properties(src/lzmainfo/lzmainfo_w32res.rc PROPERTIES
|
||||
OBJECT_DEPENDS "${W32RES_DEPENDENCIES}"
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -1682,13 +1805,26 @@ if(NOT MSVC OR MSVC_VERSION GREATER_EQUAL 1900)
|
||||
|
||||
target_link_libraries(xz PRIVATE liblzma libgnu)
|
||||
|
||||
if(USE_POSIX_THREADS)
|
||||
# src/xz/signals.c uses mythread_sigmask() which with POSIX
|
||||
# threads calls pthread_sigmask(). Thus, we need the threading
|
||||
# library as a dependency for xz. The liblzma target links against
|
||||
# Threads::Threads PRIVATEly, thus that won't provide the pthreads
|
||||
# symbols for xz.
|
||||
#
|
||||
# NOTE: The build may work without this if the symbol is in libc
|
||||
# but it is mandatory to have this here to keep it working with
|
||||
# all pthread implementations.
|
||||
target_link_libraries(xz PRIVATE Threads::Threads)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(xz PRIVATE ASSUME_RAM=128)
|
||||
|
||||
if(WIN32)
|
||||
if(WIN32 OR CYGWIN)
|
||||
# Add the Windows resource file for xz.exe.
|
||||
target_sources(xz PRIVATE src/xz/xz_w32res.rc)
|
||||
set_target_properties(xz PROPERTIES
|
||||
LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc"
|
||||
set_source_files_properties(src/xz/xz_w32res.rc PROPERTIES
|
||||
OBJECT_DEPENDS "${W32RES_DEPENDENCIES}"
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -1940,12 +2076,38 @@ endif()
|
||||
# Documentation
|
||||
#############################################################################
|
||||
|
||||
# Use OPTIONAL because doc/api might not exist. The liblzma API docs
|
||||
# can be generated by running "doxygen/update-doxygen".
|
||||
install(DIRECTORY doc/api doc/examples
|
||||
if(UNIX)
|
||||
option(ENABLE_DOXYGEN "Use Doxygen to generate liblzma API docs" OFF)
|
||||
|
||||
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}"
|
||||
COMPONENT liblzma_Documentation
|
||||
OPTIONAL)
|
||||
COMPONENT liblzma_Documentation)
|
||||
|
||||
# GPLv2 applies to the scripts. If GNU getopt_long is used then
|
||||
# LGPLv2.1 applies to the command line tools but, using the
|
||||
@ -1970,66 +2132,6 @@ install(FILES AUTHORS
|
||||
# Tests
|
||||
#############################################################################
|
||||
|
||||
include(CTest)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
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()
|
||||
# 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.
|
||||
include(tests/tests.cmake OPTIONAL)
|
||||
|
27
COPYING
27
COPYING
@ -3,8 +3,7 @@ XZ Utils Licensing
|
||||
==================
|
||||
|
||||
Different licenses apply to different files in this package. Here
|
||||
is a rough summary of which licenses apply to which parts of this
|
||||
package (but check the individual files to be sure!):
|
||||
is a summary of which licenses apply to which parts of this package:
|
||||
|
||||
- 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
|
||||
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
|
||||
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
|
||||
built.
|
||||
|
||||
- The extra directory contain files that are under various
|
||||
free software licenses.
|
||||
- The 'extra' directory contains files that are under various
|
||||
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
|
||||
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
|
||||
of a good notice to put into "about box" or into documentation:
|
||||
|
||||
This software includes code from XZ Utils
|
||||
<https://xz.tukaani.org/xz-utils/>.
|
||||
This software includes code from XZ Utils <https://tukaani.org/xz/>.
|
||||
|
||||
The following license texts are included in the following files:
|
||||
- COPYING.0BSD: BSD Zero Clause License
|
||||
- COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1
|
||||
- COPYING.GPLv2: GNU General Public License version 2
|
||||
- COPYING.GPLv3: GNU General Public License version 3
|
||||
- COPYING.CC-BY-SA-4.0: Creative Commons Attribution-ShareAlike 4.0
|
||||
International Public License
|
||||
|
||||
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.
|
79
INSTALL
79
INSTALL
@ -90,21 +90,15 @@ XZ Utils Installation
|
||||
|
||||
1.2.3. MINIX 3
|
||||
|
||||
The default install of MINIX 3 includes Amsterdam Compiler Kit (ACK),
|
||||
which doesn't support C99. Install GCC to compile XZ Utils.
|
||||
Version 3.3.0 and later are supported.
|
||||
|
||||
MINIX 3.1.8 and older have bugs in /usr/include/stdint.h, which has
|
||||
to be patched before XZ Utils can be compiled correctly. See
|
||||
<http://gforge.cs.vu.nl/gf/project/minix/tracker/?action=TrackerItemEdit&tracker_item_id=537>.
|
||||
Multithreading isn't supported because MINIX 3 doesn't have
|
||||
pthreads. The option --disable-threads must be passed to configure
|
||||
as this isn't autodetected.
|
||||
|
||||
MINIX 3.2.0 and later use a different libc and aren't affected by
|
||||
the above bug.
|
||||
|
||||
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).
|
||||
Note that disabling threads causes "make check" to show a few tests
|
||||
as skipped ("SKIP"). It's only due to a few threading-dependent
|
||||
subtests are skipped. See the matching tests/test_*.log files.
|
||||
|
||||
|
||||
1.2.4. OpenVMS
|
||||
@ -352,6 +346,12 @@ XZ Utils Installation
|
||||
will still be installed. The $docdir can be changed
|
||||
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
|
||||
This disables CRC32 and CRC64 assembly code on
|
||||
32-bit x86. This option currently does nothing
|
||||
@ -518,14 +518,6 @@ XZ Utils Installation
|
||||
calls any liblzma functions from more than
|
||||
one thread, something bad may happen.
|
||||
|
||||
--enable-ifunc
|
||||
Use __attribute__((__ifunc__())) in liblzma. This is
|
||||
enabled by default on GNU/Linux and FreeBSD.
|
||||
|
||||
The ifunc attribute is incompatible with
|
||||
-fsanitize=address. --disable-ifunc must be used
|
||||
if any -fsanitize= option is specified in CFLAGS.
|
||||
|
||||
--enable-sandbox=METHOD
|
||||
There is limited sandboxing support in the xz and xzdec
|
||||
tools. If built with sandbox support, xz uses it
|
||||
@ -561,10 +553,45 @@ XZ Utils Installation
|
||||
sandboxing. If no Landlock support
|
||||
is found, configure will give an error.
|
||||
|
||||
--enable-symbol-versions
|
||||
Use symbol versioning for liblzma. This is enabled by
|
||||
default on GNU/Linux, other GNU-based systems, and
|
||||
FreeBSD.
|
||||
--enable-symbol-versions[=VARIANT]
|
||||
Use symbol versioning for liblzma shared library.
|
||||
This is enabled by default on GNU/Linux (glibc only),
|
||||
other GNU-based systems, and FreeBSD.
|
||||
|
||||
Symbol versioning is never used for static liblzma. This
|
||||
option is ignored when not building a shared library.
|
||||
|
||||
Supported VARIANTs:
|
||||
|
||||
no Disable symbol versioning. This is the
|
||||
same as using --disable-symbol-versions.
|
||||
|
||||
auto Autodetect between "no", "linux",
|
||||
and "generic".
|
||||
|
||||
yes Autodetect between "linux" and
|
||||
"generic". This forces symbol
|
||||
versioning to be used when
|
||||
building a shared library.
|
||||
|
||||
generic Generic version is the default for
|
||||
FreeBSD and GNU/Linux on MicroBlaze.
|
||||
|
||||
This is also used on GNU/Linux when
|
||||
building with NVIDIA HPC Compiler
|
||||
because the compiler doesn't support
|
||||
the features required for the "linux"
|
||||
variant below.
|
||||
|
||||
linux Special version for GNU/Linux (glibc
|
||||
only). This adds a few extra symbol
|
||||
versions for compatibility with binaries
|
||||
that have been linked against a liblzma
|
||||
version that has been patched with
|
||||
"xz-5.2.2-compat-libs.patch" from
|
||||
RHEL/CentOS 7. That patch was used
|
||||
by some build tools outside of
|
||||
RHEL/CentOS 7 too.
|
||||
|
||||
--enable-debug
|
||||
This enables the assert() macro and possibly some other
|
||||
@ -762,7 +789,7 @@ XZ Utils Installation
|
||||
|
||||
The configure script determines if assembler code can be used by
|
||||
looking at the configure triplet; there is currently no check if
|
||||
the assembler code can actually actually be built. The x86 assembler
|
||||
the assembler code can actually be built. The x86 assembler
|
||||
code should work on x86 GNU/Linux, *BSDs, Solaris, Darwin, MinGW,
|
||||
Cygwin, and DJGPP. On other x86 systems, there may be problems and
|
||||
the assembler code may need to be disabled with the configure option.
|
||||
|
58
Makefile.am
58
Makefile.am
@ -36,18 +36,6 @@ dist_examples_DATA = \
|
||||
doc/examples/04_compress_easy_mt.c \
|
||||
doc/examples/11_file_info.c \
|
||||
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
|
||||
|
||||
EXTRA_DIST = \
|
||||
@ -58,7 +46,6 @@ EXTRA_DIST = \
|
||||
po4a \
|
||||
windows \
|
||||
CMakeLists.txt \
|
||||
COPYING.CC-BY-SA-4.0 \
|
||||
COPYING.GPLv2 \
|
||||
COPYING.GPLv3 \
|
||||
COPYING.LGPLv2.1 \
|
||||
@ -68,12 +55,12 @@ EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
build-aux/manconv.sh \
|
||||
build-aux/version.sh \
|
||||
doc/xz-logo.png \
|
||||
po/xz.pot-header
|
||||
|
||||
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 = \
|
||||
src/xz/xz.1 \
|
||||
src/xzdec/xzdec.1 \
|
||||
@ -84,42 +71,31 @@ manfiles = \
|
||||
src/scripts/xzmore.1
|
||||
|
||||
# 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:
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
( cd "$(srcdir)" && git log --date=iso --stat \
|
||||
b69da6d4bb6bb11fc0cf066920791990d2b22a06^..HEAD ) \
|
||||
> "$(distdir)/ChangeLog"; \
|
||||
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" && \
|
||||
$(MKDIR_P) "$$dest/pdf-a4" "$$dest/pdf-letter" "$$dest/txt" && \
|
||||
$(MKDIR_P) "$$dest/txt" && \
|
||||
for FILE in $(manfiles); do \
|
||||
BASE=`basename $$FILE .1` && \
|
||||
sh "$(srcdir)/build-aux/manconv.sh" pdf a4 \
|
||||
< "$(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 \
|
||||
$(SHELL) "$(srcdir)/build-aux/manconv.sh" ascii \
|
||||
< "$(srcdir)/$$FILE" \
|
||||
> "$$dest/txt/$$BASE.txt"; \
|
||||
done; \
|
||||
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 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).
|
||||
mydist:
|
||||
sh "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
cd "$(srcdir)/po4a" && sh update-po
|
||||
cd "$(srcdir)/doxygen" && sh update-doxygen
|
||||
$(SHELL) "$(srcdir)/src/liblzma/validate_map.sh"
|
||||
cd po && $(MAKE) xz.pot-update
|
||||
cd "$(srcdir)/po4a" && $(SHELL) update-po
|
||||
VERSION=$(VERSION); \
|
||||
if test -d "$(srcdir)/.git" && type git > /dev/null 2>&1; then \
|
||||
SNAPSHOT=`cd "$(srcdir)" && git describe --abbrev=4 | cut -b2-`; \
|
||||
@ -127,3 +103,17 @@ mydist:
|
||||
fi; \
|
||||
TAR_OPTIONS='--owner=0 --group=0 --numeric-owner --mode=u+rw,go+r-w' \
|
||||
$(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
|
||||
|
495
NEWS
495
NEWS
@ -2,8 +2,295 @@
|
||||
XZ Utils Release Notes
|
||||
======================
|
||||
|
||||
5.6.3 (2024-10-01)
|
||||
|
||||
IMPORTANT: This includes a Windows-specific security fix to
|
||||
the command line tools. liblzma isn't affected by this issue.
|
||||
|
||||
* liblzma:
|
||||
|
||||
- Fix x86-64 inline assembly compatibility with GNU Binutils
|
||||
older than 2.27.
|
||||
|
||||
- Fix the build with GCC 4.2 on OpenBSD/sparc64.
|
||||
|
||||
* xzdec: Display an error instead of failing silently if the
|
||||
unsupported option -M is specified.
|
||||
|
||||
* lzmainfo: Fix integer overflows when rounding the dictionary and
|
||||
uncompressed sizes to the nearest mebibyte.
|
||||
|
||||
* Windows (except Cygwin and MSYS2): Add an application manifest to
|
||||
xz, xzdec, lzmadec, and lzmainfo executables:
|
||||
|
||||
- Declare them compatible with Vista/7/8/8.1/10/11. This way
|
||||
the programs won't needlessly use Operating System Context
|
||||
of Vista when running on later Windows versions. This setting
|
||||
doesn't mean that the executables cannot run on even older
|
||||
versions if otherwise built that way.
|
||||
|
||||
- Declare them as UAC-compliant. MSVC added this by default
|
||||
already but it wasn't done with MinGW-w64, at least not
|
||||
with all toolchain variants.
|
||||
|
||||
- Declare them long path aware. This makes long path names
|
||||
work on Windows 10 and 11 if the feature has been enabled
|
||||
in the Windows registry.
|
||||
|
||||
- Use the UTF-8 code page on Windows 10 version 1903 and later.
|
||||
|
||||
* Now command line tools can access files whose names
|
||||
contain characters that don't exist in the current
|
||||
legacy code page.
|
||||
|
||||
* The options --files and --files0 now expect file lists
|
||||
to be in UTF-8 instead of the legacy code page.
|
||||
|
||||
* This fixes a security issue: If a command line contains
|
||||
Unicode characters (for example, filenames) that don't
|
||||
exist in the current legacy code page, the characters are
|
||||
converted to similar-looking characters with best-fit
|
||||
mapping. Some best-fit mappings result in ASCII
|
||||
characters that change the meaning of the command line,
|
||||
which can be exploited with malicious filenames to do
|
||||
argument injection or directory traversal attacks.
|
||||
UTF-8 avoids best-fit mappings and thus fixes the issue.
|
||||
|
||||
Forcing the process code page to UTF-8 is possible only
|
||||
on Windows 10 version 1903 and later. The command line
|
||||
tools remain vulnerable if used on an old older
|
||||
version of Windows.
|
||||
|
||||
This issue was discovered by Orange Tsai and splitline
|
||||
from DEVCORE Research Team.
|
||||
|
||||
A related smaller issue remains: Windows filenames may
|
||||
contain unpaired surrogates (invalid UTF-16). These are
|
||||
converted to the replacement character U+FFFD in the
|
||||
UTF-8 code page. Thus, filenames with different unpaired
|
||||
surrogates appear identical and aren't distinguishable
|
||||
from filenames that contain the actual replacement
|
||||
character U+FFFD.
|
||||
|
||||
* When building with MinGW-w64, it is recommended to use
|
||||
UCRT version instead of the old MSVCRT. For example,
|
||||
non-ASCII characters from filenames won't print
|
||||
correctly in messages to console with MSVCRT with
|
||||
the UTF-8 code page (a cosmetic issue). liblzma-only
|
||||
builds are still fine with MSVCRT.
|
||||
|
||||
- Cygwin and MSYS2 process command line options differently and
|
||||
the above issues don't exist. There is no need to replace the
|
||||
default application manifest on Cygwin and MSYS2.
|
||||
|
||||
* Autotools-based build:
|
||||
|
||||
- Fix feature checks with link-time optimization (-flto).
|
||||
|
||||
- Solaris: Fix a compatibility issue in version.sh. It matters
|
||||
if one wants to regenerate configure by running autoconf.
|
||||
|
||||
* CMake:
|
||||
|
||||
- Use paths relative to ${prefix} in liblzma.pc when possible.
|
||||
This is done only with CMake >= 3.20.
|
||||
|
||||
- MSVC: Install liblzma.pc as it can be useful with MSVC too.
|
||||
|
||||
- Windows: Fix liblzma filename prefix, for example:
|
||||
|
||||
* Cygwin: The DLL was incorrectly named liblzma-5.dll.
|
||||
Now it is cyglzma-5.dll.
|
||||
|
||||
* MSVC: Rename import library from liblzma.lib to lzma.lib
|
||||
while keeping liblzma.dll name as is. This helps with
|
||||
"pkgconf --msvc-syntax --libs liblzma" because it mungles
|
||||
"-llzma" in liblzma.pc to "lzma.lib".
|
||||
|
||||
* MinGW-w64: No changes.
|
||||
|
||||
- Windows: Use the correct resource file for lzmadec.exe.
|
||||
Previously the resource file for xzdec.exe was used for both.
|
||||
Autotools-based build isn't affected.
|
||||
|
||||
- Prefer a C11 compiler over a C99 compiler but accept both.
|
||||
|
||||
- Link Threads::Threads against liblzma using PRIVATE so that
|
||||
-pthread and such flags won't unnecessarily get included in
|
||||
the usage requirements of shared liblzma. That is,
|
||||
target_link_libraries(foo PRIVATE liblzma::liblzma) no
|
||||
longer adds -pthread if using POSIX threads and linking
|
||||
against shared liblzma. The threading flags are still added
|
||||
if linking against static liblzma.
|
||||
|
||||
* Updated translations: Catalan, Chinese (simplified), and
|
||||
Brazilian Portuguese.
|
||||
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
added. The API and ABI are still backward compatible with liblzma
|
||||
5.4.x and 5.2.x and 5.0.x.
|
||||
@ -23,7 +310,7 @@ XZ Utils Release Notes
|
||||
* Sandboxing support in xz:
|
||||
|
||||
- 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
|
||||
already in use with pledge(2) since 5.3.4alpha.
|
||||
|
||||
@ -289,6 +576,95 @@ XZ Utils Release Notes
|
||||
* 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)
|
||||
|
||||
* Fixed a bug involving internal function pointers in liblzma not
|
||||
@ -311,7 +687,7 @@ XZ Utils Release Notes
|
||||
* Added a new test.
|
||||
|
||||
|
||||
5.4.5 (2023-11-31)
|
||||
5.4.5 (2023-11-01)
|
||||
|
||||
* liblzma:
|
||||
|
||||
@ -1113,6 +1489,121 @@ XZ Utils Release Notes
|
||||
(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)
|
||||
|
||||
* 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
|
||||
liblzma liblzma.so.*
|
||||
liblzma-devel liblzma.so, liblzma.a, API headers
|
||||
liblzma-doc Doxygen-generated liblzma API docs (HTML),
|
||||
example programs
|
||||
liblzma-doc Example programs and, if enabled at build time,
|
||||
Doxygen-generated liblzma API docs (HTML)
|
||||
|
||||
|
||||
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
|
||||
copies of the common license texts.
|
||||
|
||||
The Doxygen-generated documentation (HTML) for the liblzma API
|
||||
headers is included in the source release and will be installed by
|
||||
"make install" to $docdir/api. All JavaScript is removed to
|
||||
simplify license compliance and to reduce the install size. If the
|
||||
liblzma API documentation is not desired, either run configure with
|
||||
--disable-doc or remove the doc/api directory before running
|
||||
"make install".
|
||||
The Doxygen-generated liblzma API documentation (HTML) is built and
|
||||
installed if the configure option --enable-doxygen is used (it's
|
||||
disabled by default). This requires that Doxygen is available. The
|
||||
API documentation is installed by "make install" to $docdir/api.
|
||||
|
||||
NOTE: The files generated by Doxygen include content from
|
||||
Doxygen itself. Check the license info before distributing
|
||||
the Doxygen-generated files.
|
||||
|
||||
|
||||
6. Extra files
|
||||
|
26
README
26
README
@ -79,8 +79,6 @@ XZ Utils
|
||||
COPYING.GPLv2 GNU General Public License version 2
|
||||
COPYING.GPLv3 GNU General Public License version 3
|
||||
COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
|
||||
COPYING.CC-BY-SA-4.0 Creative Commons Attribution-ShareAlike 4.0
|
||||
International Public License
|
||||
|
||||
AUTHORS The main authors of XZ Utils
|
||||
THANKS Incomplete list of people who have helped making
|
||||
@ -97,9 +95,9 @@ XZ Utils
|
||||
|
||||
The command-line tools are documented as man pages. In source code
|
||||
releases (and possibly also in some binary packages), the man pages
|
||||
are also provided in plain text (ASCII only) and PDF formats in the
|
||||
directory "doc/man" to make the man pages more accessible to those
|
||||
whose operating system doesn't provide an easy way to view man pages.
|
||||
are also provided in plain text (ASCII only) format in the directory
|
||||
"doc/man" to make the man pages more accessible to those whose
|
||||
operating system doesn't provide an easy way to view man pages.
|
||||
|
||||
|
||||
1.3. Documentation for liblzma
|
||||
@ -290,21 +288,23 @@ XZ Utils
|
||||
XZ Embedded is a limited implementation written for use in the Linux
|
||||
kernel, but it is also suitable for other embedded use.
|
||||
|
||||
https://xz.tukaani.org/xz-embedded/
|
||||
https://tukaani.org/xz/embedded.html
|
||||
|
||||
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
|
||||
----------------------
|
||||
|
||||
If you have questions, bug reports, patches etc. related to XZ Utils,
|
||||
the project maintainers Lasse Collin and Jia Tan can be reached via
|
||||
<xz@tukaani.org>.
|
||||
XZ Utils in general:
|
||||
- Home page: https://tukaani.org/xz/
|
||||
- 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).
|
||||
The nick is Larhzu. The channel tends to be pretty quiet,
|
||||
so just ask your question and someone might wake up.
|
||||
Lead maintainer:
|
||||
- Email: Lasse Collin <lasse.collin@tukaani.org>
|
||||
- IRC: Larhzu on Libera Chat
|
||||
|
||||
|
25
THANKS
25
THANKS
@ -33,6 +33,7 @@ has been important. :-) In alphabetical order:
|
||||
- Tomer Chachamu
|
||||
- Vitaly Chikunov
|
||||
- Antoine Cœur
|
||||
- Felix Collin
|
||||
- Gabi Davar
|
||||
- İhsan Doğan
|
||||
- Chris Donawa
|
||||
@ -46,6 +47,7 @@ has been important. :-) In alphabetical order:
|
||||
- Vincent Fazio
|
||||
- Michael Felt
|
||||
- Michael Fox
|
||||
- Andres Freund
|
||||
- Mike Frysinger
|
||||
- Daniel Richard G.
|
||||
- Tomasz Gajc
|
||||
@ -68,14 +70,17 @@ has been important. :-) In alphabetical order:
|
||||
- Hans Jansen
|
||||
- Jouk Jansen
|
||||
- Jun I Jin
|
||||
- Christoph Junghans
|
||||
- Kiyoshi Kanazawa
|
||||
- Joona Kannisto
|
||||
- Per Øyvind Karlsen
|
||||
- Firas Khalil Khana
|
||||
- Iouri Kharon
|
||||
- Thomas Klausner
|
||||
- Richard Koch
|
||||
- Anton Kochkov
|
||||
- Ville Koskinen
|
||||
- Sergey Kosukhin
|
||||
- Marcin Kowalczyk
|
||||
- Jan Kratochvil
|
||||
- Christian Kujau
|
||||
@ -90,6 +95,7 @@ has been important. :-) In alphabetical order:
|
||||
- Cary Lewis
|
||||
- Wim Lewis
|
||||
- Xin Li
|
||||
- Yifeng Li
|
||||
- Eric Lindblad
|
||||
- Lorenzo De Liso
|
||||
- H.J. Lu
|
||||
@ -105,9 +111,11 @@ has been important. :-) In alphabetical order:
|
||||
- Nathan Moinvaziri
|
||||
- Étienne Mollier
|
||||
- Conley Moorhous
|
||||
- Andrew Murray
|
||||
- Rafał Mużyło
|
||||
- Adrien Nader
|
||||
- Evan Nemerson
|
||||
- Alexander Neumann
|
||||
- Hongbo Ni
|
||||
- Jonathan Nieder
|
||||
- Andre Noll
|
||||
@ -116,11 +124,13 @@ has been important. :-) In alphabetical order:
|
||||
- Daniel Packard
|
||||
- Filip Palian
|
||||
- Peter Pallinger
|
||||
- Kai Pastor
|
||||
- Rui Paulo
|
||||
- Igor Pavlov
|
||||
- Diego Elio Pettenò
|
||||
- Elbert Pol
|
||||
- Mikko Pouru
|
||||
- Frank Prochnow
|
||||
- Rich Prohaska
|
||||
- Trần Ngọc Quân
|
||||
- Pavel Raiskup
|
||||
@ -136,9 +146,12 @@ has been important. :-) In alphabetical order:
|
||||
- Stephen Sachs
|
||||
- Jukka Salmi
|
||||
- Agostino Sarubbo
|
||||
- Vijay Sarvepalli
|
||||
- Alexandre Sauvé
|
||||
- Benno Schulenberg
|
||||
- Andreas Schwab
|
||||
- Eli Schwartz
|
||||
- Peter Seiderer
|
||||
- Bhargava Shastry
|
||||
- Dan Shechter
|
||||
- Stuart Shelton
|
||||
@ -147,15 +160,18 @@ has been important. :-) In alphabetical order:
|
||||
- Brad Smith
|
||||
- Bruce Stark
|
||||
- Pippijn van Steenhoven
|
||||
- Tobias Stoeckmann
|
||||
- Martin Storsjö
|
||||
- Jonathan Stott
|
||||
- Dan Stromberg
|
||||
- Jia Tan
|
||||
- Douglas Thor
|
||||
- Vincent Torri
|
||||
- Alexey Tourbin
|
||||
- Paul Townsend
|
||||
- Mohammed Adnène Trojette
|
||||
- Alexey Tourbin
|
||||
- Orange Tsai
|
||||
- Taiki Tsunekawa
|
||||
- Mathieu Vachon
|
||||
- Maksym Vatsyk
|
||||
- Loganaden Velvindron
|
||||
- Patrick J. Volkerding
|
||||
@ -171,9 +187,14 @@ has been important. :-) In alphabetical order:
|
||||
- Charles Wilson
|
||||
- Lars Wirzenius
|
||||
- Pilorz Wojciech
|
||||
- Chien Wong
|
||||
- Ryan Young
|
||||
- Andreas Zieringer
|
||||
|
||||
Companies:
|
||||
- Google
|
||||
- Sandfly Security
|
||||
|
||||
Also thanks to all the people who have participated in the Tukaani project.
|
||||
|
||||
I have probably forgot to add some names to the above list. Sorry about
|
||||
|
18
autogen.sh
18
autogen.sh
@ -17,14 +17,12 @@ ${AUTOCONF:-autoconf}
|
||||
${AUTOHEADER:-autoheader}
|
||||
${AUTOMAKE:-automake} -acf --foreign
|
||||
|
||||
# Generate the translated man pages and the doxygen documentation if the
|
||||
# "po4a" and "doxygen" tools are available.
|
||||
# Generate the translated man pages if the "po4a" tool is available.
|
||||
# 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.
|
||||
# It can be useful when you know that po4a or doxygen aren't available and
|
||||
# Pass --no-po4a to this script to skip this step.
|
||||
# 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.
|
||||
generate_po4a="y"
|
||||
generate_doxygen="y"
|
||||
|
||||
for arg in "$@"
|
||||
do
|
||||
@ -32,10 +30,6 @@ do
|
||||
"--no-po4a")
|
||||
generate_po4a="n"
|
||||
;;
|
||||
|
||||
"--no-doxygen")
|
||||
generate_doxygen="n"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -45,10 +39,4 @@ if test "$generate_po4a" != "n"; then
|
||||
cd ..
|
||||
fi
|
||||
|
||||
if test "$generate_doxygen" != "n"; then
|
||||
cd doxygen
|
||||
sh update-doxygen
|
||||
cd ..
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@ -18,7 +18,7 @@ USAGE="Usage: $0
|
||||
-a [autogen flags]
|
||||
-b [autotools|cmake]
|
||||
-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]
|
||||
-l [destdir]
|
||||
-m [compiler]
|
||||
@ -41,7 +41,6 @@ THREADS="y"
|
||||
SHARED="y"
|
||||
NATIVE_LANG_SUPPORT="y"
|
||||
SMALL="n"
|
||||
IFUNC="y"
|
||||
CLMUL="y"
|
||||
SANDBOX="y"
|
||||
SRC_DIR="$ABS_DIR/../"
|
||||
@ -49,12 +48,15 @@ DEST_DIR="$SRC_DIR/../xz_build"
|
||||
PHASE="all"
|
||||
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 #
|
||||
###################
|
||||
|
||||
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"
|
||||
case ${opt} in
|
||||
h)
|
||||
@ -87,7 +89,6 @@ while getopts a:b:c:d:l:m:n:s:p:f:h opt; do
|
||||
shared) SHARED="n";;
|
||||
nls) NATIVE_LANG_SUPPORT="n";;
|
||||
small) SMALL="y";;
|
||||
ifunc) IFUNC="n";;
|
||||
clmul) CLMUL="n";;
|
||||
sandbox) SANDBOX="n";;
|
||||
*) 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"
|
||||
;;
|
||||
f)
|
||||
CFLAGS="$OPTARG"
|
||||
CFLAGS+=" $OPTARG"
|
||||
export CFLAGS
|
||||
;;
|
||||
w) WRAPPER="$OPTARG"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@ -211,10 +214,18 @@ then
|
||||
add_extra_option "$SHARED" "" "--disable-shared"
|
||||
add_extra_option "$NATIVE_LANG_SUPPORT" "" "--disable-nls"
|
||||
add_extra_option "$SMALL" "--enable-small" ""
|
||||
add_extra_option "$IFUNC" "" "--disable-ifunc"
|
||||
add_extra_option "$CLMUL" "" "--disable-clmul-crc"
|
||||
add_extra_option "$SANDBOX" "" "--enable-sandbox=no"
|
||||
|
||||
# Workaround a bug in too old config.guess. Version with
|
||||
# timestamp='2022-05-08' would be needed but the autotools-dev
|
||||
# package has 2022-01-09 in Ubuntu 22.04LTS and 24.04LTS. The
|
||||
# bug breaks i386 assembler usage autodetection.
|
||||
if "$SRC_DIR/build-aux/config.guess" | grep -q x86_64-pc-linux-gnux32
|
||||
then
|
||||
EXTRA_OPTIONS="$EXTRA_OPTIONS --build=i686-pc-linux-gnu"
|
||||
fi
|
||||
|
||||
# Run configure script
|
||||
"$SRC_DIR"/configure --enable-werror --enable-checks="$CHECK_TYPE" $EXTRA_OPTIONS --config-cache
|
||||
|
||||
@ -240,10 +251,6 @@ then
|
||||
|
||||
add_extra_option "$SMALL" "-DHAVE_SMALL=ON" ""
|
||||
|
||||
if test -n "$CC" ; then
|
||||
EXTRA_OPTIONS="$EXTRA_OPTIONS -DCMAKE_C_COMPILER=$CC"
|
||||
fi
|
||||
|
||||
# Remove old cache file to clear previous settings.
|
||||
rm -f "CMakeCache.txt"
|
||||
cmake "$SRC_DIR/CMakeLists.txt" -B "$DEST_DIR" $EXTRA_OPTIONS -DADDITIONAL_CHECK_TYPES="$CHECK_TYPE" -G "Unix Makefiles"
|
||||
@ -263,7 +270,7 @@ then
|
||||
autotools)
|
||||
cd "$DEST_DIR"
|
||||
# If the tests fail, copy the test logs into the artifacts folder
|
||||
if make check
|
||||
if make check VERBOSE=1 LOG_COMPILER="$WRAPPER"
|
||||
then
|
||||
:
|
||||
else
|
||||
@ -274,7 +281,7 @@ then
|
||||
;;
|
||||
cmake)
|
||||
cd "$DEST_DIR"
|
||||
if make test
|
||||
if ${WRAPPER} make test
|
||||
then
|
||||
:
|
||||
else
|
@ -17,6 +17,5 @@ sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/
|
||||
s/LZMA_VERSION_STABILITY_STABLE//
|
||||
s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \
|
||||
src/liblzma/api/lzma/version.h \
|
||||
| tr '\n' '|' \
|
||||
| sed 's/|/./; s/|/./; s/|//g' \
|
||||
| tr -d '\r\n'
|
||||
| sed 'N; N; N; s/\n/./g; s/\.$//' \
|
||||
| tr -d '\012\015\025'
|
||||
|
285
configure.ac
285
configure.ac
@ -17,7 +17,7 @@
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
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_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@ -304,13 +304,8 @@ AC_ARG_ENABLE([microlzma], AS_HELP_STRING([--disable-microlzma],
|
||||
for example, erofs-utils.]),
|
||||
[], [enable_microlzma=yes])
|
||||
case $enable_microlzma in
|
||||
yes)
|
||||
AC_DEFINE([HAVE_MICROLZMA], [1],
|
||||
[Define to 1 if MicroLZMA support is enabled.])
|
||||
AC_MSG_RESULT([yes])
|
||||
;;
|
||||
no)
|
||||
AC_MSG_RESULT([no])
|
||||
yes | no)
|
||||
AC_MSG_RESULT([$enable_microlzma])
|
||||
;;
|
||||
*)
|
||||
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],
|
||||
[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])
|
||||
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 #
|
||||
@ -629,7 +632,7 @@ AS_CASE([$enable_threads],
|
||||
echo
|
||||
echo "POSIX threading support:"
|
||||
AX_PTHREAD([:]) dnl We don't need the HAVE_PTHREAD macro.
|
||||
LIBS="$LIBS $PTHREAD_LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
|
||||
|
||||
dnl NOTE: PTHREAD_CC is ignored. It would be useful on AIX,
|
||||
@ -714,61 +717,80 @@ fi
|
||||
# --with-pic and --without-pic though. As long as neither --with-pic nor
|
||||
# --without-pic is used then we can use #ifdef PIC to detect if the file is
|
||||
# being built for a shared library.
|
||||
if test "x$enable_symbol_versions" = xno ; then
|
||||
AS_IF([test "x$enable_symbol_versions" = xno], [
|
||||
enable_symbol_versions=no
|
||||
AC_MSG_RESULT([no])
|
||||
elif test "x$enable_shared" = xno ; then
|
||||
], [test "x$enable_shared" = xno], [
|
||||
enable_symbol_versions=no
|
||||
AC_MSG_RESULT([no (not building a shared library)])
|
||||
else
|
||||
case "$host_cpu-$host_os" in
|
||||
microblaze*)
|
||||
# GCC 12 on MicroBlaze doesn't support __symver__
|
||||
# attribute. It's simplest and safest to use the
|
||||
# generic version on that platform since then only
|
||||
# the linker script is needed. The RHEL/CentOS 7
|
||||
# compatibility symbols don't matter on MicroBlaze.
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
*-linux*)
|
||||
case "$pic_mode-$enable_static" in
|
||||
default-*)
|
||||
# Use symvers if PIC is defined.
|
||||
have_symbol_versions_linux=2
|
||||
;;
|
||||
*-no)
|
||||
# Not building static library.
|
||||
# Use symvers unconditionally.
|
||||
have_symbol_versions_linux=1
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([
|
||||
], [
|
||||
# "yes" means that symbol version are to be used but we need to
|
||||
# autodetect which variant to use.
|
||||
if test "x$enable_symbol_versions" = xyes ; then
|
||||
case "$host_cpu-$host_os" in
|
||||
microblaze*)
|
||||
# GCC 12 on MicroBlaze doesn't support
|
||||
# __symver__ attribute. It's simplest and
|
||||
# safest to use the generic version on that
|
||||
# platform since then only the linker script
|
||||
# is needed. The RHEL/CentOS 7 compatibility
|
||||
# symbols don't matter on MicroBlaze.
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
*-linux*)
|
||||
# NVIDIA HPC Compiler doesn't support symbol
|
||||
# versioning but the linker script can still
|
||||
# be used.
|
||||
AC_EGREP_CPP([use_generic_symbol_versioning],
|
||||
[#ifdef __NVCOMPILER
|
||||
use_generic_symbol_versioning
|
||||
#endif],
|
||||
[enable_symbol_versions=generic],
|
||||
[enable_symbol_versions=linux])
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if test "x$enable_symbol_versions" = xlinux ; then
|
||||
case "$pic_mode-$enable_static" in
|
||||
default-*)
|
||||
# Use symvers if PIC is defined.
|
||||
have_symbol_versions_linux=2
|
||||
;;
|
||||
*-no)
|
||||
# Not building static library.
|
||||
# Use symvers unconditionally.
|
||||
have_symbol_versions_linux=1
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([
|
||||
On GNU/Linux, building both shared and static library at the same time
|
||||
is not supported if --with-pic or --without-pic is used.
|
||||
Use either --disable-shared or --disable-static to build one type
|
||||
of library at a time. If both types are needed, build one at a time,
|
||||
possibly picking only src/liblzma/.libs/liblzma.a from the static build.])
|
||||
;;
|
||||
esac
|
||||
enable_symbol_versions=linux
|
||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||
[$have_symbol_versions_linux],
|
||||
[Define to 1 to if GNU/Linux-specific details
|
||||
are unconditionally wanted for symbol
|
||||
versioning. Define to 2 to if these are wanted
|
||||
only if also PIC is defined (allows building
|
||||
both shared and static liblzma at the same
|
||||
time with Libtool if neither --with-pic nor
|
||||
--without-pic is used). This define must be
|
||||
used together with liblzma_linux.map.])
|
||||
;;
|
||||
*)
|
||||
enable_symbol_versions=generic
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AC_DEFINE_UNQUOTED([HAVE_SYMBOL_VERSIONS_LINUX],
|
||||
[$have_symbol_versions_linux],
|
||||
[Define to 1 to if GNU/Linux-specific details
|
||||
are unconditionally wanted for symbol
|
||||
versioning. Define to 2 to if these are wanted
|
||||
only if also PIC is defined (allows building
|
||||
both shared and static liblzma at the same
|
||||
time with Libtool if neither --with-pic nor
|
||||
--without-pic is used). This define must be
|
||||
used together with liblzma_linux.map.])
|
||||
elif test "x$enable_symbol_versions" != xgeneric ; then
|
||||
AC_MSG_RESULT([])
|
||||
AC_MSG_ERROR([unknown symbol versioning variant '$enable_symbol_versions'])
|
||||
fi
|
||||
AC_MSG_RESULT([yes ($enable_symbol_versions)])
|
||||
fi
|
||||
])
|
||||
|
||||
AM_CONDITIONAL([COND_SYMVERS_LINUX],
|
||||
[test "x$enable_symbol_versions" = xlinux])
|
||||
@ -797,12 +819,6 @@ AM_GNU_GETTEXT([external])
|
||||
echo
|
||||
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.
|
||||
# cpuid.h may be used for detecting x86 processor features at runtime.
|
||||
AC_CHECK_HEADERS([immintrin.h cpuid.h])
|
||||
@ -879,78 +895,6 @@ if test "x$enable_small$enable_threads$have_func_attribute_constructor" \
|
||||
__attribute__((__constructor__))])
|
||||
fi
|
||||
|
||||
# __attribute__((__ifunc__())) can be used to choose between different
|
||||
# implementations of the same function at runtime. This is slightly more
|
||||
# efficient than using __attribute__((__constructor__)) and setting
|
||||
# a function pointer.
|
||||
AC_ARG_ENABLE([ifunc], [AS_HELP_STRING([--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.
|
||||
@ -1066,11 +1010,15 @@ AC_CHECK_DECL([_mm_movemask_epi8],
|
||||
#
|
||||
# If everything above is supported, runtime detection will be used to keep the
|
||||
# binaries working on systems that don't support the required extensions.
|
||||
#
|
||||
# NOTE: Use a check that links and not merely compiles to ensure that
|
||||
# missing intrinsics don't get accepted with compilers that allow
|
||||
# implicit function declarations.
|
||||
AC_MSG_CHECKING([if _mm_clmulepi64_si128 is usable])
|
||||
AS_IF([test "x$enable_clmul_crc" = xno], [
|
||||
AC_MSG_RESULT([no, --disable-clmul-crc was used])
|
||||
], [
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <immintrin.h>
|
||||
|
||||
// CLMUL works on older E2K instruction set but it is slow due to emulation.
|
||||
@ -1084,10 +1032,11 @@ AS_IF([test "x$enable_clmul_crc" = xno], [
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
__attribute__((__target__("ssse3,sse4.1,pclmul")))
|
||||
#endif
|
||||
__m128i my_clmul(__m128i a)
|
||||
int main(void)
|
||||
{
|
||||
const __m128i b = _mm_set_epi64x(1, 2);
|
||||
return _mm_clmulepi64_si128(a, b, 0);
|
||||
__m128i a = _mm_set_epi64x(1, 2);
|
||||
a = _mm_clmulepi64_si128(a, a, 0);
|
||||
return 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_USABLE_CLMUL], [1],
|
||||
@ -1109,24 +1058,16 @@ AC_MSG_CHECKING([if ARM64 CRC32 instruction is usable])
|
||||
AS_IF([test "x$enable_arm64_crc32" = xno], [
|
||||
AC_MSG_RESULT([no, --disable-arm64-crc32 was used])
|
||||
], [
|
||||
# Set -Werror here because some versions of Clang (14 and older)
|
||||
# do not report the unsupported __attribute__((__target__("+crc")))
|
||||
# or __crc32d() as an error, only as a warning. This does not need
|
||||
# to be done with CMake because tests will attempt to link and the
|
||||
# error will be reported then.
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <arm_acle.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
__attribute__((__target__("+crc")))
|
||||
#endif
|
||||
uint32_t my_crc(uint32_t a, uint64_t b)
|
||||
int main(void)
|
||||
{
|
||||
return __crc32d(a, b);
|
||||
return __crc32d(1, 2) != 0;
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([HAVE_ARM64_CRC32], [1],
|
||||
@ -1137,19 +1078,22 @@ uint32_t my_crc(uint32_t a, uint64_t b)
|
||||
enable_arm64_crc32=no
|
||||
])
|
||||
AC_MSG_RESULT([$enable_arm64_crc32])
|
||||
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
])
|
||||
|
||||
# Check for ARM64 CRC32 instruction runtime detection.
|
||||
# getauxval() is supported on Linux, elf_aux_info() on FreeBSD, and
|
||||
# sysctlbyname("hw.optional.armv8_crc32", ...) is supported on Darwin
|
||||
# (macOS, iOS, etc.). Note that sysctlbyname() is supported on FreeBSD,
|
||||
# NetBSD, and possibly others too but the string is specific to Apple OSes.
|
||||
# The C code is responsible for checking defined(__APPLE__) before using
|
||||
# sysctlbyname("hw.optional.armv8_crc32", ...).
|
||||
#
|
||||
# - getauxval() is supported on Linux.
|
||||
#
|
||||
# - elf_aux_info() is supported on FreeBSD and OpenBSD >= 7.6.
|
||||
#
|
||||
# - sysctlbyname("hw.optional.armv8_crc32", ...) is supported on Darwin
|
||||
# (macOS, iOS, etc.). Note that sysctlbyname() is supported on FreeBSD,
|
||||
# NetBSD, and possibly others too but the string is specific to Apple
|
||||
# OSes. The C code is responsible for checking defined(__APPLE__)
|
||||
# before using sysctlbyname("hw.optional.armv8_crc32", ...).
|
||||
#
|
||||
AS_IF([test "x$enable_arm64_crc32" = xyes], [
|
||||
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname])
|
||||
AC_CHECK_FUNCS([getauxval elf_aux_info sysctlbyname], [break])
|
||||
])
|
||||
|
||||
|
||||
@ -1177,12 +1121,37 @@ AS_CASE([$enable_sandbox],
|
||||
)
|
||||
AS_CASE([$enable_sandbox],
|
||||
[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_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <linux/landlock.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
int main(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 0;
|
||||
}
|
||||
]])], [
|
||||
enable_sandbox=found
|
||||
|
||||
AS_CASE([$CFLAGS], [*-fsanitize=*], [AC_MSG_ERROR([
|
||||
CFLAGS contains '-fsanitize=' which is incompatible with the Landlock
|
||||
sandboxing. Use --disable-sandbox when using '-fsanitize'.])])
|
||||
|
||||
AC_DEFINE([HAVE_LINUX_LANDLOCK], [1],
|
||||
[Define to 1 if Linux Landlock is supported.
|
||||
See configure.ac for details.])
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
]
|
||||
)
|
||||
|
@ -11,7 +11,8 @@ noinst_PROGRAMS = \
|
||||
memusage \
|
||||
crc32 \
|
||||
known_sizes \
|
||||
hex2bin
|
||||
hex2bin \
|
||||
testfilegen-arm64
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-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=mf=abcd" \
|
||||
"xz --lzma2=preset=foobarbaz" \
|
||||
"xz --lzma2=mf=bt4,nice=2" \
|
||||
"xz --lzma2=nice=50000" \
|
||||
"xz --help" \
|
||||
"xz --long-help" \
|
||||
|
@ -45,7 +45,7 @@ init_encoder(lzma_stream *strm)
|
||||
}
|
||||
|
||||
// Now we could customize the LZMA2 options if we wanted. For example,
|
||||
// we could set the the dictionary size (opt_lzma2.dict_size) to
|
||||
// we could set the dictionary size (opt_lzma2.dict_size) to
|
||||
// something else than the default (8 MiB) of the default preset.
|
||||
// See lzma/lzma12.h for details of all LZMA2 options.
|
||||
//
|
||||
|
@ -240,5 +240,5 @@ A: Give --enable-small to the configure script. Use also appropriate
|
||||
If the result is still too big, take a look at XZ Embedded. It is
|
||||
a separate project, which provides a limited but significantly
|
||||
smaller XZ decoder implementation than XZ Utils. You can find it
|
||||
at <https://xz.tukaani.org/xz-embedded/>.
|
||||
at <https://tukaani.org/xz/embedded.html>.
|
||||
|
||||
|
@ -40,11 +40,11 @@ The .lzma File Format
|
||||
|
||||
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)
|
||||
the section 2 was modified to change links from http to
|
||||
https and to update XZ links.
|
||||
From version 2011-04-12 11:55+0300 to 2022-07-13 21:00+0300:
|
||||
The section 1.1.3 was modified to allow End of Payload Marker
|
||||
with a known Uncompressed Size.
|
||||
|
||||
|
||||
1. File Format
|
||||
@ -166,8 +166,8 @@ The .lzma File Format
|
||||
https://tukaani.org/lzma/
|
||||
|
||||
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
|
||||
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
|
||||
===================
|
||||
|
||||
Version 1.2.0 (2024-01-19)
|
||||
Version 1.2.1 (2024-04-08)
|
||||
|
||||
|
||||
0. Preface
|
||||
@ -81,18 +81,22 @@ Version 1.2.0 (2024-01-19)
|
||||
0.2. Getting the Latest Version
|
||||
|
||||
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
|
||||
xz-file-format-X.Y.Z.txt where X.Y.Z is the version number.
|
||||
For example, the version 1.0.0 of this document is available
|
||||
at <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
|
||||
|
||||
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
|
||||
Sections 0.2 and 7. The URL of this
|
||||
specification was changed.
|
||||
@ -1147,7 +1151,7 @@ Version 1.2.0 (2024-01-19)
|
||||
https://tukaani.org/lzma/
|
||||
|
||||
XZ Utils - The next generation of LZMA Utils
|
||||
https://xz.tukaani.org/xz-utils/
|
||||
https://tukaani.org/xz/
|
||||
|
||||
[RFC-1952]
|
||||
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 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 HAVE_LZIP_DECODER 1
|
||||
|
||||
@ -108,15 +105,6 @@
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#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 HAVE_UTIMES 1
|
||||
|
||||
@ -145,7 +133,7 @@
|
||||
#define PACKAGE_NAME "XZ Utils"
|
||||
|
||||
/* 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. */
|
||||
#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.
|
||||
# If the doxygen command is not installed, it will exit with an error.
|
||||
# This script can generate Doxygen documentation for all source files or for
|
||||
# just liblzma API header files.
|
||||
# While it's possible to use the Doxyfile as is to generate liblzma API
|
||||
# documentation, it is recommended to use this script because this adds
|
||||
# the XZ Utils version number to the generated HTML.
|
||||
#
|
||||
# It is recommended to use this script to update the Doxygen-generated HTML
|
||||
# files since this will include the package version in the output and,
|
||||
# in case of liblzma API docs, strip JavaScript files from the output.
|
||||
# Other features:
|
||||
# - Generate documentation of the XZ Utils internals.
|
||||
# - Set input and output paths for out-of-tree builds.
|
||||
#
|
||||
#############################################################################
|
||||
#
|
||||
@ -21,31 +20,67 @@
|
||||
|
||||
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
|
||||
:
|
||||
else
|
||||
echo "doxygen/update-doxygen: 'doxygen' command not found." >&2
|
||||
echo "doxygen/update-doxygen: Skipping Doxygen docs generation." >&2
|
||||
echo "$0: 'doxygen' command not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f Doxyfile; then
|
||||
cd `dirname "$0"` || exit 1
|
||||
if test ! -f Doxyfile; then
|
||||
echo "doxygen/update-doxygen: Cannot find Doxyfile" >&2
|
||||
exit 1
|
||||
fi
|
||||
case $# in
|
||||
1)
|
||||
# One argument: Building inside the source tree
|
||||
ABS_TOP_SRCDIR=`dirname "$0"`/..
|
||||
ABS_OUTDIR=$ABS_TOP_SRCDIR/doc
|
||||
;;
|
||||
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
|
||||
|
||||
# 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
|
||||
'' | api)
|
||||
api)
|
||||
# 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
|
||||
# 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
|
||||
# feature to override the tags that need to change between
|
||||
# "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"
|
||||
) | doxygen -
|
||||
|
||||
# As of Doxygen 1.8.0 - 1.9.6 and the Doxyfile options we use,
|
||||
# the output is good without any JavaScript. Unfortunately
|
||||
# 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
|
||||
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
||||
echo "STRIP_FROM_PATH = $ABS_SRCDIR"
|
||||
echo "INPUT = $ABS_SRCDIR"
|
||||
) | doxygen -q -
|
||||
;;
|
||||
|
||||
internal)
|
||||
# The docs from internal aren't for distribution so
|
||||
# the JavaScript files aren't an issue here.
|
||||
rm -rf ../doc/internal
|
||||
rm -rf "$ABS_OUTDIR/internal"
|
||||
(
|
||||
cat Doxyfile
|
||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||
cat "$ABS_TOP_SRCDIR/doxygen/Doxyfile"
|
||||
echo 'PROJECT_NAME = "XZ Utils"'
|
||||
echo 'STRIP_FROM_PATH = ../src'
|
||||
echo 'INPUT = ../src'
|
||||
echo "PROJECT_NUMBER = $PACKAGE_VERSION"
|
||||
echo "OUTPUT_DIRECTORY = $ABS_OUTDIR"
|
||||
echo "STRIP_FROM_PATH = $ABS_TOP_SRCDIR"
|
||||
echo "INPUT = $ABS_TOP_SRCDIR/src"
|
||||
echo 'HTML_OUTPUT = internal'
|
||||
echo 'EXTRACT_PRIVATE = YES'
|
||||
echo 'EXTRACT_STATIC = YES'
|
||||
echo 'EXTRACT_LOCAL_CLASSES = YES'
|
||||
echo 'SEARCHENGINE = YES'
|
||||
) | doxygen -
|
||||
;;
|
||||
|
||||
*)
|
||||
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
|
||||
) | doxygen -q -
|
||||
;;
|
||||
esac
|
||||
|
@ -71,7 +71,7 @@ main(void)
|
||||
# -lfreebsd-glue when linking and thus in the current form this would
|
||||
# fail on GNU/kFreeBSD. The above test for sched_getaffinity() matches
|
||||
# on GNU/kFreeBSD so the test below should never run on that OS.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/cpuset.h>
|
||||
|
||||
@ -92,7 +92,7 @@ main(void)
|
||||
#
|
||||
# We test sysctl() first and intentionally break the sysctl() test on QNX
|
||||
# so that sysctl() is never used on QNX.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifdef __QNX__
|
||||
compile error
|
||||
#endif
|
||||
@ -116,7 +116,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=sysctl], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
@ -133,7 +133,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_cpucores_method=sysconf], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
|
||||
|
@ -65,6 +65,11 @@ compile error
|
||||
# Look for AIX-specific solution before sysconf(), because the test
|
||||
# for sysconf() will pass on AIX but won't actually work
|
||||
# (sysconf(_SC_PHYS_PAGES) compiles but always returns -1 on AIX).
|
||||
#
|
||||
# NOTE: There is no need to link the check program because it's not calling
|
||||
# any functions and thus implicit function declarations aren't a problem.
|
||||
# The unused reference to _system_configuration.physmem might get optimized
|
||||
# away, and thus the linker might not see that symbol anyway.
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
@ -76,7 +81,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=aix], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
int
|
||||
main(void)
|
||||
@ -88,7 +93,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=sysconf], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
@ -104,7 +109,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=sysctl], [
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/sysinfo.h>
|
||||
#include <machine/hal_sysinfo.h>
|
||||
|
||||
@ -118,7 +123,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=getsysinfo],[
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/param.h>
|
||||
#include <sys/pstat.h>
|
||||
|
||||
@ -133,7 +138,7 @@ main(void)
|
||||
}
|
||||
]])], [tuklib_cv_physmem_method=pstat_getstatic],[
|
||||
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <invent.h>
|
||||
int
|
||||
main(void)
|
||||
@ -150,7 +155,7 @@ main(void)
|
||||
# different sysinfo() so we must check $host_os.
|
||||
case $host_os in
|
||||
linux*)
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/sysinfo.h>
|
||||
int
|
||||
main(void)
|
||||
|
@ -1,7 +1,8 @@
|
||||
dnl SPDX-License-Identifier: FSFULLR
|
||||
|
||||
# visibility.m4 serial 8
|
||||
dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc.
|
||||
# visibility.m4
|
||||
# serial 9
|
||||
dnl Copyright (C) 2005, 2008, 2010-2024 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
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.
|
||||
AC_CACHE_CHECK([whether the -Werror option is usable],
|
||||
[gl_cv_cc_vis_werror],
|
||||
[gl_save_CFLAGS="$CFLAGS"
|
||||
[gl_saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Werror"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM([[]], [[]])],
|
||||
[gl_cv_cc_vis_werror=yes],
|
||||
[gl_cv_cc_vis_werror=no])
|
||||
CFLAGS="$gl_save_CFLAGS"
|
||||
CFLAGS="$gl_saved_CFLAGS"
|
||||
])
|
||||
dnl Now check whether visibility declarations are supported.
|
||||
AC_CACHE_CHECK([for simple visibility declarations],
|
||||
[gl_cv_cc_visibility],
|
||||
[gl_save_CFLAGS="$CFLAGS"
|
||||
[gl_saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -fvisibility=hidden"
|
||||
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
|
||||
@ -70,7 +71,7 @@ AC_DEFUN([gl_VISIBILITY],
|
||||
[[]])],
|
||||
[gl_cv_cc_visibility=yes],
|
||||
[gl_cv_cc_visibility=no])
|
||||
CFLAGS="$gl_save_CFLAGS"
|
||||
CFLAGS="$gl_saved_CFLAGS"
|
||||
])
|
||||
if test $gl_cv_cc_visibility = yes; then
|
||||
CFLAG_VISIBILITY="-fvisibility=hidden"
|
||||
|
10
po/Makevars
10
po/Makevars
@ -14,7 +14,7 @@ subdir = po
|
||||
top_builddir = ..
|
||||
|
||||
# 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
|
||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||
@ -63,7 +63,7 @@ USE_MSGCTXT = no
|
||||
# Useful options are in particular:
|
||||
# --previous to keep previous msgids of translated messages,
|
||||
# --quiet to reduce the verbosity.
|
||||
MSGMERGE_OPTIONS = --no-wrap
|
||||
MSGMERGE_OPTIONS = --add-location=file --no-wrap
|
||||
|
||||
# These options get passed to msginit.
|
||||
# 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
|
||||
# "no". Set this to no if the POT file and PO files are maintained
|
||||
# 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
|
||||
|
545
po/pt_BR.po
545
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
507
po/zh_CN.po
507
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
|
||||
# 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).
|
||||
#
|
||||
# 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
|
||||
po4a --force --verbose \
|
||||
--package-name="XZ Utils" \
|
||||
--porefs file --wrap-po newlines --msgmerge-opt "--no-wrap" \
|
||||
--package-name="xz-man" \
|
||||
--package-version="$PACKAGE_VERSION" \
|
||||
--copyright-holder="The XZ Utils authors and contributors" \
|
||||
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
|
||||
# identifier and spells out the license name instead of saying
|
||||
# "the same license as the XZ Utils package".
|
||||
|
@ -35,4 +35,6 @@ EXTRA_DIST = \
|
||||
common/tuklib_physmem.c \
|
||||
common/tuklib_physmem.h \
|
||||
common/tuklib_progname.c \
|
||||
common/tuklib_progname.h
|
||||
common/tuklib_progname.h \
|
||||
common/w32_application.manifest \
|
||||
common/w32_application.manifest.comments.txt
|
||||
|
@ -22,14 +22,15 @@
|
||||
#define MY_PRODUCT PACKAGE_NAME " <" PACKAGE_URL ">"
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION MY_VERSION
|
||||
PRODUCTVERSION MY_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE MY_TYPE
|
||||
FILESUBTYPE 0x0L
|
||||
FILEVERSION MY_VERSION
|
||||
PRODUCTVERSION MY_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEFLAGS 0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE MY_TYPE
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
@ -49,3 +50,8 @@ BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
/* Omit the manifest on Cygwin and MSYS2 (both define __CYGWIN__). */
|
||||
#if MY_TYPE == VFT_APP && !defined(__CYGWIN__)
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "w32_application.manifest"
|
||||
#endif
|
||||
|
@ -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
|
||||
mythread_mutex_init(mythread_mutex *mutex)
|
||||
{
|
||||
|
@ -16,7 +16,7 @@
|
||||
///
|
||||
/// Endianness-converting integer operations (these can be macros!)
|
||||
/// (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
|
||||
/// the native endianness): convXXYe(num)
|
||||
/// - Unaligned reads: readXXYe(ptr)
|
||||
@ -66,38 +66,47 @@
|
||||
|
||||
#if defined(HAVE___BUILTIN_BSWAPXX)
|
||||
// GCC >= 4.8 and Clang
|
||||
# define bswap16(n) __builtin_bswap16(n)
|
||||
# define bswap32(n) __builtin_bswap32(n)
|
||||
# define bswap64(n) __builtin_bswap64(n)
|
||||
# define byteswap16(num) __builtin_bswap16(num)
|
||||
# define byteswap32(num) __builtin_bswap32(num)
|
||||
# define byteswap64(num) __builtin_bswap64(num)
|
||||
|
||||
#elif defined(HAVE_BYTESWAP_H)
|
||||
// glibc, uClibc, dietlibc
|
||||
# include <byteswap.h>
|
||||
# ifdef HAVE_BSWAP_16
|
||||
# define bswap16(num) bswap_16(num)
|
||||
# define byteswap16(num) bswap_16(num)
|
||||
# endif
|
||||
# ifdef HAVE_BSWAP_32
|
||||
# define bswap32(num) bswap_32(num)
|
||||
# define byteswap32(num) bswap_32(num)
|
||||
# endif
|
||||
# ifdef HAVE_BSWAP_64
|
||||
# define bswap64(num) bswap_64(num)
|
||||
# define byteswap64(num) bswap_64(num)
|
||||
# endif
|
||||
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
// *BSDs and Darwin
|
||||
# include <sys/endian.h>
|
||||
# ifdef __OpenBSD__
|
||||
# define byteswap16(num) swap16(num)
|
||||
# define byteswap32(num) swap32(num)
|
||||
# define byteswap64(num) swap64(num)
|
||||
# else
|
||||
# define byteswap16(num) bswap16(num)
|
||||
# define byteswap32(num) bswap32(num)
|
||||
# define byteswap64(num) bswap64(num)
|
||||
# endif
|
||||
|
||||
#elif defined(HAVE_SYS_BYTEORDER_H)
|
||||
// Solaris
|
||||
# include <sys/byteorder.h>
|
||||
# ifdef BSWAP_16
|
||||
# define bswap16(num) BSWAP_16(num)
|
||||
# define byteswap16(num) BSWAP_16(num)
|
||||
# endif
|
||||
# ifdef BSWAP_32
|
||||
# define bswap32(num) BSWAP_32(num)
|
||||
# define byteswap32(num) BSWAP_32(num)
|
||||
# endif
|
||||
# ifdef BSWAP_64
|
||||
# define bswap64(num) BSWAP_64(num)
|
||||
# define byteswap64(num) BSWAP_64(num)
|
||||
# endif
|
||||
# ifdef BE_16
|
||||
# define conv16be(num) BE_16(num)
|
||||
@ -119,15 +128,15 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef bswap16
|
||||
# define bswap16(n) (uint16_t)( \
|
||||
#ifndef byteswap16
|
||||
# define byteswap16(n) (uint16_t)( \
|
||||
(((n) & 0x00FFU) << 8) \
|
||||
| (((n) & 0xFF00U) >> 8) \
|
||||
)
|
||||
#endif
|
||||
|
||||
#ifndef bswap32
|
||||
# define bswap32(n) (uint32_t)( \
|
||||
#ifndef byteswap32
|
||||
# define byteswap32(n) (uint32_t)( \
|
||||
(((n) & UINT32_C(0x000000FF)) << 24) \
|
||||
| (((n) & UINT32_C(0x0000FF00)) << 8) \
|
||||
| (((n) & UINT32_C(0x00FF0000)) >> 8) \
|
||||
@ -135,8 +144,8 @@
|
||||
)
|
||||
#endif
|
||||
|
||||
#ifndef bswap64
|
||||
# define bswap64(n) (uint64_t)( \
|
||||
#ifndef byteswap64
|
||||
# define byteswap64(n) (uint64_t)( \
|
||||
(((n) & UINT64_C(0x00000000000000FF)) << 56) \
|
||||
| (((n) & UINT64_C(0x000000000000FF00)) << 40) \
|
||||
| (((n) & UINT64_C(0x0000000000FF0000)) << 24) \
|
||||
@ -160,23 +169,23 @@
|
||||
# define conv64be(num) ((uint64_t)(num))
|
||||
# endif
|
||||
# ifndef conv16le
|
||||
# define conv16le(num) bswap16(num)
|
||||
# define conv16le(num) byteswap16(num)
|
||||
# endif
|
||||
# ifndef conv32le
|
||||
# define conv32le(num) bswap32(num)
|
||||
# define conv32le(num) byteswap32(num)
|
||||
# endif
|
||||
# ifndef conv64le
|
||||
# define conv64le(num) bswap64(num)
|
||||
# define conv64le(num) byteswap64(num)
|
||||
# endif
|
||||
#else
|
||||
# ifndef conv16be
|
||||
# define conv16be(num) bswap16(num)
|
||||
# define conv16be(num) byteswap16(num)
|
||||
# endif
|
||||
# ifndef conv32be
|
||||
# define conv32be(num) bswap32(num)
|
||||
# define conv32be(num) byteswap32(num)
|
||||
# endif
|
||||
# ifndef conv64be
|
||||
# define conv64be(num) bswap64(num)
|
||||
# define conv64be(num) byteswap64(num)
|
||||
# endif
|
||||
# ifndef conv16le
|
||||
# define conv16le(num) ((uint16_t)(num))
|
||||
@ -234,7 +243,7 @@
|
||||
// from the memcpy() method than from simple byte-by-byte shift-or code
|
||||
// when reading a 32-bit integer:
|
||||
//
|
||||
// (1) It may be constructed on stack using using four 8-bit loads,
|
||||
// (1) It may be constructed on stack using four 8-bit loads,
|
||||
// four 8-bit stores to stack, and finally one 32-bit load from stack.
|
||||
//
|
||||
// (2) Especially with -Os, an actual memcpy() call may be emitted.
|
||||
@ -624,7 +633,7 @@ write64le(uint8_t *buf, uint64_t num)
|
||||
// aligned but some compilers have language extensions to do that. With
|
||||
// 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
|
||||
// optimizations that have been made specifically with aligned access in mind.
|
||||
// As a compromise, aligned reads will fall back to non-compliant type punning
|
||||
|
28
src/common/w32_application.manifest
Normal file
28
src/common/w32_application.manifest
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/> <!-- Vista -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> <!-- 7 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- 8 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- 8.1 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> <!-- 10/11 -->
|
||||
</application>
|
||||
</compatibility>
|
||||
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level="asInvoker"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
178
src/common/w32_application.manifest.comments.txt
Normal file
178
src/common/w32_application.manifest.comments.txt
Normal file
@ -0,0 +1,178 @@
|
||||
|
||||
Windows application manifest for UTF-8 and long paths
|
||||
=====================================================
|
||||
|
||||
The .manifest file is embedded as is in the executables, thus
|
||||
the comments are here in a separate file. These comments were
|
||||
written in context of XZ Utils but might be useful when porting
|
||||
other command line tools from POSIX environments to Windows.
|
||||
|
||||
NOTE: On Cygwin and MSYS2, command line arguments and file
|
||||
system access aren't tied to a Windows code page. Cygwin
|
||||
and MSYS2 include a default application manifest. Replacing
|
||||
it doesn't seem useful and might even be harmful if Cygwin
|
||||
and MSYS2 some day change their default manifest.
|
||||
|
||||
|
||||
UTF-8 code page
|
||||
---------------
|
||||
|
||||
On Windows, command line applications can use main() or wmain().
|
||||
With the Windows-specific wmain(), argv contains UTF-16 code units
|
||||
which is the native encoding on Windows. With main(), argv uses the
|
||||
system active code page by default. It typically is a legacy code
|
||||
page like Windows-1252.
|
||||
|
||||
NOTE: On POSIX, argv for main() is constructed by the calling
|
||||
process. On Windows, argv is constructed by a new process
|
||||
itself: a program receives the command line as a single string,
|
||||
and the startup code splits it into individual arguments,
|
||||
including quote removal and wildcard expansion. Then main() or
|
||||
wmain() is called.
|
||||
|
||||
This application manifest forces the process code page to UTF-8
|
||||
when the application runs on Windows 10 version 1903 or later.
|
||||
This is useful for programs that use main():
|
||||
|
||||
* UTF-8 allows such programs to access files whose names contain
|
||||
characters that don't exist in the current legacy code page.
|
||||
However, filenames on Windows may contain unpaired surrogates
|
||||
(invalid UTF-16). Such files cannot be accesses even with the
|
||||
UTF-8 code page.
|
||||
|
||||
* UTF-8 avoids a security issue in command line argument handling:
|
||||
If a command line contains Unicode characters (for example,
|
||||
filenames) that don't exist in the current legacy code page,
|
||||
the characters are converted to similar-looking characters
|
||||
with best-fit mapping. Some best-fit mappings result in ASCII
|
||||
characters that change the meaning of the command line, which
|
||||
can be exploited with malicious filenames. For example:
|
||||
|
||||
- Double quote (") breaks quoting and makes argument
|
||||
injection possible.
|
||||
|
||||
- Question mark (?) is a wildcard character which may
|
||||
expand to one or more filenames.
|
||||
|
||||
- Forward slash (/) makes a directory traversal attack
|
||||
possible. This character can appear in a dangerous way
|
||||
even from a wildcard expansion; a look-alike character
|
||||
doesn't need to be passed directly on the command line.
|
||||
|
||||
UTF-8 avoids best-fit mappings. However, it's still not
|
||||
perfect. Unpaired surrogates (invalid UTF-16) on the command
|
||||
line (including those from wildcard expansion) are converted
|
||||
to the replacement character U+FFFD. Thus, filenames with
|
||||
different unpaired surrogates appear identical when converted
|
||||
to the UTF-8 code page and aren't distinguishable from
|
||||
filenames that contain the actual replacement character U+FFFD.
|
||||
|
||||
If different programs use different code pages, compatibility issues
|
||||
are possible. For example, if one program produces a list of
|
||||
filenames and another program reads it, both programs should use
|
||||
the same code page because the code page affects filenames in the
|
||||
char-based file system APIs.
|
||||
|
||||
If building with a MinGW-w64 toolchain, it is strongly recommended
|
||||
to use UCRT instead of the old MSVCRT. For example, with the UTF-8
|
||||
code page, MSVCRT doesn't convert non-ASCII characters correctly
|
||||
when writing to console with printf(). With UCRT it works.
|
||||
|
||||
|
||||
Long path names
|
||||
---------------
|
||||
|
||||
The manifest enables support for path names longer than 259
|
||||
characters if the feature has been enabled in the Windows registry.
|
||||
Omit the longPathAware element from the manifest if the application
|
||||
isn't compatible with it. For example, uses of MAX_PATH might be
|
||||
a sign of incompatibility.
|
||||
|
||||
Documentation of the registry setting:
|
||||
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later
|
||||
|
||||
|
||||
Summary of the manifest contents
|
||||
--------------------------------
|
||||
|
||||
See also Microsoft's documentation:
|
||||
https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests
|
||||
|
||||
assemblyIdentity (omitted)
|
||||
|
||||
This is documented as mandatory but not all apps in the real world
|
||||
have it, and of those that do, not all put an up-to-date version
|
||||
number there. Things seem to work correctly without
|
||||
<assemblyIdentity> so let's keep this simpler and omit it.
|
||||
|
||||
compatibility
|
||||
|
||||
Declare the application compatible with different Windows versions.
|
||||
Without this, Windows versions newer than Vista will run the
|
||||
application using Vista as the Operating System Context.
|
||||
|
||||
trustInfo
|
||||
|
||||
Declare the application as UAC-compliant. This avoids file system
|
||||
and registry virtualization that Windows otherwise does with 32-bit
|
||||
executables to make some ancient applications work. UAC-compliancy
|
||||
also stops Windows from using heuristics based on the filename
|
||||
(like setup.exe) to guess when elevated privileges might be
|
||||
needed which would then bring up the UAC prompt.
|
||||
|
||||
longPathAware
|
||||
|
||||
Declare the application as long path aware. This way many file
|
||||
system operations aren't limited by MAX_PATH (260 characters
|
||||
including the terminating null character) if the feature has
|
||||
also been enabled in the Windows registry.
|
||||
|
||||
activeCodePage
|
||||
|
||||
Force the process code page to UTF-8 on Windows 10 version 1903
|
||||
and later. For example:
|
||||
|
||||
- main() gets the command line arguments in UTF-8 instead of
|
||||
in a legacy code page.
|
||||
|
||||
- File system APIs that take char-based strings use UTF-8
|
||||
instead of a legacy code page.
|
||||
|
||||
- Text written to the console via stdio.h's stdout or stderr
|
||||
(like calling printf()) are expected to be in UTF-8.
|
||||
|
||||
|
||||
CMake notes
|
||||
-----------
|
||||
|
||||
As of CMake 3.30, one can add a .manifest file as a source file but
|
||||
it only works with MSVC; it's ignored with MinGW-w64 toolchains.
|
||||
Embedding the manifest with a resource file works with all
|
||||
toolchains. However, then the default manifest needs to be
|
||||
disabled with MSVC in CMakeLists.txt to avoid duplicate
|
||||
manifests which would break the build.
|
||||
|
||||
w32_application.manifest.rc:
|
||||
|
||||
#include <winresrc.h>
|
||||
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "w32_application.manifest"
|
||||
|
||||
Or the same thing without the #include:
|
||||
|
||||
1 24 "w32_application.manifest"
|
||||
|
||||
CMakeLists.txt:
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
endif()
|
||||
|
||||
add_executable(foo foo.c)
|
||||
|
||||
# WIN32 isn't set on Cygwin or MSYS2, thus if(WIN32) is correct here.
|
||||
if(WIN32)
|
||||
target_sources(foo PRIVATE w32_application.manifest.rc)
|
||||
set_source_files_properties(w32_application.manifest.rc PROPERTIES
|
||||
OBJECT_DEPENDS w32_application.manifest
|
||||
)
|
||||
endif()
|
@ -20,7 +20,7 @@ liblzma_la_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/liblzma/simple \
|
||||
-I$(top_srcdir)/src/common \
|
||||
-DTUKLIB_SYMBOL_PREFIX=lzma_
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 10:99:5
|
||||
liblzma_la_LDFLAGS = -no-undefined -version-info 11:3:6
|
||||
|
||||
EXTRA_DIST += liblzma_generic.map liblzma_linux.map validate_map.sh
|
||||
if COND_SYMVERS_GENERIC
|
||||
|
@ -17,3 +17,22 @@ nobase_include_HEADERS = \
|
||||
lzma/stream_flags.h \
|
||||
lzma/version.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)
|
||||
* 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.
|
||||
* 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,
|
||||
* 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.
|
||||
*/
|
||||
LZMA_RET_INTERNAL1 = 101,
|
||||
|
@ -306,7 +306,7 @@ extern LZMA_API(uint64_t) lzma_easy_decoder_memusage(uint32_t preset)
|
||||
* number and zero or more flags. Usually flags aren't
|
||||
* used, so preset is simply a number [0, 9] which match
|
||||
* the options -0 ... -9 of the xz command line tool.
|
||||
* Additional flags can be be set using bitwise-or with
|
||||
* Additional flags can be set using bitwise-or with
|
||||
* the preset level number, e.g. 6 | LZMA_PRESET_EXTREME.
|
||||
* \param check Integrity check type to use. See check.h for available
|
||||
* checks. The xz command line tool defaults to
|
||||
@ -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
|
||||
* 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.
|
||||
* \param memlimit Memory usage limit as bytes. Use UINT64_MAX
|
||||
* to effectively disable the limiter. liblzma
|
||||
|
@ -233,7 +233,7 @@ typedef struct {
|
||||
} block;
|
||||
|
||||
/**
|
||||
* \private Internal struct.
|
||||
* \private Internal data
|
||||
*
|
||||
* Internal data which is used to store the state of the iterator.
|
||||
* 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
|
||||
* is freed or moved to be part of dest, and all
|
||||
* 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().
|
||||
*
|
||||
* \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
|
||||
* pointed by this pointer is modified if and only
|
||||
* 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().
|
||||
* \param in Beginning of the input buffer
|
||||
* \param in_pos The next byte will be read from in[*in_pos].
|
||||
|
@ -19,10 +19,10 @@
|
||||
#define LZMA_VERSION_MAJOR 5
|
||||
|
||||
/** \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. */
|
||||
#define LZMA_VERSION_PATCH 2
|
||||
#define LZMA_VERSION_PATCH 3
|
||||
|
||||
/**
|
||||
* \brief Version stability marker
|
||||
@ -32,7 +32,7 @@
|
||||
* - LZMA_VERSION_STABILITY_BETA
|
||||
* - 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 */
|
||||
#ifndef LZMA_VERSION_COMMIT
|
||||
|
@ -67,9 +67,8 @@ typedef uint64_t lzma_vli;
|
||||
* This is useful to test that application has given acceptable values
|
||||
* for example in the uncompressed_size and compressed_size variables.
|
||||
*
|
||||
* \return True if the integer is representable as VLI or if it
|
||||
* indicates unknown value. False if the integer cannot be
|
||||
* represented as VLI.
|
||||
* \return True if the integer is representable as a VLI or if it
|
||||
* indicates an unknown value. False otherwise.
|
||||
*/
|
||||
#define lzma_vli_is_valid(vli) \
|
||||
((vli) <= LZMA_VLI_MAX || (vli) == LZMA_VLI_UNKNOWN)
|
||||
|
@ -11,7 +11,6 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef LZMA_CRC32_ARM64_H
|
||||
#define LZMA_CRC32_ARM64_H
|
||||
|
||||
@ -21,6 +20,8 @@
|
||||
# include <arm_acle.h>
|
||||
#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(HAVE_GETAUXVAL) || defined(HAVE_ELF_AUX_INFO)
|
||||
# include <sys/auxv.h>
|
||||
@ -36,8 +37,7 @@
|
||||
//
|
||||
// NOTE: Build systems check for this too, keep them in sync with this.
|
||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__EDG__)
|
||||
# define crc_attr_target \
|
||||
__attribute__((__target__("+crc")))
|
||||
# define crc_attr_target __attribute__((__target__("+crc")))
|
||||
#else
|
||||
# define crc_attr_target
|
||||
#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
|
||||
// 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)
|
||||
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
|
||||
// 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.
|
||||
for (const uint8_t *limit = buf + (size & ~((size_t)7));
|
||||
for (const uint8_t *limit = buf + (size & ~(size_t)7);
|
||||
buf < limit; buf += 8)
|
||||
crc = __crc32d(crc, aligned_read64le(buf));
|
||||
|
||||
@ -84,8 +84,10 @@ is_arch_extension_supported(void)
|
||||
#elif defined(HAVE_ELF_AUX_INFO)
|
||||
unsigned long feature_flags;
|
||||
|
||||
elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags));
|
||||
return feature_flags & HWCAP_CRC32 != 0;
|
||||
if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0)
|
||||
return false;
|
||||
|
||||
return (feature_flags & HWCAP_CRC32) != 0;
|
||||
|
||||
#elif defined(_WIN32)
|
||||
return IsProcessorFeaturePresent(
|
||||
@ -98,11 +100,12 @@ is_arch_extension_supported(void)
|
||||
// The sysctlbyname() function requires a string identifier for the
|
||||
// CPU feature it tests. The Apple documentation lists the string
|
||||
// "hw.optional.armv8_crc32", which can be found here:
|
||||
// (https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619)
|
||||
int err = sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
|
||||
&size, NULL, 0);
|
||||
// https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619
|
||||
if (sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
|
||||
&size, NULL, 0) != 0)
|
||||
return false;
|
||||
|
||||
return !err && has_crc32;
|
||||
return has_crc32;
|
||||
|
||||
#else
|
||||
// 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;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
crc = bswap32(crc);
|
||||
crc = byteswap32(crc);
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
crc = bswap32(crc);
|
||||
crc = byteswap32(crc);
|
||||
#endif
|
||||
|
||||
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
|
||||
// the function to use is selected at runtime because the system running
|
||||
// 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
|
||||
// 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
|
||||
// 1. Constructor. This method uses __attribute__((__constructor__)) to
|
||||
// set crc32_func at load time. This avoids extra computation (and any
|
||||
// unlikely threading bugs) on the first call to lzma_crc32() to decide
|
||||
// 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
|
||||
// appropriate implementation function and will not be called again.
|
||||
// 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)(
|
||||
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
|
||||
// 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.
|
||||
// This resolver is shared between all dispatch methods.
|
||||
static crc32_func_type
|
||||
crc32_resolve(void)
|
||||
{
|
||||
@ -142,11 +122,6 @@ crc32_resolve(void)
|
||||
? &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
|
||||
// Constructor method.
|
||||
@ -171,8 +146,7 @@ crc32_set_func(void)
|
||||
static uint32_t
|
||||
crc32_dispatch(const uint8_t *buf, size_t size, uint32_t crc)
|
||||
{
|
||||
// When __attribute__((__ifunc__(...))) and
|
||||
// __attribute__((__constructor__)) isn't supported, set the
|
||||
// When __attribute__((__constructor__)) isn't supported, set the
|
||||
// function pointer without any locking. If multiple threads run
|
||||
// the detection code in parallel, they will all end up setting
|
||||
// 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
|
||||
|
||||
|
||||
#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)
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -17,18 +17,16 @@
|
||||
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
||||
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
||||
|| (defined(__e2k__) && __iset__ >= 6))
|
||||
# define X86_CLMUL_NO_TABLE 1
|
||||
#endif
|
||||
# define NO_CRC32_TABLE
|
||||
|
||||
#if defined(HAVE_ARM64_CRC32) \
|
||||
#elif defined(HAVE_ARM64_CRC32) \
|
||||
&& !defined(WORDS_BIGENDIAN) \
|
||||
&& defined(__ARM_FEATURE_CRC32)
|
||||
# define ARM64_CRC32_NO_TABLE 1
|
||||
# define NO_CRC32_TABLE
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(HAVE_ENCODERS) && (defined(X86_CLMUL_NO_TABLE) \
|
||||
|| defined(ARM64_CRC32_NO_TABLE_))
|
||||
#if !defined(HAVE_ENCODERS) && defined(NO_CRC32_TABLE)
|
||||
// No table needed. Use a typedef to avoid an empty translation unit.
|
||||
typedef void lzma_crc32_dummy;
|
||||
|
||||
@ -36,9 +34,9 @@ typedef void lzma_crc32_dummy;
|
||||
// Having the declaration here silences clang -Wmissing-variable-declarations.
|
||||
extern const uint32_t lzma_crc32_table[8][256];
|
||||
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
# include "crc32_table_be.h"
|
||||
# else
|
||||
# include "crc32_table_le.h"
|
||||
# endif
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
# include "crc32_table_be.h"
|
||||
# else
|
||||
# include "crc32_table_le.h"
|
||||
# endif
|
||||
#endif
|
||||
|
@ -43,7 +43,7 @@ init_crc32_table(void)
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
for (size_t s = 0; s < 8; ++s)
|
||||
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
|
||||
|
||||
return;
|
||||
|
@ -39,7 +39,7 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
|
||||
crc = ~crc;
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
crc = bswap64(crc);
|
||||
crc = byteswap64(crc);
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
crc = bswap64(crc);
|
||||
crc = byteswap64(crc);
|
||||
#endif
|
||||
|
||||
return ~crc;
|
||||
@ -93,11 +93,6 @@ crc64_generic(const uint8_t *buf, size_t size, uint64_t crc)
|
||||
typedef uint64_t (*crc64_func_type)(
|
||||
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
|
||||
crc64_resolve(void)
|
||||
{
|
||||
@ -105,12 +100,6 @@ crc64_resolve(void)
|
||||
? &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
|
||||
# define CRC64_SET_FUNC_ATTR __attribute__((__constructor__))
|
||||
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
|
||||
|
||||
|
||||
#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)
|
||||
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);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -17,11 +17,11 @@
|
||||
#if defined(HAVE_USABLE_CLMUL) && ((defined(__x86_64__) && defined(__SSSE3__) \
|
||||
&& defined(__SSE4_1__) && defined(__PCLMUL__)) \
|
||||
|| (defined(__e2k__) && __iset__ >= 6))
|
||||
# define X86_CLMUL_NO_TABLE 1
|
||||
# define NO_CRC64_TABLE
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef X86_CLMUL_NO_TABLE
|
||||
#ifdef NO_CRC64_TABLE
|
||||
// No table needed. Use a typedef to avoid an empty translation unit.
|
||||
typedef void lzma_crc64_dummy;
|
||||
|
||||
|
@ -42,7 +42,7 @@ init_crc64_table(void)
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
for (size_t s = 0; s < 4; ++s)
|
||||
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
|
||||
|
||||
return;
|
||||
|
@ -67,8 +67,6 @@
|
||||
#undef CRC32_ARM64
|
||||
#undef CRC64_ARM64_CLMUL
|
||||
|
||||
#undef CRC_USE_IFUNC
|
||||
|
||||
#undef CRC_USE_GENERIC_FOR_SMALL_INPUTS
|
||||
|
||||
// ARM64 CRC32 instruction is only useful for CRC32. Currently, only
|
||||
@ -76,11 +74,11 @@
|
||||
// endian machine.
|
||||
//
|
||||
// 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)
|
||||
// Allow ARM64 CRC32 instruction without a runtime check if
|
||||
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define this if the
|
||||
// proper compiler options are used.
|
||||
// Allow ARM64 CRC32 instruction without a runtime check if
|
||||
// __ARM_FEATURE_CRC32 is defined. GCC and Clang only define
|
||||
// this if the proper compiler options are used.
|
||||
# if defined(__ARM_FEATURE_CRC32)
|
||||
# define CRC32_ARCH_OPTIMIZED 1
|
||||
# define CRC32_ARM64 1
|
||||
@ -96,7 +94,8 @@
|
||||
// generic version can be omitted. Note that this doesn't work with MSVC
|
||||
// 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__)) \
|
||||
|| (defined(__e2k__) && __iset__ >= 6)
|
||||
# define CRC32_ARCH_OPTIMIZED 1
|
||||
@ -109,9 +108,6 @@
|
||||
# define CRC64_ARCH_OPTIMIZED 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
|
||||
// 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
|
||||
// the special cases for 0-16-byte inputs will be omitted
|
||||
// from the CLMUL code.
|
||||
# ifndef CRC_USE_IFUNC
|
||||
# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
|
||||
# endif
|
||||
# define CRC_USE_GENERIC_FOR_SMALL_INPUTS 1
|
||||
*/
|
||||
# endif
|
||||
#endif
|
||||
|
@ -266,7 +266,7 @@ crc32_arch_optimized(const uint8_t *buf, size_t size, uint32_t crc)
|
||||
|
||||
__m128i v0, v1, v2;
|
||||
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
_mm_cvtsi32_si128((int32_t)~crc));
|
||||
|
||||
v1 = _mm_xor_si128(
|
||||
@ -355,12 +355,12 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
|
||||
__m128i v0, v1, v2;
|
||||
|
||||
#if defined(__i386__) || defined(_M_IX86)
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
_mm_set_epi64x(0, (int64_t)~crc));
|
||||
#else
|
||||
// GCC and Clang would produce good code with _mm_set_epi64x
|
||||
// but MSVC needs _mm_cvtsi64_si128 on x86-64.
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
crc_simd_body(buf, size, &v0, &v1, vfold16,
|
||||
_mm_cvtsi64_si128((int64_t)~crc));
|
||||
#endif
|
||||
|
||||
@ -385,15 +385,11 @@ crc64_arch_optimized(const uint8_t *buf, size_t size, uint64_t crc)
|
||||
#endif // BUILDING_CRC64_CLMUL
|
||||
|
||||
|
||||
// is_arch_extension_supported() must be inlined in this header file because
|
||||
// the ifunc resolver function may not support calling a function in another
|
||||
// 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.
|
||||
// Even though this is an inline function, compile it only when needed.
|
||||
// This way it won't appear in E2K builds at all.
|
||||
#if defined(CRC32_GENERIC) || defined(CRC64_GENERIC)
|
||||
// Inlining this function duplicates the function body in crc32_resolve() and
|
||||
// crc64_resolve(), but this is acceptable because this is a tiny function.
|
||||
static inline bool
|
||||
is_arch_extension_supported(void)
|
||||
{
|
||||
@ -427,9 +423,10 @@ is_arch_extension_supported(void)
|
||||
// - ICC's _may_i_use_cpu_feature: the other methods should work too.
|
||||
// - GCC >= 6 / Clang / ICX __builtin_cpu_supports("pclmul")
|
||||
//
|
||||
// CPUID decding is needed with MSVC anyway and older GCC. This keeps
|
||||
// CPUID decoding is needed with MSVC anyway and older GCC. This keeps
|
||||
// the feature checks in the build system simpler too. The nice thing
|
||||
// about __builtin_cpu_supports would be that it generates very short
|
||||
// code as is it only reads a variable set at startup but a few bytes
|
||||
// doesn't matter here.
|
||||
}
|
||||
#endif
|
||||
|
@ -21,7 +21,7 @@
|
||||
static inline uint32_t
|
||||
rotr_32(uint32_t num, unsigned amount)
|
||||
{
|
||||
return (num >> amount) | (num << (32 - amount));
|
||||
return (num >> amount) | (num << (32 - amount));
|
||||
}
|
||||
|
||||
#define blk0(i) (W[i] = conv32be(data[i]))
|
||||
|
@ -9,6 +9,9 @@
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef LZMA_EASY_PRESET_H
|
||||
#define LZMA_EASY_PRESET_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
|
||||
@ -29,3 +32,5 @@ typedef struct {
|
||||
/// Set *easy to the settings given by the preset. Returns true on error,
|
||||
/// false on success.
|
||||
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)
|
||||
return LZMA_PROG_ERROR;
|
||||
|
||||
// Initialize the decoer.
|
||||
// Initialize the decoder.
|
||||
lzma_next_coder next = LZMA_NEXT_CODER_INIT;
|
||||
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;
|
||||
|
||||
// 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_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)
|
||||
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)
|
||||
{
|
||||
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)
|
||||
lzma_raw_decoder_memusage(const lzma_filter *filters)
|
||||
{
|
||||
return lzma_raw_coder_memusage(
|
||||
(lzma_filter_find)(&decoder_find), filters);
|
||||
return lzma_raw_coder_memusage(&coder_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)
|
||||
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)
|
||||
{
|
||||
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_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_SYNC_FLUSH] = true;
|
||||
@ -253,8 +263,7 @@ lzma_raw_encoder(lzma_stream *strm, const lzma_filter *filters)
|
||||
extern LZMA_API(uint64_t)
|
||||
lzma_raw_encoder_memusage(const lzma_filter *filters)
|
||||
{
|
||||
return lzma_raw_coder_memusage(
|
||||
(lzma_filter_find)(&encoder_find), filters);
|
||||
return lzma_raw_coder_memusage(&coder_find, filters);
|
||||
}
|
||||
|
||||
|
||||
|
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