[openwrt/openwrt] config: select KERNEL_WERROR if building with default GCC version
LEDE Commits
lede-commits at lists.infradead.org
Thu Apr 18 02:53:09 PDT 2024
ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/915dfbdbb1ae16fb16bf07ed836d8979c30f1fbe
commit 915dfbdbb1ae16fb16bf07ed836d8979c30f1fbe
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sun Apr 7 19:50:04 2024 +0100
config: select KERNEL_WERROR if building with default GCC version
[ during cherry-pick GCC version was changed to default GCC 12 version ]
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: https://github.com/openwrt/openwrt/pull/15064
Signed-off-by: Daniel Golle <daniel at makrotopia.org>
Signed-off-by: Petr Štetiar <ynezz at true.cz> [GCC 12 default]
(cherry picked from commit 501ef81040baa2ee31de6dd9f75d619de0e4c9bc)
---
config/Config-kernel.in | 2 --
toolchain/gcc/Config.in | 5 +++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index bbda247cd7..42755a4d59 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -1343,8 +1343,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
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index 9156f9c263..be975e5334 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -16,6 +16,11 @@ choice
bool "gcc 13.x"
endchoice
+config GCC_USE_DEFAULT_VERSION
+ bool
+ default y if !TOOLCHAINOPTS || GCC_USE_VERSION_12
+ imply KERNEL_WERROR
+
config GCC_USE_GRAPHITE
bool
prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS
More information about the lede-commits
mailing list