This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Libsanitizer merge from upstream r253555.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Maxim Ostapenko <m dot ostapenko at partner dot samsung dot com>
- Cc: Christophe Lyon <christophe dot lyon at linaro dot org>, Kostya Serebryany <kcc at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Yury Gribov <y dot gribov at samsung dot com>, Vyacheslav Barinov <v dot barinov at samsung dot com>, Slava Garbuzov <v dot garbuzov at samsung dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Tue, 24 Nov 2015 09:25:23 +0100
- Subject: Re: [PATCH 1/2] Libsanitizer merge from upstream r253555.
- Authentication-results: sourceware.org; auth=none
- References: <5652C3E0 dot 4030000 at partner dot samsung dot com> <5652C459 dot 8090500 at partner dot samsung dot com> <20151123080753 dot GS5675 at tucnak dot redhat dot com> <CAKdteOaq_KXy_0OaKk0ePvHjCubRtXzoKi8tNpUK-RD3VxgMAw at mail dot gmail dot com> <565307B5 dot 3000901 at partner dot samsung dot com> <20151123124112 dot GA5675 at tucnak dot redhat dot com> <CAKdteOad+ahiMCvE47RZo5znVUPVTLVDN=SFm_e9Ps_UNY0bvw at mail dot gmail dot com> <565312DE dot 2020207 at partner dot samsung dot com> <20151123132411 dot GB5675 at tucnak dot redhat dot com> <565416E9 dot 3080905 at partner dot samsung dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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