From 803da36ae893e90b2c8bb33da660ff3ab020f9a7 Mon Sep 17 00:00:00 2001 From: "Sascha Kuehndel (InuSasha)" Date: Thu, 14 Dec 2017 16:48:20 +0100 Subject: [PATCH] chromium: fix build with newer gcc/glibc --- packages/addons/browser/chromium/package.mk | 23 +- .../chromium-0005-define-toolchains.patch | 48 ++++ .../chromium-0005-use-toolchain-prefix.patch | 22 -- .../patches/chromium-0006-gn_fix.patch | 10 + ...hromium-0008-fix-ucontext-from-glibc.patch | 225 ++++++++++++++++++ .../chromium-0009-fix-blink-gcc7.patch | 77 ++++++ .../patches/chromium-0010-fix-v8-gcc7.patch | 74 ++++++ 7 files changed, 452 insertions(+), 27 deletions(-) create mode 100644 packages/addons/browser/chromium/patches/chromium-0005-define-toolchains.patch delete mode 100644 packages/addons/browser/chromium/patches/chromium-0005-use-toolchain-prefix.patch create mode 100644 packages/addons/browser/chromium/patches/chromium-0006-gn_fix.patch create mode 100644 packages/addons/browser/chromium/patches/chromium-0008-fix-ucontext-from-glibc.patch create mode 100644 packages/addons/browser/chromium/patches/chromium-0009-fix-blink-gcc7.patch create mode 100644 packages/addons/browser/chromium/patches/chromium-0010-fix-v8-gcc7.patch diff --git a/packages/addons/browser/chromium/package.mk b/packages/addons/browser/chromium/package.mk index cf74b9609d..5318a8d02d 100644 --- a/packages/addons/browser/chromium/package.mk +++ b/packages/addons/browser/chromium/package.mk @@ -26,7 +26,8 @@ PKG_ARCH="x86_64" PKG_LICENSE="Mixed" PKG_SITE="http://www.chromium.org/Home" PKG_URL="https://commondatastorage.googleapis.com/chromium-browser-official/$PKG_NAME-$PKG_VERSION.tar.xz" -PKG_DEPENDS_TARGET="toolchain pciutils dbus libXcomposite libXcursor libXtst alsa-lib bzip2 yasm nss libXScrnSaver libexif ninja:host libpng harfbuzz atk gtk+ libva-vdpau-driver unclutter xdotool" +PKG_DEPENDS_HOST="toolchain" +PKG_DEPENDS_TARGET="chromium:host pciutils dbus libXcomposite libXcursor libXtst alsa-lib bzip2 yasm nss libXScrnSaver libexif ninja:host libpng harfbuzz atk gtk+ libva-vdpau-driver unclutter xdotool" PKG_SECTION="browser" PKG_SHORTDESC="Chromium Browser: the open-source web browser from Google" PKG_LONGDESC="Chromium Browser ($PKG_VERSION): the open-source web browser from Google" @@ -37,6 +38,19 @@ PKG_ADDON_NAME="Chromium" PKG_ADDON_TYPE="xbmc.python.script" PKG_ADDON_PROVIDES="executable" +post_patch() { + # Use Python 2 + find $(get_build_dir chromium) -name '*.py' -exec sed -i -r "s|/usr/bin/python$|$TOOLCHAIN/bin/python|g" {} + +} + +make_host() { + ./tools/gn/bootstrap/bootstrap.py --no-rebuild --no-clean --verbose +} + +makeinstall_host() { + : +} + pre_make_target() { strip_lto @@ -47,9 +61,6 @@ make_target() { export LDFLAGS="$LDFLAGS -ludev" export LD=$CXX - # Use Python 2 - find . -name '*.py' -exec sed -i -r "s|/usr/bin/python$|$TOOLCHAIN/bin/python|g" {} + - # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) # Note: These are for OpenELEC use ONLY. For your own distribution, please # get your own set of keys. @@ -59,6 +70,7 @@ make_target() { _google_default_client_secret=9TJlhL661hvShQub4cWhANXa local _flags=( + "host_toolchain=\"//build/toolchain/linux:x64_host\"" 'is_clang=false' 'clang_use_chrome_plugins=false' 'symbol_level=0' @@ -80,11 +92,13 @@ make_target() { 'use_kerberos=false' 'use_pulseaudio=false' 'use_sysroot=true' + 'use_vulcanize=false' "target_sysroot=\"${SYSROOT_PREFIX}\"" 'enable_hangout_services_extension=true' 'enable_widevine=true' 'enable_nacl=false' 'enable_nacl_nonsfi=false' + 'enable_swiftshader=false' "google_api_key=\"${_google_api_key}\"" "google_default_client_id=\"${_google_default_client_id}\"" "google_default_client_secret=\"${_google_default_client_secret}\"" @@ -114,7 +128,6 @@ make_target() { ./build/linux/unbundle/replace_gn_files.py --system-libraries "${_system_libs}" ./third_party/libaddressinput/chromium/tools/update-strings.py - ./tools/gn/bootstrap/bootstrap.py --gn-gen-args "${_flags[*]}" ./out/Release/gn gen out/Release --args="${_flags[*]}" --script-executable=$TOOLCHAIN/bin/python ninja -j${CONCURRENCY_MAKE_LEVEL} -C out/Release chrome chrome_sandbox widevinecdmadapter diff --git a/packages/addons/browser/chromium/patches/chromium-0005-define-toolchains.patch b/packages/addons/browser/chromium/patches/chromium-0005-define-toolchains.patch new file mode 100644 index 0000000000..b512277a4f --- /dev/null +++ b/packages/addons/browser/chromium/patches/chromium-0005-define-toolchains.patch @@ -0,0 +1,48 @@ +--- a/build/toolchain/linux/BUILD.gn 2017-08-30 14:08:06.342205027 +0200 ++++ b/build/toolchain/linux/BUILD.gn 2017-08-30 14:15:18.648503216 +0200 +@@ -129,12 +129,13 @@ + } + + gcc_toolchain("x64") { +- cc = "gcc" +- cxx = "g++" ++ toolchainprefix = "x86_64-libreelec-linux-gnu-" ++ cc = "${toolchainprefix}gcc" ++ cxx = "${toolchainprefix}g++" + +- readelf = "readelf" +- nm = "nm" +- ar = "ar" ++ readelf = "${toolchainprefix}readelf" ++ nm = "${toolchainprefix}nm" ++ ar = "${toolchainprefix}ar" + ld = cxx + + # Output linker map files for binary size analysis. +@@ -147,6 +148,26 @@ + } + } + ++gcc_toolchain("x64_host") { ++ toolchainprefix = "host-" ++ cc = "${toolchainprefix}gcc" ++ cxx = "${toolchainprefix}g++" ++ ++ readelf = "readelf" ++ nm = "nm" ++ ar = "ar" ++ ld = cxx ++ ++ # Output linker map files for binary size analysis. ++ enable_linker_map = true ++ ++ toolchain_args = { ++ current_cpu = "x64" ++ current_os = "linux" ++ is_clang = false ++ } ++} ++ + clang_toolchain("clang_mipsel") { + toolchain_args = { + current_cpu = "mipsel" diff --git a/packages/addons/browser/chromium/patches/chromium-0005-use-toolchain-prefix.patch b/packages/addons/browser/chromium/patches/chromium-0005-use-toolchain-prefix.patch deleted file mode 100644 index 3eada8d438..0000000000 --- a/packages/addons/browser/chromium/patches/chromium-0005-use-toolchain-prefix.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/build/toolchain/linux/BUILD.gn 2016-11-09 19:49:39.000000000 -0800 -+++ b/build/toolchain/linux/BUILD.gn 2016-11-10 20:33:18.200587987 -0800 -@@ -102,13 +102,14 @@ - } - - gcc_toolchain("x64") { -- cc = "gcc" -- cxx = "g++" -+ toolprefix = "x86_64-libreelec-linux-gnu-" -+ cc = "${toolprefix}gcc" -+ cxx = "${toolprefix}g++" - -- readelf = "readelf" -- nm = "nm" -- ar = "ar" -+ ar = "${toolprefix}ar" - ld = cxx -+ readelf = "${toolprefix}readelf" -+ nm = "${toolprefix}nm" - - toolchain_args = { - current_cpu = "x64" diff --git a/packages/addons/browser/chromium/patches/chromium-0006-gn_fix.patch b/packages/addons/browser/chromium/patches/chromium-0006-gn_fix.patch new file mode 100644 index 0000000000..4c9eafa2b2 --- /dev/null +++ b/packages/addons/browser/chromium/patches/chromium-0006-gn_fix.patch @@ -0,0 +1,10 @@ +--- a/tools/gn/bootstrap/bootstrap.py 2017-08-10 21:13:27.316180673 +0200 ++++ b/tools/gn/bootstrap/bootstrap.py 2017-08-10 21:13:23.544160535 +0200 +@@ -486,6 +486,7 @@ + 'base/synchronization/lock.cc', + 'base/sys_info.cc', + 'base/task_runner.cc', ++ 'base/task_scheduler/environment_config.cc', + 'base/task_scheduler/delayed_task_manager.cc', + 'base/task_scheduler/post_task.cc', + 'base/task_scheduler/priority_queue.cc', diff --git a/packages/addons/browser/chromium/patches/chromium-0008-fix-ucontext-from-glibc.patch b/packages/addons/browser/chromium/patches/chromium-0008-fix-ucontext-from-glibc.patch new file mode 100644 index 0000000000..f323972366 --- /dev/null +++ b/packages/addons/browser/chromium/patches/chromium-0008-fix-ucontext-from-glibc.patch @@ -0,0 +1,225 @@ +From b6a312ed8e144a37da840ae50dbd39df5ffb7e9f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 2 Jul 2017 16:34:54 -0700 +Subject: [PATCH 2/2] replace struct ucontext with ucontext_t + +glibc 2.26 does not expose struct ucontext any longer + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + .../linux/dump_writer_common/ucontext_reader.cc | 30 +++++++++++----------- + .../linux/dump_writer_common/ucontext_reader.h | 10 ++++---- + .../src/client/linux/handler/exception_handler.cc | 8 +++--- + .../src/client/linux/handler/exception_handler.h | 2 +- + .../linux/microdump_writer/microdump_writer.cc | 2 +- + .../linux/minidump_writer/minidump_writer.cc | 2 +- + 6 files changed, 27 insertions(+), 27 deletions(-) + +diff --git a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +index c80724dd8..93b4d9f85 100644 +--- a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -40,15 +40,15 @@ namespace google_breakpad { + + #if defined(__i386__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_ESP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_EIP]; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fp) { + const greg_t* regs = uc->uc_mcontext.gregs; + +@@ -88,15 +88,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__x86_64) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_RSP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[REG_RIP]; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fpregs) { + const greg_t* regs = uc->uc_mcontext.gregs; + +@@ -145,15 +145,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__ARM_EABI__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.arm_sp; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.arm_pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { + out->context_flags = MD_CONTEXT_ARM_FULL; + + out->iregs[0] = uc->uc_mcontext.arm_r0; +@@ -184,15 +184,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { + + #elif defined(__aarch64__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.sp; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs) { + out->context_flags = MD_CONTEXT_ARM64_FULL; + +@@ -210,15 +210,15 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc, + + #elif defined(__mips__) + +-uintptr_t UContextReader::GetStackPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]; + } + +-uintptr_t UContextReader::GetInstructionPointer(const struct ucontext* uc) { ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { + return uc->uc_mcontext.pc; + } + +-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc) { ++void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { + #if _MIPS_SIM == _ABI64 + out->context_flags = MD_CONTEXT_MIPS64_FULL; + #elif _MIPS_SIM == _ABIO32 +diff --git a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +index b6e77b4b5..2369a9ad3 100644 +--- a/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h ++++ b/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -41,21 +41,21 @@ namespace google_breakpad { + + // Wraps platform-dependent implementations of accessors to ucontext structs. + struct UContextReader { +- static uintptr_t GetStackPointer(const struct ucontext* uc); ++ static uintptr_t GetStackPointer(const ucontext_t* uc); + +- static uintptr_t GetInstructionPointer(const struct ucontext* uc); ++ static uintptr_t GetInstructionPointer(const ucontext_t* uc); + + // Juggle a arch-specific ucontext into a minidump format + // out: the minidump structure + // info: the collection of register structures. + #if defined(__i386__) || defined(__x86_64) +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct _libc_fpstate* fp); + #elif defined(__aarch64__) +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc, ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, + const struct fpsimd_context* fpregs); + #else +- static void FillCPUContext(RawContextCPU *out, const ucontext *uc); ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc); + #endif + }; + +diff --git a/breakpad/src/client/linux/handler/exception_handler.cc b/breakpad/src/client/linux/handler/exception_handler.cc +index b63f973b8..f2688acaf 100644 +--- a/breakpad/src/client/linux/handler/exception_handler.cc ++++ b/breakpad/src/client/linux/handler/exception_handler.cc +@@ -439,9 +439,9 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { + // Fill in all the holes in the struct to make Valgrind happy. + memset(&g_crash_context_, 0, sizeof(g_crash_context_)); + memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t)); +- memcpy(&g_crash_context_.context, uc, sizeof(struct ucontext)); ++ memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t)); + #if defined(__aarch64__) +- struct ucontext* uc_ptr = (struct ucontext*)uc; ++ ucontext_t* uc_ptr = (ucontext_t*)uc; + struct fpsimd_context* fp_ptr = + (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved; + if (fp_ptr->head.magic == FPSIMD_MAGIC) { +@@ -452,7 +452,7 @@ bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) { + // FP state is not part of user ABI on ARM Linux. + // In case of MIPS Linux FP state is already part of struct ucontext + // and 'float_state' is not a member of CrashContext. +- struct ucontext* uc_ptr = (struct ucontext*)uc; ++ ucontext_t* uc_ptr = (ucontext_t*)uc; + if (uc_ptr->uc_mcontext.fpregs) { + memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs, + sizeof(g_crash_context_.float_state)); +@@ -476,7 +476,7 @@ bool ExceptionHandler::SimulateSignalDelivery(int sig) { + // ExceptionHandler::HandleSignal(). + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); +- struct ucontext context; ++ ucontext_t context; + getcontext(&context); + return HandleSignal(sig, &siginfo, &context); + } +diff --git a/breakpad/src/client/linux/handler/exception_handler.h b/breakpad/src/client/linux/handler/exception_handler.h +index 591c31085..846df772f 100644 +--- a/breakpad/src/client/linux/handler/exception_handler.h ++++ b/breakpad/src/client/linux/handler/exception_handler.h +@@ -191,7 +191,7 @@ class ExceptionHandler { + struct CrashContext { + siginfo_t siginfo; + pid_t tid; // the crashing thread. +- struct ucontext context; ++ ucontext_t context; + #if !defined(__ARM_EABI__) && !defined(__mips__) + // #ifdef this out because FP state is not part of user ABI for Linux ARM. + // In case of MIPS Linux FP state is already part of struct +diff --git a/breakpad/src/client/linux/microdump_writer/microdump_writer.cc b/breakpad/src/client/linux/microdump_writer/microdump_writer.cc +index 6f5b43559..a508667a0 100644 +--- a/breakpad/src/client/linux/microdump_writer/microdump_writer.cc ++++ b/breakpad/src/client/linux/microdump_writer/microdump_writer.cc +@@ -571,7 +571,7 @@ class MicrodumpWriter { + + void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } + +- const struct ucontext* const ucontext_; ++ const ucontext_t* const ucontext_; + #if !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; + #endif +diff --git a/breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +index 86009b9f6..f2aec73d7 100644 +--- a/breakpad/src/client/linux/minidump_writer/minidump_writer.cc ++++ b/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +@@ -1248,7 +1248,7 @@ class MinidumpWriter { + const int fd_; // File descriptor where the minidum should be written. + const char* path_; // Path to the file where the minidum should be written. + +- const struct ucontext* const ucontext_; // also from the signal handler ++ const ucontext_t* const ucontext_; // also from the signal handler + #if !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; // ditto + #endif +-- +2.13.2 + diff --git a/packages/addons/browser/chromium/patches/chromium-0009-fix-blink-gcc7.patch b/packages/addons/browser/chromium/patches/chromium-0009-fix-blink-gcc7.patch new file mode 100644 index 0000000000..a867e9cc00 --- /dev/null +++ b/packages/addons/browser/chromium/patches/chromium-0009-fix-blink-gcc7.patch @@ -0,0 +1,77 @@ +Source: https://aur.archlinux.org/packages/chromium-vaapi/ +--- chromium-59.0.3071.86/third_party/WebKit/Source/platform/wtf/LinkedHashSet.h.orig 2017-06-06 15:05:38.145247996 +0300 ++++ chromium-59.0.3071.86/third_party/WebKit/Source/platform/wtf/LinkedHashSet.h 2017-06-06 15:06:13.866246667 +0300 +@@ -685,6 +685,31 @@ inline LinkedHashSet& Linked + return *this; + } + ++inline void SwapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { ++ DCHECK(a.prev_); ++ DCHECK(a.next_); ++ DCHECK(b.prev_); ++ DCHECK(b.next_); ++ swap(a.prev_, b.prev_); ++ swap(a.next_, b.next_); ++ if (b.next_ == &a) { ++ DCHECK_EQ(b.prev_, &a); ++ b.next_ = &b; ++ b.prev_ = &b; ++ } else { ++ b.next_->prev_ = &b; ++ b.prev_->next_ = &b; ++ } ++ if (a.next_ == &b) { ++ DCHECK_EQ(a.prev_, &b); ++ a.next_ = &a; ++ a.prev_ = &a; ++ } else { ++ a.next_->prev_ = &a; ++ a.prev_->next_ = &a; ++ } ++} ++ + template + inline void LinkedHashSet::Swap(LinkedHashSet& other) { + impl_.Swap(other.impl_); +@@ -877,31 +902,6 @@ inline void LinkedHashSet::e + erase(Find(value)); + } + +-inline void SwapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { +- DCHECK(a.prev_); +- DCHECK(a.next_); +- DCHECK(b.prev_); +- DCHECK(b.next_); +- swap(a.prev_, b.prev_); +- swap(a.next_, b.next_); +- if (b.next_ == &a) { +- DCHECK_EQ(b.prev_, &a); +- b.next_ = &b; +- b.prev_ = &b; +- } else { +- b.next_->prev_ = &b; +- b.prev_->next_ = &b; +- } +- if (a.next_ == &b) { +- DCHECK_EQ(a.prev_, &b); +- a.next_ = &a; +- a.prev_ = &a; +- } else { +- a.next_->prev_ = &a; +- a.prev_->next_ = &a; +- } +-} +- + inline void swap(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b) { + DCHECK_NE(a.next_, &a); + DCHECK_NE(b.next_, &b); +--- chromium-59.0.3071.86/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h.orig 2017-06-06 16:16:43.657661313 +0300 ++++ chromium-59.0.3071.86/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h 2017-06-06 16:16:50.911198032 +0300 +@@ -5,6 +5,7 @@ + #include "platform/PlatformExport.h" + #include "platform/wtf/ThreadSpecific.h" + ++#include + #include + + namespace gpu { diff --git a/packages/addons/browser/chromium/patches/chromium-0010-fix-v8-gcc7.patch b/packages/addons/browser/chromium/patches/chromium-0010-fix-v8-gcc7.patch new file mode 100644 index 0000000000..9a9a8dcce2 --- /dev/null +++ b/packages/addons/browser/chromium/patches/chromium-0010-fix-v8-gcc7.patch @@ -0,0 +1,74 @@ +Source: https://aur.archlinux.org/packages/chromium-vaapi/ +diff -upr chromium-59.0.3071.86.orig/v8/src/objects/hash-table.h chromium-59.0.3071.86/v8/src/objects/hash-table.h +--- chromium-59.0.3071.86.orig/v8/src/objects/hash-table.h 2017-06-05 22:04:29.000000000 +0300 ++++ chromium-59.0.3071.86/v8/src/objects/hash-table.h 2017-06-06 14:35:41.558245559 +0300 +@@ -135,22 +135,10 @@ class HashTable : public HashTableBase { + public: + typedef Shape ShapeT; + +- // Wrapper methods +- inline uint32_t Hash(Key key) { +- if (Shape::UsesSeed) { +- return Shape::SeededHash(key, GetHeap()->HashSeed()); +- } else { +- return Shape::Hash(key); +- } +- } +- +- inline uint32_t HashForObject(Key key, Object* object) { +- if (Shape::UsesSeed) { +- return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object); +- } else { +- return Shape::HashForObject(key, object); +- } +- } ++ // Wrapper methods. Defined in src/objects-inl.h ++ // to break a cycle with src/heap/heap.h. ++ inline uint32_t Hash(Key key); ++ inline uint32_t HashForObject(Key key, Object* object); + + // Returns a new HashTable object. + MUST_USE_RESULT static Handle New( +diff -upr chromium-59.0.3071.86.orig/v8/src/objects-body-descriptors.h chromium-59.0.3071.86/v8/src/objects-body-descriptors.h +--- chromium-59.0.3071.86.orig/v8/src/objects-body-descriptors.h 2017-06-05 22:04:29.000000000 +0300 ++++ chromium-59.0.3071.86/v8/src/objects-body-descriptors.h 2017-06-06 14:35:41.554912132 +0300 +@@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public + + template + static inline void IterateBody(HeapObject* obj, int object_size) { +- IterateBody(obj); ++ IterateBody(obj); + } + }; + +diff -upr chromium-59.0.3071.86.orig/v8/src/objects-inl.h chromium-59.0.3071.86/v8/src/objects-inl.h +--- chromium-59.0.3071.86.orig/v8/src/objects-inl.h 2017-06-05 22:04:29.000000000 +0300 ++++ chromium-59.0.3071.86/v8/src/objects-inl.h 2017-06-06 14:35:41.558245559 +0300 +@@ -46,6 +46,27 @@ + namespace v8 { + namespace internal { + ++template ++uint32_t HashTable::Hash(Key key) { ++ if (Shape::UsesSeed) { ++ return Shape::SeededHash(key, GetHeap()->HashSeed()); ++ } else { ++ return Shape::Hash(key); ++ } ++} ++ ++ ++template ++uint32_t HashTable::HashForObject(Key key, ++ Object* object) { ++ if (Shape::UsesSeed) { ++ return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object); ++ } else { ++ return Shape::HashForObject(key, object); ++ } ++} ++ ++ + PropertyDetails::PropertyDetails(Smi* smi) { + value_ = smi->value(); + }