title: Cross-compiling Valgrind for ARM
body: <p>I need to cross-compile VALGRIND to run on Freescale i.MX278 (ARM 9) running Linux. I have the tool chain provided by Freescale itself.</p>
  
  <p>I have already set the PATH variable to tool chain path. I'm using following command further:</p>
  
  <pre><code>$ export CROSS_COMPILE=arm-fsl-linux-gnueabi-
  $ export CC=${CROSS_COMPILE}gcc
  $ export CPP=${CROSS_COMPILE}cpp
  $ export CXX=${CROSS_COMPILE}g++
  $ export LD=${CROSS_COMPILE}ld
  $ export AR=${CROSS_COMPILE}ar
  
  $ ./configure --target=arm-fsl-linux-gnueabi \
                --host=armv7-fsl-linux-gnueabi \
                --prefix=/opt/valgrind \
                CFLAGS=-static
  </code></pre>
  
  <p>It passes the <code>./configure</code> but fails on <code>make</code> with following error:</p>
  
  <pre><code>gcc: error: unrecognized command line option ‘-marm’
  </code></pre>