util/kconfig: Uprev to Linux 6.6's kconfig

Upstream reimplemented KCONFIG_STRICT, just calling it KCONFIG_WERROR.
Therefore, adapt our build system and documentation. Upstream is less
strict at this time, but there's a proposed patch that got imported.

TEST=`util/abuild/abuild -C` output (config.h and
config.build) remains the same. Also, the failure type fixed in
https://review.coreboot.org/c/coreboot/+/11272 can be detected,
which I tested by manually breaking our Kconfig in a similar way.

Change-Id: I322fb08a2f7308b93cff71a5dd4136f1a998773b
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79259
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
This commit is contained in:
Patrick Georgi
2023-11-20 19:49:29 +01:00
parent 47282a90de
commit 0eab62b9cf
25 changed files with 406 additions and 449 deletions

View File

@@ -370,7 +370,11 @@ int conf_read_simple(const char *name, int def)
char *p, *p2;
struct symbol *sym;
int i, def_flags;
const char *warn_unknown;
const char *werror;
warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS");
werror = getenv("KCONFIG_WERROR");
if (name) {
in = zconf_fopen(name);
} else {
@@ -458,9 +462,10 @@ load:
if (def == S_DEF_USER) {
sym = sym_find(line + 2 + strlen(CONFIG_));
if (!sym) {
conf_message(
"ignoring nonexistent symbol %s",
line + 2 + strlen(CONFIG_));
if (warn_unknown)
conf_warning("unknown symbol: %s",
line + 2 + strlen(CONFIG_));
conf_set_changed(true);
continue;
}
@@ -495,7 +500,7 @@ load:
sym = sym_find(line + strlen(CONFIG_));
if (!sym) {
if (def == S_DEF_AUTO)
if (def == S_DEF_AUTO) {
/*
* Reading from include/config/auto.conf
* If CONFIG_FOO previously existed in
@@ -503,8 +508,13 @@ load:
* include/config/FOO must be touched.
*/
conf_touch_dep(line + strlen(CONFIG_));
else
} else {
if (warn_unknown)
conf_warning("unknown symbol: %s",
line + strlen(CONFIG_));
conf_set_changed(true);
}
continue;
}
@@ -544,7 +554,10 @@ load:
free(line);
fclose(in);
kconfig_warnings += conf_warnings;
if (conf_warnings && werror) {
fprintf(stderr, "\nERROR: %d warnings encountered, and warnings are errors.\n\n", conf_warnings);
exit(1);
}
return 0;
}