Working LDC iOS (iPhone) on github

David Nadlinger code at klickverbot.at
Sun Feb 16 05:18:44 PST 2014


On 16 Feb 2014, at 13:43, Jacob Carlborg wrote:
> On Saturday, 15 February 2014 at 15:13:07 UTC, David Nadlinger wrote:
>> From an LDC perspective, the best would be to add support for
>> emitting the TLS variables into a bracketed section and inserting
>> runtime calls to access them directly to LLVM; then none of the LDC
>> code (resp. the generated LLVM IR) would actually have to change.
>
> At least DMD had some problems with bracketed sections with the
> linker. DMD doesn't use bracketed sections anymore. Why do you need
> bracketed sections? At least OS X has API's available to access a
> specific sections.

Sorry, yes, I just intended to write "special section".

But as a side note, Darwin's dyld is more or less alone in offering
that functionality. On other OSes, DMD still uses bracketed sections
for various tasks.

> Would it be possible to output OS X native TLS for iOS? Does LLVM
> allow that? If that's possible we could experiment with adding the TLS
> code from the dynamic linker to druntime and see what happens.
> Theoretically it should work. It don't think the dynamic linker does
> anything that a regular application can't do.

I was thinking about that as well, yes. In theory, it should be
possible to adapt the code in LLVM without too much of a hassle (I
don't think there would be any problems with x86-specific relocations
or so), but as I said, I haven't looked into how the TLS sections are
emitted when writing to Mach-O at all.

Another thing to keep in mind would be that we probably can't use some
of the APIs due to App Store restrictions…

David



More information about the digitalmars-d-ldc mailing list