kernel module problem
after trying to compile a pretty stanard lkm I wrote I got this error ( among many others from included files )
Code:
In file included from /lib/modules/2.6.17.2/build/include/linux/rwsem.h:27, Has anyone seen this error or is there some config option i missed that would cause this? thanks |
/lib/modules/2.6.17.2/build/include/asm/rwsem.h
... have you tried looking in that header, lines 105, 157, etc, and seeing if there is a missing ":" or ")" that should be there? You'll find googling "rwsem.h:105: error: expected ':' or ')'" more productive... lots of folk with your kernel are experiencing difficulty with this header. |
Here is a fix
The root cause of this problem is somewhere around 2.6.15 the inline function LOCK_SECTION_NAME was defined as
#define LOCK_SECTION_NAME ".text.lock." __stringify(KBUILD_BASENAME) In latter release of the the 2.6.xx kernel it's define as #define LOCK_SECTION_NAME".text.lock."KBUILD_BASENAME without the __stringify macro. The fix is to use KBASE_STR macro at then Makefile level. add these lines to your Makefile or Makefile.am KMOD = <Module Name> # Name of module KBASE= <Module Base> # Name of Base CFLAGS+= -D"KBUILD_STR(s)=\#s" CFLAGS+= -D"KBUILD_BASENAME=KBUILD_STR(${KBASE})" CFLAGS+= -D"KBUILD_MODNAME=KBUILD_STR(${MOD})" Last thing make sure that you build str uses ${CFLAGS} IE: cc ${CFLAGS} <...> |
yes sorry for not replying to this post after getting it figured. Changing my makefile similar to how you mentioned it fixed it. thanks.
|
All times are GMT -5. The time now is 07:39 PM. |