Thread (8 messages) flat view 8 messages, 4 authors, 2021-09-01

Re: [PATCH] kconfig: forbid symbols that end with '_MODULE'

From: Masahiro Yamada <masahiroy@kernel.org>
Date: 2021-08-26 02:25:27
Also in: alsa-devel, linux-kbuild, linux-wireless, lkml

On Thu, Aug 26, 2021 at 12:42 AM Boris Kolpackov
[off-list ref] wrote:
Masahiro Yamada [off-list ref] writes:
quoted
Kconfig (syncconfig) generates include/generated/autoconf.h to make
CONFIG options available to the pre-processor.

The macros are suffixed with '_MODULE' for symbols with the value 'm'.

Here is a conflict; CONFIG_FOO=m results in '#define CONFIG_FOO_MODULE 1',
but CONFIG_FOO_MODULE=y also results in the same define.

fixdep always assumes CONFIG_FOO_MODULE comes from CONFIG_FOO=m, so the
dependency is not properly tracked for symbols that end with '_MODULE'.
It seem to me the problem is in autoconf.h/fixdep, not in the Kconfig
language.

Partly a Kconfig problem since autoconf.h is generated by Kconfig.

So, what is your suggestion for doing this correctly?
(of course without breaking the compatibility
because this is how the kernel is configured/built
for more than 20 years)



quoted
This commit makes Kconfig error out if it finds a symbol suffixed with
'_MODULE'.
I know you don't care, but I will voice my objection, for the record:
Kconfig is used by projects other than the Linux kernel and some of
them do not use the autoconf.h functionality. For such projects this
restriction seems arbitrary and potentially backwards-incompatible.
I am not sure what your worry is, but this check resides in
"if (modules_sym)" conditional, so projects using Kconfig but
not module functionality (e.g. buildroot) will not be  affected.



-- 
Best Regards
Masahiro Yamada
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help