[PATCH 3/4] Move SUPPORTED_PERSONALITIES to separate file

Dmitry V. Levin ldv at altlinux.org
Mon Aug 21 18:09:53 UTC 2017


On Mon, Aug 21, 2017 at 03:06:58AM +0300, Edgar Kaziakhmedov wrote:
> Since the defs.h contains unrelated set of functions which are
> redundant(and parhaps conflicting) for other binaries included in
> the strace package, part with quantifying the SUPPORTED_PERSONALITIES
> definition should be in separate file.
> 
> defs.h: Include "supported_personalities.h".
> (SUPPORTED_PERSONALITIES): Move ...
> supported_personalities.h: ... to the new file.
> Makefile.am(strace_SOURCES): Add it.
> 
> Signed-off-by: Edgar Kaziakhmedov <edgar.kaziakhmedov at virtuozzo.com>
> ---
>  Makefile.am               |  1 +
>  defs.h                    | 22 +------------------
>  supported_personalities.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 58 insertions(+), 21 deletions(-)
>  create mode 100644 supported_personalities.h
> 
> diff --git a/Makefile.am b/Makefile.am
> index 53115cd5..fefd3d29 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -286,6 +286,7 @@ strace_SOURCES =	\
>  	strace.c	\
>  	string_to_uint.h \
>  	string_to_uint.c \
> +	supported_personalities.h \
>  	swapon.c	\
>  	syscall.c	\
>  	sysctl.c	\
> diff --git a/defs.h b/defs.h
> index 9aba72ff..71a0e473 100644
> --- a/defs.h
> +++ b/defs.h
> @@ -60,6 +60,7 @@
>  #include "macros.h"
>  #include "mpers_type.h"
>  #include "string_to_uint.h"
> +#include "supported_personalities.h"
>  #include "sysent.h"
>  #include "xmalloc.h"
>  
> @@ -138,27 +139,6 @@ extern char *stpcpy(char *dst, const char *src);
>  # define ERESTART_RESTARTBLOCK 516
>  #endif
>  
> -#if defined X86_64
> -# define SUPPORTED_PERSONALITIES 3
> -# define PERSONALITY2_WORDSIZE  4
> -# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE
> -#elif defined AARCH64 \
> -   || defined POWERPC64 \
> -   || defined RISCV \
> -   || defined SPARC64 \
> -   || defined TILE \
> -   || defined X32
> -# define SUPPORTED_PERSONALITIES 2
> -#else
> -# define SUPPORTED_PERSONALITIES 1
> -#endif
> -
> -#if defined TILE && defined __tilepro__
> -# define DEFAULT_PERSONALITY 1
> -#else
> -# define DEFAULT_PERSONALITY 0
> -#endif
> -
>  #define PERSONALITY0_WORDSIZE  SIZEOF_LONG
>  #define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T
>  #define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"

This patch moves PERSONALITY2_WORDSIZE and PERSONALITY2_KLONGSIZE to
a separate heeader while PERSONALITY1_WORDSIZE/PERSONALITY1_KLONGSIZE
and PERSONALITY0_WORDSIZE/PERSONALITY0_KLONGSIZE are left in defs.h;
this is inconsistent.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20170821/bea846dd/attachment.bin>


More information about the Strace-devel mailing list