D on android and d_android

burt invalid_email_address at cab.abc
Sun Apr 5 17:45:41 UTC 2020


On Thursday, 2 April 2020 at 17:16:56 UTC, burt wrote:
> On Thursday, 2 April 2020 at 12:13:27 UTC, Adam D. Ruppe wrote:
>> On Thursday, 2 April 2020 at 11:29:24 UTC, burt wrote:
>>> Anyway, I don't think this fails to work because of an error 
>>> in the d_android library. If you find anything else that may 
>>> cause it, I am glad to know, but thank you for your help.
>>
>> Well, it is supposed to be a "just works" setup helper, so 
>> anything in it is a problem! There was an off-by-one bug in 
>> the downloader, maybe that missing byte made ldc ignore the 
>> corrupted library file.
>
> I think I managed to get phobos2 and druntime to link. However, 
> I still get linker errors saying that the following symbols are 
> undefined: statvfs, fmodl, modfl, getdelim, _tlsend, 
> __bss_end__, _tlsstart, __libc_current_sigrtmin, 
> __libc_current_sigrtmax, strtold. I'm not sure what to do about 
> that; did I forget to link something or are these symbols not 
> in the Android runtime?

I managed to narrow it down to just one error. The missing 
`_tlsstart` and `_tlsend` symbols were because of the missing 
`void main() {}`, that used to be added automatically in 
d_android v0.0.5 but not in v0.1.0. It worked when I added an 
empty main function.

Most of the other errors were because of the API level of 
Android; for whatever reason, Android Studio chose API level 16 
instead of at least 21, so changing minSdkVersion to 21 in 
build.gradle made those errors go away.

However, I still get one undefined reference to __bss_end__, and 
I don't know how to fix this. Is this also a problem with TLS or 
the API level?

Thanks.


More information about the Digitalmars-d-learn mailing list