* kconfig: report select on a depending option
@ 2010-03-18 9:21 Jan Engelhardt
2010-03-18 9:31 ` Américo Wang
2010-03-18 10:12 ` Michal Marek
0 siblings, 2 replies; 3+ messages in thread
From: Jan Engelhardt @ 2010-03-18 9:21 UTC (permalink / raw)
To: Michal Marek; +Cc: Linux Kernel Mailing List
Hi,
With the following combination of Kconfig config options, I can select
TEST_Z, which will select TEST_X, even if TEST_Y=n. It also allows for
awkward situations like TEST_Y=M, TEST_X=y, TEST_Z=y, which would yield
a link time error when X uses Y's symbols.
Is there a way to have such potential errors reported with kconfig?
config TEST_Y
tristate "Y"
config TEST_X
depends on Y
tristate "X"
config TEST_Z
select TEST_Y
tristate "Z"
thanks,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kconfig: report select on a depending option
2010-03-18 9:21 kconfig: report select on a depending option Jan Engelhardt
@ 2010-03-18 9:31 ` Américo Wang
2010-03-18 10:12 ` Michal Marek
1 sibling, 0 replies; 3+ messages in thread
From: Américo Wang @ 2010-03-18 9:31 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Michal Marek, Linux Kernel Mailing List
On Thu, Mar 18, 2010 at 5:21 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
> Hi,
>
>
> With the following combination of Kconfig config options, I can select
> TEST_Z, which will select TEST_X, even if TEST_Y=n. It also allows for
> awkward situations like TEST_Y=M, TEST_X=y, TEST_Z=y, which would yield
> a link time error when X uses Y's symbols.
> Is there a way to have such potential errors reported with kconfig?
>
> config TEST_Y
> tristate "Y"
>
> config TEST_X
> depends on Y
> tristate "X"
>
> config TEST_Z
> select TEST_Y
You mean "select TEST_X" here, right?
> tristate "Z"
>
I think you should use "depends on X" instead of "select X".
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: kconfig: report select on a depending option
2010-03-18 9:21 kconfig: report select on a depending option Jan Engelhardt
2010-03-18 9:31 ` Américo Wang
@ 2010-03-18 10:12 ` Michal Marek
1 sibling, 0 replies; 3+ messages in thread
From: Michal Marek @ 2010-03-18 10:12 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Linux Kernel Mailing List
On 18.3.2010 10:21, Jan Engelhardt wrote:
> Hi,
>
>
> With the following combination of Kconfig config options, I can select
> TEST_Z, which will select TEST_X, even if TEST_Y=n. It also allows for
> awkward situations like TEST_Y=M, TEST_X=y, TEST_Z=y, which would yield
> a link time error when X uses Y's symbols.
That's a known bug unfortunatelly
(Documentation/kbuild/kconfig-language.txt):
Note:
select should be used with care. select will force
a symbol to a value without visiting the dependencies.
By abusing select you are able to select a symbol FOO even
if FOO depends on BAR that is not set.
In general use select only for non-visible symbols
(no prompts anywhere) and for symbols with no dependencies.
That will limit the usefulness but on the other hand avoid
the illegal configurations all over.
kconfig should one day warn about such things.
> Is there a way to have such potential errors reported with kconfig?
No there isn't. There is a guy who wants to work on improving/rewriting
the kconfig depsolver during GSoC, let's see :). But a warning should be
easy to add now, I think.
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-18 10:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 9:21 kconfig: report select on a depending option Jan Engelhardt
2010-03-18 9:31 ` Américo Wang
2010-03-18 10:12 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox