• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Cross-compiling applications for the SheevaPlug?  (Read 2816 times)
littlebigman
Newbie
*

Karma: 0
Posts: 40


View Profile
« on: April 05, 2013, 07:00:52 AM »

Hello

I checked the Documentation section on the Plug Computer site, but didn't find how to set up a cross-compiler on a PC running Linux, and compile an application for the SheevaPlug (armv5tel processor: Feroceon 88FR131 rev 1 (v5l)).

After upgrading the SheevaPlug from its stock Ubuntu 9.04 to Debian 6, I noticed that the latest release of Nginx is 0.7.67, while support for the uwsgi protocol requires release 0.8.40 or newer.

Is there a good tutorial on how to cross-compile on Linux for the SheevaPlug?

Thank you.
Logged

littlebigman
Newbie
*

Karma: 0
Posts: 40


View Profile
« Reply #1 on: April 08, 2013, 05:27:38 AM »

I downloaded and unzipped the "Host SW Support Package For Linux" file from the Downloads section, but don't know what to do next:

Code:
drwxr-xr-x 11 fred fred     4096 Feb 26  2008 gcc/
drwxr-xr-x 10 root root     4096 Feb 25  2009 rootfsv1.0/

The gcc/ directory contains no information on how to set things up to cross-compile applications.
Logged

littlebigman
Newbie
*

Karma: 0
Posts: 40


View Profile
« Reply #2 on: April 08, 2013, 06:38:09 AM »

I successfully compiled and ran "Hello, world!" thusly:

1. Unzip Marvell's Plug_Host_SWsupportPackageLinuxHost.zip
2. cd LinuxHost/gcc/bin
3. Create "Hello, World!" file, and save as hello.c
4. gcc -o hello hello.c
5. Copy binary to embedded host
6. chmod +x hello
7. Run hello

But to compile real applications, I assume I must configure the host so it knows where to find the include files and the libraries, provided the application doesn't need some files not provided by the Marvell file.
Logged

littlebigman
Newbie
*

Karma: 0
Posts: 40


View Profile
« Reply #3 on: April 08, 2013, 06:41:39 AM »

Also, I notice a discrepancy between the Linux version (3.5.0-17, 2.6.14, 2.6.32-5-kirkwood): Does it mean that the Marvell toolchain was compiled with Linux 2.6.14?

Code:
ubuntu.host# uname -a
Linux Aspire-3810T 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux

sheeva# file hello
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped

sheeva# uname -a
Linux debian 2.6.32-5-kirkwood #1 Mon Feb 25 13:55:40 UTC 2013 armv5tel GNU/Linux
Logged

littlebigman
Newbie
*

Karma: 0
Posts: 40


View Profile
« Reply #4 on: April 11, 2013, 05:01:24 AM »

For the benefit of other newbies struggling to cross-compile applications on a Linux PC for the SheevaPlug, I made two mistakes in the post above:

1. The Plug_Host_SWsupportPackageLinuxHost.zip contains two compiled file: gcc.tar.bz2 is indeed a Bz2 file, but "Linux Host Filesystem - rootfs.tar.bz2" is actually a gzip file. I ran this:
Code:
mv "Linux Host Filesystem - rootfs.tar.bz2" rootfs.tar.gz ; tar xzvf rootfs.tar.gz

2. To compile a basic app like "Hello, world", cd to LinuxHost/gcc/bin, and run "arm-none-linux-gnueabi-gcc -o hello hello.c", which will create a binary that uses shared libraries.

At this point, I'm surprised it works although I didn't specify neither the path to the C library nor its name. Maybe Marvell's toolchain is hard-linked to figure this out by itself by reading files from LinuxHost/rootfsv1.0.
Logged

Pages: [1]
Print
Jump to: