Cross Compile OpenSSH for ARM

arian picture arian · Aug 7, 2012 · Viewed 48.3k times · Source

Does anybody know how I can cross compile OpenSSH for ARM? This is what I have done:

First I've downloaded Zlib source code, untarred it, built it and installed it using the following command lines:

   # ./configure --prefix=/usr/local/cross/arm

   # make 

   # make install

But then when I try to compile OpenSSH for the ARM target board, it gives the error "zlib missing" during the ./configure process:

  # sudo LDFLAGS=-L/usr/local/cross/arm/lib CC=arm-none-linux-gnueabi-gcc PATH=$PATH:/home/arishop/arm-tool-chain/arm-fsl-linux-gnueabi/bin/ ./configure --host=arm-linux --with-zlib=/usr/local/cross/arm/ --prefix=/usr/local/cross/arm/openssh

Answer

jaguzu picture jaguzu · Jan 26, 2013

To cross compile openSHH for ARM (in my case a mini2440) I did following:

Install arm cross compiler - (eg. what is arm-linux-gcc and how to install this in ubuntu)

Download:

  • Zlib
  • OpenSSL
  • OpenSSH

Build Zlib:

cd zlib-1.2.7
CC=arm-linux-gnueabi-gcc
./configure --prefix=$HOME/zlibArm
make 
make install

Build OpenSSL:

export cross=arm-linux-gnueabi-
cd openssl-1.0.1c
./Configure dist --prefix=$HOME/opensslArm
make CC="${cross}gcc" AR="${cross}ar r" RANLIB="${cross}ranlib"
make install

Build OpenSSH:

./configure --host=arm-linux --with-libs --with-zlib=$HOME/zlibArm --with-ssl-dir=$HOME/opensslArm --disable-etc-default-login CC=gcc-arm-linux-gnueabi-gcc AR=gcc-arm-linux-gnueabi-ar
make

More info at http://code.google.com/p/openssh4mini2440/wiki/HowTo, download source and read "build.sh"