]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add a file containing information on how to cross-compile for Android.
authorJulian Seward <jseward@acm.org>
Tue, 12 Jul 2011 13:34:31 +0000 (13:34 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 12 Jul 2011 13:34:31 +0000 (13:34 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11888

Makefile.am
README.android [new file with mode: 0644]

index 79657a5056652048919df65c4fb28e1fa0d109dd..8526048a5a640d7671d30ece99349c501d4dad5b 100644 (file)
@@ -100,6 +100,7 @@ EXTRA_DIST = \
        README_PACKAGERS \
        README_MISSING_SYSCALL_OR_IOCTL \
        README.s390 \
+       README.android \
        valgrind.pc.in \
        valgrind.spec.in \
        valgrind.spec
diff --git a/README.android b/README.android
new file mode 100644 (file)
index 0000000..d0e28ee
--- /dev/null
@@ -0,0 +1,58 @@
+
+How to cross-compile for Android.
+
+This is known to work at least for Android 3.0 running on a Motorola
+Xoom.  Other configurations and toolchains might work, but haven't
+been tested.  Feedback is welcome.
+
+You need the android-ndk-r5c native development kit.  Install it
+somewhere.  Then do this:
+
+# Maybe not all of these are necessary -- I'm just being cautious.
+#
+export AR=/path/to/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar
+export CPP=/path/to/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-cpp
+export LD=/path/to/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld
+export CXX=/path/to/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++
+export CC=/path/to/android-ndk-r5c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
+
+# Configure.  This will build a Valgrind that needs to go in
+# /data/local/Inst on the device and that uses /data/local/tmp
+# as the tmp dir on the device.  This means it can operate on
+# non-rooted (production) devices.
+#
+
+cd trunk
+./autogen.sh
+
+CPPFLAGS="--sysroot=/path/to/android-ndk-r5c/platforms/android-3/arch-arm" \
+   CFLAGS="--sysroot=/path/to/android-ndk-r5c/platforms/android-3/arch-arm" \
+   ./configure --prefix=/data/local/Inst \
+   --host=armv7-unknown-linux --target=armv7-unknown-linux \
+   --with-tmpdir=/data/local/tmp
+
+
+# At the end of the configure run, a few lines of details
+# are printed.  Make sure that you see these two lines:
+#
+#          Platform variant: android
+#     Primary -DVGPV string: -DVGPV_arm_linux_android=1
+#
+# If you see anything else at this point, something is wrong, and
+# either the build will fail, or will succeed but you'll get something
+# which won't work.
+
+
+# Build, and park the install tree in `pwd`/Inst
+make
+make install DESTDIR=`pwd`/Inst
+
+
+# To get the install tree onto the device:
+# (I don't know why it's not "adb push Inst /data/local", but this
+# formulation does appear to put the result in /data/local/Inst.)
+#
+adb push Inst /
+
+# To run (on the device)
+/data/local/Bin/valgrind [the usual args etc]