Question

when I try to configure valgrind for android I get:

  Platform variant: vanilla
  Primary -DVGPV string: -DVGPV_arm_linux_vanilla=1

I figured out by looking at configure.in that this must be the case because of:

AC_EGREP_CPP([BIONIC_LIBC], [
#if defined(__ANDROID__)
  BIONIC_LIBC
#endif
],
GLIBC_VERSION="bionic")

The GLIBC_VERSION is not being set to "bionic", thus __ANDROID__ must not be defined. How can I fix this? The commands I am running are:

export NDKROOT='/home/matt/Desktop/android-ndk-r6' 
export HWKIND=emulator
export AR=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
export LD=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld
export CC=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
cd '/home/matt/Desktop/valgrind-3.8.1' 
./autogen.sh
CPPFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm -DANDROID_HARDWARE_$HWKIND"    CFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm"    sudo ./configure --prefix=/data/local/Inst    --host=armv7-unknown-linux --target=armv7-unknown-linux    --with-tmpdir=/sdcard

Information about the machine I'm building on:

Kernel      : Linux 3.2.0-23-generic (x86_64)
Default C Compiler      : GNU C Compiler version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 
Distribution        : Linux Mint 13 Maya

Edit: I confirmed that when running $CC directly, the __ANDROID__ is defined. So ./configure is not using $CC?

Edit 2: Adding CC=$CC LD=$LD AR=$AR to the configure gives configure: error: C compiler cannot create executables.

Was it helpful?

Solution

To get this to work, you need to change the parameters passed to the ./configure script to:

sudo ./configure --prefix=/data/local/Inst --host=armv7-unknown-linux\
        --target=armv7-unknown-linux --with-tmpdir=/sdcard0\
        CPPFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm -DANDROID_HARDWARE_$HWKIND"\
        CFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm"\
        CC=$CC LD=$LD AR=$AR
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top