diff --git a/include/toplevel.mk b/include/toplevel.mk
index 2965f75c7cd7e66fef5b7562a77f134ff6ddb18f..def80503dd911d209d55bfa7a79fc3dd83f79d1c 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -102,7 +102,7 @@ prepare-tmpinfo: FORCE
 ifneq ($(DISTRO_PKG_CONFIG),)
 scripts/config/%onf: export PATH:=$(dir $(DISTRO_PKG_CONFIG)):$(PATH)
 endif
-scripts/config/%onf: CFLAGS+= -O2
+scripts/config/%onf: CFLAGS+= -O2 $(if $(WARN_RECURSIVE_DEP),-DWARN_RECURSIVE_DEP)
 scripts/config/%onf:
 	@$(_SINGLE)$(SUBMAKE) -s -C scripts/config $(notdir $@) CC="$(HOSTCC_WRAPPER)"
 
diff --git a/scripts/config/README b/scripts/config/README
index ac5f094ff2933971a781acb78fa5f874778247c0..81243e8016dd888c3e80c67262d625bde701e3ce 100644
--- a/scripts/config/README
+++ b/scripts/config/README
@@ -16,6 +16,10 @@ OpenWrt Buildroot:
  - reverted an upstream change that avoids writing symbols that are not
    visible to .config, which breaks OpenWrt busybox's '.config' generation
    logic.
+ - add a compilation option (-DWARN_RECURSIVE_DEP) to treat recursive deps
+   as a warning, avoiding a complete build failure because of unrelated or
+   minor recursive deps, or making a scrict check before commiting a change
+   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
diff --git a/scripts/config/symbol.c b/scripts/config/symbol.c
index b1dd9be29d541217c931c61492810326e2e82d68..5c6f54031437a0d64b98ac6942d6892550c0b753 100644
--- a/scripts/config/symbol.c
+++ b/scripts/config/symbol.c
@@ -1250,6 +1250,11 @@ struct symbol *sym_check_deps(struct symbol *sym)
 		sym->flags &= ~SYMBOL_CHECK;
 	}
 
+#ifdef WARN_RECURSIVE_DEP
+	if (sym2 && sym2 == sym)
+		sym2 = NULL;
+#endif
+
 	return sym2;
 }