All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: buildroot@busybox.net
Subject: [Buildroot] building kernel modules
Date: Mon, 9 Nov 2009 23:59:51 +0100	[thread overview]
Message-ID: <20091109225951.GI14091@buzzloop.caiaq.de> (raw)
In-Reply-To: <4AF899C8.5010702@cs.ucsb.edu>

On Mon, Nov 09, 2009 at 02:38:00PM -0800, Roman Chertov wrote:
> > But don't need all the rest. All you need to provide is ARCH=arm and
> > CROSS_COMPILE=..., the rest is done automatically. The kernel's build
> > system is very self-contained and the sources come with all kind of
> > headers and libraries. No need to point it to any external resources.
> > 
> > Following that should make the 2nd error go away.
> 
> I have changed my makefile to this
> 
> obj-m  := musec_can.o
> musec_can-y := main.o hms30c7202_can.o c_can.o \
>         irq.o open.o close.o read.o write.o ioctl.o
> 
> The makefile is then invoked via a shell script:
> 
> make ARCH=arm \
> CROSS_COMPILE=/<br_dir>/build_arm/staging_dir/usr/bin/arm-linux-uclibcgnueabi-\
> -C /proj/tools/buildroot-2009.08/project_build_arm/uclibc/linux-2.6.29 \
> M=`pwd` modules
> 
> 
> I have also configured buildroot to use gcc 4.4.1.  I also rebuilt
> uclibc and the kernel with new compiler.  When I make the module, I get
> the following during the linking phase.
> 
> make: Entering directory
> `/proj/tools/buildroot-2009.08/project_build_arm/uclibc/linux-2.6.29'
>   Building modules, stage 2.
>   MODPOST 1 modules
> WARNING: "__aeabi_uldivmod"

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.

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.

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

Daniel

  reply	other threads:[~2009-11-09 22:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05 21:59 [Buildroot] building kernel modules Roman Chertov
2009-11-09  5:28 ` Roman Chertov
2009-11-09  6:58   ` Daniel Mack
2009-11-09 22:38     ` Roman Chertov
2009-11-09 22:59       ` Daniel Mack [this message]
2009-11-10 17:18         ` Roman Chertov
2009-11-11  0:58           ` Daniel Mack
2009-11-11 19:52             ` Roman Chertov
  -- strict thread matches above, loose matches on Subject: below --
2008-06-24 17:00 Brian Beattie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091109225951.GI14091@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.