Archlinux Kernel based on different schedulers and some other performance improvements.
Shell archlinuxbaby-schedcachycachy-schedulercachyoscacule-schedkernellinux-kernelperformanceperformance-tuning
PKGBUILD: Make LTO a hard dependency when building with clang
Eric Naimb85dc1830c67
diff --git a/linux-cachyos-bmq/PKGBUILD b/linux-cachyos-bmq/PKGBUILDindex 3082c710..c937b9a3 100644--- a/linux-cachyos-bmq/PKGBUILD+++ b/linux-cachyos-bmq/PKGBUILD@@ -143,14 +143,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-gcc"else_pkgsuffix="cachyos-${_cpusched}"@@ -199,7 +199,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-bore/PKGBUILD b/linux-cachyos-bore/PKGBUILDindex b00105f3..849eae67 100644--- a/linux-cachyos-bore/PKGBUILD+++ b/linux-cachyos-bore/PKGBUILD@@ -143,14 +143,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-gcc"else_pkgsuffix="cachyos-${_cpusched}"@@ -199,7 +199,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-deckify/PKGBUILD b/linux-cachyos-deckify/PKGBUILDindex 2a294bc7..902b9606 100644--- a/linux-cachyos-deckify/PKGBUILD+++ b/linux-cachyos-deckify/PKGBUILD@@ -142,14 +142,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-deckify-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-deckify-gcc"else_pkgsuffix="cachyos-deckify"@@ -201,7 +201,7 @@ source=("${_patchsource}/misc/0001-handheld.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-eevdf/PKGBUILD b/linux-cachyos-eevdf/PKGBUILDindex ad08796c..9c4d8c55 100644--- a/linux-cachyos-eevdf/PKGBUILD+++ b/linux-cachyos-eevdf/PKGBUILD@@ -143,14 +143,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-gcc"else_pkgsuffix="cachyos-${_cpusched}"@@ -199,7 +199,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-rc/PKGBUILD b/linux-cachyos-rc/PKGBUILDindex a76bcffd..bfc65c0e 100644--- a/linux-cachyos-rc/PKGBUILD+++ b/linux-cachyos-rc/PKGBUILD@@ -156,14 +156,14 @@ _autofdo_profile_name=${_autofdo_profile_name-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ] || [ -n "$_autofdo" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-rc-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-rc-gcc"else_pkgsuffix="cachyos-rc"@@ -212,7 +212,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-rt-bore/PKGBUILD b/linux-cachyos-rt-bore/PKGBUILDindex 40353e13..0798b518 100644--- a/linux-cachyos-rt-bore/PKGBUILD+++ b/linux-cachyos-rt-bore/PKGBUILD@@ -143,14 +143,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-${_cpusched}-gcc"else_pkgsuffix="cachyos-${_cpusched}"@@ -199,7 +199,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos-server/PKGBUILD b/linux-cachyos-server/PKGBUILDindex b01e5dd3..2acf6298 100644--- a/linux-cachyos-server/PKGBUILD+++ b/linux-cachyos-server/PKGBUILD@@ -143,14 +143,14 @@ _build_nvidia_open=${_build_nvidia_open-}_build_debug=${_build_debug-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix="cachyos-server-lto"-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix="cachyos-server-gcc"else_pkgsuffix="cachyos-server"@@ -199,7 +199,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILDindex 40bacfcc..33000741 100644--- a/linux-cachyos/PKGBUILD+++ b/linux-cachyos/PKGBUILD@@ -156,14 +156,14 @@ _autofdo_profile_name=${_autofdo_profile_name-}# ATTENTION: Do not modify after this line-_is_clang_kernel() {- [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ] || [ -n "$_autofdo" ]+_is_lto_kernel() {+ [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]]return $?}-if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then+if _is_lto_kernel && [ "$_use_lto_suffix" = "y" ]; then_pkgsuffix=cachyos-lto-elif [ "$_use_llvm_lto" = "none" ] && [ -z "$_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then+elif ! _is_lto_kernel && [ "$_use_gcc_suffix" = "y" ]; then_pkgsuffix=cachyos-gccelse_pkgsuffix=cachyos@@ -212,7 +212,7 @@ source=("${_patchsource}/all/0001-cachyos-base-all.patch")# LLVM makedepends-if _is_clang_kernel; then+if _is_lto_kernel; thenmakedepends+=(clang llvm lld)source+=("${_patchsource}/misc/dkms-clang.patch")BUILD_FLAGS=(