This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Libsanitizer merge from upstream r253555.


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.ostapenko@partner.samsung.com>
> +
> +	* include/system/linux/asm/ptrace.h: New header.
> +
>  2015-11-23  Maxim Ostapenko  <m.ostapenko@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]