Skip to content

Commit

Permalink
config: select KERNEL_WERROR if building with default GCC version
Browse files Browse the repository at this point in the history
At the moment we have to manually follow the default GCC version
also in config/Config-kernel.in. This tends to be forgotten at GCC
version bumps (just happened when switching from version 12 to 13).
Instead, introduce a hidden Kconfig symbol which implies KERNEL_WERROR
in toolchain/gcc/Config.in where it is visible for developers changing
the default version.

Also remove the explicit default on BUILDBOT to avoid a circular
dependency and also because buildbots anyway implicitly always select
the default GCC version.

Reference: openwrt/openwrt#15064
Signed-off-by: Daniel Golle <[email protected]>
  • Loading branch information
dangowrt committed Apr 8, 2024
1 parent 5e0587b commit 501ef81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions config/Config-kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -1418,8 +1418,6 @@ config KERNEL_JFFS2_FS_SECURITY

config KERNEL_WERROR
bool "Compile the kernel with warnings as errors"
default BUILDBOT
default y if GCC_USE_VERSION_12
help
A kernel build should not cause any compiler warnings, and this
enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
Expand Down
5 changes: 5 additions & 0 deletions toolchain/gcc/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ choice
bool "gcc 13.x"
endchoice

config GCC_USE_DEFAULT_VERSION
bool
default y if !TOOLCHAINOPTS || GCC_USE_VERSION_13
imply KERNEL_WERROR

config GCC_USE_GRAPHITE
bool
prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS
Expand Down

0 comments on commit 501ef81

Please sign in to comment.