Commit c2d97732 authored by Jeremy Apthorp's avatar Jeremy Apthorp Committed by Commit Bot

fix backup includes for PTRACE_GET_THREAD_AREA on arm/arm64

<asm/ptrace-abi.h> doesn't exist in the arm sysroots, and <sys/ptrace.h>
defines PTRACE_GET_THREAD_AREA as an enum, not a #define:

  /* Get the thread pointer of a process.  */
  PTRACE_GET_THREAD_AREA = 22,

On aarch64, neither PT_GET_THREAD_AREA nor PTRACE_GET_THREAD_AREA are defined.

This changes the include trigger to check for !arm && !aarch64 as well as
defined(PTRACE_GET_THREAD_AREA) to catch the arm and aarch64 cases.

Change-Id: I9044d9f315cbb15011f397a06d03d4bec7396985
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1496448Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637905}
parent ff71f092
......@@ -34,12 +34,14 @@
#if !defined(OS_NACL_NONSFI)
#include <sys/ioctl.h>
#include <sys/ptrace.h>
#if !defined(PTRACE_GET_THREAD_AREA) && defined(OS_LINUX) && \
!defined(OS_CHROMEOS)
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && !defined(__arm__) && \
!defined(__aarch64__) && !defined(PTRACE_GET_THREAD_AREA)
// Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
// the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
// asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't
// defined on aarch64, so don't try to include this on those platforms.
#include <asm/ptrace-abi.h>
#endif // !PTRACE_GET_THREAD_AREA && OS_LINUX && !OS_CHROMEOS
#endif
#endif // !OS_NACL_NONSFI
#if defined(OS_ANDROID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment