Android valgrind build fails

前端 未结 5 1820
清酒与你
清酒与你 2020-12-03 00:27

Hello I\'m trying to build valgrind for android-arm. On Linux Mint 13 it fails with:

$ make
echo \"# This is a generated file, composed of the following supp         


        
5条回答
  •  长情又很酷
    2020-12-03 01:00

    This gets valgrind to compile for me on linux. (using android-ndk-r8e and valgrind-3.8.1)

    There was no need to run autogen.sh since I downloaded the tar ball from the website.

    Also make sure the TOOLCHAIN= line points to a valid toolchain.

    export NDK_HOME=$HOME/Downloads/android-ndk-r8e
    
    export HWKIND=generic
    
    export TOOLCHAIN=$NDK_HOME/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/arm-linux-androideabi
    
    export AR=$TOOLCHAIN-ar
    export LD=$TOOLCHAIN-ld
    export CC=$TOOLCHAIN-gcc
    
    CPPFLAGS="--sysroot=$NDK_HOME/platforms/android-14/arch-arm -DANDROID_HARDWARE_$HWKIND" \
        CFLAGS="--sysroot=$NDK_HOME/platforms/android-14/arch-arm" \
        ./configure --prefix=/data/local/Inst \
        --host=armv7-unknown-linux --target=armv7-unknown-linux \
        --with-tmpdir=/sdcard
    
    make 
    

    It eventually came up with a compile error saying

    $NDK_HOME/platforms/android-14/arch-arm/usr/include/elf.h:58:3: error: unknown type name 'uint32_t'
    

    It seem like someone forgot to add #include somewhere. To fix this I edited $NDK_HOME/platforms/android-14/arch-arm/usr/include/elf.h and added #include to the include section of this header. NOTE: This is probably not the best fix but it is the one that I came up with that fixed the compilation errors.


    On mac I was able to get it to compile up until the unknown type uint32_t part by changing how the configure script checks the kernel version.

    Inside the configure script search of a line kernel=`uname -r` and change it to kernel=3.9.2. (There are two kernel=`uname -r` lines replace the first one or both if you feel like it)

    This stops the configure script from looking at the host kernel when deciding how it should build valgrind. (uname -r grabs the host kernel)

    I believe adding the #include to elf.h should work on mac to but I have not tested it.

提交回复
热议问题