KBUILD_MODNAME issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am again hit with KBUILD issue which says as shown below

/home/tmp/linux-26/include/net/inet_connection_sock.h: In function
‘inet_csk_clear_xmit_timer’:
/home/tmp/linux-26/include/net/inet_connection_sock.h:203:3: error:
‘KBUILD_MODNAME’ undeclared (first use in this function)
/home/tmp/linux-26/include/net/inet_connection_sock.h:203:3: note:
each undeclared identifier is reported only once for each function it
appears in
/home/tmp/linux-26/include/net/inet_connection_sock.h: In function
‘inet_csk_reset_xmit_timer’:
/home/tmp/linux-26/include/net/inet_connection_sock.h:219:3: error:
‘KBUILD_MODNAME’ undeclared (first use in this function)

Ideally my understanding is When a module is build KBUILD_MODNAME is
automatically updated.

But I even tried options like -D"KBUILD_MODNAME=KBUILD_STR(l2_module)"

/usr/bin/gcc -M -g -O2 -DMODULE
-D"KBUILD_MODNAME=KBUILD_STR(l2_module)" -D__KERNEL__ -DLINUX
-fno-strict-aliasing -fno-common -ffreestanding -O2 -m32
-fomit-frame-pointer -g -pipe -msoft-float
-mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=i686
-mtune=pentium4 -mregparm=3 -I/lib/modules/3.7.6.1.i686/source
/include -I/lib/modules/3.7.6.1.i686/source/arch/x86/include
-I/lib/modules/3.7.6.1.i686/source/include
-I/lib/modules/3.7.6.1.i686/source/include2
-I/lib/modules/3.7.6.1.i686/source/include/asm/mach-default
-I/lib/modules/3.7.6.1.i686/source/include2/asm/mach-default
-I/lib/modules/3.7.6.1.i686/source/include/uapi
-I/lib/modules/3.7.6.1.i686/source/include/linux/kconfig.h
-I/lib/modules/3.7.6.1.i686/source/include/generated/uapi
-I/lib/modules/3.7.6.1.i686/source/arch/x86/include/generated/uapi
-m32 tmp/l2.c

/lib/modules/3.7.6.1.i686/source/include/net/inet_connection_sock.h:203:3:
error: ‘l2_module’ undeclared (first use in this function)

It says it is undeclared.

Anybody have any clue what I messed up this time ? Thanks for the last reply

Regards,
Ajith
--------------------------------------------
codingfreak.blogspot.com


On Thu, Feb 21, 2013 at 10:38 AM, Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
> On 02/20/13 20:31, Ajith Adapa wrote:
>> That really fixed it .. thanks randy
>>
>> But Last time when I tried in 2.6.32 kernel I am not including kconfig.h.
>>
>> Is there any major change by latest 3.7 kernel where we need to add
>> kconfig.h in code ? Just knowing
>
> Obviously Yes.  :)
>
> Any source file (or header file) that uses #IS_ENABLED() or any of its cousins
> as defined in <linux/kconfig.h> needs to #include <linux/kconfig.h>.
>
>
>
>> Regards,
>> Ajith
>> --------------------------------------------
>> codingfreak.in
>>
>>
>>
>>
>> On Thu, Feb 21, 2013 at 12:46 AM, Randy Dunlap <rdunlap@xxxxxxxxxxxxx> wrote:
>>> On 02/19/13 20:21, Ajith Adapa wrote:
>>>> Hi,
>>>>
>>>> I am not sure if this is the right place to ask the doubt or not but
>>>> since I got this issue building LKM i am dropping a maile down here
>>>> sorry for inconvenience caused.
>>>>
>>>> I am trying to build private LKM on latest 3.7 kernel using GCC 4.7.2.
>>>>
>>>> /usr/bin/gcc -M -g -O2 -DMODULE -D__KERNEL__ -DLINUX
>>>> -fno-strict-aliasing -fno-common -ffreestanding -O2 -m32
>>>> -fomit-frame-pointer -g -pipe -msoft-float
>>>> -mpreferred-stack-boundary=2 -fno-unit-at-a-time -march=i686
>>>> -mtune=pentium4 -mregparm=3 -I/lib/modules/3.7.6.1.i686/source/include
>>>> -I/lib/modules/3.7.6.1.i686/source/arch/x86/include
>>>> -I/lib/modules/3.7.6.1.i686/source/include
>>>> -I/lib/modules/3.7.6.1.i686/source/include2
>>>> -I/lib/modules/3.7.6.1.i686/source/include/asm/mach-default
>>>> -I/lib/modules/3.7.6.1.i686/source/include2/asm/mach-default
>>>> -I/lib/modules/3.7.6.1.i686/source/include/uapi
>>>> -I/lib/modules/3.7.6.1.i686/source/include/linux/kconfig.h
>>>> -I/lib/modules/3.7.6.1.i686/source/include/generated/uapi
>>>> -I/lib/modules/3.7.6.1.i686/source/arch/x86/include/generated/uapi
>>>> -m32 tmp/l2.c
>>>>
>>>> I get the following error as shown below
>>>>
>>>> In file included from /home/linux-26/include/net/net_namespace.h:13:0,
>>>>                  from /home/linux-26/include/linux/netdevice.h:43,
>>>>                  from tmp/l2.c:26:
>>>> /home/linux-26/include/net/netns/mib.h:15:15: error: missing binary
>>>> operator before token "("
>>>> In file included from /home/linux-26/include/net/net_namespace.h:17:0,
>>>>                  from /home/linux-26/include/linux/netdevice.h:43,
>>>>                  from tmp/l2.c:26:
>>>> /home/linux-26/include/net/netns/ipv6.h:75:15: error: missing binary
>>>> operator before token "("
>>>>
>>>> Any idea about the issue ?? Even I include uapi directory properly in
>>>> the command.
>>>
>>> Does your module source file
>>> #include <linux/kconfig.h>
>>> ?
>>> It probably needs to #include that file.
>
>
> --
> ~Randy
--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux