xref: /OK3568_Linux_fs/kernel/Documentation/kbuild/Kconfig.select-break (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# Select broken dependency issue
2*4882a593Smuzhiyun# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3*4882a593Smuzhiyun#
4*4882a593Smuzhiyun# Test with:
5*4882a593Smuzhiyun#
6*4882a593Smuzhiyun# make KBUILD_KCONFIG=Documentation/kbuild/Kconfig.select-break menuconfig
7*4882a593Smuzhiyun#
8*4882a593Smuzhiyun# kconfig will not complain and enable this layout for configuration. This is
9*4882a593Smuzhiyun# currently a feature of kconfig, given select was designed to be heavy handed.
10*4882a593Smuzhiyun# Kconfig currently does not check the list of symbols listed on a symbol's
11*4882a593Smuzhiyun# "select" list, this is done on purpose to help load a set of known required
12*4882a593Smuzhiyun# symbols. Because of this use of select should be used with caution. An
13*4882a593Smuzhiyun# example of this issue is below.
14*4882a593Smuzhiyun#
15*4882a593Smuzhiyun# The option B and C are clearly contradicting with respect to A.
16*4882a593Smuzhiyun# However, when A is set, C can be set as well because Kconfig does not
17*4882a593Smuzhiyun# visit the dependencies of the select target (in this case B).  And since
18*4882a593Smuzhiyun# Kconfig does not visit the dependencies, it breaks the dependencies of B
19*4882a593Smuzhiyun# (!A).
20*4882a593Smuzhiyun
21*4882a593Smuzhiyunmainmenu "Simple example to demo kconfig select broken dependency issue"
22*4882a593Smuzhiyun
23*4882a593Smuzhiyunconfig A
24*4882a593Smuzhiyun	bool "CONFIG A"
25*4882a593Smuzhiyun
26*4882a593Smuzhiyunconfig B
27*4882a593Smuzhiyun	bool "CONFIG B"
28*4882a593Smuzhiyun	depends on !A
29*4882a593Smuzhiyun
30*4882a593Smuzhiyunconfig C
31*4882a593Smuzhiyun	bool "CONFIG C"
32*4882a593Smuzhiyun	depends on A
33*4882a593Smuzhiyun	select B
34