%{kversion}

This commit is contained in:
Sergey Zhemoytel 2024-11-17 12:08:59 +00:00
parent 1db5f56752
commit 8f03a593dd
2 changed files with 23 additions and 2 deletions

13
clang-wrapper.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
# Функция для фильтрации неподдерживаемых опций
filter_options() {
echo "$@" | sed -e 's/-Wno-shift-negative-value//g'
}
# Получаем отфильтрованные опции
filtered_options=$(filter_options "$@")
# Выполняем clang с отфильтрованными опциями
/opt/llvm17/bin/clang $filtered_options

View file

@ -157,6 +157,8 @@ Source52: cpupower-start.sh
Source53: cpupower.path
Source80: kernel.rpmlintrc
Source90: clang-wrapper.sh
####################################################################
# Patches
@ -699,6 +701,8 @@ should use the 'kernel-devel' package instead.
cd %src_dir
tar -xf %{S:1}
insall -Dm0755 %{S:90} ./clang-wrapper.sh
%apply_patches
#
@ -737,6 +741,10 @@ sed -i 's/CONFIG_STACKPROTECTOR_STRONG=y/# CONFIG_STACKPROTECTOR_STRONG is not s
sed -i 's/# CONFIG_DEBUG_INFO is not set/CONFIG_DEBUG_INFO=y\nCONFIG_DEBUG_INFO_DWARF4=y\nCONFIG_GDB_SCRIPTS=y/' .config
%endif
sed -i 's/KBUILD_CFLAGS += -Werror/# KBUILD_CFLAGS += -Werror/' .config
sed -i -e 's/CONFIG_CC_IS_GCC=y/CONFIG_CC_IS_GCC=n/' -e 's/CONFIG_CC_IS_CLANG=n/CONFIG_CC_IS_CLANG=y/' .config
%if %{enhanced_security}
# seems to be needed to boot system in enforcing selinux mode
# note: cpio fpormat of initramfs does not support xattrs without patches
@ -779,8 +787,8 @@ find . -name '.get_maintainer.ignore' | %kxargs rm -f
############################################################################
%build
export CC=/opt/llvm17/bin/clang
export CXX=/opt/llvm17/bin/clang++
export CC=./clang-wrapper.sh
export CXX=./clang-wrapper.sh
export AR=/opt/llvm17/bin/llvm-ar
export NM=/opt/llvm17/bin/llvm-nm
export OBJCOPY=/opt/llvm17/bin/llvm-objcopy