brintos

brintos / linux-shallow public Read only

0
0
Text · 2.2 KiB · ac49836 Raw
58 lines · plain
1# Simple Kconfig recursive issue2# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~3#4# Test with:5#6# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.recursion-issue-01 allnoconfig7#8# This Kconfig file has a simple recursive dependency issue. In order to9# understand why this recursive dependency issue occurs lets consider what10# Kconfig needs to address. We iterate over what Kconfig needs to address11# by stepping through the questions it needs to address sequentially.12#13#  * What values are possible for CORE?14#15# CORE_BELL_A_ADVANCED selects CORE, which means that it influences the values16# that are possible for CORE. So for example if CORE_BELL_A_ADVANCED is 'y',17# CORE must be 'y' too.18#19#  * What influences CORE_BELL_A_ADVANCED?20#21# As the name implies CORE_BELL_A_ADVANCED is an advanced feature of22# CORE_BELL_A so naturally it depends on CORE_BELL_A. So if CORE_BELL_A is 'y'23# we know CORE_BELL_A_ADVANCED can be 'y' too.24#25#   * What influences CORE_BELL_A?26#27# CORE_BELL_A depends on CORE, so CORE influences CORE_BELL_A.28#29# But that is a problem, because this means that in order to determine30# what values are possible for CORE we ended up needing to address questions31# regarding possible values of CORE itself again. Answering the original32# question of what are the possible values of CORE would make the kconfig33# tools run in a loop. When this happens Kconfig exits and complains about34# the "recursive dependency detected" error.35#36# Reading the Documentation/kbuild/Kconfig.recursion-issue-01 file it may be37# obvious that an easy solution to this problem should just be the removal38# of the "select CORE" from CORE_BELL_A_ADVANCED as that is implicit already39# since CORE_BELL_A depends on CORE. Recursive dependency issues are not always40# so trivial to resolve, we provide another example below of practical41# implications of this recursive issue where the solution is perhaps not so42# easy to understand. Note that matching semantics on the dependency on43# CORE also consist of a solution to this recursive problem.44 45mainmenu "Simple example to demo kconfig recursive dependency issue"46 47config CORE48	tristate49 50config CORE_BELL_A51	tristate52	depends on CORE53 54config CORE_BELL_A_ADVANCED55	tristate56	depends on CORE_BELL_A57	select CORE58