If the output buffer and the window buffer are the same
memory allocation, we cannot make the assumptions that chunkunroll
does, that it is okay to overwrite the output buffer.
Compiling zlib-ng with glibc 2.17 (minimum version still supported by
crosstool-ng) fails due to the lack of HWCAP_S390_VX - it was
introduced in glibc 2.23.
Strictly speaking, this is a problem with the feature detection logic
in cmake. However, it's not worth disabling the s390x vectorized CRC32
if the hwcap constant is missing and the compiler intrinsics are
available.
So fix by hardcoding the constant. It's a part of the kernel ABI,
which does not change.
Harmen Stoppels [Fri, 28 Jun 2024 11:21:33 +0000 (13:21 +0200)]
don't use zlib-ng's -Wl,--version-script in tests (#1750)
lld 18 errors when a version script assigns a version to a symbol that
is not defined in the object files. Therefore configure scripts should
not use zlib-ng's version script -- all tests will fail.
Also test whether the linker supports the flag instead of assuming.
Mika Lindqvist [Tue, 9 Apr 2024 15:49:58 +0000 (18:49 +0300)]
free_aligned: validate passed in pointer
Especially when replacing zlib with zlib-ng in old binaries, it is possible that the binary is mixing allocation and
deallocation functions from different libraries. As not all old binaries can be rebuild, we should validate the passed
in pointer and if the pointer doesn't seem to be allocated with alloc_aligned of zlib-ng, we should not try to adjust
the pointer.
Fix illegal instruction usage in Xeon Phi x200 processors
The Xeon Phi x200 family of processors (Knights Landing) supports
AVX512 (F, CD, ER, PF) but does not support AVX512 (VL, DQ, BW).
Because of processors like this, the Intel Software Developer's Manual
suggests the bits AVX512 (DQ,BW,VL) are also tested in EBX together with
AVX512F before deciding to run AVX512 (DQ,BW,VL) instructions.
This also adds a new x86 feature called avx512_common that indicates
that AVX512 (F,DQ,BW,VL) are all available and start using this for both
adler32_avx512 and crc32_vpclmulqdq implementations because they are
both built with -mavx512dq -mavx512bw -mavx512vl.
This has been reported downstream as
https://bugzilla.redhat.com/show_bug.cgi?id=2280347 .
Update s390x CI setup.
- New dockerfile
- Using native actions-runner instead of relying on qemu.
- To support s390x, we include patches to actions-runner.
- Using Almalinux 9 instead of Ubuntu, with functional .Net.
- Update CI workflow.
- Update readme guide.
Currently the DFLTCC sanitizer instrumentation is limited to
MSAN-unpoisoning the parameter block. Add ASAN and MSAN checks;
also MSAN-unpoison the window.
Introduce the generic instrument_read(), instrument_write() and
instrument_read_write() macros, that are modeled after the repsective
functions in the Linux kernel.
Deniz Bahadir [Wed, 24 Apr 2024 14:37:34 +0000 (16:37 +0200)]
.gitattributes: Enforce LF line-endings on all non-binary files
Although Git is able to automatically modify line-endings during checkin
and checkout, this brings a lot of trouble, especially when trying to
use a repository from different platforms (as Windows and Linux). This
is due to the fact that Git consults different local gitconfig settings
and uses problematic defaults if not set.
Therefore, Git should enfoce one type of line-ending (LF) and not
consult the local config, which is what the change from this commit
does.
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
Matt McCormick [Tue, 9 Apr 2024 14:44:07 +0000 (10:44 -0400)]
Bump max CMake policy version to 3.29.0
Addresses:
3.29.0/share/cmake/Modules/CMakeDependentOption.cmake:89 (message):
Policy CMP0127 is not set: cmake_dependent_option() supports full Condition
Syntax. Run "cmake --help-policy CMP0127" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:107 (cmake_dependent_option)
This warning is for project developers. Use -Wno-dev to suppress it.
/home/autobuild/autobuild/instance-2/output-1/build/zlib-ng-2.1.6/arch/riscv/riscv_features.c:4:10: fatal error: sys/auxv.h: No such file or directory
4 | #include <sys/auxv.h>
| ^~~~~~~~~~~~
Deniz Bahadir [Fri, 5 Apr 2024 20:37:11 +0000 (22:37 +0200)]
CMake: Replace ';' by '$<SEMICOLON>' in generator-expression
Note: CMake generator-expressions should not contain semicolons,
especially if they might end up in a CMake list, because a semicolon
would be interpreted as list-item separator and therefore render the
generator-expression invalid. The generator-expression `$<SEMICOLON>`
should be used instead.
Signed-off-by: Deniz Bahadir <deniz@code.bahadir.email>
Mika Lindqvist [Sun, 25 Feb 2024 14:42:43 +0000 (16:42 +0200)]
[ARM] Override Clang x4 NEON intrinsics for Android
* Clang for Android requires 256-bit alignment for x4 loads and stores, which can't be guaranteed and is unnecessary
Don Olmstead [Thu, 1 Feb 2024 20:49:11 +0000 (12:49 -0800)]
Relocate CMake target export definitions
When exporting a CMake target the `install(TARGETS ${ZLIB_INSTALL_LIBRARIES})` is repeated with an `EXPORT` parameter. On Windows this would install the `.dll` files into the `lib` directory.
Set the `EXPORT_NAME` earlier and unconditionally on the `TARGET`. Then move the `EXPORT` to a single `install(TARGETS)`.
Mika Lindqvist [Tue, 23 Jan 2024 05:42:29 +0000 (07:42 +0200)]
Generate CMake package configuration files
* For COMPAT mode, zlib-config.cmake and zlib-config-version.cmake
* For non-COMPAT mode, zlib-ng-config.cmake and zlib-ng-config-version.cmake
Mika Lindqvist [Wed, 24 Jan 2024 20:48:00 +0000 (22:48 +0200)]
Fix regression caused by 2fa631e029084b75acd81db5d33fd4aa802fd082
* POWER8/9 feature checks were enabled even if the toolchain didn't support AT_HWCAP2
* Add detection if we need to include <linux/auxvec.h>