Building Valgrind for Android

我的梦境 提交于 2020-01-01 05:59:33

问题


Building valgrind-3.8.1 on ubuntu 12.04 with ndk-r6 or ndk-r8d failed with following error:

...
cc1: Error: not rekognized option "-marm"
priv/main_globals.c:1:0: Error: wrong Value (cortex-a8) for -mtune=switch
...

My build-script:

export NDKROOT=/home/stefan/android-ndk-r6-crystax-2
export HWKIND=generic
PATH=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:$PATH
PATH=$PATH:$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/libexec/gcc/arm-linux-androideabi/4.4.3
export CROSS_COMPILE=arm-linux-androideabi-
export AR=${CROSS_COMPLIE}ar
export LD=${CROSS_COMPLIE}ld
export CC=${CROSS_COMPLIE}gcc
export CXX=${CROSS_COMPLIE}g++
export CPP=${CROSS_COMPLIE}cpp

./autogen.sh CPPFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm -DANDROID_HARDWARE_$HWKIND" CFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm"
./configure --prefix=/data/local/Inst --host=armv7-unknown-linux --target=armv7-unknown-linux --with-tmpdir=/tmp

And finally

make    

:)

Any ideas? THANKS

Also i would accept builded binaries ;))


回答1:


For how to build Valgrind for Android (ARM) see: https://stackoverflow.com/a/19255251/313113

For how to run your app through Valgrind see: https://stackoverflow.com/a/19235439/313113




回答2:


Follow the instructions on this page : http://valgrind.org/docs/manual/dist.readme-android.html

You don't compile valgrind as embbeded for your application, but you compile a arm-compatible valgrind binary on your computer, linked with the android-ndk library, and then you can ship valgrind on some folder on your device or simulator. That's around 130 Mb of data.

Note that the device must be rooted.

Then, whenever you want to run valgrind with your android app, you will have to attach valgrind to the app. For that, look here : How to start an android app with valgrind



来源:https://stackoverflow.com/questions/15131126/building-valgrind-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!