From 334ab6e62fa06a83a920070b462dc247a7924882 Mon Sep 17 00:00:00 2001 From: Eric Naim Date: Tue, 1 Oct 2024 20:25:54 +0800 Subject: [PATCH] chore: Add $_use_gcc_suffix Use `$_use_gcc_suffix` instead of `$_use_lto_suffix` since LTO kernel is going to be the default now. The latter variable will be preserved for users that still want to use it. I have modified the if statement with the logic: 1. If using LTO + enabled LTO suffix -> cachyos-lto 2. If no LTO + no kCFI + enabled GCC suffix -> cachyos-gcc 3. All other combinations -> cachyos The main rationale behind (2) is that kCFI isn't LTO but it also isn't gcc. I have also moved $pkgbase outside of the if else condition because it is the same regardless of condition Signed-off-by: Eric Naim --- linux-cachyos/PKGBUILD | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILD index 17fff7fa..0a020628 100644 --- a/linux-cachyos/PKGBUILD +++ b/linux-cachyos/PKGBUILD @@ -112,11 +112,14 @@ _use_auto_optimization=${_use_auto_optimization-y} _use_llvm_lto=${_use_llvm_lto-thin} # Use suffix -lto only when requested by the user -# Enabled by default. # y - enable -lto suffix # n - disable -lto suffix # https://github.com/CachyOS/linux-cachyos/issues/36 -_use_lto_suffix=${_use_lto_suffix-y} +_use_lto_suffix=${_use_lto_suffix-} + +# Use suffix -gcc when requested by the user +# Enabled by default to show the difference between LTO kernels and GCC kernels +_use_gcc_suffix=${_use_gcc_suffix-y} # KCFI is a proposed forward-edge control-flow integrity scheme for # Clang, which is more suitable for kernel use than the existing CFI @@ -148,13 +151,14 @@ _is_lto_kernel() { _build_debug=${_build_debug-} if [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] && [ "$_use_lto_suffix" = "y" ]; then - _pkgsuffix=cachyos - pkgbase="linux-$_pkgsuffix" - -elif [ -n "$_use_llvm_lto" ] || [[ "$_use_lto_suffix" = "n" ]]; then + _pkgsuffix=cachyos-lto +elif [ "$_use_llvm_lto" = "none" ] && [ -z "_use_kcfi" ] && [ "$_use_gcc_suffix" = "y" ]; then _pkgsuffix=cachyos-gcc - pkgbase="linux-$_pkgsuffix" +else + _pkgsuffix=cachyos fi + +pkgbase="linux-$_pkgsuffix" _major=6.11 _minor=2 #_minorc=$((_minor+1))