<div class="gmail_quote">On 6 February 2012 02:25, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><div class="gmail_quote">On 6 February 2012 00:04, Johannes Pfau <span dir="ltr"><<a href="mailto:nospam@example.com" target="_blank">nospam@example.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am Sun, 5 Feb 2012 18:04:12 +0100<br>
schrieb Johannes Pfau <<a href="mailto:nospam@example.com" target="_blank">nospam@example.com</a>>:<br>
<div><br>
> I will probably need some more time to get this working...<br>
><br>
<br>
</div>I have some good news:<br>
<a href="http://www.mediafire.com/?107we120sh3xx" target="_blank">http://www.mediafire.com/?107we120sh3xx</a><br>
<br>
I fixed that problem and then the whole build worked fine. I'll post<br>
build instructions soon, but the binaries are ready. I only did a<br>
simple gdc -c test.d to check the compiler, but it seems to work.<br>
<br>
Linking against druntime fails, as it uses functions which are not<br>
available on Android (backtrace, signal stuff).<br>
<br>
I also built a simple hello world on linux (printf, no runtime) and ran<br>
it on my android phone, and it worked!<br>
<br>
In case you haven't used GDC without runtime before, a short<br>
introduction:<br>
<br>
* use gdc -nophoboslib to make gdc not link against phobos (and afaik,<br>
druntime)<br>
* theres also -nostdlib in case you need it<br>
* complex code may require -fno-section-anchors because of bug #120<br>
* You'll get an error about a missing _Dmodule_ref symbol. That symbol<br>
is used by module constructors and not generated by gdc if<br>
-nophoboslib was passed. As long as you don't run the module<br>
constructors, you can add a fake _Dmodule_ref in a .c file:<br>
<br>
------------<br>
void* _Dmodule_ref;<br>
------------<br>
<br>
* The compiler defines version(Android)<br>
<br>
Here's my hello world:<br>
------------<br>
version(Android)<br>
{<br>
pragma(msg, "Hello Android!");<br>
}<br>
<br>
extern(C)<br>
{<br>
int printf(in char* format, ...);<br>
}<br>
<br>
extern(C) void main()<br>
{<br>
printf("Hello, %s!\n".ptr, "Android".ptr);<br>
}<br>
------------<br>
<br>
compile the _Dmodule_ref into hack.o, then use<br>
gdc -nophoboslib hello.d hack.o<br>
</blockquote></div><br></div></div><div>Amazing! You sir, are a genius!</div><div>I'm gonna have to have some fun with that after work tomorrow :)</div><div><br></div><div>I reckon this binary distro should be put on d-p-l somewhere obvious.</div>
</blockquote></div><br><div>I just tried with -mfpu=neon, which should allow GCC to generate neon opcodes for the simd stuff, but it didn't seem to want to do that. In fact it generates really horrible code where it CALLS an intrinsic for each float in the vector...</div>
<div>Any idea why this wouldn't work out of the box?</div><div><br></div><div>I wanted to add ARM support to my std.simd work here as a better proof of concept.</div><div><br></div><div>Iain: was there anything particularly special you needed to do to hook the x86 SSE stuff to GDC which would need to be duplicated for ARM? gcc.builtins doesn't seen to have any ARM intrinsics in there either...</div>