ARM crosscompile

Revision as of 13:17, 12 July 2017 by Xemul (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Install the toolchain

If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.

 sudo apt-get install lib32stdc++6 lib32z1 # These are ia32 binaries
 mkdir -p deps/`uname -m`-linux-gnu
 cd deps
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz
 cd ..

Build

ARMv7

 cd deps
 rsync -a --exclude=.git --exclude=deps .. criu-arm
 cd criu-arm
 make \
   ARCH=arm \
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \
   USERCFLAGS="-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib" \
   PATH="`pwd`/../`uname -m`-linux-gnu/bin:$PATH"
 cd ../..

ARMv8

  cd deps
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64
  cd criu-aarch64
  make \
   ARCH=aarch64 \
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \
   USERCFLAGS="-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib" \
   PATH="`pwd`/../`uname -m`-linux-gnu/bin:$PATH"
  cd ../..