Add a script that regenerates rpminspect.yaml

Every new release we notice that annocheck finds a new file that can't
be built with LTO. These files may change between releases as new
optimizations are implemented or removed.

A script that can generate the configuration will make our lives easier
when the source code is updated.
This commit is contained in:
Tulio Magno Quites Machado Filho 2024-09-12 13:53:00 -03:00
commit 92e84a48ac
2 changed files with 66 additions and 2 deletions

33
regenerate-rpminspect Executable file
View file

@ -0,0 +1,33 @@
#!/usr/bin/bash
#
# Regenerated rpminspect.yaml.
# The contents in rpminspect.yaml depends on the usage of NOLTOFLAG in
# zlib-ng's build system.
OUTPUT=$(pwd)/rpminspect.yaml
cat - <<EOF > $OUTPUT
# This file has been generated automatically by regenerate-rpminspect.
# Ignore LTO test on CPU-optimized files which cannot use the LTO.
# More described in upstream: https://github.com/zlib-ng/zlib-ng/pull/938
annocheck:
extra_opts:
- hardened:
EOF
tmpdir=$(mktemp -p $(pwd) -d)
fedpkg prep --builddir $tmpdir > /dev/null
rootdir=$(dirname $(find $tmpdir -name arch))
for makefile in $(find $tmpdir -name Makefile.in); do
dir=$(dirname $makefile)
for f in $(gawk \
'match($0, /\$\(NOLTOFLAG\).*\/([^\/]+\.c)/, ret) {print ret[1]}' \
$makefile | sort -u); do
echo "--skip-lto=$(realpath --relative-to=$rootdir $dir)/$f" >> $OUTPUT
done
done
rm -rf $tmpdir

View file

@ -1,6 +1,37 @@
# Ignore LTO test on CPU-optimized files which cannot use the LTO
# This file has been generated automatically by regenerate-rpminspect.
# Ignore LTO test on CPU-optimized files which cannot use the LTO.
# More described in upstream: https://github.com/zlib-ng/zlib-ng/pull/938
annocheck:
extra_opts:
- hardened: --skip-lto=arch/arm/crc32_acle.c --skip-lto=arch/power/adler32_power8.c --skip-lto=arch/x86/chunkset_avx2.c --skip-lto=arch/x86/slide_hash_avx2.c
- hardened:
--skip-lto=arch/arm/adler32_neon.c
--skip-lto=arch/arm/chunkset_neon.c
--skip-lto=arch/arm/compare256_neon.c
--skip-lto=arch/arm/crc32_acle.c
--skip-lto=arch/arm/insert_string_acle.c
--skip-lto=arch/arm/slide_hash_armv6.c
--skip-lto=arch/arm/slide_hash_neon.c
--skip-lto=arch/power/adler32_power8.c
--skip-lto=arch/power/adler32_vmx.c
--skip-lto=arch/power/chunkset_power8.c
--skip-lto=arch/power/compare256_power9.c
--skip-lto=arch/power/crc32_power8.c
--skip-lto=arch/power/slide_hash_power8.c
--skip-lto=arch/power/slide_hash_vmx.c
--skip-lto=arch/s390/crc32-vx.c
--skip-lto=arch/x86/adler32_avx2.c
--skip-lto=arch/x86/adler32_avx512.c
--skip-lto=arch/x86/adler32_avx512_vnni.c
--skip-lto=arch/x86/adler32_sse42.c
--skip-lto=arch/x86/adler32_ssse3.c
--skip-lto=arch/x86/chunkset_avx2.c
--skip-lto=arch/x86/chunkset_sse2.c
--skip-lto=arch/x86/chunkset_ssse3.c
--skip-lto=arch/x86/compare256_avx2.c
--skip-lto=arch/x86/compare256_sse2.c
--skip-lto=arch/x86/crc32_pclmulqdq.c
--skip-lto=arch/x86/crc32_vpclmulqdq.c
--skip-lto=arch/x86/insert_string_sse42.c
--skip-lto=arch/x86/slide_hash_avx2.c
--skip-lto=arch/x86/slide_hash_sse2.c