Re: KBUILD_MODNAME issue

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

 



On 02/21/13 04:15, Ajith Adapa wrote:
> 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


The official, expected way to build any (external) kernel module is to use a Makefile
for the module and run 'make', e.g.:

$ make -C /path/to/kernel/source M=/path/to/module/source [O=/path/to/kernel/build] modules

That should work.  If not, let us know.


-- 
~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