Sep 8, 2009

How to build Valgrind for Beagleboard

1) Get Valgrind source code from SVN using revision 9648 and 1888 for VEX
svn co -r 9648 svn://svn.valgrind.org/valgrind/trunk
cd VEX
svn update -r 1888


3) Apply the patch into the source code
cd valgrind
patch -p1 < [path to the patch]

4) Run autogen.sh to run autotools

5) Configure the source code
./configure --host=arm-angstrom-linux-gnueabi

The patch still has some bugs such as CPU instruction alignment you can 'cat /proc/cpu/alignment' to find out if the kernel is configured to fix unaligned accesses, and you can enable it by executing 'echo 2 > /proc/cpu/alignment' but it's enough to use for simple application.
Have fun with Valgrind :-)

Sep 4, 2009

How to build Clutter for Beagleboard

The Clutter need to be configured with =flavour=eglnative= so that it can work with SGX driver
The following is the configure command
./configure --with-flavour=eglnative --host=arm-angstrom-linux-gnueabi PKG_CONFIG=/data/workspace/OE/tmp/staging/i686-linux/usr/bin/pkg-config PKG_CONFIG_PATH=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/lib/pkgconfig CFLAGS="--sysroot=/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/ -I/data/workspace/OE/tmp/staging/armv7a-angstrom-linux-gnueabi/usr/include" --with-x=no --with-gles=1.1 --with-imagebackend=internal

with
  • --host: set the target for the build, need to be arm-angstrom-linux-gnueabi
  • PKG_CONFIG: use the pgk-config command from OE distribution
  • PKG_CONFIG_PATH: the path to search for *.pc file, need to be pointed to OE distribution
  • --with-x: not using X
  • --with-imagebackend: specific the image backend to use
  • --with-gles: specific the GLES version to use (1.1 or 2.0)
  • CFLAGS: override some C compiler flags
  • --sysroot: the root directory to search for library and header files
  • -I[include_dir]: some optional include directories to search for

Fix undefined rpl_malloc on autoconf tool in cross compile mode

When using autoconf tool in cross compile environment, sometime there is error like this `undefined reference to `rpl_malloc'`

It is the bug of autoconf tool in the test function AC_FUNC_MALLOC. To fix it we need define an environment variable that forces the test to pass. Define it in the environment prior to calling ./configure and the script will act as if the AC_FUNC_MALLOC check has passed.

export ac_cv_func_malloc_0_nonnull=yes