History

kconfig: make 'imply' obey the direct dependency

The 'imply' statement may create unmet direct dependency when the implied symbol depends on m. [Test Code] config FOO tristate "foo" imply BAZ config BAZ tristate "baz" depends on BAR config BAR def_tristate m config MODULES def_bool y option modules If you set FOO=y, BAZ is also promoted to y, which results in the following .config file: CONFIG_FOO=y CONFIG_BAZ=y CONFIG_BAR=m CONFIG_MODULES=y This does not meet the dependency 'BAZ depends on BAR'. Unlike 'select', what is worse, Kconfig never shows the 'WARNING: unmet direct dependencies detected for ...' for this case. Because 'imply' is considered to be weaker than 'depends on', Kconfig should take the direct dependency into account. For clarification, describe this case in kconfig-language.rst too.

Masahiro Yamada committed 6 years ago

Commit 3a9dd3e1 parent def2fbf2 files · +16 −3Browse files

Showing the changes to scripts (1 of 2 files). Show all

Unified · Split

scripts/kconfig/symbol.c+3−1
@@ -221,7 +221,7 @@ static void sym_calc_visibility(struct symbol *sym) · 220 unmodified lines
221 sym_set_changed(sym);221 sym_set_changed(sym);
222 }222 }
223 tri = no;223 tri = no;
224 if (sym->implied.expr && sym->dir_dep.tri != no)224 if (sym->implied.expr)
225 tri = expr_calc_value(sym->implied.expr);225 tri = expr_calc_value(sym->implied.expr);
226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)226 if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
227 tri = yes;227 tri = yes;
@@ -394,6 +394,8 @@ void sym_calc_value(struct symbol *sym) · 166 unmodified lines
394 if (sym->implied.tri != no) {394 if (sym->implied.tri != no) {
395 sym->flags |= SYMBOL_WRITE;395 sym->flags |= SYMBOL_WRITE;
396 newval.tri = EXPR_OR(newval.tri, sym->implied.tri);396 newval.tri = EXPR_OR(newval.tri, sym->implied.tri);
397 newval.tri = EXPR_AND(newval.tri,
398 sym->dir_dep.tri);
397 }399 }
398 }400 }
399 calc_newval:401 calc_newval: