Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libdeflate for openSUSE:Factory checked in at 2026-11-03 17:51:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libdeflate (Old) and /work/SRC/openSUSE:Factory/.libdeflate.new.1257 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdeflate" Tue Nov 3 17:51:17 2026 rev:18 rq:1394332 version:1.26 Changes: -------- --- /work/SRC/openSUSE:Factory/libdeflate/libdeflate.changes 2025-12-30 12:00:32.901013848 +0100 +++ /work/SRC/openSUSE:Factory/.libdeflate.new.1257/libdeflate.changes 2026-11-03 17:51:19.136670616 +0100 @@ -1,0 +2,20 @@ +Sun Nov 1 21:22:17 UTC 2026 - Dirk Müller <[email protected]> + +- update to 1.26: + * Added support for compression level -1 as an alias for the + default compression level (6). + * libdeflate now requires a C11 compiler. + * Fixed build failures with clang 18 specifically (clang 19+ + unaffected). + * Fixed build failure with glibc 2.43 and later. + * Enabled unaligned access optimizations on all PowerPC + variants. + * Improved CRC-32 performance on Arm Neoverse V-Series + processors by selecting a faster CRC-32 implementation for + these processors. + * The CMakeLists.txt now supports the user overriding + `CMAKE_C_FLAGS_RELEASE`. + * The CMakeLists.txt no longer runs installation commands when + it is built as a subproject. + +------------------------------------------------------------------- Old: ---- libdeflate-1.25.tar.gz New: ---- libdeflate-1.26.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libdeflate.spec ++++++ --- /var/tmp/diff_new_pack.iQPrVZ/_old 2026-11-03 17:51:19.935704015 +0100 +++ /var/tmp/diff_new_pack.iQPrVZ/_new 2026-11-03 17:51:19.937704098 +0100 @@ -1,7 +1,7 @@ # # spec file for package libdeflate # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %define major 0 %define libname %{name}%{major} Name: libdeflate -Version: 1.25 +Version: 1.26 Release: 0 Summary: Library for DEFLATE/zlib/gzip compression and decompression License: BSD-2-Clause ++++++ libdeflate-1.25.tar.gz -> libdeflate-1.26.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/.cirrus.yml new/libdeflate-1.26/.cirrus.yml --- old/libdeflate-1.25/.cirrus.yml 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/.cirrus.yml 2026-08-22 18:05:42.000000000 +0200 @@ -1,7 +1,7 @@ task: freebsd_instance: matrix: - - image_family: freebsd-14-2 + - image_family: freebsd-15-0-amd64-ufs install_script: pkg install -y cmake script: - cmake -B build -DLIBDEFLATE_BUILD_TESTS=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/.github/workflows/ci.yml new/libdeflate-1.26/.github/workflows/ci.yml --- old/libdeflate-1.25/.github/workflows/ci.yml 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/.github/workflows/ci.yml 2026-08-22 18:05:42.000000000 +0200 @@ -12,7 +12,7 @@ env: CC: ${{ matrix.compiler }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update @@ -40,8 +40,8 @@ - { arch: riscv64, distro: ubuntu_latest, compiler: clang } runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: uraimo/[email protected] + - uses: actions/checkout@v6 + - uses: uraimo/run-on-arch-action@v3 with: arch: ${{ matrix.arch }} distro: ${{ matrix.distro }} @@ -62,7 +62,7 @@ env: CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: cmake -B build -DLIBDEFLATE_BUILD_TESTS=1 - run: cmake --build build --verbose - run: DESTDIR=build/install cmake --install build --verbose @@ -84,7 +84,7 @@ env: CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} @@ -108,25 +108,25 @@ strategy: matrix: include: - - {os: windows-latest, gen: "Visual Studio 17 2022", toolset: v143, vs: x64, vcpkg: x64-windows} - - {os: windows-latest, gen: "Visual Studio 17 2022", toolset: ClangCL, vs: x64, vcpkg: x64-windows} - - {os: windows-latest, gen: "Visual Studio 17 2022", toolset: v143, vs: Win32, vcpkg: x86-windows} - - {os: windows-latest, gen: "Visual Studio 17 2022", toolset: ClangCL, vs: Win32, vcpkg: x86-windows} + - {os: windows-latest, gen: "Visual Studio 18 2026", toolset: v145, vs: x64, vcpkg: x64-windows} + - {os: windows-latest, gen: "Visual Studio 18 2026", toolset: ClangCL, vs: x64, vcpkg: x64-windows} + - {os: windows-latest, gen: "Visual Studio 18 2026", toolset: v145, vs: Win32, vcpkg: x86-windows} + - {os: windows-latest, gen: "Visual Studio 18 2026", toolset: ClangCL, vs: Win32, vcpkg: x86-windows} runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v4 - - uses: microsoft/setup-msbuild@v2 + - uses: actions/checkout@v6 + - uses: microsoft/setup-msbuild@v3 - run: vcpkg install zlib:${{matrix.vcpkg}} - run: > - echo C:\vcpkg\packages\zlib_${{matrix.vcpkg}}\bin + echo C:\vcpkg\installed\${{matrix.vcpkg}}\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append # Note: as per the CMake documentation, DESTDIR is unsupported on Windows. - run: > cmake -B build -G "${{matrix.gen}}" -T ${{matrix.toolset}} -A ${{matrix.vs}} -DLIBDEFLATE_BUILD_TESTS=1 -DCMAKE_C_FLAGS="/W4 /WX /DLIBDEFLATE_ENABLE_ASSERTIONS" - -DZLIB_LIBRARY=C:\vcpkg\packages\zlib_${{matrix.vcpkg}}\lib\zlib.lib - -DZLIB_INCLUDE_DIR=C:\vcpkg\packages\zlib_${{matrix.vcpkg}}\include + -DZLIB_LIBRARY=C:\vcpkg\installed\${{matrix.vcpkg}}\lib\z.lib + -DZLIB_INCLUDE_DIR=C:\vcpkg\installed\${{matrix.vcpkg}}\include -DCMAKE_INSTALL_PREFIX=build\install - run: cmake --build build --verbose --config Debug - run: cmake --install build --verbose --config Debug @@ -137,17 +137,17 @@ strategy: matrix: platform: [ARM64, ARM64EC] - toolset: [v143, ClangCL] + toolset: [v145, ClangCL] exclude: # Exclude unsupported combinations - platform: ARM64EC toolset: ClangCL runs-on: windows-latest steps: - - uses: actions/checkout@v4 - - uses: microsoft/setup-msbuild@v2 + - uses: actions/checkout@v6 + - uses: microsoft/setup-msbuild@v3 # Note: as per the CMake documentation, DESTDIR is unsupported on Windows. - run: > - cmake -B build -G "Visual Studio 17 2022" -T ${{matrix.toolset}} + cmake -B build -G "Visual Studio 18 2026" -T ${{matrix.toolset}} -A ${{matrix.platform}} -DCMAKE_C_FLAGS="/W4 /WX" -DCMAKE_INSTALL_PREFIX=build\install -DCMAKE_SYSTEM_VERSION=10 - run: cmake --build build --verbose --config Release @@ -157,7 +157,7 @@ name: Run clang static analyzer runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update @@ -169,7 +169,7 @@ name: Run shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update @@ -183,7 +183,7 @@ env: CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update @@ -213,7 +213,7 @@ env: CFLAGS: -Werror -DLIBDEFLATE_ENABLE_ASSERTIONS steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - run: | scripts/cmake-helper.sh \ -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME"/build/cmake/android.toolchain.cmake \ @@ -227,7 +227,7 @@ name: Test building adler32.c and crc32.c with various flags runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update @@ -278,7 +278,7 @@ sanitizer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install dependencies run: | sudo apt-get update diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/CMakeLists.txt new/libdeflate-1.26/CMakeLists.txt --- old/libdeflate-1.25/CMakeLists.txt 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/CMakeLists.txt 2026-08-22 18:05:42.000000000 +0200 @@ -6,6 +6,10 @@ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build" FORCE) endif() +if(DEFINED CMAKE_C_FLAGS_RELEASE) + set(LIBDEFLATE_USER_SET_RELEASE_FLAGS ON) +endif() + # With MSVC, don't automatically append /W3 to the compiler flags. # This makes it possible for the user to select /W4. if(POLICY CMP0092) @@ -22,6 +26,11 @@ project(libdeflate LANGUAGES C VERSION ${VERSION_STRING}) +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + set(LIBDEFLATE_IS_TOP_LEVEL_PROJECT ON) +else() + set(LIBDEFLATE_IS_TOP_LEVEL_PROJECT OFF) +endif() # Include the CMake modules required by the top-level directory. include(CMakePackageConfigHelpers) @@ -44,6 +53,8 @@ option(LIBDEFLATE_USE_SHARED_LIB "Link the libdeflate-gzip and test programs to the shared library instead of the static library" OFF) +option(LIBDEFLATE_INSTALL "Install all targets built" ${LIBDEFLATE_IS_TOP_LEVEL_PROJECT}) + if(APPLE) option(LIBDEFLATE_APPLE_FRAMEWORK "Build as Apple Framework" OFF) endif() @@ -64,8 +75,11 @@ endif() # Set common C compiler flags for all targets (the library and the programs). -set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG") -set(CMAKE_C_STANDARD 99) +if(NOT LIBDEFLATE_USER_SET_RELEASE_FLAGS) + set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG" + CACHE STRING "C compiler flags for release builds" FORCE) +endif() +set(CMAKE_C_STANDARD 11) if(NOT MSVC) check_c_compiler_flag(-Wdeclaration-after-statement HAVE_WDECLARATION_AFTER_STATEMENT) check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH) @@ -303,17 +317,19 @@ endif() # Install the static and/or shared library. -install(TARGETS ${LIB_TARGETS} - EXPORT libdeflate_exported_targets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime OPTIONAL - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +if(LIBDEFLATE_INSTALL) + install(TARGETS ${LIB_TARGETS} + EXPORT libdeflate_exported_targets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime OPTIONAL + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +endif() # Install resource files to Resources/ directory in the framework -if(LIBDEFLATE_APPLE_FRAMEWORK) +if(LIBDEFLATE_INSTALL AND LIBDEFLATE_APPLE_FRAMEWORK) install(FILES ${LIBDEFLATE_RESOURCES} DESTINATION "${CMAKE_INSTALL_LIBDIR}/libdeflate_static.framework/Resources" ) @@ -335,21 +351,25 @@ set(CMAKE_PKGCONFIG_LIBDIR "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") endif() configure_file(libdeflate.pc.in libdeflate.pc @ONLY) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdeflate.pc - DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +if(LIBDEFLATE_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdeflate.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +endif() # Generate a "libdeflate-targets.cmake" file in the build tree that can be # included by outside projects to import targets from the build tree. -export(EXPORT libdeflate_exported_targets +export(TARGETS ${LIB_TARGETS} NAMESPACE libdeflate:: FILE libdeflate-targets.cmake) # Generate and install a separate "libdeflate-targets.cmake" file that can be # included by outside projects to import targets from the installation tree. -install(EXPORT libdeflate_exported_targets - NAMESPACE libdeflate:: - FILE libdeflate-targets.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libdeflate) +if(LIBDEFLATE_INSTALL) + install(EXPORT libdeflate_exported_targets + NAMESPACE libdeflate:: + FILE libdeflate-targets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libdeflate) +endif() # Generate and install the CMake package version and config files. write_basic_package_version_file(libdeflate-config-version.cmake @@ -359,11 +379,13 @@ ${CMAKE_CURRENT_SOURCE_DIR}/libdeflate-config.cmake.in libdeflate-config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libdeflate) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdeflate-config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/libdeflate-config-version.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libdeflate) +if(LIBDEFLATE_INSTALL) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libdeflate-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/libdeflate-config-version.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libdeflate) +endif() # Build the programs subdirectory if needed. if(LIBDEFLATE_BUILD_GZIP OR LIBDEFLATE_BUILD_TESTS) add_subdirectory(programs) -endif() \ No newline at end of file +endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/NEWS.md new/libdeflate-1.26/NEWS.md --- old/libdeflate-1.25/NEWS.md 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/NEWS.md 2026-08-22 18:05:42.000000000 +0200 @@ -1,5 +1,30 @@ # libdeflate release notes +## Version 1.26 + +* Added support for compression level -1 as an alias for the default compression + level (6). + +* libdeflate now requires a C11 compiler. For Visual Studio builds, this bumps + the minimum version up to Visual Studio 2019 v16.8. + +* Fixed build failures with clang 18 specifically (clang 19+ unaffected). + +* Fixed build failure with glibc 2.43 and later. + +* Enabled unaligned access optimizations on all PowerPC variants. + +* Improved CRC-32 performance on Arm Neoverse V-Series processors by selecting a + faster CRC-32 implementation for these processors. + +* The CMakeLists.txt now supports the user overriding `CMAKE_C_FLAGS_RELEASE`. + +* The CMakeLists.txt no longer runs installation commands when it is built as a + subproject. + +* The prebuilt Windows binaries are now 64-bit only. Prebuilt 32-bit binaries + are no longer provided, though they can still be built by users. + ## Version 1.25 * Fixed a build error with gcc 16. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/README.md new/libdeflate-1.26/README.md --- old/libdeflate-1.25/README.md 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/README.md 2026-08-22 18:05:42.000000000 +0200 @@ -85,8 +85,8 @@ - gcc: v4.9 and later - clang: v3.9 and later (upstream), Xcode 8 and later (Apple) -- MSVC: Visual Studio 2015 and later -- Other compilers: any other C99-compatible compiler should work, though if your +- MSVC: Visual Studio 2019 version 16.8 and later +- Other compilers: any other C11-compatible compiler should work, though if your compiler pretends to be gcc, clang, or MSVC, it needs to be sufficiently compatible with the compiler it pretends to be. @@ -146,7 +146,7 @@ * C#: [LibDeflate.NET](https://github.com/jzebedee/LibDeflate.NET) * Delphi: [libdeflate-pas](https://github.com/zedxxx/libdeflate-pas) * Go: [go-libdeflate](https://github.com/4kills/go-libdeflate) -* Java: [libdeflate-java](https://github.com/astei/libdeflate-java) +* Java: [jlibdeflate](https://github.com/fulcrumgenomics/jlibdeflate) * Julia: [LibDeflate.jl](https://github.com/jakobnissen/LibDeflate.jl) * Nim: [libdeflate-nim](https://github.com/gemesa/libdeflate-nim) * Perl: [Gzip::Libdeflate](https://github.com/benkasminbullock/gzip-libdeflate) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/common_defs.h new/libdeflate-1.26/common_defs.h --- old/libdeflate-1.25/common_defs.h 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/common_defs.h 2026-08-22 18:05:42.000000000 +0200 @@ -159,8 +159,8 @@ #endif #ifdef _MSC_VER # define MSVC_PREREQ(version) (_MSC_VER >= (version)) -# if !MSVC_PREREQ(1900) -# error "MSVC versions older than Visual Studio 2015 are no longer supported" +# if !MSVC_PREREQ(1928) +# error "MSVC versions older than Visual Studio 2019 v16.8 are no longer supported" # endif #else # define MSVC_PREREQ(version) 0 @@ -212,20 +212,6 @@ # define NORETURN #endif -/* - * restrict - hint that writes only occur through the given pointer. - * - * Don't use MSVC's __restrict, since it has nonstandard behavior. - * Standard restrict is okay, if it is supported. - */ -#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) -# if defined(__GNUC__) || defined(__clang__) -# define restrict __restrict__ -# else -# define restrict -# endif -#endif /* else assume 'restrict' is usable as-is */ - /* likely(expr) - hint that an expression is usually true */ #if defined(__GNUC__) || __has_builtin(__builtin_expect) # define likely(expr) __builtin_expect(!!(expr), 1) @@ -402,7 +388,8 @@ */ #if (defined(__GNUC__) || defined(__clang__)) && \ (defined(ARCH_X86_64) || defined(ARCH_X86_32) || \ - defined(__ARM_FEATURE_UNALIGNED) || defined(__powerpc64__) || \ + defined(__ARM_FEATURE_UNALIGNED) || \ + defined(__powerpc64__) || defined(__powerpc__) || defined(__POWERPC__) || \ defined(__riscv_misaligned_fast) || \ /* * For all compilation purposes, WebAssembly behaves like any other CPU diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/lib/arm/cpu_features.c new/libdeflate-1.26/lib/arm/cpu_features.c --- old/libdeflate-1.25/lib/arm/cpu_features.c 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/lib/arm/cpu_features.c 2026-08-22 18:05:42.000000000 +0200 @@ -54,6 +54,7 @@ #include <errno.h> #include <fcntl.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> @@ -67,7 +68,7 @@ int filled = 0; int i; - fd = open("/proc/self/auxv", O_RDONLY); + fd = open("/proc/self/auxv", O_RDONLY | O_CLOEXEC); if (fd < 0) return; @@ -130,6 +131,51 @@ return features; } +#ifdef ARCH_ARM64 +/* + * Return whether cpu0's MIDR_EL1 identifies one of the Arm Neoverse + * V-class server cores (V1 / V2 / V3 / V3AE). MIDR_EL1 is exposed + * unprivileged via sysfs (added in Linux 4.7). Reading cpu0 only is fine + * in practice: no Neoverse V-class server SKU has shipped as part of a + * big.LITTLE cluster. Any failure (file missing, read error, parse + * failure, unrecognized CPU) returns false. + */ +static bool arm64_cpu_is_neoverse_v_class(void) +{ + int fd; + char buf[32]; + ssize_t n; + unsigned long midr; + u32 part; + + fd = open("/sys/devices/system/cpu/cpu0/regs/identification/midr_el1", + O_RDONLY | O_CLOEXEC); + if (fd < 0) + return false; + do { + n = read(fd, buf, sizeof(buf) - 1); + } while (n < 0 && errno == EINTR); + close(fd); + if (n <= 0) + return false; + buf[n] = '\0'; + midr = strtoul(buf, NULL, 0); /* sysfs prints "0x%016llx\n" */ + + /* MIDR_EL1: [31:24]=Implementer, [15:4]=PartNum. */ + if (((midr >> 24) & 0xff) != 0x41) /* Implementer must be Arm Ltd. */ + return false; + part = (midr >> 4) & 0xfff; + switch (part) { + case 0xd40: /* Neoverse V1 (e.g. AWS Graviton 3) */ + case 0xd4f: /* Neoverse V2 (e.g. AWS Graviton 4) */ + case 0xd83: /* Neoverse V3AE */ + case 0xd84: /* Neoverse V3 */ + return true; + } + return false; +} +#endif /* ARCH_ARM64 */ + #elif defined(__APPLE__) /* On Apple platforms, arm64 CPU features can be detected via sysctlbyname(). */ @@ -202,24 +248,40 @@ {ARM_CPU_FEATURE_DOTPROD, "dotprod"}, }; +/* + * Whether to set ARM_CPU_FEATURE_PREFER_PMULL on this CPU. This is the + * right choice on CPUs whose pmull pipes have more aggregate throughput + * than the crc32 unit -- in measured cases by a wide margin: the Apple M + * series sustains ~68 GB/s on pmull vs ~25 GB/s on crc32 (M1), and the Arm + * Neoverse V class sustains ~40 GB/s vs ~22 GB/s (Graviton 4 / V2). + * + * We detect Apple at compile time, and Neoverse V-class cores at runtime + * via MIDR_EL1 on Linux. Elsewhere we leave this unset, and the dispatcher + * picks the crc32-instruction path which is the right default for most + * other modern ARM CPUs. + */ +static bool arm_cpu_prefers_pmull(void) +{ +#if defined(__APPLE__) && TARGET_OS_OSX + return true; +#elif defined(__linux__) && defined(ARCH_ARM64) + if (arm64_cpu_is_neoverse_v_class()) + return true; +#endif +#ifdef TEST_SUPPORT__DO_NOT_USE + return true; +#endif + return false; +} + volatile u32 libdeflate_arm_cpu_features = 0; void libdeflate_init_arm_cpu_features(void) { u32 features = query_arm_cpu_features(); - /* - * On the Apple M1 processor, crc32 instructions max out at about 25.5 - * GB/s in the best case of using a 3-way or greater interleaved chunked - * implementation, whereas a pmull-based implementation achieves 68 GB/s - * provided that the stride length is large enough (about 10+ vectors - * with eor3, or 12+ without). - * - * Assume that crc32 instructions are preferable in other cases. - */ -#if (defined(__APPLE__) && TARGET_OS_OSX) || defined(TEST_SUPPORT__DO_NOT_USE) - features |= ARM_CPU_FEATURE_PREFER_PMULL; -#endif + if (arm_cpu_prefers_pmull()) + features |= ARM_CPU_FEATURE_PREFER_PMULL; disable_cpu_features_for_testing(&features, arm_cpu_feature_table, ARRAY_LEN(arm_cpu_feature_table)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/lib/deflate_compress.c new/libdeflate-1.26/lib/deflate_compress.c --- old/libdeflate-1.25/lib/deflate_compress.c 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/lib/deflate_compress.c 2026-08-22 18:05:42.000000000 +0200 @@ -3885,6 +3885,13 @@ if (options->sizeof_options != sizeof(*options)) return NULL; + /* + * Note: For similarity with zlib's API, -1 is accepted as an alias for + * the default compression level. + */ + if (compression_level == -1) + compression_level = 6; + if (compression_level < 0 || compression_level > 12) return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/lib/deflate_decompress.c new/libdeflate-1.26/lib/deflate_decompress.c --- old/libdeflate-1.25/lib/deflate_decompress.c 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/lib/deflate_decompress.c 2026-08-22 18:05:42.000000000 +0200 @@ -1094,18 +1094,18 @@ #ifdef arch_select_decompress_func static enum libdeflate_result -dispatch_decomp(struct libdeflate_decompressor *d, - const void *in, size_t in_nbytes, - void *out, size_t out_nbytes_avail, +dispatch_decomp(struct libdeflate_decompressor * restrict d, + const void * restrict in, size_t in_nbytes, + void * restrict out, size_t out_nbytes_avail, size_t *actual_in_nbytes_ret, size_t *actual_out_nbytes_ret); static volatile decompress_func_t decompress_impl = dispatch_decomp; /* Choose the best implementation at runtime. */ static enum libdeflate_result -dispatch_decomp(struct libdeflate_decompressor *d, - const void *in, size_t in_nbytes, - void *out, size_t out_nbytes_avail, +dispatch_decomp(struct libdeflate_decompressor * restrict d, + const void * restrict in, size_t in_nbytes, + void * restrict out, size_t out_nbytes_avail, size_t *actual_in_nbytes_ret, size_t *actual_out_nbytes_ret) { decompress_func_t f = arch_select_decompress_func(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/lib/x86/adler32_impl.h new/libdeflate-1.26/lib/x86/adler32_impl.h --- old/libdeflate-1.25/lib/x86/adler32_impl.h 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/lib/x86/adler32_impl.h 2026-08-22 18:05:42.000000000 +0200 @@ -72,6 +72,7 @@ #endif #if (GCC_PREREQ(8, 1) || CLANG_PREREQ(6, 0, 10000000) || MSVC_PREREQ(1920)) && \ + !(CLANG_PREREQ(18, 0, 18000000) && !CLANG_PREREQ(19, 0, 19000000)) && \ !defined(LIBDEFLATE_ASSEMBLER_DOES_NOT_SUPPORT_AVX512VNNI) /* * AVX512VNNI implementation using 256-bit vectors. This is very similar to the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/lib/x86/crc32_impl.h new/libdeflate-1.26/lib/x86/crc32_impl.h --- old/libdeflate-1.25/lib/x86/crc32_impl.h 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/lib/x86/crc32_impl.h 2026-08-22 18:05:42.000000000 +0200 @@ -92,6 +92,7 @@ #endif #if (GCC_PREREQ(10, 1) || CLANG_PREREQ(6, 0, 10000000) || MSVC_PREREQ(1920)) && \ + !(CLANG_PREREQ(18, 0, 18000000) && !CLANG_PREREQ(19, 0, 19000000)) && \ !defined(LIBDEFLATE_ASSEMBLER_DOES_NOT_SUPPORT_VPCLMULQDQ) /* * VPCLMULQDQ/AVX512 implementation using 256-bit vectors. This is very similar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/libdeflate.h new/libdeflate-1.26/libdeflate.h --- old/libdeflate-1.25/libdeflate.h 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/libdeflate.h 2026-08-22 18:05:42.000000000 +0200 @@ -13,8 +13,8 @@ #endif #define LIBDEFLATE_VERSION_MAJOR 1 -#define LIBDEFLATE_VERSION_MINOR 25 -#define LIBDEFLATE_VERSION_STRING "1.25" +#define LIBDEFLATE_VERSION_MINOR 26 +#define LIBDEFLATE_VERSION_STRING "1.26" /* * Users of libdeflate.dll on Windows can define LIBDEFLATE_DLL to cause @@ -43,10 +43,11 @@ * level on a zlib-like scale but with a higher maximum value (1 = fastest, 6 = * medium/default, 9 = slow, 12 = slowest). Level 0 is also supported and means * "no compression", specifically "create a valid stream, but only emit - * uncompressed blocks" (this will expand the data slightly). + * uncompressed blocks" (this will expand the data slightly). Level -1 is an + * alias indicating a default level of 6. * * The return value is a pointer to the new compressor, or NULL if out of memory - * or if the compression level is invalid (i.e. outside the range [0, 12]). + * or if the compression level is invalid (i.e. outside the range [-1, 12]). * * Note: for compression, the sliding window size is defined at compilation time * to 32768, the largest size permissible in the DEFLATE format. It cannot be diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/programs/CMakeLists.txt new/libdeflate-1.26/programs/CMakeLists.txt --- old/libdeflate-1.25/programs/CMakeLists.txt 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/programs/CMakeLists.txt 2026-08-22 18:05:42.000000000 +0200 @@ -44,7 +44,9 @@ if(LIBDEFLATE_BUILD_GZIP) add_executable(libdeflate-gzip gzip.c) target_link_libraries(libdeflate-gzip PRIVATE libdeflate_prog_utils) - install(TARGETS libdeflate-gzip DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(LIBDEFLATE_INSTALL) + install(TARGETS libdeflate-gzip DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14") # Install libdeflate-gunzip as a hard link to libdeflate-gzip. # Fall back to a copy if hard links are unsupported. @@ -53,17 +55,21 @@ # when ${CMAKE_INSTALL_FULL_BINDIR} includes a drive letter. But that # is fine since DESTDIR is unsupported on Windows anyway, according to # the CMake documentation. - set(GZIP "${CMAKE_INSTALL_FULL_BINDIR}/libdeflate-gzip${CMAKE_EXECUTABLE_SUFFIX}") - set(GUNZIP "${CMAKE_INSTALL_FULL_BINDIR}/libdeflate-gunzip${CMAKE_EXECUTABLE_SUFFIX}") - install(CODE "message(\"-- Installing: \$ENV{DESTDIR}${GUNZIP}\")") - install(CODE "file(CREATE_LINK \"\$ENV{DESTDIR}${GZIP}\" - \"\$ENV{DESTDIR}${GUNZIP}\" COPY_ON_ERROR)") + if(LIBDEFLATE_INSTALL) + set(GZIP "${CMAKE_INSTALL_FULL_BINDIR}/libdeflate-gzip${CMAKE_EXECUTABLE_SUFFIX}") + set(GUNZIP "${CMAKE_INSTALL_FULL_BINDIR}/libdeflate-gunzip${CMAKE_EXECUTABLE_SUFFIX}") + install(CODE "message(\"-- Installing: \$ENV{DESTDIR}${GUNZIP}\")") + install(CODE "file(CREATE_LINK \"\$ENV{DESTDIR}${GZIP}\" + \"\$ENV{DESTDIR}${GUNZIP}\" COPY_ON_ERROR)") + endif() else() # The cmake version is too old to support file(CREATE_LINK). # Just compile gzip.c again to build libdeflate-gunzip. add_executable(libdeflate-gunzip gzip.c) target_link_libraries(libdeflate-gunzip PRIVATE libdeflate_prog_utils) - install(TARGETS libdeflate-gunzip DESTINATION ${CMAKE_INSTALL_BINDIR}) + if(LIBDEFLATE_INSTALL) + install(TARGETS libdeflate-gunzip DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif() endif() endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/programs/gzip.c new/libdeflate-1.26/programs/gzip.c --- old/libdeflate-1.25/programs/gzip.c 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/programs/gzip.c 2026-08-22 18:05:42.000000000 +0200 @@ -563,7 +563,7 @@ options.force = false; options.keep = false; options.test = false; - options.compression_level = 6; + options.compression_level = -1; options.suffix = T(".gz"); while ((opt_char = tgetopt(argc, argv, optstring)) != -1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/programs/tgetopt.c new/libdeflate-1.26/programs/tgetopt.c --- old/libdeflate-1.25/programs/tgetopt.c 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/programs/tgetopt.c 2026-08-22 18:05:42.000000000 +0200 @@ -70,7 +70,7 @@ } else { /* More short options in previous arg */ tchar opt = *nextchar; - tchar *p = tstrchr(optstring, opt); + const tchar *p = tstrchr(optstring, opt); if (p == NULL) { if (topterr) msg("invalid option -- '%"TC"'", opt); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libdeflate-1.25/scripts/gen-release-archives.sh new/libdeflate-1.26/scripts/gen-release-archives.sh --- old/libdeflate-1.25/scripts/gen-release-archives.sh 2025-11-01 03:19:27.000000000 +0100 +++ new/libdeflate-1.26/scripts/gen-release-archives.sh 2026-08-22 18:05:42.000000000 +0200 @@ -13,25 +13,25 @@ git archive --format=tar --prefix="${prefix}/" HEAD \ | libdeflate-gzip -12 > "$tarball" -# Generate Windows binary releases libdeflate-*-windows-*-bin.zip -for arch in 'i686' 'x86_64'; do - dir=${prefix}-windows-${arch}-bin - zipfile="${dir}.zip" - echo "Generating $zipfile" - rm -rf build "$dir" "$zipfile" - CFLAGS="-Werror" ${arch}-w64-mingw32-cmake -B build -G Ninja \ - -DLIBDEFLATE_BUILD_TESTS=1 > /dev/null - cmake --build build > /dev/null - mkdir "$dir" - cp libdeflate.h build/libdeflate.{dll,dll.a,a} \ - build/programs/{benchmark,checksum}.exe "$dir" - cp build/programs/libdeflate-gzip.exe "$dir"/gzip.exe - cp build/programs/libdeflate-gzip.exe "$dir"/gunzip.exe - ${arch}-w64-mingw32-strip "$dir"/libdeflate.dll "$dir"/*.exe - for file in COPYING NEWS.md README.md; do - sed < $file > "$dir/${file}.txt" -e 's/$/\r/g' - done - (cd "$dir" && zip -q -r "../${zipfile}" .) +# Generate Windows binary release libdeflate-*-windows-x86_64-bin.zip +dir=${prefix}-windows-x86_64-bin +zipfile="${dir}.zip" +echo "Generating $zipfile" +rm -rf build "$dir" "$zipfile" +CFLAGS="-Werror" x86_64-w64-mingw32-cmake -B build -G Ninja \ + -DLIBDEFLATE_BUILD_TESTS=1 -DZLIB_USE_STATIC_LIBS=1 \ + -DCMAKE_EXE_LINKER_FLAGS="-static-libgcc" \ + -DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc" > /dev/null +cmake --build build > /dev/null +mkdir "$dir" +cp libdeflate.h build/libdeflate.{dll,dll.a,a} \ + build/programs/{benchmark,checksum}.exe "$dir" +cp build/programs/libdeflate-gzip.exe "$dir"/gzip.exe +cp build/programs/libdeflate-gzip.exe "$dir"/gunzip.exe +x86_64-w64-mingw32-strip "$dir"/libdeflate.dll "$dir"/*.exe +for file in COPYING NEWS.md README.md; do + sed < $file > "$dir/${file}.txt" -e 's/$/\r/g' done +(cd "$dir" && zip -q -r "../${zipfile}" .) echo "Successfully generated release archives"
