[Buildroot] building kernel modules

Roman Chertov rchertov at cs.ucsb.edu
Tue Nov 10 17:18:33 UTC 2009


> 
> Hmm. If you only get this error for your own module (and not the kernel
> itself), you should have a look at the assembly output and see what gcc
> does there and why. It shouldn't be using the __aeabi_uldivmod function
> which is part of libgcc which the kernel does not seem to link on your
> platform. According to the postings below, these errors are likely to be
> caused by false gcc optimisations.
> 
> You should get around that by altering your sources, but again, without
> the code, this is all speculating.

Turns out it was a division of a long that was causing that.  After I
changed the long to a uint32_t then the problem went away.  Now, I have
to figure out why I cannot insert the module.

musec_can: unknown relocation: 40
insmod: can't insert
'/proj/tools/can_driver/musec_can/src/musec_can.ko': invalid module format

Modules built during the kernel built work fine.  I guess I have to
figure out what linker setting I am missing.

> 
> Those links could also help:
> 
>   http://www.spinics.net/lists/arm-kernel/msg48776.html
>   http://lists.arm.linux.org.uk/lurker/message/20080227.081641.1580db5d.en.html
> 
> In case you consider bringing your driver mainline, you can also post it
> to LKML and get some feedback there.

That would be down the road once I actually test the driver and iron out
any problems that might occur.

> 
> After all, what you're seeing is an effect that has to do with your
> code, the kernel and gcc. And not with buildroot :)

True.  I was just hoping that somebody would give me a starting point as
  I new to cross compiling :)  Thanks for the help.

Roman

> 
> Daniel
> 



More information about the buildroot mailing list