bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Patch: Fix OS X PowerPC support


From: Bruno Haible
Subject: Re: Patch: Fix OS X PowerPC support
Date: Fri, 10 Nov 2023 00:48:51 +0100

Sevan Janiyan wrote:
> @@ -676,11 +678,21 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
>  
>  # elif defined __powerpc__
>  
> +#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
>  /* See the definitions of
>       - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_structs.h>,
>       - 'struct __darwin_mcontext' in <ppc/_structs.h>, and
>       - 'struct __darwin_ppc_thread_state' in <mach/ppc/_structs.h>.  */
>  #  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) 
> ucp)->uc_mcontext->__ss.__r1
> +#endif
> +
> +#if MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_4
> +/* See the definitions of
> +     - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types.h>,
> +     - 'struct __darwin_mcontext' in <ppc/ucontext.h>, and
> +     - 'struct __darwin_ppc_thread_state' in <mach/ppc/_types.h>.  */
> +#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) 
> ucp)->uc_mcontext->ss.r1
> +#endif
>  
>  # endif
 
The patch tests MAC_OS_X_VERSION_MIN_REQUIRED in one place and
MAC_OS_X_VERSION_MAX_ALLOWED in the other place. What if someone compiles
for a range that includes both 10.4 and 10.5? That is,
  MAC_OS_X_VERSION_MIN_REQUIRED is MAC_OS_X_VERSION_10_4
and
  MAC_OS_X_VERSION_MAX_ALLOWED is MAC_OS_X_VERSION_10_5 or larger.
Then your patch will not define SIGSEGV_FAULT_STACKPOINTER.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]