From 4c73a14ca9ac34135befc9e4ab9c8f13d17353a7 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 5 Dec 2024 15:01:24 +0100 Subject: [PATCH] 6.12.1-3 (clr 6.12.1-1493) add _subarch_microarch option --- .SRCINFO | 2 +- PKGBUILD | 28 ++++++++++++++++++++++++---- README.md | 3 ++- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.SRCINFO b/.SRCINFO index ad63eca..1d0be4d 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = linux-clear pkgdesc = Linux kernel with patches from Clear Linux which allow for higher performance. pkgver = 6.12.1 - pkgrel = 2 + pkgrel = 3 url = https://git.staropensource.de/JeremyStarTM/aur-linux-clear arch = x86_64 license = GPL-2.0-only diff --git a/PKGBUILD b/PKGBUILD index 55ef0c6..587122e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -111,6 +111,18 @@ # 43. AMD-Native optimizations autodetected by the compiler (MNATIVE_AMD) : "${_subarch:=""}" +# Selects the x86-64 microarchitecture to compile for. +# This value is only used by the GENERIC_CPU +# subarchitecture and is required. +# Can be either '1', '2', '3' or '4' +# +# Set to '1' by default +# +# For more information see: +# https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels +: "${_subarch_microarch:="1"}" + + # Enable compilation with LLVM # Be warned, this is largely untested by me (JeremyStarTM). It *should* work, # but if it doesn't, write a comment and I'll fix it. @@ -143,7 +155,7 @@ _src_clr=${_kernel_major}.${_clr} # Package information pkgbase=linux-clear pkgver=${_kernel_major}.${_kernel_minor} -pkgrel=2 +pkgrel=3 pkgdesc="Linux kernel with patches from Clear Linux which allow for higher performance." arch=("x86_64") url="https://git.staropensource.de/JeremyStarTM/aur-linux-clear" @@ -309,9 +321,17 @@ update_defconfig() { patch -Np1 -i "$srcdir/kernel_compiler_patch-$_kernelcompilerpatch/more-ISA-levels-and-uarches-for-kernel-6.1.79+.patch" # Set subarch automatically - [[ -n "${_subarch}" ]] && yes "${_subarch}" | make ${BUILD_FLAGS[*]} oldconfig - # Ask for subarch - [[ -z "${_subarch}" ]] && make ${BUILD_FLAGS[*]} oldconfig + if [ -n "${_subarch}" ]; then + if [ "${_subarch}" == "41" ]; then + yes "${_subarch} +${_subarch_microarch}" | make ${BUILD_FLAGS[*]} oldconfig + else + yes "${_subarch}" | make ${BUILD_FLAGS[*]} oldconfig + fi + else + # Ask for subarch + make ${BUILD_FLAGS[*]} oldconfig + fi } # Prepares the installation diff --git a/README.md b/README.md index 199bbf1..bfddffd 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,8 @@ The PKGBUILD file supports customization via environment variables. Here's a lis - `_copyfinalconfig`: Copies the final kernel configuration into the repository root as `kconfig-new` before compilation starts - `_localmodcfg`: Only compiles modules found in modprobed-db's database (which decreases compilation time and kernel size) - `_use_llvm_lto`: Compiles the kernel with LLVM instead of GCC. Should work, if not open an issue -- `_subarch`: Specifies the sub architecture to compile for (see the [PKGBUILD file](https://git.staropensource.de/JeremyStarTM/aur-linux-clear/src/branch/develop/PKGBUILD) for a list of all subarches). Default is `41` (Generic x86-64), which is compatible with all amd64 processors. Must be a number +- `_subarch`: Specifies the subarchitecture to compile for (see the [PKGBUILD file](https://git.staropensource.de/JeremyStarTM/aur-linux-clear/src/branch/develop/PKGBUILD) for a list of all subarches). Default is `41` (Generic x86-64), which is compatible with all amd64 processors. Must be a number +- `_subarch_microarch`: Specifies the microarchitecture to compile for. Only applies to and is required by the GENERIC_CPU subarch. Must be a number between `1` and `4` ([click for more information](https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels)) - `_debug`: Force enables debug options when set to `y`, force disables debug options when set to `n` or uses the config defaults when unset All of these variables just need to be set for them to apply, except for `_subarch` and `_debug`. See their descriptions for more information.