Project

General

Profile

Cross compiling for ARM9 doesn't work

Added by samweber about 15 years ago

1. I have carefully set the CC, STRIP, and RANLIB environment variables to the ARM binaries.

2. make clean

3. ./configure --target=arm-linux --disable-static --enable-shared --without-zlib --without-bzip2

4. make

Resulting binary runs on the X86 host, is worthless on the ARM9 target. PLEASE HELP ME.


Replies (3)

RE: Cross compiling for ARM9 doesn't work - Added by penma about 15 years ago

./configure --help says

--host=HOST       cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]

use --host. lighttpd isn't a compiler.

RE: Cross compiling for ARM9 doesn't work - Added by samweber about 15 years ago

lighttpd isn't a compiler.

Thanks for that.

I had tried --host=HOST in one of my previous attempts and came up with the same results so I decided to apply the canonical use of the term target to see if that made a difference.

After a lot more smashing my head against this, I finally got an ARM9 binary out of the build process. Here's where I went wrong:

Bad way:

  1. CC=armv5l-linux-gcc
  2. STRIP=armv5l-linux-strip
  3. RANLIB=armv5l-linux-ranlib
  4. ./configure --host=arm-linux --disable-static --enable-shared --without-zlib --without-bzip2

You get an x86 executable from this procedure every time.

Good way:

  1. CC=armv5l-linux-gcc RANLIB=armv5l-linux-ranlib STRIP=armv5l-linux-strip ./configure --host=arm-linux --disable-static --enable-shared --without-zlib --without-bzip2

You get an ARM binary. We'll see tomorrow whether or not progress can now be made (on the target, er host, I guess).

The TutorialInstallation link is no longer broken but the page contains a single unhelpful line.

RE: RE: Cross compiling for ARM9 doesn't work - Added by lightning over 14 years ago

The reason "bad way" does not work is that you need to export those env vars otherwise they are not seen by the implicit shell that runs configure command line. eg.

export CC=armv5l-linux-gcc

You should also use a tuple like arm-unknown-linux not just arm-linux.

    (1-3/3)