Skip to content

Commit

Permalink
Kconfig: move LTO options to Build Setup menu
Browse files Browse the repository at this point in the history
LTO is optimization option so it's more appropriate to place it
in the same place as other optimization options
  • Loading branch information
raiden00pl authored and acassis committed Jun 2, 2024
1 parent e6973c7 commit 37b3dc1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
38 changes: 38 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,44 @@ config DEBUG_OPTLEVEL
This string represents the custom optimization level that will be
used if DEBUG_CUSTOMOPT.

choice
prompt "Link Time Optimization (LTO)"
default LTO_NONE
---help---
This option enables Link Time Optimization (LTO), which allows the
compiler to optimize binaries globally.

If unsure, select LTO_NONE. Note that LTO is very resource-intensive
so it's disabled by default.

config LTO_NONE
bool "None"
---help---
Build the kernel normally, without Link Time Optimization (LTO).

config LTO_FULL
bool "GNU Full LTO (EXPERIMENTAL)"
depends on ARCH_TOOLCHAIN_GNU
---help---
Link time optimization is implemented as a GCC front end for a bytecode
bytecode representation of GIMPLE that is emitted in special sections
of .o files. Currently, LTO support is enabled in most ELF-based systems,
as well as darwin, cygwin and mingw systems.

config LTO_THIN
bool "Clang ThinLTO (EXPERIMENTAL)"
depends on ARCH_TOOLCHAIN_CLANG
---help---
This option enables Clang's ThinLTO, which allows for parallel
optimization and faster incremental compiles compared to the
CONFIG_LTO_FULL option. More information can be found
from Clang's documentation:

https://clang.llvm.org/docs/ThinLTO.html

If unsure, say Y.
endchoice

config DEBUG_OPT_UNUSED_SECTIONS
bool "Optimization to eliminate the unused input sections"
default y
Expand Down
38 changes: 0 additions & 38 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -283,44 +283,6 @@ config ARCH_TOOLCHAIN_TASKING
bool
default n

choice
prompt "Link Time Optimization (LTO)"
default LTO_NONE
---help---
This option enables Link Time Optimization (LTO), which allows the
compiler to optimize binaries globally.

If unsure, select LTO_NONE. Note that LTO is very resource-intensive
so it's disabled by default.

config LTO_NONE
bool "None"
---help---
Build the kernel normally, without Link Time Optimization (LTO).

config LTO_FULL
bool "GNU Full LTO (EXPERIMENTAL)"
depends on ARCH_TOOLCHAIN_GNU
---help---
Link time optimization is implemented as a GCC front end for a bytecode
bytecode representation of GIMPLE that is emitted in special sections
of .o files. Currently, LTO support is enabled in most ELF-based systems,
as well as darwin, cygwin and mingw systems.

config LTO_THIN
bool "Clang ThinLTO (EXPERIMENTAL)"
depends on ARCH_TOOLCHAIN_CLANG
---help---
This option enables Clang's ThinLTO, which allows for parallel
optimization and faster incremental compiles compared to the
CONFIG_LTO_FULL option. More information can be found
from Clang's documentation:

https://clang.llvm.org/docs/ThinLTO.html

If unsure, say Y.
endchoice

config ARCH_GNU_NO_WEAKFUNCTIONS
bool
depends on ARCH_TOOLCHAIN_GNU
Expand Down

0 comments on commit 37b3dc1

Please sign in to comment.