util/kconfig: Uprev to Linux 6.8's kconfig
Linux kconfig has its own implementation of KCONFIG_WERROR now, so use that. This reduces our patch count by 2. Change-Id: I4f5f1f552e96f8ef7a4c5c0ab2ab7e2b6d798ceb Signed-off-by: Patrick Georgi <patrick@georgi.software> Reviewed-on: https://review.coreboot.org/c/coreboot/+/81223 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
committed by
Felix Held
parent
96499840aa
commit
7761237dfe
@@ -1,18 +0,0 @@
|
||||
Make KCONFIG_WERROR more verbose.
|
||||
|
||||
Index: kconfig/confdata.c
|
||||
===================================================================
|
||||
--- kconfig.orig/confdata.c
|
||||
+++ kconfig/confdata.c
|
||||
@@ -533,8 +533,10 @@ load:
|
||||
free(line);
|
||||
fclose(in);
|
||||
|
||||
- if (conf_warnings && werror)
|
||||
+ if (conf_warnings && werror) {
|
||||
+ fprintf(stderr, "\nERROR: %d warnings encountered, and warnings are errors.\n\n", conf_warnings);
|
||||
exit(1);
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
@@ -23,7 +23,7 @@ Index: kconfig/confdata.c
|
||||
===================================================================
|
||||
--- kconfig.orig/confdata.c
|
||||
+++ kconfig/confdata.c
|
||||
@@ -166,6 +166,16 @@ static void conf_warning(const char *fmt
|
||||
@@ -173,6 +173,16 @@ static void conf_warning(const char *fmt
|
||||
conf_warnings++;
|
||||
}
|
||||
|
||||
@@ -40,25 +40,16 @@ Index: kconfig/confdata.c
|
||||
static void conf_default_message_callback(const char *s)
|
||||
{
|
||||
printf("#\n# ");
|
||||
@@ -454,7 +464,7 @@ load:
|
||||
sym->type = S_BOOLEAN;
|
||||
}
|
||||
if (sym->flags & def_flags) {
|
||||
- conf_warning("override: reassigning to symbol %s", sym->name);
|
||||
+ conf_notice("override: reassigning to symbol %s", sym->name);
|
||||
}
|
||||
switch (sym->type) {
|
||||
case S_BOOLEAN:
|
||||
@@ -498,7 +508,7 @@ load:
|
||||
}
|
||||
@@ -503,7 +513,7 @@ load:
|
||||
}
|
||||
|
||||
if (sym->flags & def_flags) {
|
||||
- conf_warning("override: reassigning to symbol %s", sym->name);
|
||||
+ conf_notice("override: reassigning to symbol %s", sym->name);
|
||||
}
|
||||
if (conf_set_sym_val(sym, def, def_flags, p))
|
||||
continue;
|
||||
@@ -523,7 +533,7 @@ load:
|
||||
if (sym->flags & def_flags)
|
||||
- conf_warning("override: reassigning to symbol %s", sym->name);
|
||||
+ conf_notice("override: reassigning to symbol %s", sym->name);
|
||||
|
||||
if (conf_set_sym_val(sym, def, def_flags, val))
|
||||
continue;
|
||||
@@ -521,7 +531,7 @@ load:
|
||||
break;
|
||||
case yes:
|
||||
if (cs->def[def].tri != no)
|
||||
|
@@ -14,7 +14,7 @@ Index: kconfig/conf.c
|
||||
===================================================================
|
||||
--- kconfig.orig/conf.c
|
||||
+++ kconfig/conf.c
|
||||
@@ -892,7 +892,7 @@ int main(int ac, char **av)
|
||||
@@ -898,7 +898,7 @@ int main(int ac, char **av)
|
||||
|
||||
if (input_mode == savedefconfig) {
|
||||
if (conf_write_defconfig(defconfig_file)) {
|
||||
|
@@ -15,9 +15,9 @@ Index: kconfig/confdata.c
|
||||
===================================================================
|
||||
--- kconfig.orig/confdata.c
|
||||
+++ kconfig/confdata.c
|
||||
@@ -155,6 +155,10 @@ static void conf_message(const char *fmt
|
||||
static const char *conf_filename;
|
||||
static int conf_lineno, conf_warnings;
|
||||
@@ -162,6 +162,10 @@ bool conf_errors(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
+#ifdef __MINGW32__
|
||||
+#define mkdir(_n,_p) mkdir((_n))
|
||||
|
@@ -1,71 +0,0 @@
|
||||
From: Sergey Senozhatsky <senozhatsky@chromium.org>
|
||||
To: Masahiro Yamada <masahiroy@kernel.org>
|
||||
Cc: Patrick Georgi <pgeorgi@google.com>, linux-kbuild@vger.kernel.org,
|
||||
linux-kernel@vger.kernel.org,
|
||||
Sergey Senozhatsky <senozhatsky@chromium.org>,
|
||||
Stefan Reinauer <reinauer@google.com>
|
||||
Subject: [PATCH] kconfig: WERROR unmet symbol dependency
|
||||
Date: Wed, 22 Nov 2023 12:47:45 +0900
|
||||
Message-ID: <20231122034753.1446513-1-senozhatsky@chromium.org>
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 8bit
|
||||
List-ID: <linux-kernel.vger.kernel.org>
|
||||
X-Mailing-List: linux-kernel@vger.kernel.org
|
||||
|
||||
When KCONFIG_WERROR env variable is set treat unmet direct
|
||||
symbol dependency as a terminal condition (error).
|
||||
|
||||
Suggested-by: Stefan Reinauer <reinauer@google.com>
|
||||
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
|
||||
---
|
||||
scripts/kconfig/symbol.c | 9 ++++++++-
|
||||
1 file changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: kconfig/symbol.c
|
||||
===================================================================
|
||||
--- kconfig.orig/symbol.c
|
||||
+++ kconfig/symbol.c
|
||||
@@ -37,6 +37,7 @@ static struct symbol symbol_empty = {
|
||||
|
||||
struct symbol *modules_sym;
|
||||
static tristate modules_val;
|
||||
+static int sym_warnings;
|
||||
|
||||
enum symbol_type sym_get_type(struct symbol *sym)
|
||||
{
|
||||
@@ -317,12 +318,14 @@ static void sym_warn_unmet_dep(struct sy
|
||||
" Selected by [m]:\n");
|
||||
|
||||
fputs(str_get(&gs), stderr);
|
||||
+ sym_warnings++;
|
||||
}
|
||||
|
||||
void sym_calc_value(struct symbol *sym)
|
||||
{
|
||||
struct symbol_value newval, oldval;
|
||||
struct property *prop;
|
||||
+ const char *werror;
|
||||
struct expr *e;
|
||||
|
||||
if (!sym)
|
||||
@@ -338,8 +341,9 @@ void sym_calc_value(struct symbol *sym)
|
||||
sym_calc_value(prop_get_symbol(prop));
|
||||
}
|
||||
|
||||
+ werror = getenv("KCONFIG_WERROR");
|
||||
+ sym_warnings = 0;
|
||||
sym->flags |= SYMBOL_VALID;
|
||||
-
|
||||
oldval = sym->curr;
|
||||
|
||||
switch (sym->type) {
|
||||
@@ -430,6 +434,9 @@ void sym_calc_value(struct symbol *sym)
|
||||
;
|
||||
}
|
||||
|
||||
+ if (sym_warnings && werror)
|
||||
+ exit(1);
|
||||
+
|
||||
sym->curr = newval;
|
||||
if (sym_is_choice(sym) && newval.tri == yes)
|
||||
sym->curr.val = sym_calc_choice(sym);
|
@@ -14,7 +14,7 @@ Index: kconfig/confdata.c
|
||||
===================================================================
|
||||
--- kconfig.orig/confdata.c
|
||||
+++ kconfig/confdata.c
|
||||
@@ -738,7 +738,12 @@ static void print_symbol_for_dotconfig(F
|
||||
@@ -731,7 +731,12 @@ static void print_symbol_for_dotconfig(F
|
||||
|
||||
static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ Index: kconfig/confdata.c
|
||||
}
|
||||
|
||||
void print_symbol_for_listconfig(struct symbol *sym)
|
||||
@@ -763,6 +768,10 @@ static void print_symbol_for_c(FILE *fp,
|
||||
@@ -756,6 +761,10 @@ static void print_symbol_for_c(FILE *fp,
|
||||
case S_TRISTATE:
|
||||
switch (*val) {
|
||||
case 'n':
|
||||
@@ -39,7 +39,7 @@ Index: kconfig/confdata.c
|
||||
return;
|
||||
case 'm':
|
||||
sym_suffix = "_MODULE";
|
||||
@@ -774,6 +783,12 @@ static void print_symbol_for_c(FILE *fp,
|
||||
@@ -767,6 +776,12 @@ static void print_symbol_for_c(FILE *fp,
|
||||
case S_HEX:
|
||||
if (val[0] != '0' || (val[1] != 'x' && val[1] != 'X'))
|
||||
val_prefix = "0x";
|
||||
@@ -52,7 +52,7 @@ Index: kconfig/confdata.c
|
||||
break;
|
||||
case S_STRING:
|
||||
escaped = escape_string_value(val);
|
||||
@@ -1190,8 +1205,9 @@ static int __conf_write_autoconf(const c
|
||||
@@ -1183,8 +1198,9 @@ static int __conf_write_autoconf(const c
|
||||
|
||||
conf_write_heading(file, comment_style);
|
||||
|
||||
|
@@ -21,7 +21,7 @@ Index: kconfig/confdata.c
|
||||
===================================================================
|
||||
--- kconfig.orig/confdata.c
|
||||
+++ kconfig/confdata.c
|
||||
@@ -237,6 +237,13 @@ static const char *conf_get_rustccfg_nam
|
||||
@@ -244,6 +244,13 @@ static const char *conf_get_rustccfg_nam
|
||||
return name ? name : "include/generated/rustc_cfg";
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ Index: kconfig/confdata.c
|
||||
static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
|
||||
{
|
||||
char *p2;
|
||||
@@ -1106,19 +1113,19 @@ static int conf_write_autoconf_cmd(const
|
||||
@@ -1099,19 +1106,19 @@ static int conf_write_autoconf_cmd(const
|
||||
|
||||
static int conf_touch_deps(void)
|
||||
{
|
||||
|
@@ -1,9 +1,7 @@
|
||||
0001-Kconfig-Add-KCONFIG_STRICT-mode.patch
|
||||
0002-Kconfig-Change-symbol-override-from-warning-to-notic.patch
|
||||
0003-util-kconfig-conf.c-Fix-newline-in-error-printf.patch
|
||||
0004-src-util-Use-NULL-instead-of-0-for-pointer.patch
|
||||
0006-util-kconfig-Set-parameter-of-mkdir-to-only-one-for-.patch
|
||||
0007-kconfig-Allow-KCONFIG_STRICT-outside-of-confdata.c.patch
|
||||
0008-kconfig-Add-wildcard-support-for-source.patch
|
||||
0009-util-kconfig-Allow-emitting-false-booleans-into-kconfig-output.patch
|
||||
0010-reenable-source-in-choice.patch
|
||||
|
Reference in New Issue
Block a user