Skip to content

Commit

Permalink
linux-cachyos{,-rc}: Check for LTO when sourcing and passing build fl…
Browse files Browse the repository at this point in the history
…ags 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 <[email protected]>
  • Loading branch information
1Naim committed Dec 6, 2024
1 parent 84a6510 commit 1cd4a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions linux-cachyos-rc/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions linux-cachyos/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1cd4a37

Please sign in to comment.