Jump to page: 1 2
Thread overview
TLS + LDC + Android (ARM) = FAIL
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
Iain Buclaw
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
David Nadlinger
Nov 01, 2017
Johannes Pfau
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
Johannes Pfau
Nov 01, 2017
Iain Buclaw
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
Joakim
Nov 01, 2017
Johannes Pfau
Nov 01, 2017
Joakim
Nov 01, 2017
Joakim
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
David Nadlinger
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
Joakim
Nov 01, 2017
Johannes Pfau
Nov 01, 2017
Igor Shirkalin
Nov 01, 2017
Joakim
November 01, 2017
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

November 01, 2017
On 1 November 2017 at 18:24, Igor Shirkalin via Digitalmars-d <digitalmars-d@puremagic.com> 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.

GDC supports the same or maybe more platforms than LDC. :-)
November 01, 2017
On Wednesday, 1 November 2017 at 17:30:05 UTC, Iain Buclaw wrote:
> On 1 November 2017 at 18:24, Igor Shirkalin via Digitalmars-d <digitalmars-d@puremagic.com> 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.
>
> GDC supports the same or maybe more platforms than LDC. :-)

Could you please give the reference how to build it in linux or windows?
November 01, 2017
On Wednesday, 1 November 2017 at 17:30:05 UTC, Iain Buclaw wrote:
> GDC supports the same or maybe more platforms than LDC. :-)

Or quite possibly fewer, depending on what one understands "platform" and "support" to mean. ;)

What is the state of GDC on Android/ARM – has anyone been using it recently?

 — David

November 01, 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.

You'd have been better off opening an issue for ldc:

https://github.com/ldc-developers/ldc/issues

TLS should work fine, though it's emulated, as Android doesn't support native TLS.  You have to be careful how you link the emulated TLS, and you have to include a main function even for a shared library:

https://wiki.dlang.org/Build_LDC_for_Android#Directions_for_future_work

You'd be better off talking to the ldc devs- this is the first I'm hearing about this- rather than going in and making changes to druntime.

> 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?

You'll need to expand on this: you want to use std.parallelism, which isn't working for you now, or something else to do with the linker is going wrong?
November 01, 2017
On Wednesday, 1 November 2017 at 17:24:32 UTC, Igor Shirkalin wrote:
> Does new "-betterC" mean we may use parallelism with using separate linker?

`-betterC` does not add any emulation of missing platform features — on the contrary, it *removes* language runtime functionality! Thus, if TLS doesn't work for you (IIRC, emulated TLS should work on Android following Joakim's work!), adding `-betterC` won't improve the situation.

Could you please open an ticket on the LDC GitHub tracker with details on the issue?

 — David
November 01, 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.
November 01, 2017
On Wednesday, 1 November 2017 at 17:44:11 UTC, Joakim wrote:
> 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.
>
> You'd have been better off opening an issue for ldc:
>
> https://github.com/ldc-developers/ldc/issues
>
> TLS should work fine, though it's emulated, as Android doesn't support native TLS.  You have to be careful how you link the emulated TLS, and you have to include a main function even for a shared library:
>
> https://wiki.dlang.org/Build_LDC_for_Android#Directions_for_future_work
>
> You'd be better off talking to the ldc devs- this is the first I'm hearing about this- rather than going in and making changes to druntime.
>
>> 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?
>
> You'll need to expand on this: you want to use std.parallelism, which isn't working for you now, or something else to do with
We use external D libraries in C project. Using parallelisms means we have to initialize druntime. But tls stops it (therefore we had changed it). Sure, we have tried to build pure D part and it didnt work.
> the linker is going wrong?
of course the linker was working properly.

November 01, 2017
On Wednesday, 1 November 2017 at 17:46:29 UTC, David Nadlinger wrote:
> On Wednesday, 1 November 2017 at 17:24:32 UTC, Igor Shirkalin wrote:
>> Does new "-betterC" mean we may use parallelism with using separate linker?
>
> `-betterC` does not add any emulation of missing platform features — on the contrary, it *removes* language runtime functionality! Thus, if TLS doesn't work for you (IIRC, emulated TLS should work on Android following Joakim's work!), adding `-betterC` won't improve the situation.
I undrastand that.
>
> Could you please open an ticket on the LDC GitHub tracker with details on the issue?

I'd try with help.

>
>  — David


November 01, 2017
Am Wed, 01 Nov 2017 17:42:22 +0000
schrieb David Nadlinger <code@klickverbot.at>:

> On Wednesday, 1 November 2017 at 17:30:05 UTC, Iain Buclaw wrote:
> > GDC supports the same or maybe more platforms than LDC. :-)
> 
> Or quite possibly fewer, depending on what one understands "platform" and "support" to mean. ;)
> 
> What is the state of GDC on Android/ARM – has anyone been using it recently?
> 
>   — David
> 

ARM: Fine. Android: probably won't work well. AFAIK we're only missing emulated TLS / GC integration, so most test will pass but real apps will crash because of GC memory corruption. I guess I should finally get back to fixing that problem ;-) OTOH Android doesn't even support GCC anymore, so I don't really see much benefit in maintaining GDC Android support.


-- Johannes

« First   ‹ Prev
1 2