<div dir="ltr">Hi Michael.<div><br></div><div>Look also here <a href="http://forum.world.st/Ann-Stack-Android-VM-td4919869.html.">http://forum.world.st/Ann-Stack-Android-VM-td4919869.html. </a></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-16 21:48 GMT+02:00 Michael Rueger <span dir="ltr"><<a href="mailto:lists@andience.co.nz" target="_blank">lists@andience.co.nz</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi all,<br>
<br>
long time no see :-)<br>
<br>
Recently I spent a bit of time trying to piece together an Android VM using the up to date versions of AndroidStudio, SDK and NDK. Once things are building and running, I was planning to fold everything back into the proper build process.<br>
<br>
Current (somewhat messy) state of things here<br>
<a href="https://github.com/mrueger42/st-android" rel="noreferrer" target="_blank">https://github.com/mrueger42/s<wbr>t-android</a><br>
<br>
It has been quite a long time since I looked at building VMs, so forgive me if I'm just being stupid here...<br>
<br>
I was able to get the original port from Andreas to build and run, but it is a very outdated version. Still nice to have it as a piece of history, I think (AndroidVM in the above repo).<br>
<br>
Some puzzle pieces later I have something running that is based on recent CogSpur opensmalltalk code and bits and pieces I found. Unfortunately CogSpur doesn't seem to play well with the setjmp/longjmp used in the code (CogDroid in the above repo).<br>
<br>
Plus, the VM is running on the UI thread, not something that is viewed well on mobile. Actually it makes Android just kill the app if you block the UI thread for too long.<br>
<br>
Trying to run the VM on a thread runs into a division by 0 exception (I think) and finds me way out of my league to track down why that would be. Crash below...<br>
<br>
I haven't really tried getting Dmitry's version to build/work in a current environment, partly because I'm not sure I'm looking at the most up to date version (see below).<br>
<br>
Any help, pointers, code snippets highly appreciated!<br>
<br>
Cheers<br>
<br>
Michael<br>
<br>
P.S. Sending this to vm-dev and pharo-dev, but should probably send any followup to vm-dev?<br>
<br>
--------<br>
<br>
<br>
list of sources I looked at:<br>
<br>
-opensmalltalk<br>
-pharo<br>
<br>
-original port by Andreas<br>
git@github.com:timfel/squeak-a<wbr>ndroid-vm.git<br>
<br>
-stack<br>
<a href="https://github.com/sbragagnolo/pharo-vm/" rel="noreferrer" target="_blank">https://github.com/sbragagnolo<wbr>/pharo-vm/</a><br>
<br>
-dmitry<br>
gitorious is no longer, just an archival snapshot<br>
clicking on snapshot gives you the sources<br>
<a href="https://gitorious.org/cogvm/dmg-blessed?p=cogvm:dmg-blessed.git;a=summary" rel="noreferrer" target="_blank">https://gitorious.org/cogvm/dm<wbr>g-blessed?p=cogvm:dmg-blessed.<wbr>git;a=summary</a><br>
non-functional jenkins setup<br>
<a href="https://ci.inria.fr/pharo-contribution/view/VM/job/CogDroid/configure-readonly/" rel="noreferrer" target="_blank">https://ci.inria.fr/pharo-cont<wbr>ribution/view/VM/job/CogDroid/<wbr>configure-readonly/</a><br>
<br>
<br>
<br>
-------------<br>
<br>
The Cog VM crash when running on a Thread:<br>
<br>
<br>
D/jni-vm: Java_org_smalltalk_android_vm_<wbr>VM_runVM<br>
D/jni-vm: runVM<br>
D/jni-vm: interpret<br>
<br>
A/libc: Fatal signal 8 (SIGFPE), code -6, fault addr 0x67db in tid 26636 (Thread-5)<br>
<br>
Revision: '6'<br>
ABI: 'arm'<br>
pid: 26587, tid: 26636, name: Thread-5  >>> org.smalltalk.android <<<<br>
signal 8 (SIGFPE), code -6 (SI_TKILL), fault addr 0x67db<br>
    r0 00000000  r1 0000680c  r2 00000008  r3 00000000<br>
    r4 e4f7f978  r5 00000008  r6 e4f7f920  r7 0000010c<br>
    r8 e4f7ef60  r9 e3516400  sl e351648c  fp e4f7ecb4<br>
    ip 00000002  sp e4f7ce30  lr efca84c7  pc efcaad30  cpsr 600e0010<br>
<br>
backtrace:<br>
    #00 pc 0004ad30  /system/lib/libc.so (tgkill+12)<br>
    #01 pc 000484c3  /system/lib/libc.so (pthread_kill+34)<br>
    #02 pc 0001dd99  /system/lib/libc.so (raise+10)<br>
    #03 pc 000c54a3  /data/app/org.smalltalk.androi<wbr>d-2/lib/arm/libStackVM.so<br>
    #04 pc 00051507  /data/app/org.smalltalk.androi<wbr>d-2/lib/arm/libStackVM.so<br>
    #05 pc 0003d38b  /data/app/org.smalltalk.androi<wbr>d-2/lib/arm/libStackVM.so (interpret+238)<br>
    #06 pc 000a4e6f  /data/app/org.smalltalk.androi<wbr>d-2/lib/arm/libStackVM.so (runVM+22)<br>
    #07 pc 000a4a55  /data/app/org.smalltalk.androi<wbr>d-2/lib/arm/libStackVM.so (Java_org_smalltalk_android_vm<wbr>_VM_runVM+36)<br>
    #08 pc 0031ec99  /data/app/org.smalltalk.androi<wbr>d-2/oat/arm/base.odex (offset 0x302000)<br>
<br>
</blockquote></div><br></div>