This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] powerpc: Undefine Linux ptrace macros that conflict with __ptrace_request


On Tue, Feb 13, 2018 at 12:01:33PM -0200, Tulio Magno Quites Machado Filho wrote:
> Linux ptrace headers define macros whose tokens conflict with the
> constants of enum __ptrace_request causing build errors when
> asm/ptrace.h or linux/ptrace.h are included before sys/ptrace.h.
> 
> 2018-02-13  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
> 
> 	* sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h: Undefine Linux
> 	macros used in __ptrace_request.
> 
> Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
> ---
>  sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h | 44 ++++++++++++++++++++++++++++
>  1 file changed, 44 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
> index 75567b2..a8af6f7 100644
> --- a/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
> +++ b/sysdeps/unix/sysv/linux/powerpc/sys/ptrace.h
> @@ -24,6 +24,50 @@
>  
>  __BEGIN_DECLS
>  
> +#if defined _LINUX_PTRACE_H || defined _ASM_POWERPC_PTRACE_H
> +/* Do not let Linux headers macros interfere with enum __ptrace_request.  */
> +# undef PTRACE_TRACEME
> +# undef PTRACE_PEEKTEXT
> +# undef PTRACE_PEEKDATA
> +# undef PTRACE_PEEKUSER
> +# undef PTRACE_POKETEXT
> +# undef PTRACE_POKEDATA
> +# undef PTRACE_POKEUSER
> +# undef PTRACE_CONT
> +# undef PTRACE_KILL
> +# undef PTRACE_SINGLESTEP
> +# undef PTRACE_GETREGS
> +# undef PTRACE_SETREGS
> +# undef PTRACE_GETFPREGS
> +# undef PTRACE_SETFPREGS
> +# undef PTRACE_ATTACH
> +# undef PTRACE_DETACH
> +# undef PTRACE_GETVRREGS
> +# undef PTRACE_SETVRREGS
> +# undef PTRACE_GETEVRREGS
> +# undef PTRACE_SETEVRREGS
> +# undef PTRACE_GETREGS64
> +# undef PTRACE_SETREGS64
> +# undef PTRACE_SYSCALL
> +# undef PTRACE_GET_DEBUGREG
> +# undef PTRACE_SET_DEBUGREG
> +# undef PTRACE_GETVSRREGS
> +# undef PTRACE_SETVSRREGS
> +# undef PTRACE_SETOPTIONS
> +# undef PTRACE_GETEVENTMSG
> +# undef PTRACE_GETSIGINFO
> +# undef PTRACE_SETSIGINFO
> +# undef PTRACE_GETREGSET
> +# undef PTRACE_SETREGSET
> +# undef PTRACE_SEIZE
> +# undef PTRACE_INTERRUPT
> +# undef PTRACE_LISTEN
> +# undef PTRACE_PEEKSIGINFO
> +# undef PTRACE_GETSIGMASK
> +# undef PTRACE_SETSIGMASK
> +# undef PTRACE_SECCOMP_GET_FILTER
> +#endif

The list looks fine, except the following:
- PTRACE_PEEKUSER and PTRACE_POKEUSER are not defined by kernel headers
  (they define PTRACE_PEEKUSR and PTRACE_POKEUSR instead) so there is no
  need to #undef them here;
- looks like PTRACE_SINGLEBLOCK should be #undef'ed here and defined
  in "sync sys/ptrace.h with Linux 4.15" patch to

  /* Execute process until next taken branch.  */
  PTRACE_SINGLEBLOCK = 256,
#define PT_STEPBLOCK PTRACE_SINGLEBLOCK


-- 
ldv

Attachment: signature.asc
Description: PGP signature


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