[sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.

Address issue reported by Greg Fitzgerald.

llvm-svn: 183098
This commit is contained in:
Sergey Matveev 2013-06-03 10:20:23 +00:00
parent 8050395236
commit 3786ae5c54
1 changed files with 6 additions and 0 deletions

View File

@ -195,7 +195,13 @@ uptr GetTlsSize() {
#if defined(__x86_64__) || defined(__i386__)
// sizeof(struct thread) from glibc.
// There has been a report of this being different on glibc 2.11. We don't know
// when this change happened, so 2.12 is a conservative estimate.
#if __GNUC_PREREQ(2, 12)
const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1216, 2304);
#else
const uptr kThreadDescriptorSize = FIRST_32_SECOND_64(1168, 2304);
#endif
uptr ThreadDescriptorSize() {
return kThreadDescriptorSize;