iOS progress

Dan Olson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Mon Feb 16 08:28:38 PST 2015


Jacob Carlborg <doob at me.com> writes:

> On 2015-02-15 20:19, Dan Olson wrote:
>
>> For iOS, TLS is working fine with the modification I made to LLVM last
>> spring.  Newer arm64 devices are supposed to natively support TLS, but I
>> don't have an arm64 device yet.  The iphonesim ironically does not
>> support TLS because of a check in ld to make sure TLS doesn't slip in.
>> Obviously it could support it.  I have ideas of how to get around the
>> check.
>
> I had a look at the TLS commits as well. Is iOS using the
> "__tls_get_addr" symbol? On OS X "tlv_get_addr" is used.

Hi Jacob!  Yes, tlv_get_addr is used, but indirectly.  When I modified
LLVM, I had it emit a call to __tls_get_addr instead of to the thunk
which is initialized to tlv_get_addr.  It gave me a hook to work with
until I felt TLS was working, and so far it appears to be working.  My
__tls_get_addr just verifies the thunk and then calls tlv_get_addr().

https://github.com/smolt/iphoneos-apple-support/blob/master/threadLocalVariables.c#L487

It could be changed here,

https://github.com/smolt/llvm/blob/ios/lib/Target/ARM/ARMISelLowering.cpp#L2473

but I would need some help creating the correct LLVM code.


More information about the digitalmars-d-ldc mailing list