Submitted By: Ken Moffat Date: 2022-01-16 Initial Package Version: From git 5.15 branch. Upstream Status: Anything for gcc-11 and glibc-2.34 not used upstream. Origin: upstream via gentoo, Douglas, fedora, self. Description: Allows this to build and work on BLFS-10.1 Updated on 2021-05-04: add gentoo patch for gcc-11. Updated on 2021-06-18: remove fix for graphcycles.cc which is now upstream Updated on 2021-08-13: add fixes to compile and let browsers using it work on glibc-2.34 (apply the upstream_fixes-2 patch BEFORE applying this). Updated on 2021-11-22: fixes for qtwebengine-5.15.7. Updated on 2022-01-13: reduced to what still applies to 5.15.8. Note: although Arch have patches to use python3, they make changes which end in them invoking python instead of python2. For BLFS, python is python2. Attempting to maintain suitable BLFS changes going forward looks unmaintainable. That problem will disappear whenever kde uses qtwebengine6 which now supports python3. First, a patch from gentoo to avoid the build from a git version requiring git, although the .git directories are still required. generate_gni.sh: update_readme() runs git at the end of process, prevent it. Thanks-to: Georgy Yakovlev --- a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 2021-02-07 12:51:49.438514897 +0100 +++ b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 2021-02-21 16:23:38.375724515 +0100 @@ -519,8 +519,3 @@ gn format --in-place $BASE_DIR/BUILD.gn gn format --in-place $BASE_DIR/libvpx_srcs.gni - -cd $BASE_DIR/$LIBVPX_SRC_DIR -update_readme - -cd $BASE_DIR Second was a patch from fedora to make some web pages render when glibc-2.33 is used. Upstream fixed qtwebengine-5.15.6 slightly differently Third, a patch from Douglas R. Reno (renodr at linuxfromscratch dot org): When building qtwebengine where libxml2 has been built before ICU has been installed, a build failure will occur because QtWebEngine will attempt to use it's internal version of libxml2, which *was not* patched against API changes in ICU-68.1+. These changes involved removing the TRUE and FALSE macros, and the official documentation states that developers should use 'true' and 'false' instead, of course making sure that 'stdbool.h' is included so that the compiler can actually find those boolean values. Since Chromium's internal version of ICU is older than ours, it's not a problem when building with the internal version of ICU. Users who have installed ICU before libxml2 are exempt from running into this issue. diff -Naurp qtwebengine-everywhere-src-5.15.2.orig/src/3rdparty/chromium/third_party/libxml/src/encoding.c qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/libxml/src/encoding.c --- qtwebengine-everywhere-src-5.15.2.orig/src/3rdparty/chromium/third_party/libxml/src/encoding.c 2020-11-06 19:22:36.000000000 -0600 +++ qtwebengine-everywhere-src-5.15.2/src/3rdparty/chromium/third_party/libxml/src/encoding.c 2020-12-08 19:39:00.607894718 -0600 @@ -44,7 +44,7 @@ #endif #include #include - +#include #include "buf.h" #include "enc.h" @@ -1893,7 +1893,7 @@ xmlUconvWrapper(uconv_t *cd, int toUnico *inlen = ucv_in - (const char*) in; *outlen = ucv_out - (char *) out; if (U_SUCCESS(err)) { - /* reset pivot buf if this is the last call for input (flush==TRUE) */ + /* reset pivot buf if this is the last call for input (flush==true) */ if (flush) cd->pivot_source = cd->pivot_target = cd->pivot_buf; return 0; @@ -1958,7 +1958,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler #ifdef LIBXML_ICU_ENABLED else if (handler->uconv_out != NULL) { ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen, - TRUE); + true); } #endif /* LIBXML_ICU_ENABLED */ else { Fourth, patch from gentoo to allow it to build with gcc-11 where some less-used headers such as have been removed from the C++ standard library headers which used to include them, and must now be included where needed. [https://gcc.gnu.org/gcc-11/porting_to.html] diff --git a/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp b/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp index 013f1dfb2..3ce63c192 100644 --- a/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp +++ b/src/3rdparty/chromium/third_party/angle/src/libANGLE/HandleAllocator.cpp @@ -9,6 +9,7 @@ #include "libANGLE/HandleAllocator.h" +#include #include #include diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc index fd651958f..1e8d0606c 100644 --- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc +++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/containers/string_pool.cc @@ -14,9 +14,9 @@ * limitations under the License. */ +#include #include "src/trace_processor/containers/string_pool.h" -#include #include "perfetto/base/logging.h" #include "perfetto/ext/base/utils.h" diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc index 00496b335..0dccfeb8a 100644 --- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc +++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/db/column.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include "src/trace_processor/db/column.h" #include "src/trace_processor/db/compare.h" diff --git a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc index 837bfeba9..cdd56817d 100644 --- a/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc +++ b/src/3rdparty/chromium/third_party/perfetto/src/trace_processor/types/variadic.cc @@ -14,6 +14,7 @@ * limitations under the License. */ +#include #include "src/trace_processor/types/variadic.h" namespace perfetto { diff --git a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc index be91def6b..73f202356 100644 --- a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc +++ b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_atk_hyperlink.cc @@ -245,7 +245,7 @@ static void AXPlatformAtkHyperlinkInit(AXPlatformAtkHyperlink* self, gpointer) { } GType ax_platform_atk_hyperlink_get_type() { - static volatile gsize type_volatile = 0; + static gsize type_volatile = 0; AXPlatformNodeAuraLinux::EnsureGTypeInit(); diff --git a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc index 04125c6fd..6c64e5d8e 100644 --- a/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc +++ b/src/3rdparty/chromium/ui/accessibility/platform/ax_platform_node_auralinux.cc @@ -2274,7 +2274,7 @@ void ClassInit(gpointer class_pointer, gpointer /* class_data */) { GType GetType() { AXPlatformNodeAuraLinux::EnsureGTypeInit(); - static volatile gsize type_volatile = 0; + static gsize type_volatile = 0; if (g_once_init_enter(&type_volatile)) { static const GTypeInfo type_info = { sizeof(AXPlatformNodeAuraLinuxClass), // class_size diff --git a/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc b/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc index c663a2074..38a342484 100644 --- a/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc +++ b/src/3rdparty/chromium/ui/gtk/gtk_key_bindings_handler.cc @@ -141,7 +141,7 @@ void GtkKeyBindingsHandler::HandlerClassInit(HandlerClass* klass) { } GType GtkKeyBindingsHandler::HandlerGetType() { - static volatile gsize type_id_volatile = 0; + static gsize type_id_volatile = 0; if (g_once_init_enter(&type_id_volatile)) { GType type_id = g_type_register_static_simple( GTK_TYPE_TEXT_VIEW, g_intern_static_string("GtkKeyBindingsHandler"), --- a/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc +++ b/src/3rdparty/chromium/components/bookmarks/browser/bookmark_expanded_state_tracker.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include #include "components/bookmarks/browser/bookmark_expanded_state_tracker.h" #include diff --git a/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc b/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc index 657a3c96b..ad641a082 100644 --- a/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc +++ b/src/3rdparty/chromium/components/bookmarks/browser/base_bookmark_model_observer.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + #include "components/bookmarks/browser/base_bookmark_model_observer.h" namespace bookmarks { Fifth were some fixes from upstream abseil to build with glibc-2.34. The first part has been fixed slightly differently in chromium in qtwebengne-5.15.8, I assume the remainder are not actually needed for chromium. Sixth was a patch from Fedora to compile breakpad on glibc-2.34, fixed slightly differently in chromium in qtwebengine-5.15.8 Seventh: a patch from fedora to handle time64 syscalls, fixed up to apply to 5.15.7 (parts were upstream but in a slightly different order). diff -ur a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc --- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-11-21 05:26:12.779893741 +0000 +++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-11-21 05:48:06.855720781 +0000 @@ -158,7 +158,15 @@ return Allow(); #endif - if (SyscallSets::IsClockApi(sysno)) { + if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep +#if defined(__NR_clock_gettime64) + || sysno == __NR_clock_gettime64 +#endif +#if defined(__NR_clock_nanosleep_time64) + || sysno == __NR_clock_nanosleep_time64 +#endif + ) { + return RestrictClockID(); } diff -up qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h.sandbox-time64-syscalls qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h --- qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h.sandbox-time64-syscalls 2021-06-24 10:36:45.694826524 -0500 +++ qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/arm_linux_syscalls.h 2021-06-24 10:37:50.383852263 -0500 @@ -1441,6 +1441,14 @@ #define __NR_io_pgetevents (__NR_SYSCALL_BASE+399) #endif +#if !defined(__NR_clock_gettime64) +#define __NR_clock_gettime64 (__NR_SYSCALL_BASE+403) +#endif + +#if !defined(__NR_clock_nanosleep_time64) +#define __NR_clock_nanosleep_time64 (__NR_SYSCALL_BASE+407) +#endif + // ARM private syscalls. #if !defined(__ARM_NR_BASE) #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000) diff -up qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h.sandbox-time64-syscalls qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h --- qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h.sandbox-time64-syscalls 2021-05-28 07:05:45.000000000 -0500 +++ qtwebengine-everywhere-src-5.15.5/src/3rdparty/chromium/sandbox/linux/system_headers/mips_linux_syscalls.h 2021-06-24 10:36:45.695826525 -0500 @@ -1433,4 +1433,12 @@ #define __NR_memfd_create (__NR_Linux + 354) #endif +#if !defined(__NR_clock_gettime64) +#define __NR_clock_gettime64 (__NR_Linux + 403) +#endif + +#if !defined(__NR_clock_nanosleep_time64) +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +#endif + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_