ldc icon indicating copy to clipboard operation
ldc copied to clipboard

druntime: Simplify & somewhat accelerate getTLSRange() on Darwin

Open kinke opened this issue 2 years ago • 5 comments

kinke avatar Mar 12 '22 15:03 kinke

If this works, the shared libs support for macOS should be upstreamable without requiring DMD compiler changes. FYI @jacob-carlborg.

kinke avatar Mar 12 '22 15:03 kinke

A PITA without being able to test locally. Maybe the TLS block incl. TLVDescriptor are lazily allocated, so that it was with the previous getTLSAnchor() call but now isn't anymore (or rather, too late).

kinke avatar Mar 12 '22 16:03 kinke

If this works, the shared libs support for macOS should be upstreamable without requiring DMD compiler changes

Even though this change won't require DMD compiler changes, this change will not make dynamic libraries with DMD, right?

jacob-carlborg avatar Mar 13 '22 19:03 jacob-carlborg

A PITA without being able to test locally.

I recommend setting up a VM with macOS. Here's some instructions: https://gist.github.com/MartinNowak/8156507.

jacob-carlborg avatar Mar 13 '22 19:03 jacob-carlborg

this change will not make dynamic libraries with DMD, right?

Not alone; the according rt.sections_elf_shared modifications would need to be upstreamed of course, but that should be almost it. Perhaps still requires a tiny DMD adaptation to emit the CompilerDSOData struct and d_dso_register calls as on Linux, the only difference being a different mangle for the bracketing symbols, but at least no extra getTLSAnchor() function + TLS global in each object file anymore.

I recommend setting up a VM with macOS.

If I really wanted to I'd have one, but I don't and definitely don't plan to.

kinke avatar Mar 13 '22 21:03 kinke