[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87efgk0xx7.fsf@notabene.neil.brown.name>
Date: Wed, 04 Jul 2018 08:14:28 +1000
From: NeilBrown <neilb@...e.com>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Michal Marek <michal.lkml@...kovi.net>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH 4/5] kbuild: disable KBUILD_MODNAME when building for mod.a
On Wed, Jun 27 2018, Masahiro Yamada wrote:
> 2018-06-18 13:55 GMT+09:00 NeilBrown <neilb@...e.com>:
>> When building an object to be included in mod.a we
>> cannot know the name of the module. So don't define
>> KBUILD_MODNAME. This will ensure attempt to use
>> that macro when the module name isn't know will
>> trigger an error.
>
> Honestly, I hate KBUILD_MODNAME.
>
> If KBUILD_MODNAME is undefined,
> you cannot call pr_debug() in the sub-directory for example.
I think this is only true if you have something like
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
in your .c files. Developers who use modobj-m could be advised not to
do this.
>
> CONFIG_DYNAMIC_DEBUG requires KBUILD_MODNAME,
> but people often miss to notice that, then cause build errors.
Yes, I can see that.
We could change it to use a default ("no-name") if KBUILD_MODNAME isn't
defined. Or we could require that KBUILD_MODNAME always be defined.
Where I've been using these patches I've sometimes been adding
ccflags-y += -DKBUILD_MODNAME='"FOO"'
to Makefiles so that modules_params get handled correctly on non-module
builds. I've thought about instead allowing "modobj-name" to be defined
and requiring that it be set if either modobj-[yn] is set. Then it gets
used for the KBUILD_MODNAME when building modobj modules.
Would you prefer to always require KBUILD_MODNAME, or to use a default
name for dynamic-debug?
Thanks,
NeilBrown
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists