[Click] Experiences with cross compiling kernel module for mipsel
Eddie Kohler
kohler at cs.ucla.edu
Tue Aug 28 14:00:32 EDT 2007
Jens,
Thanks for these experiences, which should be useful for others.
I've checked in changes that should address the atomic.h and integers.hh
issues. However, I didn't fix -mlong-calls; I'm surprised Click is not
automatically extracting that from the Linux header files. Any idea?
Eddie
Jens Mueller wrote:
> Hi,
>
> recently I tried cross compiling the click kernel module (latest CVS)
> for mipsel. I discovered some problems, but my solution is a bit
> awkward. I'm going to step you through my building and fixing process to
> get some feedback. I'm using kamikaze from OpenWRT for cross compiling.
> I downloaded the Linux kernel 2.6.19.2 and applied the click patch. To
> build the kernel I ran:
>
> $ PATH=/home/jkm/tmp/kamikaze/staging_dir_mipsel/bin:$PATH make
> ARCH=mips CROSS_COMPILE=mipsel-linux-
>
> Next I configured click:
>
> $ ARCH=mips PATH=/home/jkm/tmp/kamikaze/staging_dir_mipsel/bin:$PATH
> ./configure --host=mipsel-linux --enable-linuxmodule
> --with-linux=/home/jkm/linux-2.6.19.2/ --enable-tools=host
> --disable-userlevel
>
> I found out that adding ARCH=mips is important, otherwise configure
> will fail, because the wrong kernel header files are used.
>
> $ ARCH=mips PATH=/home/jkm/tmp/kamikaze/staging_dir_mipsel/bin:$PATH
> make linuxmodule
>
> failed. I suppose this is due to wrongly used g++, gcc and ld. So the
> configure process has still some problems. That's why I changed into
> directory linuxmodule/ and ran
>
> $ ARCH=mips PATH=/home/jkm/tmp/kamikaze/staging_dir_mipsel/bin:$PATH
> make CXX=mipsel-linux-g++ CC=mipsel-linux-gcc LD=mipsel-linux-ld
>
> Some functions (atomic_set_mask, atomic_clear_mask) weren't defined in
> asm-mips/atomic.h. I copied them from asm-sh/atomic.h. See attached
> patch. But I suppose the kernel should look at asm-sh/atomic.h itself?
>
> During linking the click module there is an undefined symbol named ffs.
> That's why I changed some macros in integers.hh and integers.cc. See the
> attached patch. But I don't know whether this is the right way to go. I
> doubt it.
> The module can't be loaded. You get 'module click: relocation overflow'.
> I added '-mlong-calls' in linuxmodule/Makefile.in to fix this. See
> also the attached patch.
>
> I appreciate any feedback. I hope my changes show some problems and
> somebody has a way to fix them more accurately.
>
> Kind regards,
> Jens
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list