Commit ac1ffde1ba053db0266f886a15ed845a6628fcb0

Authored by Ulf Magnusson
Committed by Michal Marek
1 parent 1244b41d00

kconfig: fix MODULES-related bug in case of no .config

There seems to be a kconfig bug due to MODULES not always being
evaluated if no .config is found. Take the following Kconfig as an
example:

config MODULES
	def_bool y

config FOO
	def_tristate m

With no .config, the following configuration is generated:

CONFIG_MODULES=y
CONFIG_FOO=y

With an empty .config, the following:

CONFIG_MODULES=y
CONFIG_FOO=m

Tristate choice statements can also exhibit the problem, due to having an
implicit rev_dep (select) containing "m".

The problem is that MODULES is never evaluted in conf_read_simple() unless
there's a .config. The following patch fixes this.

Signed-off-by: Ulf Magnusson <ulfalizer.lkml@gmail.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 1 changed file with 4 additions and 1 deletions Side-by-side Diff

scripts/kconfig/confdata.c
... ... @@ -170,8 +170,11 @@
170 170 if (in)
171 171 goto load;
172 172 sym_add_change_count(1);
173   - if (!sym_defconfig_list)
  173 + if (!sym_defconfig_list) {
  174 + if (modules_sym)
  175 + sym_calc_value(modules_sym);
174 176 return 1;
  177 + }
175 178  
176 179 for_all_defaults(sym_defconfig_list, prop) {
177 180 if (expr_calc_value(prop->visible.expr) == no ||