mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
Add configure check for arm64 user_regs_struct.
old glibc defined kernel user_pt_regs, but newer glibc instead define user_regs_struct. Add a configure test to see what we need. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14176
This commit is contained in:
parent
ef4e827246
commit
22bbeba086
16
configure.ac
16
configure.ac
@ -1461,6 +1461,22 @@ AC_LANG(C)
|
||||
|
||||
AM_CONDITIONAL(CXX_CAN_INCLUDE_THREAD_HEADER, test x$ac_cxx_can_include_thread_header = xyes)
|
||||
|
||||
|
||||
# On aarch64 before glibc 2.20 we would get the kernel user_pt_regs instead
|
||||
# of the user_regs_struct from sys/user.h. They are structurally the same
|
||||
# but we get either one or the other.
|
||||
|
||||
AC_CHECK_TYPE([struct user_regs_struct],
|
||||
[sys_user_has_user_regs=yes], [sys_user_has_user_regs=no],
|
||||
[[#include <sys/ptrace.h>]
|
||||
[#include <sys/time.h>]
|
||||
[#include <sys/user.h>]])
|
||||
if test "$sys_user_has_user_regs" = "yes"; then
|
||||
AC_DEFINE(HAVE_SYS_USER_REGS, 1,
|
||||
[Define to 1 if <sys/user.h> defines struct user_regs_struct])
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Checking for supported compiler flags.
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@ -515,7 +515,13 @@ void detach_from_all_threads (pid_t pid)
|
||||
}
|
||||
|
||||
# if defined(VGA_arm64)
|
||||
/* arm64 is extra special, old glibc defined kernel user_pt_regs, but
|
||||
newer glibc instead define user_regs_struct. */
|
||||
# ifdef HAVE_SYS_USER_REGS
|
||||
static struct user_regs_struct user_save;
|
||||
# else
|
||||
static struct user_pt_regs user_save;
|
||||
# endif
|
||||
# else
|
||||
static struct user user_save;
|
||||
# endif
|
||||
@ -783,7 +789,13 @@ Bool invoker_invoke_gdbserver (pid_t pid)
|
||||
long res;
|
||||
Bool stopped;
|
||||
# if defined(VGA_arm64)
|
||||
/* arm64 is extra special, old glibc defined kernel user_pt_regs, but
|
||||
newer glibc instead define user_regs_struct. */
|
||||
# ifdef HAVE_SYS_USER_REGS
|
||||
struct user_regs_struct user_mod;
|
||||
# else
|
||||
struct user_pt_regs user_mod;
|
||||
# endif
|
||||
# else
|
||||
struct user user_mod;
|
||||
# endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user