1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>9.README.android</title>
<link rel="stylesheet" type="text/css" href="vg_basic.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Valgrind Documentation">
<link rel="up" href="dist.html" title="Valgrind Distribution Documents">
<link rel="prev" href="dist.readme-s390.html" title="8.README.S390">
<link rel="next" href="dist.readme-android_emulator.html" title="10.README.android_emulator">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div><table class="nav" width="100%" cellspacing="3" cellpadding="3" border="0" summary="Navigation header"><tr>
<td width="22px" align="center" valign="middle"><a accesskey="p" href="dist.readme-s390.html"><img src="images/prev.png" width="18" height="21" border="0" alt="Prev"></a></td>
<td width="25px" align="center" valign="middle"><a accesskey="u" href="dist.html"><img src="images/up.png" width="21" height="18" border="0" alt="Up"></a></td>
<td width="31px" align="center" valign="middle"><a accesskey="h" href="index.html"><img src="images/home.png" width="27" height="20" border="0" alt="Up"></a></td>
<th align="center" valign="middle">Valgrind Distribution Documents</th>
<td width="22px" align="center" valign="middle"><a accesskey="n" href="dist.readme-android_emulator.html"><img src="images/next.png" width="18" height="21" border="0" alt="Next"></a></td>
</tr></table></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="dist.readme-android"></a>9.README.android</h1></div></div></div>
<div class="literallayout"><p><br>
<br>
Howtocross-compileandrunonAndroid.Pleasereadtotheend,<br>
sincethereareimportantdetailsfurtherdownregardingcrash<br>
avoidanceandGPUsupport.<br>
<br>
Thesenoteswerelastupdatedon4Nov2014,forValgrindSVN<br>
revision14689/2987.<br>
<br>
Theseinstructionsareknowntowork,orhaveworkedatsometimein<br>
thepast,for:<br>
<br>
arm:<br>
Android4.0.3runningona(rooted,AOSPbuild)NexusS.<br>
Android4.0.3runningonMotorolaXoom.<br>
Android4.0.3runningonandroidarmemulator.<br>
Android4.1runningonandroidemulator.<br>
Android2.3.4onNexusSworkedatsometimeinthepast.<br>
<br>
x86:<br>
Android4.0.3runningonandroidx86emulator.<br>
<br>
mips32:<br>
Android4.1.2runningonandroidmipsemulator.<br>
Android4.2.2runningonandroidmipsemulator.<br>
Android4.3runningonandroidmipsemulator.<br>
Android4.0.4runningonBROADCOMbcm7425<br>
<br>
arm64:<br>
Android4.5(?)runningonARMJuno<br>
<br>
Onandroid-arm,GDBservermightinsertbreaksatwrongaddresses.<br>
Feedbackonthiswelcome.<br>
<br>
Otherconfigurationsandtoolchainsmightwork,buthaven'tbeentested.<br>
Feedbackiswelcome.<br>
<br>
Toolchain:<br>
<br>
Forarm32,x86andmips32youneedtheandroid-ndk-r6native<br>
developmentkit.r6bandr7giveanon-completely-workingbuild;<br>
seehttp://code.google.com/p/android/issues/detail?id=23203<br>
Fortheandroidemulator,theversionsneededandhowtoinstall<br>
themaredescribedinREADME.android_emulator.<br>
<br>
Youcangetandroid-ndk-r6from<br>
http://dl.google.com/android/ndk/android-ndk-r6-linux-x86.tar.bz2<br>
<br>
Forarm64(aarch64)youneedtheandroid-ndk-r10cNDK,from<br>
http://dl.google.com/android/ndk/android-ndk-r10c-linux-x86_64.bin<br>
<br>
InstalltheNDKsomewhere.Doesn'tmatterwhere.Then:<br>
<br>
<br>
#Modifythis(obviously).Note,this"export"commandisonlydone<br>
#soastoreducetheamountoftypingrequired.Noneofthecommands<br>
#belowreaditaspartoftheiroperation.<br>
#<br>
exportNDKROOT=/path/to/android-ndk-r<version><br>
<br>
<br>
#ThencdtotherootofyourValgrindsourcetree.<br>
#<br>
cd/path/to/valgrind/source/tree<br>
<br>
<br>
#Afterthispoint,youdon'tneedtomodifyanything.Justcopyand<br>
#pastethecommandsbelow.<br>
<br>
<br>
#Setuptoolchainpaths.<br>
#<br>
#ForARM<br>
exportAR=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar<br>
exportLD=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld<br>
exportCC=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc<br>
<br>
#Forx86<br>
exportAR=$NDKROOT/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-ar<br>
exportLD=$NDKROOT/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-ld<br>
exportCC=$NDKROOT/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-gcc<br>
<br>
#ForMIPS32<br>
exportAR=$NDKROOT/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86_64/bin/mipsel-linux-android-ar<br>
exportLD=$NDKROOT/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86_64/bin/mipsel-linux-android-ld<br>
exportCC=$NDKROOT/toolchains/mipsel-linux-android-4.8/prebuilt/linux-x86_64/bin/mipsel-linux-android-gcc<br>
<br>
#ForARM64(AArch64)<br>
exportAR=$NDKROOT/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar<br>
exportLD=$NDKROOT/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld<br>
exportCC=$NDKROOT/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc<br>
<br>
<br>
#Doconfigurationstuff.Don'tmesswiththe--prefixinthe<br>
#configurecommandbelow,evenifyouthinkit'swrong.<br>
#Youmayneedtosetthe--with-tmpdirpathtosomething<br>
#differentif/sdcarddoesn'tworkonthedevice--thisis<br>
#aknowncauseofdifficulties.<br>
<br>
#Thebelowre-generatesconfigure,Makefiles,...<br>
#Thisisnotneededifyoustartfromareleasetarball.<br>
./autogen.sh<br>
<br>
#forARM<br>
CPPFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm"\<br>
CFLAGS="--sysroot=$NDKROOT/platforms/android-3/arch-arm"\<br>
./configure--prefix=/data/local/Inst\<br>
--host=armv7-unknown-linux--target=armv7-unknown-linux\<br>
--with-tmpdir=/sdcard<br>
#note:onandroidemulator,android-14platformwasalsotestedandworks.<br>
#Itisnotclearwhatthisplatformnrreallyis.<br>
<br>
#forx86<br>
CPPFLAGS="--sysroot=$NDKROOT/platforms/android-9/arch-x86"\<br>
CFLAGS="--sysroot=$NDKROOT/platforms/android-9/arch-x86-fno-pic"\<br>
./configure--prefix=/data/local/Inst\<br>
--host=i686-android-linux--target=i686-android-linux\<br>
--with-tmpdir=/sdcard<br>
<br>
#forMIPS32<br>
CPPFLAGS="--sysroot=$NDKROOT/platforms/android-18/arch-mips"\<br>
CFLAGS="--sysroot=$NDKROOT/platforms/android-18/arch-mips"\<br>
./configure--prefix=/data/local/Inst\<br>
--host=mipsel-linux-android--target=mipsel-linux-android\<br>
--with-tmpdir=/sdcard<br>
<br>
#forARM64(AArch64)<br>
CPPFLAGS="--sysroot=$NDKROOT/platforms/android-21/arch-arm64"\<br>
CFLAGS="--sysroot=$NDKROOT/platforms/android-21/arch-arm64"\<br>
./configure--prefix=/data/local/Inst\<br>
--host=aarch64-unknown-linux--target=aarch64-unknown-linux\<br>
--with-tmpdir=/sdcard<br>
<br>
<br>
#Attheendoftheconfigurerun,afewlinesofdetails<br>
#areprinted.Makesurethatyouseethesetwolines:<br>
#<br>
#ForARM:<br>
#Platformvariant:android<br>
#Primary-DVGPVstring:-DVGPV_arm_linux_android=1<br>
#<br>
#Forx86:<br>
#Platformvariant:android<br>
#Primary-DVGPVstring:-DVGPV_x86_linux_android=1<br>
#<br>
#Formips32:<br>
#Platformvariant:android<br>
#Primary-DVGPVstring:-DVGPV_mips32_linux_android=1<br>
#<br>
#ForARM64(AArch64):<br>
#Platformvariant:android<br>
#Primary-DVGPVstring:-DVGPV_arm64_linux_android=1<br>
#<br>
#Ifyouseeanythingelseatthispoint,somethingiswrong,and<br>
#eitherthebuildwillfail,orwillsucceedbutyou'llgetsomething<br>
#whichwon'twork.<br>
<br>
<br>
#Build,andparktheinstalltreein`pwd`/Inst<br>
#<br>
make-j4<br>
make-j4installDESTDIR=`pwd`/Inst<br>
<br>
<br>
#Togettheinstalltreeontothedevice:<br>
#(Idon'tknowwhyit'snot"adbpushInst/data/local",butthis<br>
#formulationdoesappeartoputtheresultin/data/local/Inst.)<br>
#<br>
adbpushInst/<br>
<br>
<br>
#Torun(onthedevice).Therearetwothingsyouneedtoconsider:<br>
#<br>
#(1)ifyouarerunningontheAndroidemulator,Valgrindmaycrash<br>
#atstartup.Thisisbecausetheemulator(forARM)maynotbe<br>
#simulatingahardwareTLSregister.Togetaroundthis,run<br>
#Valgrindwith:<br>
#--kernel-variant=android-no-hw-tls<br>
#<br>
#(2)ifyouarerunningarealdevice,youneedtotellValgrind<br>
#whatGPUithas,soValgrindknowshowtohandlecustomGPU<br>
#ioctls.Youcanchooseoneofthefollowing:<br>
#--kernel-variant=android-gpu-sgx5xx#PowerVRSGX5XXseries<br>
#--kernel-variant=android-gpu-adreno3xx#QualcommAdreno3XXseries<br>
#Ifyoudon'tchooseone,theprogramwillstillrun,butMemcheck<br>
#mayreportfalseerrorsaftertheprogramperformsGPU-specificioctls.<br>
#<br>
#Anyway:torunonthedevice:<br>
#<br>
/data/local/Inst/bin/valgrind[kernelvariantargs][theusualargsetc]<br>
<br>
<br>
#Onceyou'reupandrunning,ahandymodify-V-rebuild-reinstall<br>
#commandline(onthehost,ofcourse)is<br>
#<br>
mq-j2&&mq-j2installDESTDIR=`pwd`/Inst&&adbpushInst/<br>
#<br>
#where'mq'isanaliasfor'make--quiet'.<br>
<br>
<br>
#Onecommoncauseofrunsfailingatstartupistheinabilityof<br>
#Valgrindtofindasuitabletemporarydirectory.Onthedevice,<br>
#theredoesn'tseemtobeanyonelocationwhichwealwayshave<br>
#permissiontowriteto.Theinstructionsaboveuse/sdcard.If<br>
#thatdoesn'tworkforyou,andyou'reValgrindingonespecific<br>
#applicationwhichisalreadyinstalled,youcouldtryusingits<br>
#temporarydirectory,in/data/data,forexample<br>
#/data/data/org.mozilla.firefox_beta.<br>
#<br>
#Using/system/bin/logcatonthedeviceishelpfulfordiagnosing<br>
#thesekindsofproblems.<br>
<br>
</p></div>
</div>
<div>
<br><table class="nav" width="100%" cellspacing="3" cellpadding="2" border="0" summary="Navigation footer">
<tr>
<td rowspan="2" width="40%" align="left">
<a accesskey="p" href="dist.readme-s390.html"><<8.README.S390</a></td>
<td width="20%" align="center"><a accesskey="u" href="dist.html">Up</a></td>
<td rowspan="2" width="40%" align="right"><a accesskey="n" href="dist.readme-android_emulator.html">10.README.android_emulator>></a>
</td>
</tr>
<tr><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td></tr>
</table>
</div>
</body>
</html>
|