blob: 54a79c33cec1b9ca2437bc652dd9e060a8eed057 [file] [log] [blame]
Martin Rothb7f92a02022-11-13 15:27:08 -07001From 2a44aa33d6506a29b14d9c429410ad582d1d6636 Mon Sep 17 00:00:00 2001
2From: Martin Roth <gaumless@gmail.com>
3Date: Sun, 13 Nov 2022 15:20:57 -0700
4Subject: [PATCH] util/kconfig: Move Kconfig deps back into build/config
5
6revert commit 1b9e740a8 (kconfig: fix failing to generate auto.conf) [1]
7
8The above change caused all of the enabled kconfig options to be written
9into the top level build directory. We don't want that, so go back to
10the old behavior for the coreboot tree.
11
12[1] https://web.archive.org/web/20220316120807/https://github.com/torvalds/linux/commit/1b9e740a81f91ae338b29ed70455719804957b80
13
14Signed-off-by: Martin Roth <gaumless@gmail.com>
15Change-Id: I2904f69a5d85337ad0a6b48590ccd4b4a6e38b70
16---
17 util/kconfig/confdata.c | 20 +++++++++++---------
18 1 file changed, 11 insertions(+), 9 deletions(-)
19
Nicholas Chin6e902bc2022-11-20 11:00:42 -070020Index: kconfig/confdata.c
21===================================================================
22--- kconfig.orig/confdata.c
23+++ kconfig/confdata.c
Patrick Georgi7f93aa42023-11-20 17:58:40 +010024@@ -237,6 +237,13 @@ static const char *conf_get_rustccfg_nam
25 return name ? name : "include/generated/rustc_cfg";
Martin Rothb7f92a02022-11-13 15:27:08 -070026 }
27
28+static const char *conf_get_autobase_name(void)
29+{
30+ char *name = getenv("KCONFIG_SPLITCONFIG");
31+
32+ return name ? name : "include/config/";
33+}
34+
35 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
36 {
37 char *p2;
Patrick Georgi0eab62b2023-11-20 19:49:29 +010038@@ -1106,19 +1113,19 @@ static int conf_write_autoconf_cmd(const
Martin Rothb7f92a02022-11-13 15:27:08 -070039
40 static int conf_touch_deps(void)
41 {
42- const char *name, *tmp;
43+ const char *name;
44 struct symbol *sym;
45 int res, i;
46
47- name = conf_get_autoconfig_name();
48- tmp = strrchr(name, '/');
49- depfile_prefix_len = tmp ? tmp - name + 1 : 0;
50- if (depfile_prefix_len + 1 > sizeof(depfile_path))
51- return -1;
52-
53- strncpy(depfile_path, name, depfile_prefix_len);
54- depfile_path[depfile_prefix_len] = 0;
Nicholas Chin8ef2f7c2022-11-23 10:18:32 -070055+ /*
56+ * Upstream Kconfig sets depfile_path based on the directory
57+ * prefix of the autoconfig path, but coreboot overrides this
58+ * using the KCONFIG_SPLITCONFIG environment variable
59+ */
Martin Rothb7f92a02022-11-13 15:27:08 -070060+ strcpy(depfile_path, conf_get_autobase_name());
61+ depfile_prefix_len = strlen(depfile_path);
62
63+ name = conf_get_autoconfig_name();
64 conf_read_simple(name, S_DEF_AUTO);
65 sym_calc_value(modules_sym);
66