diff options
Diffstat (limited to 'src/common/android/include')
-rw-r--r-- | src/common/android/include/sys/user.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/common/android/include/sys/user.h b/src/common/android/include/sys/user.h index d41a82cb..05b22ced 100644 --- a/src/common/android/include/sys/user.h +++ b/src/common/android/include/sys/user.h @@ -34,9 +34,11 @@ // glibc) and therefore avoid doing otherwise awkward #ifdefs in the code. // The following quirks are currently handled by this file: // - MIPS: Keep using forked definitions of user.h structs. The definition in -// the NDK is completely different. -// Internal bug b/18097715 +// the NDK is completely different. Internal bug b/18097715 // - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct. +// - x86_64: Override a typo in user_fpregs_struct (mxcsr_mask -> mxcr_mask). +// The typo has been fixed in NDK r10d, but a preprocessor workaround is +// required to make breakpad build with r10c and lower (more details below). // - Other platforms: Just use the Android NDK unchanged. #ifdef __mips__ @@ -113,8 +115,24 @@ struct user_fpregs_struct { #else // __mips__ +// TODO(primiano): remove this after Chromium has stably rolled to NDK r10d. +// Historical context: NDK releases < r10d had a typo in sys/user.h (mxcsr_mask +// instead of mxcr_mask), which is fixed in r10d. However, just switching to use +// the correct one (mxcr_mask) would put Breakpad in a state where it can be +// rolled in chromium only atomically with the r10d NDK. A revert of either +// project (android_tools, breakpad) would make the other one unrollable. +// This hack makes breakpad code compatible with both r10c and r10d NDKs, +// reducing the dependency entangling with android_tools. +#if defined(__x86_64__) +#define mxcsr_mask mxcr_mask +#endif + #include_next <sys/user.h> +#if defined(__x86_64__) +#undef mxcsr_mask +#endif + #ifdef __i386__ #ifdef __cplusplus extern "C" { |