From ff6d4099a05b506c6e4110ac0d32102398b70088 Mon Sep 17 00:00:00 2001 From: Pratham Patel Date: Sun, 8 Oct 2023 12:21:11 +0530 Subject: [PATCH] switch from gcc to llvm --- kernel-lts-tfg.spec | 2 +- kernel-next-tfg.spec | 2 +- kernel-opi5-tfg.spec | 2 +- kernel-rc-tfg.spec | 2 +- kernel-stable-tfg.spec | 2 +- kernel-vendor-opi5-tfg.spec | 2 +- master.inc | 17 ++++++++++------- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kernel-lts-tfg.spec b/kernel-lts-tfg.spec index 7a28f6b..452c4bf 100644 --- a/kernel-lts-tfg.spec +++ b/kernel-lts-tfg.spec @@ -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 diff --git a/kernel-next-tfg.spec b/kernel-next-tfg.spec index 330a116..53f2c2f 100644 --- a/kernel-next-tfg.spec +++ b/kernel-next-tfg.spec @@ -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 diff --git a/kernel-opi5-tfg.spec b/kernel-opi5-tfg.spec index 4ea5d8f..a7e4edf 100644 --- a/kernel-opi5-tfg.spec +++ b/kernel-opi5-tfg.spec @@ -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 diff --git a/kernel-rc-tfg.spec b/kernel-rc-tfg.spec index 00e0fbf..3bb38c8 100644 --- a/kernel-rc-tfg.spec +++ b/kernel-rc-tfg.spec @@ -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 diff --git a/kernel-stable-tfg.spec b/kernel-stable-tfg.spec index 7f19cc3..8bb8e2e 100644 --- a/kernel-stable-tfg.spec +++ b/kernel-stable-tfg.spec @@ -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 diff --git a/kernel-vendor-opi5-tfg.spec b/kernel-vendor-opi5-tfg.spec index 6b0caed..4be8eb8 100644 --- a/kernel-vendor-opi5-tfg.spec +++ b/kernel-vendor-opi5-tfg.spec @@ -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 diff --git a/master.inc b/master.inc index 50509d7..7c76a73 100644 --- a/master.inc +++ b/master.inc @@ -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}