D for Android

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Mon May 18 08:47:06 PDT 2015


On Monday, 18 May 2015 at 14:30:54 UTC, Dan Olson wrote:
> "Joakim" <dlang at joakim.fea.st> writes:
>
>> I just checked last week and the recent Android NDK's gcc has 
>> emulated
>> TLS enabled by default, while the same C/C++ source employing 
>> TLS
>> __thread and compiled with the NDK's clang will segfault 
>> because it
>> doesn't have emulated TLS.  Emulated TLS wasn't added to the 
>> NDK's gcc
>> by google either: it appears to have just slipped in from 
>> upstream,
>> which is perhaps why they seem to be unaware that it works for 
>> one
>> compiler in the NDK and not the other.
>>
>> Let the llvm guys know of this disparity, and I'm sure they'll 
>> be up
>> for remedying it.
>
> Just out of curiosity, shouldn't GDC then be better suited for 
> Android
> than LDC? LDC works well with iOS only because Apple 
> contributes to
> LLVM.

I don't think it matters, as llvm works very well on linux and 
the changes google makes for Android to the NDK compilers are 
minimal:

https://android.googlesource.com/toolchain/llvm/+log/release_36
https://android.googlesource.com/toolchain/clang/+log/release_36

https://android.googlesource.com/toolchain/gcc/+log/master/gcc-4.9

The one difference is TLS using the __thread annotation, which 
was documented as unsupported by the Android NDK for a long time 
but now happens to work with gcc and not clang/llvm.  However, 
the gdc guys trying to use gcc's emulated TLS have reported 
problems getting it working with the GC.  Maybe that's since been 
fixed, but that's the last I heard.

> Later, mid-summer perhaps, I plan to get both iOS and Android 
> arm64
> devicse so will be joining in the effort. I have too much other 
> stuff
> going on now though outside of D-Land and have to stick to 
> little D
> projects that won't vacuum away an afternoon.

Sure, have fun with your new devices. :) Hopefully, I'll get 
Android/ARM working before then, but I don't and won't have any 
AArch64 devices to test.  Not that it matters, as 64-bit ARM has 
even less share than x86 right now.


More information about the Digitalmars-d mailing list