From 1cd4a370e565b0e26f80c87c779980e448f11919 Mon Sep 17 00:00:00 2001 From: Eric Naim Date: Sat, 7 Dec 2024 00:12:45 +0800 Subject: [PATCH] linux-cachyos{,-rc}: Check for LTO when sourcing and passing build flags for autofdo While in theory this shouldn't cause any compilation issues due to different compiler being used, we should still check for this to remove unnecessary build flags and files in the source array. Signed-off-by: Eric Naim --- linux-cachyos-rc/PKGBUILD | 4 ++-- linux-cachyos/PKGBUILD | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-cachyos-rc/PKGBUILD b/linux-cachyos-rc/PKGBUILD index ce3e55b9..6df8617b 100644 --- a/linux-cachyos-rc/PKGBUILD +++ b/linux-cachyos-rc/PKGBUILD @@ -252,7 +252,7 @@ if [ -n "$_build_nvidia_open" ]; then fi # Use generated AutoFDO Profile -if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then +if _is_lto_kernel && [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then if [ -e "$_autofdo_profile_name" ]; then source+=("$_autofdo_profile_name") else @@ -480,7 +480,7 @@ prepare() { scripts/config -e AUTOFDO_CLANG fi - if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then + if _is_lto_kernel && [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then echo "AutoFDO profile has been found..." BUILD_FLAGS+=(CLANG_AUTOFDO_PROFILE="${srcdir}/${_autofdo_profile_name}") fi diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILD index 348b6589..b700c319 100644 --- a/linux-cachyos/PKGBUILD +++ b/linux-cachyos/PKGBUILD @@ -250,7 +250,7 @@ if [ -n "$_build_nvidia_open" ]; then fi # Use generated AutoFDO Profile -if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then +if _is_lto_kernel && [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then if [ -e "$_autofdo_profile_name" ]; then source+=("$_autofdo_profile_name") else @@ -479,7 +479,7 @@ prepare() { scripts/config -e AUTOFDO_CLANG fi - if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then + if _is_lto_kernel && [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then echo "AutoFDO profile has been found..." BUILD_FLAGS+=(CLANG_AUTOFDO_PROFILE="${srcdir}/${_autofdo_profile_name}") fi