From 2dab89412523e93d18844aafb1884ad311ceafe2 Mon Sep 17 00:00:00 2001 From: Eric Naim Date: Fri, 6 Dec 2024 03:59:05 +0800 Subject: [PATCH] script-v3-v4: Handle $autofdo 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 --- script-v3-v4.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script-v3-v4.sh b/script-v3-v4.sh index a77ebbb3..e22e872f 100755 --- a/script-v3-v4.sh +++ b/script-v3-v4.sh @@ -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 @@ -26,6 +28,7 @@ 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") @@ -47,6 +50,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") @@ -61,6 +65,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")