aboutsummaryrefslogtreecommitdiff
path: root/util/kconfig/confdata.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@coreboot.org>2023-11-20 19:49:29 +0100
committerPatrick Georgi <patrick@coreboot.org>2023-11-25 14:51:41 +0000
commit0eab62b9cfadfd7d77ca4b14212fe1695e0a5dd8 (patch)
tree61b2bb64f139084a7af351051559756ba595e973 /util/kconfig/confdata.c
parent47282a90debed401ba0110bff06c0a3f837a20bd (diff)
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>
Diffstat (limited to 'util/kconfig/confdata.c')
-rw-r--r--util/kconfig/confdata.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/util/kconfig/confdata.c b/util/kconfig/confdata.c
index b5c6da3453..a6ee708b4b 100644
--- a/util/kconfig/confdata.c
+++ b/util/kconfig/confdata.c
@@ -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;
}