• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Native kernel compile?  (Read 8756 times)
ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« on: July 23, 2009, 06:02:20 AM »

I am trying to compile the feroceon kernel on the plug.
I have the ubuntu 9.05 file system on a usb stick and 2.6.22.18 kernel in nand.

I apt-get build-essentials and was able compile "hello world" with gcc.

I downloaded SheevaPlug_LSP1.2.zip and following the instructions in "SheevaPlug Development Kit - Configuring and Building
the Linux kernel with LSP for KW(A0) based device"

All goes well until make uImage when I get an error that says "arm-none-linux-gnueabi-gcc" not found.

Looking in /src/bin/ I see symlinks for "arm-linux-gnueabi-gcc" but not "arm-none-linux-gnueabi-gcc"

What is the difference?
Is there an easy fix?
Thanks in advance.
Ian
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #1 on: July 23, 2009, 06:16:47 AM »

specify CROSS_COMPILE when invoking make.

make CROSS_COMPILE=/somepath/arm-linux-gnueabi-  ...other options
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #2 on: July 23, 2009, 06:21:55 AM »

Thanks for the super fast response. I'll give it a try.
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #3 on: July 23, 2009, 06:30:25 PM »

Ok that got me further. I then got the error "/bin/sh: /usr/bin/arm-linux-gnueabi-ld: not found" and sure enough there is no symlink for "/arm-linux-gnueabi-ld". I fixed that by creating a symlink to /usr/bin/ld and then fixed the next error with another symlink to  /usr/bin/ar. It appears to be compiling now.

Update: the compile ran for about 30 minutes and then quit with :
Code:
  CHK     include/linux/compile.h
dnsdomainname: Unknown host
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
kernel/built-in.o: In function `getnstimeofday':
utsname_sysctl.c:(.text.getnstimeofday+0xe0): undefined reference to `__aeabi_uldivmod'
kernel/built-in.o: In function `do_gettimeofday':
utsname_sysctl.c:(.text.do_gettimeofday+0x9c): undefined reference to `__aeabi_uldivmod'
utsname_sysctl.c:(.text.do_gettimeofday+0xb8): undefined reference to `__aeabi_uldivmod'
kernel/built-in.o: In function `update_wall_time':
utsname_sysctl.c:(.text.update_wall_time+0x55c): undefined reference to `__aeabi_uldivmod'
utsname_sysctl.c:(.text.update_wall_time+0x57c): undefined reference to `__aeabi_uldivmod'
make: *** [.tmp_vmlinux1] Error 1
root@debian:/usr/local/src/linux-feroceon_4_2_7_KW#

Any ideas?

Thanks, Ian
« Last Edit: July 23, 2009, 07:09:08 PM by ianjb » Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #4 on: July 23, 2009, 09:55:20 PM »

Archive:  SheevaPlug_Host_SWsupportPackageLinuxHost.zip
  Length     Date   Time    Name
 --------    ----   ----    ----
 77294144  02-23-09 16:42   LinuxHost/gcc.tar.bz2
 57869442  02-24-09 14:44   LinuxHost/Linux Host Filesystem - rootfs.tar.bz2

Extract gcc.tar.bz2 and use that.
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #5 on: July 24, 2009, 04:33:00 AM »

I'm trying to compile on the plug, isn't LinuxHost/gcc.tar.bz2 the i386 code?
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #6 on: July 24, 2009, 06:07:49 AM »

Yeah, I thought you were cross-compiling based on your initial error.
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #7 on: July 27, 2009, 02:11:03 PM »

I did a bit of googling and found that the error "undefined reference to `__aeabi_uldivmod'" is caused by a bug in gcc 4.3.? The compiler installed in the plug using apt-get install build-essential is 4.3.2 and apparently has that bug. The cross compiler from sheeva uses gcc 4.2 which does not have the bug and is able to compile without problems.

My question now is: has anyone successfully done a native kernel compile on the plug with the gcc version installed in the plug using apt-get install build-essential?

Thanks,

Ian
Logged

cbxbiker61
Global Moderator
Sr. Member
*****

Karma: 38
Posts: 497


View Profile
« Reply #8 on: July 27, 2009, 08:16:31 PM »

The kernel compiles cleanly on my Sheeva.  Mkimage has to be installed to get a uImage.  One significant difference is that I compiled and installed gcc 4.3.3 first.  Not sure it would be worthwhile for you to do that though.

If your quest to do a native build fails you can alway just install the kernel from:
http://plugcomputer.org/plugforum/index.php?topic=524.0
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #9 on: July 28, 2009, 06:35:42 AM »

Thanks cbxbiker, I'm compiling gcc 4.3.3 now. I'll update when complete.
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #10 on: July 30, 2009, 07:24:45 PM »

The kernel compiles cleanly on my Sheeva. 
Which kernel? Does linux-feroceon_4_2_7_KW (2.6.22.18) build cleanly?
I built gcc 4.3.3 from source and got the same error:
kernel/built-in.o: In function `getnstimeofday':
utsname_sysctl.c:(.text.getnstimeofday+0xe0): undefined reference to `__aeabi_uldivmod'

Thanks,
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #11 on: August 03, 2009, 06:25:50 AM »

OK. I compiled gcc-4.3.3 successfully and got the same "undefined reference to `__aeabi_uldivmod'" error when I compiled linux-feroceon_4_2_7_KW.

Next I downloaded and compiled gcc-4.3.2 and again got "undefined reference to `__aeabi_uldivmod'".

Next I downloaded and tried to compile gcc-4.2.4 (that supposedly doesn't have the bug) but the compile was not successful and gave up on that.

Next I recompiled gcc-4.3.3, downloaded 2.6.30.4 from kernel.org and compiled that and successfully created a uImage!

I copied that uImage to my tftp server and was able to successfully boot it (after changing the appropriate env. vars.) with the  ubuntu 9.0.5 root file system. It gave module errors as I hadn't copied those over but I'm guessing that would be easy to fix.

So I have successfully built and booted 2.6.30.4 from kernel.org on the plug
Logged

ianjb
Jr. Member
**

Karma: 0
Posts: 65


View Profile
« Reply #12 on: August 23, 2009, 10:27:19 AM »

Just a quick update.

I was finally able to compile a working 2.6.22.18 kernel using gcc 4.2.3. It was compiled on a Pogoplug using the optware ipkg toolchain.
Logged

jwillis84
Newbie
*

Karma: 1
Posts: 3


View Profile
« Reply #13 on: February 02, 2010, 11:21:14 PM »


this will probably get dated fairly quickly

a method to build and install kernel modules on the SheevaPlug as it comes from the factory

-JoWi

===========

mkdir -p /var/cache/apt/archives/partial

apt-get update

apt-get install build-essential libncurses5-dev

get SheevaPlug_LSP.zip from the CD ROM

unzip

winscp the linux-2.6.22.18.tar.bz2 to the /root directory

bunzip2 linux-2.6.22.18.tar.bz2

tar -xvf linux-2.6.22.18.tar

rm linux-2.6.22.18.tar

mv linux-2.6.22.18 linux-feroceon_4_2_7_KW

apt-get install ntpdate

vi /etc/resolv.conf
208.67.222.222

ntpdate -s ntp3.tamu.edu

apt-get install make

apt-get remove gcc-4.3

apt-get purge gcc-4.3

apt-get install gcc-4.2

cd /usr/bin

rm cc gcc c++ g++
ln -s gcc-4.2 cc
ln -s gcc-4.2 gcc
ln -s c++-4.2 c++
ln -s g++-4.2 g++

cd /root/linux-feroceon_4_2_7_KW

vi Makefile

comment out #CROSS_COMPILE=arm-none-linux-gnueabi-

make mrproper

make mv88f6281_defconfig

make modules <- takes a long time to compile on the Plug but its "native"

make modules_install <- this moves modules to -> /lib/modules/2.6.22.18

to add a usb2serial device like Prolific 2303 to the Plug we need to build a set of kernel modules
and configure the kernel config to compile them, make menuconfig does not work, so we punt
and run the line by line config program

make config

*
* USB port drivers
*
*
* USB Serial Converter support
*
USB Serial Converter support (USB_SERIAL) [N/m/y/?] m
...
  USB Prolific 2303 Single Port Serial Driver (USB_SERIAL_PL2303) [N/m/?] (NEW) m
...

make modules

make modules_install

...
  INSTALL drivers/usb/serial/pl2303.ko
  INSTALL drivers/usb/serial/usbserial.ko
...


insert a usb2serial device

tail /var/log/messages

Feb  3 05:45:21 debian kernel: usb 1-1: new full speed USB device using ehci_marvell and address 5
Feb  3 05:45:21 debian kernel: usb 1-1: configuration #1 chosen from 1 choice
Feb  3 05:45:21 debian kernel: pl2303 1-1:1.0: pl2303 converter detected
Feb  3 05:45:21 debian kernel: usb 1-1: pl2303 converter now attached to ttyUSB0


apt-get install minicom

vi /etc/minicom/minirc.dfl

pu port             /dev/ttyUSB0
pu baudrate         9600
pu minit
pu mreset
pu mdialpre
pu mdialsuf
pu mdialpre2
pu mdialsuf2
pu mdialpre3
pu mdialsuf3
pu mconnect
pu mnocon1
pu mnocon2
pu mnocon3
pu mnocon4
pu mhangup
pu mdialcan
pu hasdcd           No
pu rtscts           No

attach a serial device to the usb2serial adapter to talk to

i used a cisco 1700 router

minicom

type return a couple of times to get a prompt from the router

CTRL+A X to quit minicom

...

- JoWi
« Last Edit: April 17, 2010, 08:50:48 PM by jwillis84 » Logged

jwillis84
Newbie
*

Karma: 1
Posts: 3


View Profile
« Reply #14 on: April 17, 2010, 08:43:12 PM »

Gene noticed when minicom is connected through a ProLific 2303 usb2serial cable with a null modem adapter to another device, minicom appears "disconnected", or "not connected".

That's because the minicom program was designed to work with modems and monitors rs-232 lines that indicate connection state.

In our case we were connected to an old switch and the switch or the null modem adapter did not support those signals.

No big deal, just hit the keyboard a couple times and the device on the other side responds.. even though minicom continues to report there is no connection on its status bar at the bottom of the screen.

- JoWi
« Last Edit: April 17, 2010, 09:12:35 PM by jwillis84 » Logged

Pages: [1]
Print
Jump to: