|
|
|
@ -1,19 +1,6 @@
|
|
|
|
|
# All global changes to build and install should follow this line.
|
|
|
|
|
%define patchlevel 1
|
|
|
|
|
# Disable LTO in userspace packages.
|
|
|
|
|
%global _lto_cflags %{nil}
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
%define with_toolchain_clang 1
|
|
|
|
|
%define with_clang_lto 1
|
|
|
|
|
%else
|
|
|
|
|
%define with_toolchain_clang 0
|
|
|
|
|
%define with_clang_lto 0
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with_toolchain_clang}
|
|
|
|
|
%global toolchain clang
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
# The libexec directory is not used by the linker, so the shared object there
|
|
|
|
|
# should not be exported to RPM provides.
|
|
|
|
@ -37,11 +24,9 @@
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
%define _kasan 1
|
|
|
|
|
%define _kmsan 1
|
|
|
|
|
%define _kmemleak 1
|
|
|
|
|
%else
|
|
|
|
|
%define _kasan 0
|
|
|
|
|
%define _kmsan 0
|
|
|
|
|
%define _kmemleak 0
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
@ -168,19 +153,6 @@
|
|
|
|
|
%define _use_vdso 0
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with_toolchain_clang}
|
|
|
|
|
|
|
|
|
|
%global llvm_ias 1
|
|
|
|
|
|
|
|
|
|
%global clang_make_opts HOSTCC=clang CC=clang LLVM_IAS=%{llvm_ias}
|
|
|
|
|
%if %{with_clang_lto}
|
|
|
|
|
%global clang_make_opts %{clang_make_opts} LD=ld.lld HOSTLD=ld.lld AR=llvm-ar NM=llvm-nm HOSTAR=llvm-ar HOSTNM=llvm-nm
|
|
|
|
|
%endif
|
|
|
|
|
%global make_opts %{clang_make_opts}
|
|
|
|
|
# clang does not support the -fdump-ipa-clones option
|
|
|
|
|
%global with_ipaclones 0
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Packages that need to be installed before the kernel is installed,
|
|
|
|
|
# as they will be used by the %%post scripts.
|
|
|
|
@ -210,16 +182,6 @@ BuildRequires: gzip, hmaccalc, hostname, kernel-rpm-macros >= 185-9, kmod, m4, m
|
|
|
|
|
BuildRequires: patch, perl-Carp, perl-devel, perl-generators, perl-interpreter, python3-devel
|
|
|
|
|
BuildRequires: redhat-rpm-config, tar, which, xz
|
|
|
|
|
|
|
|
|
|
%if %{with_toolchain_clang}
|
|
|
|
|
BuildRequires: clang
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with_clang_lto}
|
|
|
|
|
BuildRequires: llvm
|
|
|
|
|
BuildRequires: lld
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64 aarch64
|
|
|
|
|
BuildRequires: bpftool, openssl-devel
|
|
|
|
|
%endif
|
|
|
|
@ -276,7 +238,6 @@ Source0: https://git.linuxtesting.ru/pub/scm/linux/kernel/git/lvc/linux-stable.g
|
|
|
|
|
Source2: config-%{version}-x86_64
|
|
|
|
|
Source4: config-%{version}-aarch64
|
|
|
|
|
Source6: config-%{version}-x86_64-kasan
|
|
|
|
|
Source8: config-%{version}-x86_64-kmsan
|
|
|
|
|
Source10: config-%{version}-x86_64-kmemleak
|
|
|
|
|
|
|
|
|
|
Source20: mod-denylist.sh
|
|
|
|
@ -577,11 +538,6 @@ device input and output, etc.
|
|
|
|
|
%description kasan-core
|
|
|
|
|
Package contains the Linux kernel with KASAN support.
|
|
|
|
|
|
|
|
|
|
%define variant_summary The Linux kernel.
|
|
|
|
|
%kernel_lt_variant_package kmsan
|
|
|
|
|
%description kmsan-core
|
|
|
|
|
Package contains the Linux kernel with KMSAN support.
|
|
|
|
|
|
|
|
|
|
%define variant_summary The Linux kernel.
|
|
|
|
|
%kernel_lt_variant_package kmemleak
|
|
|
|
|
%description kmemleak-core
|
|
|
|
@ -595,7 +551,7 @@ Package contains the Linux kernel with KMEMLEAK support.
|
|
|
|
|
%global _build_id_links none
|
|
|
|
|
|
|
|
|
|
# Set up our "big" %%{make} macro.
|
|
|
|
|
%global make %{__make} %{?make_opts} -s HOSTCFLAGS="%{?build_cflags}" HOSTLDFLAGS="%{?build_ldflags}"
|
|
|
|
|
%global make %{__make} -s HOSTCFLAGS="%{?build_cflags}" HOSTLDFLAGS="%{?build_ldflags}"
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%ifarch x86_64 aarch64
|
|
|
|
@ -634,7 +590,6 @@ pathfix.py -i "%{__python3} %{py3_shbang_opts}" -n -p \
|
|
|
|
|
tools \
|
|
|
|
|
scripts \
|
|
|
|
|
Documentation \
|
|
|
|
|
scripts/clang-tools \
|
|
|
|
|
2>&1 | grep -Ev 'recursedown|no change'
|
|
|
|
|
|
|
|
|
|
mv COPYING COPYING-%{version}-%{release}
|
|
|
|
@ -648,7 +603,6 @@ cd configs
|
|
|
|
|
cp %{SOURCE2} config-%{version}-x86_64.config
|
|
|
|
|
cp %{SOURCE4} config-%{version}-aarch64.config
|
|
|
|
|
cp %{SOURCE6} config-%{version}-x86_64-kasan.config
|
|
|
|
|
cp %{SOURCE8} config-%{version}-x86_64-kmsan.config
|
|
|
|
|
cp %{SOURCE10} config-%{version}-x86_64-kmemleak.config
|
|
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
@ -662,7 +616,6 @@ sed -i "s@^EXTRAVERSION.*@EXTRAVERSION = -%{release}.%{_target_cpu}@" Makefile
|
|
|
|
|
declare -a config_files=(
|
|
|
|
|
"configs/config-%{version}-x86_64.config"
|
|
|
|
|
"configs/config-%{version}-x86_64-kasan.config"
|
|
|
|
|
"configs/config-%{version}-x86_64-kmsan.config"
|
|
|
|
|
"configs/config-%{version}-x86_64-kmemleak.config"
|
|
|
|
|
)
|
|
|
|
|
%endif
|
|
|
|
@ -701,13 +654,6 @@ cat rheldup3.pem rhelkpatch1.pem rhelimaca1.pem > certs/rhel.pem
|
|
|
|
|
|
|
|
|
|
cd configs/
|
|
|
|
|
|
|
|
|
|
%if %{with clang_lto}
|
|
|
|
|
for i in *aarch64*.config *x86_64*.config; do
|
|
|
|
|
sed -i 's/# CONFIG_LTO_CLANG_THIN is not set/CONFIG_LTO_CLANG_THIN=y/' $i
|
|
|
|
|
sed -i 's/CONFIG_LTO_NONE=y/# CONFIG_LTO_NONE is not set/' $i
|
|
|
|
|
done
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
for i in *.config; do
|
|
|
|
|
sed -i 's@CONFIG_SYSTEM_TRUSTED_KEYS="*"@CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem"@' $i
|
|
|
|
|
done
|
|
|
|
@ -1110,11 +1056,6 @@ BuildKernel() {
|
|
|
|
|
%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE26} kasan
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$Variant" = "kmsan" ]; then
|
|
|
|
|
# Identify modules in the kernel-rt-kvm package
|
|
|
|
|
%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE26} kmsan
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$Variant" = "kmemleak" ]; then
|
|
|
|
|
# Identify modules in the kernel-rt-kvm package
|
|
|
|
|
%{SOURCE20} $RPM_BUILD_ROOT lib/modules/$KernelVer %{SOURCE26} kmemleak
|
|
|
|
@ -1259,10 +1200,6 @@ cd linux-%{KVERREL}
|
|
|
|
|
BuildKernel %make_target %kernel_image %{_use_vdso} kasan
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
BuildKernel %make_target %kernel_image %{_use_vdso} kmsan
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
BuildKernel %make_target %kernel_image %{_use_vdso} kmemleak
|
|
|
|
|
%endif
|
|
|
|
@ -1353,9 +1290,6 @@ if [ "%{signmodules}" -eq "1" ]; then \
|
|
|
|
|
if [ "%{_kasan}" -ne "0" ]; then \
|
|
|
|
|
%{SOURCE21} linux-%{version}-%{release}.%{_build_arch}-kasan/certs/signing_key.pem.sign+kasan linux-%{version}-%{release}.%{_build_arch}-kasan/certs/signing_key.x509.sign+kasan $RPM_BUILD_ROOT/lib/modules/%{KVERREL}+kasan/ \
|
|
|
|
|
fi \
|
|
|
|
|
if [ "%{_kmsan}" -ne "0" ]; then \
|
|
|
|
|
%{SOURCE21} linux-%{version}-%{release}.%{_build_arch}-kmsan/certs/signing_key.pem.sign+kmsan linux-%{version}-%{release}.%{_build_arch}-kmsan/certs/signing_key.x509.sign+kmsan $RPM_BUILD_ROOT/lib/modules/%{KVERREL}+kmsan/ \
|
|
|
|
|
fi \
|
|
|
|
|
if [ "%{_kmemleak}" -ne "0" ]; then \
|
|
|
|
|
%{SOURCE21} linux-%{version}-%{release}.%{_build_arch}-kmemleak/certs/signing_key.pem.sign+kmemleak linux-%{version}-%{release}.%{_build_arch}-kmemleak/certs/signing_key.x509.sign+kmemleak $RPM_BUILD_ROOT/lib/modules/%{KVERREL}+kmemleak/ \
|
|
|
|
|
fi \
|
|
|
|
@ -1617,9 +1551,6 @@ fi\
|
|
|
|
|
%kernel_lt_variant_preun kasan
|
|
|
|
|
%kernel_lt_variant_post -v kasan
|
|
|
|
|
|
|
|
|
|
%kernel_lt_variant_preun kmsan
|
|
|
|
|
%kernel_lt_variant_post -v kmsan
|
|
|
|
|
|
|
|
|
|
%kernel_lt_variant_preun kmemleak
|
|
|
|
|
%kernel_lt_variant_post -v kmemleak
|
|
|
|
|
|
|
|
|
@ -1784,13 +1715,13 @@ fi
|
|
|
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
|
%kernel_lt_variant_files %{_use_vdso} %{with_std} kasan
|
|
|
|
|
%kernel_lt_variant_files %{_use_vdso} %{with_std} kmsan
|
|
|
|
|
%kernel_lt_variant_files %{_use_vdso} %{with_std} kmemleak
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Mon Feb 10 2025 Eduard Basov <ebasov@msvsphere-os.ru> - 6.1.124-5.lvc13.inferit.fuzzing
|
|
|
|
|
- Change macros
|
|
|
|
|
- Disable build KMSAN
|
|
|
|
|
|
|
|
|
|
* Mon Feb 10 2025 Eduard Basov <ebasov@msvsphere-os.ru> - 6.1.124-4.lvc13.inferit.fuzzing
|
|
|
|
|
- Added build ALL Kernel with clang
|
|
|
|
|