Skip to content

Commit

Permalink
script-v3-v4: Handle $autofdo
Browse files Browse the repository at this point in the history
In the PKGBUILD, we have a check whenever $autofdo is a non-zero string, it will build with clang. This breaks
the workflow of the script when building with GCC. It's not that obvious that it's broken because $pkgsuffix is
also broken.

We can fix this by forcing $autofdo off during GCC compilations and flipping it back on again when compiling with
ThinLTO

Signed-off-by: Eric Naim <[email protected]>
  • Loading branch information
1Naim committed Dec 5, 2024
1 parent 3d51457 commit d0f11c6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions script-v3-v4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ find . -name "PKGBUILD" | xargs -I {} sed -i "s/_build_nvidia-/_build_nvidia-y/"
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_build_nvidia_open-/_build_nvidia_open-y/" {}
## Disable clang-LTO
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_use_llvm_lto-thin/_use_llvm_lto-none/" {}
## Force autofdo off to ensure that kernels are being compiled with GCC
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_autofdo-y/_autofdo-/" {}

## GCC v3 Kernel

Expand All @@ -26,6 +28,8 @@ done

## LLVM ThinLTO v3 Kernel
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_use_llvm_lto-none/_use_llvm_lto-thin/" {}
find linux-cachyos linux-cachyos-rc -name "PKGBUILD" | xargs -I {} sed -i "s/_autofdo-/_autofdo-y/" {}


files=$(find . -name "PKGBUILD")

Expand All @@ -47,6 +51,7 @@ RUST_LOG=trace repo-manage-util -p cachyos-v3 update
## GCC v4 Kernel
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_use_llvm_lto-thin/_use_llvm_lto-none/" {}
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_processor_opt-GENERIC_V3/_processor_opt-GENERIC_V4/" {}
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_autofdo-y/_autofdo-/" {}

files=$(find . -name "PKGBUILD")

Expand All @@ -61,6 +66,7 @@ done

## LLVM ThinLTO v4 Kernel
find . -name "PKGBUILD" | xargs -I {} sed -i "s/_use_llvm_lto-none/_use_llvm_lto-thin/" {}
find linux-cachyos linux-cachyos-rc -name "PKGBUILD" | xargs -I {} sed -i "s/_autofdo-/_autofdo-y/" {}

files=$(find . -name "PKGBUILD")

Expand Down

0 comments on commit d0f11c6

Please sign in to comment.