1
0
mirror of https://git.tukaani.org/xz.git synced 2025-04-15 04:00:50 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Lasse Collin
a69fbd3aae
CI: MSVC: Use fewer runners for the same number of tests
Using eight runners seems wasteful. Using only two runners isn't
much slower due to the runner startup overhead.

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

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

Fixes: 54eaea5ea49b ("liblzma: x86 CLMUL CRC: Rewrite")
Fixes: https://github.com/tukaani-project/xz/issues/171
Reported-by: Andrew Murray
2025-04-07 22:36:58 +03:00
Lasse Collin
c5fd88dfc3
liblzma: Remove MSVC hack from CLMUL CRC
It's not enough with MSVC 19.29 (VS 2019) even if the hack was also
applied to the CRC32 code. The tests crash when built for 32-bit x86.
2025-04-07 22:36:58 +03:00
Lasse Collin
49ba8c69ea
CI: Test 32/64-bit x86 builds with Visual Studio 2019 and 2022 2025-04-07 22:36:52 +03:00
Lasse Collin
1176a19df6
Tests: Add fuzz_decode_stream_mt.options 2025-04-04 20:08:37 +03:00
Lasse Collin
c3cb1e53a1
doc/SHA256SUMS: Add 5.8.1 2025-04-03 15:06:07 +03:00
6 changed files with 114 additions and 11 deletions

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

@ -0,0 +1,89 @@
# SPDX-License-Identifier: 0BSD
# Author: Lasse Collin
name: Windows-MSVC
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
MSVC:
strategy:
fail-fast: false
matrix:
os: [ windows-2019, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4.2.2
- name: Configure Win32
run: >
cmake
-A Win32
-B build-msvc-win32
- name: Build Win32 Debug
run: >
cmake
--build build-msvc-win32
--config Debug
- name: Test Win32 Debug
run: >
ctest
--test-dir build-msvc-win32
--build-config Debug
--output-on-failure
- name: Build Win32 Release
run: >
cmake
--build build-msvc-win32
--config Release
# This fails with VS 2019 without b5a5d9e3f702.
- name: Test Win32 Release
run: >
ctest
--test-dir build-msvc-win32
--build-config Release
--output-on-failure
- name: Configure x64
run: >
cmake
-A x64
-B build-msvc-x64
- name: Build x64 Debug
run: >
cmake
--build build-msvc-x64
--config Debug
- name: Test x64 Debug
run: >
ctest
--test-dir build-msvc-x64
--build-config Debug
--output-on-failure
- name: Build x64 Release
run: >
cmake
--build build-msvc-x64
--config Release
- name: Test x64 Release
run: >
ctest
--test-dir build-msvc-x64
--build-config Release
--output-on-failure

1
THANKS
View File

@ -33,6 +33,7 @@ has been important. :-) In alphabetical order:
- Cristiano Ceglia
- Marek Černocký
- Tomer Chachamu
- Aziz Chaudhry
- Vitaly Chikunov
- Antoine Cœur
- Elijah Almeida Coimbra

View File

@ -234,3 +234,10 @@ b523c5e47d1490338c5121bdf2a6ecca2bcf0dce05a83ad40a830029cbe6679b xz-5.8.0.tar.g
05ecad9e71919f4fca9f19fbbc979ea28e230188ed123dc6f06b98031ea14542 xz-5.8.0.tar.xz
397165cedccb8e16700b8fdd026c3fd7ff2d18923e28cfbf7d0c5f89cd6a50af xz-5.8.0-windows.zip
078caa9d406018d4d43df343455f57811e9ba69c1340670a85a0ae6341d42ba3 xz-5.8.0-windows.7z
ee188eabc3220684422f62df7a385541a86d2a5c385407f9d8fd94d49b251c4e xz-cve-2025-31115.patch
c9789682496d124fd214e665f6aa2f6d3d9e8527a7f0e120f9180c531d322bd6 xz-5.8.1.tar
5965c692c4c8800cd4b33ce6d0f6ac9ac9d6ab227b17c512b6561bce4f08d47e xz-5.8.1.tar.bz2
507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543 xz-5.8.1.tar.gz
0b54f79df85912504de0b14aec7971e3f964491af1812d83447005807513cd9e xz-5.8.1.tar.xz
62fdfde73d5c5d293bbb4a96211b29d09adbd56bc6736976e4c9fc9942ae3c67 xz-5.8.1-windows.zip
8ed1403fe6c971a2a6ac85fb7b27c8438b83175bc6f3bc49fec06540c904c84d xz-5.8.1-windows.7z

View File

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

View File

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

View File

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