llvm / clang and thread_local storage problems

Ken Cunningham ken.cunningham.webuse at gmail.com
Sat Oct 8 23:06:55 PDT 2016

On 2016-10-08, at 10:03 PM, Stephen J. Butler wrote:

> FYI, it's in the Xcode 8 release notes:
> https://developer.apple.com/library/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
> I did a quick test file and it seems to compile with Apple clang. No clue on compatibility issues though.


> Thanks for finding and sharing that information. It sounds like you could get TLS by using MacPorts clang instead of Xcode clang, but that it will be incompatible with whatever TLS implementation Apple eventually creates.

I had hoped it would be in the macports-clang-3.7 build I'm using, but it seems to error out.

However, I noticed this bit in the the libcxxabi port 


#ifdef __linux__
// Linux TLS support. Not yet an official part of the Itanium ABI.
// https://sourceware.org/glibc/wiki/Destructor%20support%20for%20thread_local%20variables
extern int __cxa_thread_atexit(void (*)(void *), void *, void *) throw();

and - if I open up that guard, it actually builds cleanly on MacOSX.

I wonder if TLS support was just disabled on all but Linux...perhaps I'll try installing this new version I just built and see what happens. --- after I back everything up :>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20161008/3233071a/attachment.html>

More information about the macports-dev mailing list