All of 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: Sun, 08 Nov 2009 21:28:38 -0800	[thread overview]
Message-ID: <4AF7A886.8000703@cs.ucsb.edu> (raw)
In-Reply-To: <4AF34ADF.7090303@cs.ucsb.edu>

So I figured out how to get the external kernel module compilation
going.  The cross compilation works fine, but the linking fails as there
are two undefined symbols.  Also, there is a strange error regarding
/usr/local/src/mv-kernel/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc

However, the compilation proceeds even with that error.

[rchertov at number2 src]$ sh make.sh
make:
/usr/local/src/mv-kernel/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc:
Command not found
make: Entering directory
`/proj/tools/buildroot-2009.08/project_build_arm/uclibc/linux-2.6.29'
  LD [M]  /proj/tools/can_driver/musec_can/src/musec_can.o
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: "__bad_udelay"
[/proj/tools/can_driver/musec_can/src/musec_can.ko] undefined!
WARNING: "__aeabi_uldivmod"
[/proj/tools/can_driver/musec_can/src/musec_can.ko] undefined!
  LD [M]  /proj/tools/can_driver/musec_can/src/musec_can.ko
make: Leaving directory
`/proj/tools/buildroot-2009.08/project_build_arm/uclibc/linux-2.6.29'


I believe that the linker uses libc instead of uclibc which was compiled
for ARM, and hence the linking step is failing.  I would appreciate it
if somebody could point out which linker setting I am missing.  Below, I
listed all of the variables that I redefined for the build.

ARCH=arm
CROSS_COMPILE=/<br_dir>/build_arm/staging_dir/usr/bin/arm-linux-uclibcgnueabi-
AS      =$(CROSS_COMPILE)as
LD      =$(CROSS_COMPILE)ld
CC      =$(CROSS_COMPILE)gcc
CPP     =$(CC) -E
AR      =$(CROSS_COMPILE)ar
NM      =$(CROSS_COMPILE)nm
STRIP   =$(CROSS_COMPILE)strip
OBJCOPY =$(CROSS_COMPILE)objcopy
OBJDUMP =$(CROSS_COMPILE)objdump


EXTRA_CFLAGS=-I /<br_dir>/project_build_arm/uclibc/linux-2.6.29/include\
-I<br_dir>/build_arm/staging_dir/usr/lib/gcc/arm-linux-uclibcgnueabi/4.3.3/include

LDFLAGS=-L/<br_dir>/build_arm/staging_dir/lib

...



Roman Chertov wrote:
> Hello,
> 
> I am using buildroot to build a distro for an ARM ep9xx system.
> Everything works great except for one kernel module. I am trying to
> debug it, but it is a pain to make the whole kernel tree to insert a
> single printk.  Also, it looks like I have to do "touch
> <...>/.configured" to get the kernel to detect the change the compile a
> new version of the module.
> 
> Is there any documentation regarding building kernel modules by
> themselves after having built the main kernel?  Something similar to how
> userlevel apps get cross compiled.  I suppose that somehow I need to
> access all of the flags that buildroot passes to the kernel when it
> builds it.
> 
> Ideally, I just want to just compile the module, and then insmod it over
> the NFS rootfs.
> 
> Many Thanks,
> 
> Roman
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

  reply	other threads:[~2009-11-09  5:28 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 [this message]
2009-11-09  6:58   ` Daniel Mack
2009-11-09 22:38     ` Roman Chertov
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=4AF7A886.8000703@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 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.