Cross Compiling

From Libreswan
Jump to: navigation, search

libreswan has been cross compiled to many platforms. An example CROSSCOMPILE.sh file is shipped in the main directory of the source tree that demonstrates most of the important variables. See further the various comments in Makefile.inc.

Note that you first need to cross compile all the required libraries. Some features can be disabled in Makefile.inc to reduce the number of libraries needed. libgmp and nss are always needed.

ARM BLFT binary format

Some ARM cross compiles use the BLFT file format instead of the ELF format. Add -Wl,-elf2flt to LDFLAGS, CFLAGS or USERCOMPILE if your cross compile tool chain does not add it for you automatically.

If you toolchain does not support this option, use the script ld-elf2flt . It renams the linker *ld to *ld.real and ld-elf2flt is put in it's place.

Do not attempt to run elf2flt against the binaries after they have been linked already. See the ld-elf2flt script to see the complexity of the process involved.

Cross compiling on Windows

The windows cross compile windows-cross-compile.txt is very old and most likely no longer up to date or correct.