• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Problems trying to compile kernel  (Read 3113 times)
woutc
Newbie
*

Karma: 0
Posts: 11


View Profile
« on: November 09, 2009, 01:02:15 PM »

Hello,

I'm trying to compile a kernel but at the end it fails with this error:
Code:
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
/usr/local/bin/mkimage: Can't map arch/arm/boot/uImage: Invalid argument
make[1]: *** [arch/arm/boot/uImage] Error 1
make: *** [uImage] Error 2


I installed mkimage as described here: http://www.openplug.org/plugwiki/index.php/Compiling_Linux_Kernel_for_the_Plug_Computer

Note that i'm building the kernel ON my plug.

When i try to cross-compile it on my system (x86_64) using the suggestions from this page: http://computingplugs.com/index.php/Building_a_custom_kernel#Getting_U-Boot.27s_mkimage

I get this error:
Code:
$ make -j2 ARCH=arm CROSS_COMPILE=../arm-2008q3/bin/arm-none-eabi- uImage
make: ../arm-2008q3/bin/arm-none-eabi-gcc: Command not found
  CHK     include/linux/version.h
  SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
  CHK     include/linux/utsrelease.h
  CC      scripts/mod/empty.o
/bin/sh: ../arm-2008q3/bin/arm-none-eabi-gcc: No such file or directory
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2

but

Code:
$ ls -l ../arm-2008q3/bin/arm-none-eabi-gcc
-rwxr-xr-x 1 wout wout 189800 2008-11-13 19:13 ../arm-2008q3/bin/arm-none-eabi-gcc

Can somebody help me with one of this problems?
Thanks!
« Last Edit: November 09, 2009, 01:33:16 PM by woutc » Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #1 on: November 10, 2009, 02:08:48 AM »

CROSS_COMPILE should be a full path.  If it's not, make won't be able to find the appropriate files when it starts recursing into the build tree.
Logged

woutc
Newbie
*

Karma: 0
Posts: 11


View Profile
« Reply #2 on: November 10, 2009, 05:23:51 AM »

I still don't know what caused the first error, but i was able cross-compiling the kernel using the suggestion from cbxbiker61 AND doing it on a 32bits system.
It seems the binary files from the cross-compiler are only for 32 bits.

Logged

fragfutter
Sr. Member
****

Karma: 12
Posts: 280


View Profile
« Reply #3 on: November 10, 2009, 09:07:34 AM »

the cross compiler is for 32bit systems. But almost any linux desktop distribution also installs an 32bit compatibility layer, so you can execute 32bit binaries on a 64bit system.
Logged

gunnarhx
Newbie
*

Karma: 0
Posts: 13


View Profile
« Reply #4 on: November 11, 2009, 09:16:17 AM »

Regarding 32-bit; on desktop ubuntu 9.10 64-bit for instance, the 32 bit libraries are installed by default, so there should be no problems running CodeSourcery ARM cross compiler for instance.
If 32-bit compatibility libs are not available, you'll probably get a confusing "could not find file" message from linux loader.

Alternatively to specifying absolute path to compiler, you could add a line to .bashrc
export PATH=/compiler/path:$PATH

and then refer to it via CROSS_COMPILE=arm-whatever-

The make system is doing a lot of recursive calls, so a relative path won't work, as pointed out earlier in the thread.
Logged

amspilot01
Newbie
*

Karma: 0
Posts: 4


View Profile
« Reply #5 on: November 13, 2009, 01:22:33 PM »

Hi just dumping some suggestions here :

it seems that the kernel can not be adapted for the uBoot format

before compiling did you do the following ?:

5. Copy “mkimage” binary located in the ‘SheevaPlug_U-Boot’ package in the CD (path -
      /u-boot/tools/mkimage) to HOST Linux machine in the “/usr/bin” directory.
  5a. change the settings of mkimage te be executable
       cd /usr/bin
       sudo chmod 755 mkimage
       sudo chown root:root mkimage

make shore when you care cross compiling that you use the ARCH=arm all the time!!
like
make ARCH=arm mrproper
make ARCH=arm menuconfig
make -j1 ARCH=arm  CROSS_COMPILE=/home/gcc/bin/arm-none-linux-gnueabi- uImage 

note:  the gcc compiler was installed in the /home folder as described in one of the sheeva documents 'sheevaPlug_host_SWsupportPackageLinuxHost1.2zip'

Also when compiling try a kernel configuration you know works, compile it run it, then start changing it to your one needs . ( you can look for 'default kernel options' in the file sheeva-2.6.xx.config on the Prebuilt Kernels at sheeva.with-linux.com )

i hope this helps..

Regards AMSpilot01




Logged

binaryni
Newbie
*

Karma: 0
Posts: 1


View Profile
« Reply #6 on: January 05, 2010, 10:10:52 PM »

I think the first error is due to mmap is not supported by jffs2
I had same problem and I compiled mkimage on my x64 machine and finished this last step on the x64 machine.
you just need to type:

mkimage  -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n 'Linux-2.6.32.2' -d zImage uImage

You need to put the zImage generated by the previous step in the same dir as mkimage
You will get the new uImage immediately.

Good luck!
Logged

ruivilela
Newbie
*

Karma: 0
Posts: 21


View Profile
« Reply #7 on: January 06, 2010, 03:05:44 AM »

I'm using a Gentoo system. And I can't see much advantage on cross-compiling. The plug is not so slow for compiling as it looks (1.5MB kernel in 35 min).
Logged

Pages: [1]
Print
Jump to: