Re: Getting tls symbols out of the compiler.

2013-06-02 Thread Jacob Carlborg
On 2013-06-01 11:53, David Nadlinger wrote: Yep. It's a bit cumbersome to handle, though, as it relies on Blocks support: https://github.com/ldc-developers/druntime/blob/2c78290fff65f2fce763da4b077856a2fc7596fb/src/ldc/osx_tls.c#L36 Oh, I didn't noticed it used blocks. -- /Jacob Carlborg

Re: Getting tls symbols out of the compiler.

2013-06-01 Thread David Nadlinger
On Friday, 31 May 2013 at 07:58:25 UTC, Jacob Carlborg wrote: void dyld_enumerate_tlv_storage(dyld_tlv_state_change_handler handler) If I recall correctly, LDC is using "dyld_enumerate_tlv_storage". Yep. It's a bit cumbersome to handle, though, as it relies on Blocks support: https://gith

Re: Getting tls symbols out of the compiler.

2013-05-31 Thread Johannes Pfau
Am Fri, 31 May 2013 09:42:10 +0200 schrieb Jacob Carlborg : > On 2013-05-30 12:13, Johannes Pfau wrote: > > > AFAIK he also changed how TLS sections are looked up for the main > > executable. _tlsstart and _tlsend are not used anymore. Instead some > > mainly undocumented obscure glibc interface

Re: Getting tls symbols out of the compiler.

2013-05-31 Thread Jacob Carlborg
On 2013-05-30 11:42, Iain Buclaw wrote: It's the same problem with what we currently have. LD when it gets all reference symbols that are to go into the tls section (for Linux, at least) has the right to reorder the symbols. As such, trying to push _tlsstart as the first symbol in the compiler

Re: Getting tls symbols out of the compiler.

2013-05-31 Thread Jacob Carlborg
On 2013-05-30 12:13, Johannes Pfau wrote: AFAIK he also changed how TLS sections are looked up for the main executable. _tlsstart and _tlsend are not used anymore. Instead some mainly undocumented obscure glibc interface is used to ask the runtime linker for the start and end of the TLS section.

Re: Getting tls symbols out of the compiler.

2013-05-30 Thread Iain Buclaw
On 30 May 2013 11:13, Johannes Pfau wrote: > Am Thu, 30 May 2013 10:42:17 +0100 > schrieb Iain Buclaw : > >> >> This is more of a lazy init that won't affect start-up speed. Note: >> this idea is based off what C++ (g++) does for say - static A a = new >> A(); >> > > I see. > >> >> I don't think

Re: Getting tls symbols out of the compiler.

2013-05-30 Thread Iain Buclaw
On 30 May 2013 11:13, Johannes Pfau wrote: > Am Thu, 30 May 2013 10:42:17 +0100 > schrieb Iain Buclaw : > >> >> This is more of a lazy init that won't affect start-up speed. Note: >> this idea is based off what C++ (g++) does for say - static A a = new >> A(); >> > > I see. > >> >> I don't think

Re: Getting tls symbols out of the compiler.

2013-05-30 Thread Johannes Pfau
Am Thu, 30 May 2013 10:42:17 +0100 schrieb Iain Buclaw : > > This is more of a lazy init that won't affect start-up speed. Note: > this idea is based off what C++ (g++) does for say - static A a = new > A(); > I see. > > I don't think it would have much slow down. Albeit the first > initial

Re: Getting tls symbols out of the compiler.

2013-05-30 Thread Iain Buclaw
On 30 May 2013 09:25, Johannes Pfau wrote: > Am Thu, 30 May 2013 01:19:10 +0200 > schrieb "Iain Buclaw" : > >> OK, from today till the end of the week I'm going to be sitting >> down and thinking through this, as I'd really like the emitting >> of _tlsstart and _tlsend out of the compiler by hook

Re: Getting tls symbols out of the compiler.

2013-05-30 Thread Johannes Pfau
Am Thu, 30 May 2013 01:19:10 +0200 schrieb "Iain Buclaw" : > OK, from today till the end of the week I'm going to be sitting > down and thinking through this, as I'd really like the emitting > of _tlsstart and _tlsend out of the compiler by hook or by crook. > > > Phase one - start: > > We ha