[OpenWrt-Devel] [PATCH] build: config: allow bool to select a module pkg

Eneas U de Queiroz cotequeiroz at gmail.com
Thu Apr 9 20:39:17 EDT 2020


kconfig-v5.6 disallowed a bool symbol to select another symbol that
'depends on m' (i.e. can be only 'm' on 'n').  It is, in fact, an unmet
dependency to have set to 'y'.  However, openwrt depends on the previous
behavior, to be able to build a package that can be a module or built-in
depending on a bool config.  This restores the previous behavior.

Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
--
This was reported to me here:
https://github.com/openwrt/openwrt/commit/dcf3e63a35d05e7e5103819c0f17195bfafe9baa#commitcomment-38390450
The update to kconfig-v5.6 broke TARGET_MULTI_PROFILE because it would
not accept bool TARGET_DEVICE_<dev> to select MODULE_DEFAULT_<pkg>
because MODULE_DEFAULT_<pgk> 'depends on m'--should only have a 'n' or
'm' value.  A 'y' value would imply an unmet direct dependency (depends
on m).

My first thought was OK, if it wants to be a 'y', get rid of the
'depends on m' line; that did not work, because MODULE_DEFAULT_<pkg>
selects PACKAGE_pkg, then <pkg> would be forced to be built-in.
So, unless someone has a better idea, let's revert to the old behavior,
and tolerate some 'unmet dependencies' once again.

diff --git a/scripts/config/README b/scripts/config/README
index 81243e8016..d193050ba4 100644
--- a/scripts/config/README
+++ b/scripts/config/README
@@ -22,7 +22,9 @@ OpenWrt Buildroot:
    that may cause one.
  - use pre-built *.lex.c *.tab.[ch] files by default, to avoid depending on
    flex & bison.  Rebuild/remove these files only if running make with
-   BUILD_SHIPPED_FILES defined
+   BUILD_SHIPPED_FILES defined.
+ - allow a bool symbol to select a tristate symbol that depends on m (i.e.
+   a package that should only be built as a module).
 
 For a full list of changes, see the repository at:
 https://github.com/cotequeiroz/linux/commits/openwrt/scripts/kconfig
diff --git a/scripts/config/symbol.c b/scripts/config/symbol.c
index 5c6f540314..051472238d 100644
--- a/scripts/config/symbol.c
+++ b/scripts/config/symbol.c
@@ -205,7 +205,7 @@ static void sym_calc_visibility(struct symbol *sym)
 	tri = yes;
 	if (sym->dir_dep.expr)
 		tri = expr_calc_value(sym->dir_dep.expr);
-	if (tri == mod && sym_get_type(sym) == S_BOOLEAN)
+	if (tri == mod)
 		tri = yes;
 	if (sym->dir_dep.tri != tri) {
 		sym->dir_dep.tri = tri;

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list