Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature test for thread_local on Clang for TLS #1883

Merged
merged 1 commit into from Dec 3, 2015

Conversation

zao
Copy link
Contributor

@zao zao commented Nov 27, 2015

Clang has __has_feature which can be used to query for whether
thread_local exists. As clang with libc++ isn't covered by the
existing thread_specific_ptr cases, this adds support for TLS
on this combination of compiler and runtime.

This should resolve the issues in issue #1880.

Clang has __has_feature which can be used to query for whether
thread_local exists. As clang with libc++ isn't covered by the
existing thread_specific_ptr cases, this adds support for TLS
on this combination of compiler and runtime.
@hkaiser hkaiser added this to the 0.9.12 milestone Nov 28, 2015
@hkaiser
Copy link
Member

hkaiser commented Nov 28, 2015

Is there really a guarantee that any system implementing thread_local also exposes __has_feature(cxx_thread_local)?

@zao
Copy link
Contributor Author

zao commented Nov 28, 2015

The existing fallback cases will still be there for implementations that do lack __has_feature or the feature cxx_thread_local.

The documentation I consulted for this change is http://llvm.org/releases/3.3/tools/clang/docs/LanguageExtensions.html#c-11-thread-local which claims that if the feature is present, the Clang compiler in the current configuration implements thread_local.

As for widespread compiler support for __has_feature, I'm not aware of any compiler that implements the Clang-sourced feature detection macro. GCC has a feature request open since 2014 but seem to have been sidetracked by the SD6 initiative.

@hkaiser
Copy link
Member

hkaiser commented Nov 28, 2015

LGTM, thanks!

hkaiser added a commit that referenced this pull request Dec 3, 2015
Add feature test for thread_local on Clang for TLS
@hkaiser hkaiser merged commit 7c70f2a into STEllAR-GROUP:master Dec 3, 2015
hkaiser added a commit that referenced this pull request Dec 3, 2015
This reverts commit 7c70f2a, reversing
changes made to 1579364.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants