Skip to content

Commit

Permalink
[sanitizer] Don't include <linux/user.h> in sanitizer_stoptheworld_li…
Browse files Browse the repository at this point in the history
…nux_libcdep.cc on ARM Android

Turned out that adding defined(_arm_) in sanitizer_stoptheworld_linux_libcdep.cc breaks android arm with some toolchains.

.../llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:36:11: fatal error:
      'linux/user.h' file not found
# include <linux/user.h>  // for pt_regs
          ^
1 error generated.

Context:
#if SANITIZER_ANDROID && defined(__arm__)
# include <linux/user.h>  // for pt_regs
#else

This patch removes corresponding #if SANITIZER_ANDROID && defined(__arm__) and a bit rearranges adjacent сode.

Differential Revision: https://reviews.llvm.org/D32128

llvm-svn: 300531
  • Loading branch information
chefmax7 committed Apr 18, 2017
1 parent 133a720 commit 3546060
Showing 1 changed file with 6 additions and 10 deletions.
Expand Up @@ -32,17 +32,13 @@
#include <sys/types.h> // for pid_t
#include <sys/uio.h> // for iovec
#include <elf.h> // for NT_PRSTATUS
#if SANITIZER_ANDROID && defined(__arm__)
# include <linux/user.h> // for pt_regs
#else
# ifdef __aarch64__
#if defined(__aarch64__) && !SANITIZER_ANDROID
// GLIBC 2.20+ sys/user does not include asm/ptrace.h
# include <asm/ptrace.h>
# endif
# include <sys/user.h> // for user_regs_struct
# if SANITIZER_ANDROID && SANITIZER_MIPS
# include <asm/reg.h> // for mips SP register in sys/user.h
# endif
# include <asm/ptrace.h>
#endif
#include <sys/user.h> // for user_regs_struct
#if SANITIZER_ANDROID && SANITIZER_MIPS
# include <asm/reg.h> // for mips SP register in sys/user.h
#endif
#include <sys/wait.h> // for signal-related stuff

Expand Down

0 comments on commit 3546060

Please sign in to comment.