Skip to content

Archlinux Kernel based on different schedulers and some other performance improvements.

PKGBUILD: Make LTO a hard dependency when building with clang

Eric Naimb85dc1830c67
diff --git a/linux-cachyos-bmq/PKGBUILD b/linux-cachyos-bmq/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-bore/PKGBUILD b/linux-cachyos-bore/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-deckify/PKGBUILD b/linux-cachyos-deckify/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-eevdf/PKGBUILD b/linux-cachyos-eevdf/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-rc/PKGBUILD b/linux-cachyos-rc/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-rt-bore/PKGBUILD b/linux-cachyos-rt-bore/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos-server/PKGBUILD b/linux-cachyos-server/PKGBUILD
index 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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(
diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILD
index 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-gcc
else
_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; then
makedepends+=(clang llvm lld)
source+=("${_patchsource}/misc/dkms-clang.patch")
BUILD_FLAGS=(