Move definition of personality macros to arch_defs_.h

* supported_personalities.h: Remove.
* defs.h: Do not include it.
* linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New
macro.
[!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise.
* linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro.
* linux/riscv/arch_defs_.h: Likewise.
* linux/s390x/arch_defs_.h: Likewise.
* linux/sparc64/arch_defs_.h: Likewise.
* linux/x32/arch_defs_.h: Likewise.
* linux/x86_64/arch_defs_.h: Likewise.
* linux/powerpc64/arch_defs_.h: New file.
* linux/tile/arch_defs_.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
(strace_SOURCES): Remove supported_personalities.h.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
This commit is contained in:
Eugene Syromyatnikov 2018-01-20 04:51:29 +01:00 committed by Dmitry V. Levin
parent bf23036873
commit ac8241cd4f
12 changed files with 22 additions and 53 deletions

View File

@ -294,7 +294,6 @@ strace_SOURCES = \
strace.c \
string_to_uint.h \
string_to_uint.c \
supported_personalities.h \
swapon.c \
syscall.c \
sysctl.c \
@ -658,6 +657,7 @@ EXTRA_DIST = \
linux/powerpc/set_scno.c \
linux/powerpc/syscallent.h \
linux/powerpc/userent.h \
linux/powerpc64/arch_defs_.h \
linux/powerpc64/arch_regs.c \
linux/powerpc64/arch_regs.h \
linux/powerpc64/arch_rt_sigframe.c\
@ -812,6 +812,7 @@ EXTRA_DIST = \
linux/sparc64/userent.h \
linux/subcall.h \
linux/syscall.h \
linux/tile/arch_defs_.h \
linux/tile/arch_regs.c \
linux/tile/arch_regs.h \
linux/tile/arch_rt_sigframe.c \

1
defs.h
View File

@ -60,7 +60,6 @@
#include "macros.h"
#include "mpers_type.h"
#include "string_to_uint.h"
#include "supported_personalities.h"
#include "sysent.h"
#include "xmalloc.h"

View File

@ -1,2 +1,3 @@
#define HAVE_ARCH_OLD_MMAP 1
#define HAVE_ARCH_UID16_SYSCALLS 1
#define SUPPORTED_PERSONALITIES 2

View File

@ -15,3 +15,11 @@
#ifndef HAVE_ARCH_UID16_SYSCALLS
# define HAVE_ARCH_UID16_SYSCALLS 0
#endif
#ifndef DEFAULT_PERSONALITY
# define DEFAULT_PERSONALITY 0
#endif
#ifndef SUPPORTED_PERSONALITIES
# define SUPPORTED_PERSONALITIES 1
#endif

View File

@ -0,0 +1 @@
#define SUPPORTED_PERSONALITIES 2

View File

@ -1 +1,2 @@
#define HAVE_ARCH_UID16_SYSCALLS 1
#define SUPPORTED_PERSONALITIES 2

View File

@ -1,3 +1,4 @@
#define HAVE_ARCH_OLD_MMAP 1
#define HAVE_ARCH_OLD_MMAP_PGOFF 1
#define HAVE_ARCH_UID16_SYSCALLS 1
#define SUPPORTED_PERSONALITIES 2

View File

@ -1,3 +1,4 @@
#define HAVE_ARCH_GETRVAL2 1
#define HAVE_ARCH_UID16_SYSCALLS 1
#define HAVE_ARCH_SA_RESTORER 1
#define SUPPORTED_PERSONALITIES 2

5
linux/tile/arch_defs_.h Normal file
View File

@ -0,0 +1,5 @@
#define SUPPORTED_PERSONALITIES 2
#ifdef __tilepro__
# define DEFAULT_PERSONALITY 1
#endif

View File

@ -1,2 +1,3 @@
#define HAVE_ARCH_OLD_MMAP 1
#define HAVE_ARCH_UID16_SYSCALLS 1
#define SUPPORTED_PERSONALITIES 2

View File

@ -1,2 +1,3 @@
#define HAVE_ARCH_OLD_MMAP 1
#define HAVE_ARCH_UID16_SYSCALLS 1
#define SUPPORTED_PERSONALITIES 3

View File

@ -1,51 +0,0 @@
/*
* Copyright (c) 2001-2017 The strace developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STRACE_SUPPORTED_PERSONALITIES_H
#define STRACE_SUPPORTED_PERSONALITIES_H
#if defined X86_64
# define SUPPORTED_PERSONALITIES 3
#elif defined AARCH64 \
|| defined POWERPC64 \
|| defined RISCV \
|| defined S390X \
|| 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
#endif /* !STRACE_SUPPORTED_PERSONALITIES_H */