Cross-compiling applications?
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. |
Before you start cross compiling, do you have a cross compiler (or, more accurately, a cross toolchain)? There are probably vendor supplied cross toolchains for the SheevaPlug; I'll let you explore that. Armed with enough knowledge of your target architecture, you can build your own. I like crosstool-NG for that.
Once installed, most applications that use the common 'configure' procedure allow you the choose the cross target architecture as a configure option; typically Code:
# |
Thanks for the infos. The ARM architecture does seem to be complicated enough that a lot of people do need to build their own toolchain.
However, before I invest time in this, Marvell provides a binary toolchain: "Host SW Support Package For Linux". After unzipping the file, I get two BZ2 files which untar into two directories: gcc/ and rootfsv1.0/, respectively: Code:
~/LinuxHost# ll gcc 1. Running "gcc/bin/arm-none-linux-gnueabi-gcc -o hello hello.c" did compile a shared "Hello, world!" binary that I could run succesfuly on the SheevaPlug: How did the compiler know where to find the include + library? Code:
~/LinuxHost/gcc/bin# file hello 2. "file hello" says "for GNU/Linux 2.6.14: Is it because the toolchain was built with that older release of Linux? 3. Why did Marvell provide a rootfs? 4. What should I do to compile real applications? Is it just a matter of editing PATH to include "/home/fred/LinuxHost/gcc" and using the right options in "./configure"? Thank you. |
I think these questions have been answered in a startlingly similar recent thread on LQ.
|
Yes, the first question was answered in that other thread :-)
What about the others? 2. "file hello" says "for GNU/Linux 2.6.14: Is it because the toolchain was built with that older release of Linux? 3. Why did Marvell provide a rootfs? |
Generally, a toolchain gets built against a particular kernel version. That accounts for the result of the file command, I believe. In systems I've used, file also reports the CPU architecture of the specific executable.
The root filesystem is probably just a skeleton filesystem that is the sysroot for the toolchain, so it can find libraries, header files and ancillary toolchain components. Ideally, the sysroot files exactly match the respective target filesystem. --- rod. |
Thanks much.
|
All times are GMT -5. The time now is 08:11 PM. |