[Openswan Users] Cross compiling openswan for ARM

Paul Wouters paul at xelerance.com
Wed Sep 14 11:19:05 EDT 2011


On Wed, 14 Sep 2011, satpal parmar wrote:

> I am trying to cross compile openswan for ARM Board. For that I am
>  following below steps:

> 1. Cross compiled GMP. 

>    c. Created a softlink to libgmp in the toolchain path

You also need to be able to find the gmp headers. Usually a "make install"
after cross compile installs those somewhere in your toolchain

>     a. Modified CROSSCOMPILE.sh as per my toolchain setttings
> 
>       export PREFIX=/usr/local/CodeSourcery/Sourcery_G++_Lite
>       export DESTDIR=/tmp/openswan.arm
>       export ARCH=arm
>       export CC=$PREFIX/bin/arm-none-linux-gnueabi-gcc
>       export GCC=$PREFIX/bin/arm-none-linux-gnueabi-gcc
>       export LD=$PREFIX/bin/arm-none-linux-gnueabi-ld
>       export RANLIB=$PREFIX/bin/arm-none-linux-gnueabi-ranlib
>       export AR=$PREFIX/bin/arm-none-linux-gnueabi-ar
>       export AS=$PREFIX/bin/arm-none-linux-gnueabi-as
>       export STRIP=$PREFIX/biin/arm-none-linux-gnueabi-strip
>       export
> LD_LIBRARY_PATH=$PREFIX/lib/gcc/arm-none-linux-gnueabi/4.3.3/

You left out the line from CROSSCOMPILE that adds the include file search
path, eg:

export USERCOMPILE="-Wl,-elf2flt -DCOMPILER_HAS_NO_PRINTF_LIKE -O3 -g ${PORTDEFI
NE} -I$PREFIX/arm-elf/inc -L$PREFIX/lib/gcc-lib -DGCC_LINT -DLEAK_DETECTIVE -Dli
nux -D__linux__"

In this case the gmp.h and other headers was installed in $PREFIX/arm-elf/inc

> 
>                  from openswan/openswan-2.6.33/lib/libopenswan/id.c:39:
> openswan/openswan-2.6.33/include/secrets.h:20:41: error: gmp.h: No such
> file or directory

It needs the gmp.h from the crosscompile, not the system one.

> Now from openswan site I got that libgmp is required for openswan
> compilation. Since I have already crosscomplied and softlinked I am not
> able to understand what is missing.

What's missing is the header files for that ARM architecture, which are
normally installed running "make install" on the cross compiled libgmp.

Paul


More information about the Users mailing list