Revision: 6171
Author: [email protected]
Date: Wed Jan  5 02:59:17 2011
Log: Created page on cross compiling for ARM targets
http://code.google.com/p/v8/source/detail?r=6171

Added:
 /wiki/CrossCompilingForARM.wiki

=======================================
--- /dev/null
+++ /wiki/CrossCompilingForARM.wiki     Wed Jan  5 02:59:17 2011
@@ -0,0 +1,90 @@
+#summary Detailed instructions for Cross compiling for ARM
+
+= Using Sourcery G++ Lite =
+
+The Sourcery G++ Lite cross compiler suite us a free version of Sourcery G++ from [http:\\wwww.codesourcery.com CodeSourcery].
+
+Determine the version you need for your host/target combination. The following instructions uses [http://www.codesourcery.com/sgpp/lite/arm/portal/release858 2009q1-203 for ARM GNU/Linux].
+
+== Installing on host and target ==
+
+The simplest way of setting this up it to install the full Sourcery G++ Lite package on both the host and target at the same location. This will ensure that all the libraries required are available on both sides. If you want to use the default libraries on the host there is no need the install anything on the target.
+
+The following script will install in `/opt/codesourcery`:
+
+{{{
+#!/bin/sh
+
+sudo mkdir /opt/codesourcery
+cd /opt/codesourcery
+sudo chown $USERNAME .
+chmod g+ws .
+umask 2
+wget http://www.codesourcery.com/sgpp/lite/arm/portal/package4571/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+tar -xvf arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
+}}}
+
+
+== Building using scons without snapshot ==
+
+The simplest way to build is without snapshot, as that does no involve using the simulator to generate the snapshot. The following script will build the sample shell without snapshot for ARMv7.
+
+{{{
+#!/bin/sh
+
+export TOOL_PREFIX=/opt/codesourcery/arm-2009q1/bin/arm-none-linux-gnueabi
+export CXX=$TOOL_PREFIX-g++
+export AR=$TOOL_PREFIX-ar
+export RANLIB=$TOOL_PREFIX-ranlib
+export CC=$TOOL_PREFIX-gcc
+export LD=$TOOL_PREFIX-ld
+
+export CCFLAGS="-mthumb -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp" +export ARM_TARGET_LIB=/opt/codesourcery/arm-2009q1/arm-none-linux-gnueabi/libc/thumb2
+
+scons wordsize=32 snapshot=off arch=arm sample=shell
+}}}
+
+If the processor is not Cortex A8 or does not have VFP enabled the `-mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp` part of `CCFLAGS` needs to be changed accordingly.
+
+If using the default libraries on the target just leave out the setting of `ARM_TARGET_LIB` and if the target libraies are in a different location ARM_TARGET_LIB` needs to be adjusted accordingly.
+
+If testing building for ARMv5 the setting of `CCFLAGS` and `ARM_TARGET_LIB` should be changed to:
+
+{{{
+CCFLAGS="-mfpu=vfp -mfloat-abi=softfp"
+ARM_TARGET_LIB=/opt/codesourcery/arm-2009q1/arm-none-linux-gnueabi/libc
+}}}
+
+or the following if the target has no VFP unit
+
+{{{
+CCFLAGS=""
+ARM_TARGET_LIB=/opt/codesourcery/arm-2009q1/arm-none-linux-gnueabi/libc
+}}}
+
+== Building using scons with snapshot ==
+
+When building with snapshot the simulator is used to build the snapshot on the host and then building for the target with that snapshot. The following script will accomplish that.
+
+{{{
+#!/bin/sh
+
+scons simulator=arm snapshot=on
+mv obj/release/snapshot.cc src/snapshot.cc
+scons -c
+
+export TOOL_PREFIX=/opt/codesourcery/arm-2009q1/bin/arm-none-linux-gnueabi
+export CXX=$TOOL_PREFIX-g++
+export AR=$TOOL_PREFIX-ar
+export RANLIB=$TOOL_PREFIX-ranlib
+export CC=$TOOL_PREFIX-gcc
+export LD=$TOOL_PREFIX-ld
+
+export CCFLAGS="-mthumb -march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp" +export ARM_TARGET_LIB=/opt/codesourcery/arm-2009q1/arm-none-linux-gnueabi/libc/thumb2
+
+scons wordsize=32 snapshot=nobuild arch=arm sample=shell
+}}}
+
+This script of cause builds the whole of V8 two times, but that can be avoided by using two build directories and the -Y option for scons.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to