Trouble compiling kernel module

Hi,

I have recently started using OpenEmbedded for a project I'm doing on
a gumstix overo board. I'm trying to cross-compile a kernel module
using a bitbake recipe and keep running up against a wall. I'm
starting with a helloworld module and could not compile that.

So I tried to build the char-driver module in the OE recipes, that
also failed. I'm currently using the overo OE branch. I got the
following output from bitbake when building the char-driver:

NOTE: Psyco JIT Compiler (http://psyco.sf.net) not available. Install
it to increase performance.
NOTE: Handling BitBake files: / (7156/7156) [100 %]
NOTE: Parsing finished. 6877 cached, 0 parsed, 279 skipped, 2 masked.
NOTE: Cache is clean, not saving.
NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing runqueue
NOTE: Running task 408 of 574 (ID: 8, /home/mike/courses/enel675/
org.openembedded.dev/recipes/char-driver/char-driver.bb, do_compile)
ERROR: function do_compile failed
ERROR: log data follows (/home/mike/courses/enel675/build/tmp/work/
overo-angstrom-linux-gnueabi/char-driver-1.0-r45/temp/log.do_compile.
5306)

NOTE: make CROSS_COMPILE=arm-angstrom-linux-gnueabi- KERNELDIR=/home/

mike/courses/enel675/build/tmp/work/overo-angstrom-linux-gnueabi/linux-
omap3-2.6.30-r45/git CC=arm-angstrom-linux-gnueabi-gcc -march=armv7-a -
mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

make -C /home/mike/courses/enel675/build/tmp/work/overo-angstrom-

linux-gnueabi/linux-omap3-2.6.30-r45/git M=/home/mike/courses/enel675/
build/tmp/work/overo-angstrom-linux-gnueabi/char-driver-1.0-r45/char-
driver ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- modules

make[1]: Entering directory `/home/mike/courses/enel675/build/tmp/

work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.30-r45/git'

scripts/Makefile.build:49: *** CFLAGS was changed in "/home/mike/

courses/enel675/build/tmp/work/overo-angstrom-linux-gnueabi/char-
driver-1.0-r45/char-driver/Makefile". Fix it to use EXTRA_CFLAGS.
Stop.

make[1]: *** [_module_/home/mike/courses/enel675/build/tmp/work/

overo-angstrom-linux-gnueabi/char-driver-1.0-r45/char-driver] Error 2

make[1]: Leaving directory `/home/mike/courses/enel675/build/tmp/

work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.30-r45/git'

make: *** [kernel-module] Error 2
FATAL: oe_runmake failed

NOTE: Task failed: /home/mike/courses/enel675/build/tmp/work/overo-
angstrom-linux-gnueabi/char-driver-1.0-r45/temp/log.do_compile.5306
ERROR: TaskFailed event exception, aborting
ERROR: Build of /home/mike/courses/enel675/org.openembedded.dev/
recipes/char-driver/char-driver.bb do_compile failed

It seems that the bitbake recipe is calling the makefile with:
CC=arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -
mfpu=neon -mfloat-abi=softfp
which doesnt make sense to me. Shouldn't the compiler flags be passed
as a separate variable? Any help would be really appreciated.

Hope you dont mind that I'm not beagleboard :slight_smile: this seems to be the
best place around for OE discussion.

Hi,

I have recently started using OpenEmbedded for a project I'm doing on
a gumstix overo board. I'm trying to cross-compile a kernel module
using a bitbake recipe and keep running up against a wall. I'm
starting with a helloworld module and could not compile that.

So I tried to build the char-driver module in the OE recipes, that
also failed. I'm currently using the overo OE branch. I got the
following output from bitbake when building the char-driver:

NOTE: Psyco JIT Compiler (http://psyco.sf.net) not available. Install
it to increase performance.
NOTE: Handling BitBake files: / (7156/7156) [100 %]
NOTE: Parsing finished. 6877 cached, 0 parsed, 279 skipped, 2 masked.
NOTE: Cache is clean, not saving.
NOTE: Resolving any missing task queue dependencies
NOTE: Preparing runqueue
NOTE: Executing runqueue
NOTE: Running task 408 of 574 (ID: 8, /home/mike/courses/enel675/
org.openembedded.dev/recipes/char-driver/char-driver.bb, do_compile)
ERROR: function do_compile failed
ERROR: log data follows (/home/mike/courses/enel675/build/tmp/work/
overo-angstrom-linux-gnueabi/char-driver-1.0-r45/temp/log.do_compile.
5306)
> NOTE: make CROSS_COMPILE=arm-angstrom-linux-gnueabi- KERNELDIR=/home/
mike/courses/enel675/build/tmp/work/overo-angstrom-linux-gnueabi/linux-
omap3-2.6.30-r45/git CC=arm-angstrom-linux-gnueabi-gcc -march=armv7-a -
mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
> make -C /home/mike/courses/enel675/build/tmp/work/overo-angstrom-
linux-gnueabi/linux-omap3-2.6.30-r45/git M=/home/mike/courses/enel675/
build/tmp/work/overo-angstrom-linux-gnueabi/char-driver-1.0-r45/char-
driver ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- modules
> make[1]: Entering directory `/home/mike/courses/enel675/build/tmp/
work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.30-r45/git'
> scripts/Makefile.build:49: *** CFLAGS was changed in "/home/mike/
courses/enel675/build/tmp/work/overo-angstrom-linux-gnueabi/char-
driver-1.0-r45/char-driver/Makefile". Fix it to use EXTRA_CFLAGS.
Stop.
> make[1]: *** [_module_/home/mike/courses/enel675/build/tmp/work/
overo-angstrom-linux-gnueabi/char-driver-1.0-r45/char-driver] Error 2
> make[1]: Leaving directory `/home/mike/courses/enel675/build/tmp/
work/overo-angstrom-linux-gnueabi/linux-omap3-2.6.30-r45/git'
> make: *** [kernel-module] Error 2
> FATAL: oe_runmake failed
NOTE: Task failed: /home/mike/courses/enel675/build/tmp/work/overo-
angstrom-linux-gnueabi/char-driver-1.0-r45/temp/log.do_compile.5306
ERROR: TaskFailed event exception, aborting
ERROR: Build of /home/mike/courses/enel675/org.openembedded.dev/
recipes/char-driver/char-driver.bb do_compile failed

It seems that the bitbake recipe is calling the makefile with:
CC=arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a8 -
mfpu=neon -mfloat-abi=softfp
which doesnt make sense to me. Shouldn't the compiler flags be passed
as a separate variable? Any help would be really appreciated.

Hope you dont mind that I'm not beagleboard :slight_smile: this seems to be the
best place around for OE discussion.

You could try the gumstix list or the openembedded lists :slight_smile: I'd post
links, but it is late and I am to tired to hunt for them ....

Philip

did you try doing ‘inherit module’?

I fixed this problem,

I realized that I was passing CC=${CC} to the kernel buildsystem in my
makefile. This is bad because bitbake defines CC as the desired
crosscompiler PLUS a whole bunch of CC flags (CFLAGS).

This causes the build to fail because make thinks that you are passing
it flags. CFLAGS should be passed to make as environment variables.
This was fixed by removing the CC=... in the makefile and letting
bitbake set the CC environment variable itself.

--Mike