Cross-compiling Nginx for ARM?

Hello,

I’d like to run Nginx on the SheevaPlug
(SheevaPlug - Wikipedia), which is based on Marvell’s
Kirkwood 88F6281 (ARM9E/ARMv5TE).

I have a couple of newbie questions:

  1. The archives of the mailing list
    (Re: nginx-1.3.2) include a
    reference to those ports based on older versions:

http://packages.debian.org/search?arch=arm&keywords=nginx
Based on 1.2.1-2.2

http://nginx.org/packages/debian/pool/nginx/n/nginx/
Based on 1.2.8-1

Currently (www.nginx.org/en/CHANGES), the latest Nginx source is 1.3.15.
Why
are those ports based on older code? Because it’s not just a matter of
recompiling, but it also requires making changes to the source code so
Nginx
can run on ARM?

  1. I tried cross-compiling Nginx on a PC running Ubuntu with Marvell’s
    cross-compiler (www.plugcomputer.org/downloads/plug-basic/), but it
    fails
    right from the start:

====================
~/nginx-1.2.6# ./configure
–with-cc=/root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc

checking for OS

  • Linux 3.5.0-17-generic i686
    checking for C compiler … not found

./configure: error: C compiler
/root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc is not found

~/nginx-1.2.6# ll /root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc
-rwxr-xr-x 1 fred fred 180000 Feb 26 2008
/root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc*

How should I set things up so that I can try cross-compiling Nginx?

Thanks for any help.

Posted at Nginx Forum:

Hello!

On Fri, Apr 12, 2013 at 01:22:14PM -0400, Shohreh wrote:

reference to those ports based on older versions:
can run on ARM?
Latest stable is 1.2.8, and that’s what you see in the official
repository. Latest mainline is 1.3.15, it is available in a
separate repository, see here:

http://nginx.org/en/linux_packages.html#mainline

checking for C compiler … not found

./configure: error: C compiler
/root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc is not found

~/nginx-1.2.6# ll /root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc
-rwxr-xr-x 1 fred fred 180000 Feb 26 2008
/root/LinuxHost/gcc/arm-none-linux-gnueabi/bin/gcc*

How should I set things up so that I can try cross-compiling Nginx?

We don’t really support cross-compilation in our configure/build
system, but there were reports of success with relatively few
tweaks to configure. You may try to look into ./objs/autoconf.err
for more information on what fails during configure.


Maxim D.
http://nginx.org/en/donation.html

I’ve compiled for ARM A8. The biggest issue was configuring to use the
system OpenSSL and pcre libraries. other than that , no problems.

djczaski Wrote:

I’ve compiled for ARM A8. The biggest issue was configuring to use the
system OpenSSL and pcre libraries. other than that , no problems.

Thanks for the input. By any chance, did you write a tutorial that I
could
use to try and compile it for that other ARM processor?

Posted at Nginx Forum:

2013/4/16 Shohreh:

djczaski Wrote:

Thanks for the input. By any chance, did you write a tutorial that I could
use to try and compile it for that other ARM processor?

Here you go:
[1] Ossdl - Blog

You don’t need to patch Nginx anymore and can skip step 7.

I’ve run a Gentoo binhost for ARM architecture, compatible to the
Sheevaplug’s Kirkwood 88F6281 »Feroceon«. Some binaries might work on
Ubuntu, though I’ve switched to Gentoo:
[2] http://binhost.ossdl.de/ARM/armv5tel-softfloat-linux-gnueabi/ (see
www-servers there; »Packages« is a plaintext file which lists the
contents of the binhost)

More:
[3] Ossdl - Blog
[4]
Ossdl - Blog
[5]
Ossdl - Blog
[6]
Ossdl - Blog
Links to git.ossdl.de don’t work, but you can download my modified
kernel, get its ».config« and compile your own. Most patches
(excluding the one for SATA on the SheevaPlug) have already been
integrated into Linux.

[7]

If I were you I would go for a Mikrotik Routerboard (the RB951G-2HnD
is excellent except its lack of 5GHz wifi). That are MIPS machines,
though. :wink:


Mark