Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Chertov <rchertov@cs.ucsb.edu>
To: buildroot@busybox.net
Subject: [Buildroot] building kernel modules
Date: Mon, 09 Nov 2009 14:38:00 -0800	[thread overview]
Message-ID: <4AF899C8.5010702@cs.ucsb.edu> (raw)
In-Reply-To: <20091109065815.GZ14091@buzzloop.caiaq.de>

> This error is due to an illegal usage of udelay() in the module code.
> Calling this function at all is frowned upon, and calling it with too
> big values fail[*] the kernel compilation for very good reasons. You
> should rather use schedule_timeout() or timer functions to give CPU time
> to do something useful while waiting for so long. But, without knowing
> the sources, it's impossible to give any further hints.
> 

I have removed udelay calls in the code. (I am porting an old 2.4 driver
to 2.6.29) and the _bad_udelay error went away.

> 
> 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"
[/proj/tools/can_driver/musec_can/src/musec_can.ko] undefined!
make: Leaving directory
`/proj/tools/buildroot-2009.08/project_build_arm/uclibc/linux-2.6.29'

Naturally, this module is not loadable as there an undefined symbol in
the module.  insmod reports the following:

insmod: can't insert './musec_can.ko': unknown symbol in module, or
unknown parameter

I would appreciate some help in resolving this.

Thanks,

Roman

> 
> Daniel
> 

  reply	other threads:[~2009-11-09 22:38 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 [this message]
2009-11-09 22:59       ` Daniel Mack
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=4AF899C8.5010702@cs.ucsb.edu \
    --to=rchertov@cs.ucsb.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox