On 24/11/15 11:25, Jakub Jelinek wrote:
On Tue, Nov 24, 2015 at 10:51:05AM +0300, Maxim Ostapenko wrote:
Ok, I posted a fix to upstream (http://reviews.llvm.org/D14921) yesterday,
but it's still not reviewed. So, I'm wondering if I should fix the issue
locally?
Attaching proposed fix following Jakub's suggestion.

Christophe could you try the patch?
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index b97fc7d..c392c57 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-24  Maxim Ostapenko  <m.ostape...@partner.samsung.com>
+
+       * include/system/linux/asm/ptrace.h: New header.
+
  2015-11-23  Maxim Ostapenko  <m.ostape...@partner.samsung.com>
* All source files: Merge from upstream r253555.
diff --git a/libsanitizer/include/system/linux/asm/ptrace.h 
b/libsanitizer/include/system/linux/asm/ptrace.h
new file mode 100644
index 0000000..dbdd58b
--- /dev/null
+++ b/libsanitizer/include/system/linux/asm/ptrace.h
@@ -0,0 +1,8 @@
+#include_next <linux/asm/ptrace.h>
+#if defined(__arm__)
+#ifndef ARM_VFPREGS_SIZE
+/* The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
+   and core dumps.  */
+#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
+#endif
+#endif
You could have just used #if defined(__arm__) && !defined(ARM_VFPREGS_SIZE)
or #ifdef __arm__
or #if !defined(ARM_VFPREGS_SIZE).
Mixing if defined with ifndef on the next line is just weird.
And, you should mention which kernel version introduced ARM_VFPREGS_SIZE
macro (I believe it was 2011-ish, but have not checked exact kernel
version).

        Jakub
Ok, does it look better now?

-Maxim
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index b97fc7d..c392c57 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,7 @@
+2015-11-24  Maxim Ostapenko  <m.ostape...@partner.samsung.com>
+
+	* include/system/linux/asm/ptrace.h: New header.
+
 2015-11-23  Maxim Ostapenko  <m.ostape...@partner.samsung.com>
 
 	* All source files: Merge from upstream r253555.
diff --git a/libsanitizer/include/system/linux/asm/ptrace.h b/libsanitizer/include/system/linux/asm/ptrace.h
new file mode 100644
index 0000000..d4249fe
--- /dev/null
+++ b/libsanitizer/include/system/linux/asm/ptrace.h
@@ -0,0 +1,7 @@
+#include_next <linux/asm/ptrace.h>
+/* ARM_VFPREGS_SIZE has been added in 3.0 */
+#if defined(__arm__) && !defined(ARM_VFPREGS_SIZE)
+/* The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
+   and core dumps.  */
+#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
+#endif

Reply via email to