From 05bbf1b0d31cdeb8ac3c439fda261acb146cfe8d Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 25 Sep 2018 12:59:05 -0700
Subject: [PATCH] chromium: musl: elf_reader.cc: include <sys/reg.h> to get
 __WORDSIZE on musl libc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 chromium/third_party/breakpad/breakpad/configure.ac             | 2 +-
 .../breakpad/breakpad/src/common/dwarf/elf_reader.cc            | 2 ++
 .../breakpad/breakpad/src/common/linux/elf_core_dump.h          | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/chromium/third_party/breakpad/breakpad/configure.ac b/chromium/third_party/breakpad/breakpad/configure.ac
index 08513687f34..13745540a5e 100644
--- a/chromium/third_party/breakpad/breakpad/configure.ac
+++ b/chromium/third_party/breakpad/breakpad/configure.ac
@@ -72,7 +72,7 @@ AC_ARG_ENABLE(m32,
 AC_HEADER_STDC
 AC_SYS_LARGEFILE
 AX_PTHREAD
-AC_CHECK_HEADERS([a.out.h sys/random.h])
+AC_CHECK_HEADERS([a.out.h sys/random.h sys/reg.h])
 AC_CHECK_FUNCS([arc4random getcontext getrandom])
 AM_CONDITIONAL([HAVE_GETCONTEXT], [test "x$ac_cv_func_getcontext" = xyes])
 
diff --git a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
index bbfdba68093..d7d5dcf0e92 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
+++ b/chromium/third_party/breakpad/breakpad/src/common/dwarf/elf_reader.cc
@@ -30,6 +30,8 @@
 #define _GNU_SOURCE  // needed for pread()
 #endif
 
+#include <config.h>
+#include <sys/reg.h>
 #include <fcntl.h>
 #include <limits.h>
 #include <string.h>
diff --git a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
index 6e153745dba..5cd2c6fcb23 100644
--- a/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
+++ b/chromium/third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h
@@ -33,6 +33,7 @@
 #ifndef COMMON_LINUX_ELF_CORE_DUMP_H_
 #define COMMON_LINUX_ELF_CORE_DUMP_H_
 
+#include <sys/reg.h>
 #include <elf.h>
 #include <limits.h>
 #include <link.h>
