From 3a48565ca7b5aa7abe210fdfde223ff766abd9ac Mon Sep 17 00:00:00 2001 From: Eric Naim Date: Tue, 22 Apr 2025 23:07:36 +0800 Subject: [PATCH 1/3] linux-cachyos-rc: Add support for Distributed ThinLTO Add distributed ThinLTO build support for the Linux kernel. This new mode offers several advantages: (1) Increased flexibility in handling user-specified build options. (2) Improved user-friendliness for developers. (3) Greater convenience for integrating with objtool and livepatch. Note that "distributed" in this context refers to a term that differentiates in-process ThinLTO builds by invoking backend compilation through the linker, not necessarily building in distributed environments. Depends on dfd4c69f9f12f8fdd68e08cdba250e37cefc93ce so merge this when 6.15rc4 is released Link: https://lore.kernel.org/20250420010214.1963979-1-xur@google.com/ Signed-off-by: Eric Naim --- linux-cachyos-rc/PKGBUILD | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linux-cachyos-rc/PKGBUILD b/linux-cachyos-rc/PKGBUILD index ba1b0a1ee..9d5bc05f0 100644 --- a/linux-cachyos-rc/PKGBUILD +++ b/linux-cachyos-rc/PKGBUILD @@ -85,8 +85,9 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO -: "${_use_llvm_lto:=thin}" +: "${_use_llvm_lto:=thin-dist}" # Use suffix -lto only when requested by the user # yes - enable -lto suffix @@ -150,7 +151,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -337,6 +338,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; From 0e089fe18ae38987017c5128ffe665753a40dfd6 Mon Sep 17 00:00:00 2001 From: Piotr Gorski Date: Tue, 27 May 2025 18:26:35 +0200 Subject: [PATCH 2/3] linux-cachyos kernels: Add support for Distributed ThinLTO Signed-off-by: Piotr Gorski --- linux-cachyos-bmq/PKGBUILD | 4 +++- linux-cachyos-bore/PKGBUILD | 4 +++- linux-cachyos-deckify/PKGBUILD | 4 +++- linux-cachyos-eevdf/PKGBUILD | 4 +++- linux-cachyos-rt-bore/PKGBUILD | 4 +++- linux-cachyos-server/PKGBUILD | 4 +++- linux-cachyos/PKGBUILD | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/linux-cachyos-bmq/PKGBUILD b/linux-cachyos-bmq/PKGBUILD index 2103fb1bf..653c84971 100644 --- a/linux-cachyos-bmq/PKGBUILD +++ b/linux-cachyos-bmq/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -125,7 +126,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -298,6 +299,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos-bore/PKGBUILD b/linux-cachyos-bore/PKGBUILD index 062641257..432e40a67 100644 --- a/linux-cachyos-bore/PKGBUILD +++ b/linux-cachyos-bore/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -125,7 +126,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -298,6 +299,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos-deckify/PKGBUILD b/linux-cachyos-deckify/PKGBUILD index 2450e2f41..5637c10ba 100644 --- a/linux-cachyos-deckify/PKGBUILD +++ b/linux-cachyos-deckify/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -124,7 +125,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -299,6 +300,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos-eevdf/PKGBUILD b/linux-cachyos-eevdf/PKGBUILD index c30635dad..f070851b8 100644 --- a/linux-cachyos-eevdf/PKGBUILD +++ b/linux-cachyos-eevdf/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -125,7 +126,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -298,6 +299,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos-rt-bore/PKGBUILD b/linux-cachyos-rt-bore/PKGBUILD index 54159a2dd..fdad6d72f 100644 --- a/linux-cachyos-rt-bore/PKGBUILD +++ b/linux-cachyos-rt-bore/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -125,7 +126,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -298,6 +299,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos-server/PKGBUILD b/linux-cachyos-server/PKGBUILD index a65cf1152..7caef3183 100644 --- a/linux-cachyos-server/PKGBUILD +++ b/linux-cachyos-server/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=none}" @@ -125,7 +126,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -298,6 +299,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILD index bd093c5bf..6aa03db4f 100644 --- a/linux-cachyos/PKGBUILD +++ b/linux-cachyos/PKGBUILD @@ -85,6 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" # "none: disable LTO : "${_use_llvm_lto:=thin}" @@ -150,7 +151,7 @@ # ATTENTION: Do not modify after this line _is_lto_kernel() { - [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] + [[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" || "$_use_llvm_lto" = "thin-dist" ]] return $? } @@ -338,6 +339,7 @@ prepare() { ### Select LLVM level case "$_use_llvm_lto" in thin) scripts/config -e LTO_CLANG_THIN;; + thin-dist) scripts/config -e LTO_CLANG_THIN_DIST;; full) scripts/config -e LTO_CLANG_FULL;; none) scripts/config -e LTO_NONE;; *) _die "The value '$_use_llvm_lto' is invalid. Choose the correct one again.";; From 95c93fee895c1c11804e118237d76538e3a9bcc6 Mon Sep 17 00:00:00 2001 From: Piotr Gorski Date: Tue, 27 May 2025 19:23:06 +0200 Subject: [PATCH 3/3] linux-cachyos kernels: Add description for Distributed ThinLTO Signed-off-by: Piotr Gorski --- linux-cachyos-bmq/PKGBUILD | 2 +- linux-cachyos-bore/PKGBUILD | 2 +- linux-cachyos-deckify/PKGBUILD | 2 +- linux-cachyos-eevdf/PKGBUILD | 2 +- linux-cachyos-rc/PKGBUILD | 2 +- linux-cachyos-rt-bore/PKGBUILD | 2 +- linux-cachyos-server/PKGBUILD | 2 +- linux-cachyos/PKGBUILD | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-cachyos-bmq/PKGBUILD b/linux-cachyos-bmq/PKGBUILD index 653c84971..a4d38cbd8 100644 --- a/linux-cachyos-bmq/PKGBUILD +++ b/linux-cachyos-bmq/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos-bore/PKGBUILD b/linux-cachyos-bore/PKGBUILD index 432e40a67..aee2064a8 100644 --- a/linux-cachyos-bore/PKGBUILD +++ b/linux-cachyos-bore/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos-deckify/PKGBUILD b/linux-cachyos-deckify/PKGBUILD index 5637c10ba..cc3ebbfab 100644 --- a/linux-cachyos-deckify/PKGBUILD +++ b/linux-cachyos-deckify/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos-eevdf/PKGBUILD b/linux-cachyos-eevdf/PKGBUILD index f070851b8..5b0e232a3 100644 --- a/linux-cachyos-eevdf/PKGBUILD +++ b/linux-cachyos-eevdf/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos-rc/PKGBUILD b/linux-cachyos-rc/PKGBUILD index 9d5bc05f0..e772c004d 100644 --- a/linux-cachyos-rc/PKGBUILD +++ b/linux-cachyos-rc/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=thin-dist}" diff --git a/linux-cachyos-rt-bore/PKGBUILD b/linux-cachyos-rt-bore/PKGBUILD index fdad6d72f..72797caac 100644 --- a/linux-cachyos-rt-bore/PKGBUILD +++ b/linux-cachyos-rt-bore/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos-server/PKGBUILD b/linux-cachyos-server/PKGBUILD index 7caef3183..1fb9eb7ad 100644 --- a/linux-cachyos-server/PKGBUILD +++ b/linux-cachyos-server/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=none}" diff --git a/linux-cachyos/PKGBUILD b/linux-cachyos/PKGBUILD index 6aa03db4f..60403e009 100644 --- a/linux-cachyos/PKGBUILD +++ b/linux-cachyos/PKGBUILD @@ -85,7 +85,7 @@ # ATTENTION - one of three predefined values should be selected! # "full: uses 1 thread for Linking, slow and uses more memory, theoretically with the highest performance gains." # "thin: uses multiple threads, faster and uses less memory, may have a lower runtime performance than Full." -# "thin-dist: Similar to thin, but uses a distributed model rather than in-process" +# "thin-dist: Similar to thin, but uses a distributed model rather than in-process: https://discourse.llvm.org/t/rfc-distributed-thinlto-build-for-kernel/85934" # "none: disable LTO : "${_use_llvm_lto:=thin}"