[PATCH] [sanitizer] Fix kThreadDescriptorSize for glibc <= 2.11.

Sergey Matveev earthdok at google.com
Mon Jun 3 02:48:00 PDT 2013


    - Use __GNUC_PREREQ

Hi glider, kcc,

http://llvm-reviews.chandlerc.com/D907

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D907?vs=2227&id=2229#toc

BRANCH
  fix/sanitizer/descr_size

ARCANIST PROJECT
  compiler-rt

Files:
  lib/sanitizer_common/sanitizer_linux_libcdep.cc

Index: lib/sanitizer_common/sanitizer_linux_libcdep.cc
===================================================================
--- lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -195,7 +195,13 @@
 
 #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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D907.2.patch
Type: text/x-patch
Size: 725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130603/36638555/attachment.bin>


More information about the llvm-commits mailing list