TLS + LDC + Android (ARM) = FAIL

Joakim dlang at joakim.fea.st
Wed Nov 1 18:06:29 UTC 2017


On Wednesday, 1 November 2017 at 17:24:32 UTC, Igor Shirkalin 
wrote:
> We solved the subject with modifying druntime source related 
> with tls. Imaging, we have lost a lot of D's features.
> As far as I know DMD or GDC are not available for ARM 
> architecture. So we need LDC.
> A short story: we have big C/C++ project that links D (LDC) 
> code for different platforms.
>
> Does new "-betterC" mean we may use parallelism with using 
> separate linker?
>
> - IS

If you're having problems with the emulated TLS I put together 
for Android, it is most likely because I didn't document well 
what needs to be done when linking for Android.  Specifically, 
there are three rules that _must_ be followed:

1. You must use the ld.bfd linker, ld.gold won't do.
2. You must have a D main function, even for a shared library 
(which can be put next to android_main, if you're using the 
default Android wrapper from my D android library).
3. The ELF object with the D main function must be passed to the 
linker first.

If you look at my examples on the wiki, you'll see that they all 
follow these rules:

https://wiki.dlang.org/Build_D_for_Android

I should have called these rules out separately though, like I'm 
doing here, a documentation oversight.


More information about the Digitalmars-d mailing list