Difference between revisions of "ARM crosscompile"

From CRIU
Jump to navigation Jump to search
(Moved)
 
 
Line 1: Line 1:
 +
== Install the toolchain ==
 +
 
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.
 
If you are cross compiling for ARM, use distribution packages or download prebuilt toolchains from Linaro.
  
Line 10: Line 12:
 
  tar --strip=1 -C `uname -m`-linux-gnu -xf 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 ..
 
  cd ..
 +
</pre>
 +
 +
== Build ==
 +
 +
=== ARMv7 ===
 +
<pre>
 +
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 ../..
 +
</pre>
 +
 +
=== ARMv8 ===
 +
<pre>
 +
  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 ../..
 
</pre>
 
</pre>
  
 
[[Category: Building]]
 
[[Category: Building]]

Latest revision as of 13:17, 12 July 2017

Install the toolchain[edit]

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[edit]

ARMv7[edit]

 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[edit]

  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 ../..