switch from gcc to llvm

This commit is contained in:
Pratham Patel 2023-10-08 12:21:11 +05:30
parent bc5d5e4ea0
commit ff6d4099a0
No known key found for this signature in database
7 changed files with 16 additions and 13 deletions

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 2
%global rel_ver 3
%global major_ver 6
%global minor_ver 1
%global patch_ver 56

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 2
%global rel_ver 3
%global next_snapshot_date 20231006
%global target_config defconfig
%global kname next

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 2
%global rel_ver 3
%global patch_ver 0
%global major_ver 6
%global minor_ver 6

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 7
%global rel_ver 8
%global major_ver 6
%global minor_ver 6
%global rc_ver 4

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 2
%global rel_ver 3
%global major_ver 6
%global minor_ver 5
%global patch_ver 6

View File

@ -1,5 +1,5 @@
# change version here
%global rel_ver 3
%global rel_ver 4
%global major_ver 5
%global minor_ver 10
%global patch_ver 160

View File

@ -12,7 +12,8 @@ URL: https://www.kernel.org
Provides: %{name}-%{KVERREL}
BuildRequires: bc binutils bison dwarves
BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
BuildRequires: gcc make openssl openssl-devel perl python3 rsync
BuildRequires: make openssl openssl-devel perl python3 rsync
BuildRequires: clang lld llvm llvm-devel
BuildRequires: opencsd-devel
BuildRequires: kmod
BuildRequires: python3-devel
@ -31,7 +32,7 @@ Requires: linux-firmware
%global make_targets Image.gz modules dtbs
%endif
%global make make KERNELRELEASE=%{KVERREL}
%global make make -j$(( $(nproc) + 2 )) KERNELRELEASE=%{KVERREL}
Source2: https://git.resf.org/thefossguy/kernel-tfg/archive/master.tar.gz
@ -89,6 +90,7 @@ pathfix.py -i "%{__python3} %{py3_shbang_opts}" -n -p \
Documentation \
drivers >/dev/null 2>&1
export LLVM=1 AR=llvm-ar CC=clang HOSTAR=llvm-ar HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf STRIP=llvm-strip
[ -f .config ] && rm -vf .config*
%{make} distclean
@ -110,7 +112,8 @@ make olddefconfig
diff .config .config.%{target_config} || echo "Diffing done"
%build
%{make} %{?_smp_mflags} PYTHON=%{__python3} %{make_targets}
#export LLVM=1 AR=llvm-ar CC=clang HOSTAR=llvm-ar HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld LD=ld.lld NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf STRIP=llvm-strip
%{make} PYTHON=%{__python3} %{make_targets}
%install
rm -rf $RPM_BUILD_ROOT
@ -124,7 +127,7 @@ echo "%{KVERREL}" > $RPM_BUILD_ROOT/boot/.uname-%{KVERREL}
# install DTBs
%ifarch aarch64 || riscv64
%{make} %{?_smp_mflags} INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/boot/dtb-%{KVERREL} dtbs_install
%{make} INSTALL_DTBS_PATH=$RPM_BUILD_ROOT/boot/dtb-%{KVERREL} dtbs_install
find arch/%{build_arch}/boot/dts -name '*.dtb' -type f -delete
%endif
@ -132,13 +135,13 @@ find arch/%{build_arch}/boot/dts -name '*.dtb' -type f -delete
# '$(mod-fw)' is overridden because there is no reason to install any firmware
# since we already have 'linux-firmware' package as the dependency of this package.
%if "%{name}" == "kernel-next-tfg"
%{make} %{?_smp_mflags} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT mod-fw= DEPMOD=/doesnt/exist modules_install
%{make} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT mod-fw= DEPMOD=/doesnt/exist modules_install
%else
%{make} %{?_smp_mflags} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT mod-fw= modules_install
%{make} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$RPM_BUILD_ROOT mod-fw= modules_install
%endif
# install headers
%{make} %{?_smp_mflags} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install
%{make} INSTALL_HDR_PATH=$RPM_BUILD_ROOT/usr headers_install
# install other key files too
install -m 644 .config $RPM_BUILD_ROOT/boot/config-%{KVERREL}