[compiler-rt] r183098 - [sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.

Sergey Matveev earthdok at google.com
Mon Jun 3 03:20:23 PDT 2013


Author: smatveev
Date: Mon Jun  3 05:20:23 2013
New Revision: 183098

URL: http://llvm.org/viewvc/llvm-project?rev=183098&view=rev
Log:
[sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.

Address issue reported by Greg Fitzgerald.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc?rev=183098&r1=183097&r2=183098&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux_libcdep.cc Mon Jun  3 05:20:23 2013
@@ -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;





More information about the llvm-commits mailing list