├── chromium-114.0.5735.133 ├── 0ppc64.patch ├── boringssl.patch ├── chromium.patch ├── closure_compiler.patch ├── crashpad.patch ├── dav1d.patch ├── dpf.patch ├── eigen.patch ├── flatbuffers.patch ├── libvpx.patch ├── pdfium.patch ├── perfetto.patch ├── quiche.patch ├── sandbox.patch ├── skia.patch ├── swiftshader.patch ├── v8.patch ├── webp.patch └── webrtc.patch ├── chromium-87.0.4280.66 ├── 0ppc64.patch ├── boringssl.patch ├── breakpad.patch ├── chromium.patch ├── closure_compiler.patch ├── dav1d.patch ├── flatbuffers.patch ├── libvpx.patch ├── perfetto.patch ├── sandbox.patch ├── skia.patch ├── swiftshader.patch ├── v8.patch ├── webp.patch └── webrtc.patch ├── chromium-89.0.4389.114 ├── 0ppc64.patch ├── boringssl.patch ├── breakpad.patch ├── chromium.patch ├── closure_compiler.patch ├── dav1d.patch ├── flatbuffers.patch ├── libvpx.patch ├── perfetto.patch ├── quiche.patch ├── sandbox.patch ├── skia.patch ├── swiftshader.patch ├── v8.patch ├── webp.patch └── webrtc.patch ├── qtwebengine-5.15.1 ├── 0gyakovlev │ ├── enable-ppc64-build.patch │ ├── qtwebengine-5.15.0-ppc64-ffmpeg.patch │ ├── qtwebengine-5.15.0-ppc64-libvpx.patch │ └── qtwebengine-5.15.0-ppc64.patch ├── boringssl.patch ├── chromium.patch ├── dav1d.patch ├── ffmpeg.patch ├── flatbuffers.patch ├── libvpx.patch ├── pdfium.patch ├── perfetto.patch ├── qtcomposer.patch ├── skia.patch ├── v8.patch ├── webp.patch └── webrtc.patch ├── qtwebengine-5.15.10_p20230505 ├── 0gyakovlev │ ├── 0000-enable-ppc64.patch │ ├── 0001-ppc64le-libvpx.patch │ ├── 0002-ppc64le-support.patch │ ├── 0003-ppc64le-support-sandbox-linux-stat.patch │ └── 0004-ppc64le-swiftshader.patch ├── boringssl.patch ├── chromium.patch ├── closure_compiler.patch ├── dav1d.patch ├── ffmpeg.patch ├── flatbuffers.patch ├── libvpx.patch ├── perfetto.patch ├── qtcomposer.patch ├── skia.patch ├── swiftshader.patch ├── v8.patch ├── webp.patch └── webrtc.patch └── qtwebengine-5.15.11_p20231102 ├── 0ppc64_gentoo.patch ├── boringssl.patch ├── chromium.patch ├── closure_compiler.patch ├── dav1d.patch ├── ffmpeg.patch ├── flatbuffers.patch ├── libvpx.patch ├── perfetto.patch ├── qtcomposer.patch ├── skia.patch ├── swiftshader.patch ├── v8.patch ├── webp.patch └── webrtc.patch /chromium-114.0.5735.133/closure_compiler.patch: -------------------------------------------------------------------------------- 1 | From db94f934ed125c4e562d0a6778a652d9c11e6936 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:32:08 +0100 4 | Subject: [PATCH] Remove unsupported -client option to JVM 5 | 6 | --- 7 | third_party/closure_compiler/compiler.py | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/third_party/closure_compiler/compiler.py b/third_party/closure_compiler/compiler.py 11 | index c6368af733..2616cf7d34 100755 12 | --- a/third_party/closure_compiler/compiler.py 13 | +++ b/third_party/closure_compiler/compiler.py 14 | @@ -24,7 +24,6 @@ class Compiler(object): 15 | _JAVA_PATH, 16 | "-jar", 17 | "-Xms1024m", 18 | - "-client", 19 | "-XX:+TieredCompilation", 20 | ] 21 | 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/crashpad.patch: -------------------------------------------------------------------------------- 1 | From c15b739391975ac27eb8ec027d9e424ee275035d Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 5 Jul 2023 10:57:20 +0200 4 | Subject: [PATCH 1/2] minidump: Set correct cpu architecture for PPC64 5 | 6 | --- 7 | .../crashpad/crashpad/minidump/minidump_system_info_writer.cc | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc 11 | index 4468c41aff..d9ce14903e 100644 12 | --- a/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc 13 | +++ b/third_party/crashpad/crashpad/minidump/minidump_system_info_writer.cc 14 | @@ -132,6 +132,9 @@ void MinidumpSystemInfoWriter::InitializeFromSnapshot( 15 | case kCPUArchitectureARM64: 16 | cpu_architecture = kMinidumpCPUArchitectureARM64; 17 | break; 18 | + case kCPUArchitecturePPC64: 19 | + cpu_architecture = kMinidumpCPUArchitecturePPC64; 20 | + break; 21 | default: 22 | NOTREACHED(); 23 | cpu_architecture = kMinidumpCPUArchitectureUnknown; 24 | -- 25 | 2.39.3 26 | 27 | 28 | From 233933764f7c42ddd07c73de53c56fe8eb4fbea3 Mon Sep 17 00:00:00 2001 29 | From: Marcus Comstedt 30 | Date: Wed, 5 Jul 2023 13:40:41 +0200 31 | Subject: [PATCH 2/2] r_debug does not contain 64-bit ints 32 | 33 | --- 34 | .../crashpad/crashpad/snapshot/linux/debug_rendezvous.cc | 2 +- 35 | 1 file changed, 1 insertion(+), 1 deletion(-) 36 | 37 | diff --git a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc 38 | index 5a03bbd859..139a2f83b1 100644 39 | --- a/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc 40 | +++ b/third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous.cc 41 | @@ -35,7 +35,7 @@ struct Traits32 { 42 | }; 43 | 44 | struct Traits64 { 45 | - using Integer = int64_t; 46 | + using Integer = int32_t; 47 | using Address = uint64_t; 48 | }; 49 | 50 | -- 51 | 2.39.3 52 | 53 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/dav1d.patch: -------------------------------------------------------------------------------- 1 | From 18f2b9fd71394203ef81741e725fb70b7f574878 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:16:45 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | third_party/dav1d/BUILD.gn | 4 ++++ 8 | third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 9 | third_party/dav1d/libdav1d/src/cpu.h | 2 +- 10 | 3 files changed, 10 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/third_party/dav1d/BUILD.gn b/third_party/dav1d/BUILD.gn 13 | index 359f04b3af..a6970d713b 100644 14 | --- a/third_party/dav1d/BUILD.gn 15 | +++ b/third_party/dav1d/BUILD.gn 16 | @@ -102,6 +102,10 @@ if (is_win) { 17 | } 18 | } 19 | 20 | +if (current_cpu == "ppc64") { 21 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 22 | +} 23 | + 24 | if (enable_nasm) { 25 | nasm_assemble("dav1d_asm") { 26 | sources = x86_asm_sources 27 | diff --git a/third_party/dav1d/config/linux/ppc64/config.h b/third_party/dav1d/config/linux/ppc64/config.h 28 | index 3aeede04b2..d57a3a1add 100644 29 | --- a/third_party/dav1d/config/linux/ppc64/config.h 30 | +++ b/third_party/dav1d/config/linux/ppc64/config.h 31 | @@ -9,7 +9,9 @@ 32 | 33 | #define ARCH_ARM 0 34 | 35 | -#define ARCH_PPC64LE 1 36 | +#define ARCH_PPC64LE 0 37 | + 38 | +#define ARCH_PPC64 1 39 | 40 | #define ARCH_X86 0 41 | 42 | @@ -23,9 +25,9 @@ 43 | 44 | // #define CONFIG_LOG 1 -- Logging is controlled by Chromium 45 | 46 | -#define ENDIANNESS_BIG 0 47 | +#define ENDIANNESS_BIG 1 48 | 49 | -#define HAVE_ASM 1 50 | +#define HAVE_ASM 0 51 | 52 | #define HAVE_CLOCK_GETTIME 1 53 | 54 | diff --git a/third_party/dav1d/libdav1d/src/cpu.h b/third_party/dav1d/libdav1d/src/cpu.h 55 | index 8f70fefe54..ebf344822c 100644 56 | --- a/third_party/dav1d/libdav1d/src/cpu.h 57 | +++ b/third_party/dav1d/libdav1d/src/cpu.h 58 | @@ -37,7 +37,7 @@ 59 | 60 | #if ARCH_AARCH64 || ARCH_ARM 61 | #include "src/arm/cpu.h" 62 | -#elif ARCH_PPC64LE 63 | +#elif ARCH_PPC64LE || ARCH_PPC64 64 | #include "src/ppc/cpu.h" 65 | #elif ARCH_X86 66 | #include "src/x86/cpu.h" 67 | -- 68 | 2.39.3 69 | 70 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/dpf.patch: -------------------------------------------------------------------------------- 1 | From 363d43d8a0476f54610ba986975b75184e86a64e Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Mon, 3 Jul 2023 13:36:40 +0200 4 | Subject: [PATCH] Remove check for LE 5 | 6 | --- 7 | .../code/dpf/internal/evaluate_prg_hwy.cc | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc b/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc 11 | index 8a51745569..cce48f291a 100644 12 | --- a/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc 13 | +++ b/third_party/distributed_point_functions/code/dpf/internal/evaluate_prg_hwy.cc 14 | @@ -117,7 +117,6 @@ auto IsBitSet(D d, const V input, int index) { 15 | // Now load it into a vector of 64-bit integers. Note that every second 16 | // element of that vector will be 0. 17 | const hn::Repartition d64; 18 | - static_assert(ABSL_IS_LITTLE_ENDIAN); 19 | const auto index_64 = 20 | hn::LoadDup128(d64, reinterpret_cast(&shifted_index)); 21 | 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/eigen.patch: -------------------------------------------------------------------------------- 1 | From a30b4ab88d02ff03ea34bed23a2e6e7887fcf71e Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Mon, 3 Jul 2023 13:10:07 +0200 4 | Subject: [PATCH] Fix compilation with >=c++20 5 | 6 | --- 7 | .../src/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/third_party/eigen3/src/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h b/third_party/eigen3/src/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h 11 | index e107335b78..829989762d 100644 12 | --- a/third_party/eigen3/src/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h 13 | +++ b/third_party/eigen3/src/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.h 14 | @@ -891,7 +891,7 @@ EIGEN_ALWAYS_INLINE Packet pset_init(Packet& c1) 15 | template 16 | struct alpha_store 17 | { 18 | - alpha_store(ResScalar& alpha) { 19 | + alpha_store(ResScalar& alpha) { 20 | separate.r = pset1_complex(alpha); 21 | separate.i = pset1_complex(alpha); 22 | } 23 | -- 24 | 2.39.3 25 | 26 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From 33362d6ce2ce66d92465e5c3c14ca067cddbfa12 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/third_party/flatbuffers/src/include/flatbuffers/base.h b/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 219b6d308a..07e041c020 100644 19 | --- a/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -381,15 +381,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.39.3 42 | 43 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/pdfium.patch: -------------------------------------------------------------------------------- 1 | From 8921ca656db621611535cb539d8a9443cde6f5eb Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 9 Jul 2023 17:42:28 +0200 4 | Subject: [PATCH] Fix rendering on big endian 5 | 6 | --- 7 | third_party/pdfium/core/fxge/agg/fx_agg_driver.cpp | 5 +++-- 8 | third_party/pdfium/core/fxge/skia/fx_skia_device.cpp | 10 +++++++++- 9 | 2 files changed, 12 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/third_party/pdfium/core/fxge/agg/fx_agg_driver.cpp b/third_party/pdfium/core/fxge/agg/fx_agg_driver.cpp 12 | index a1949de548..093e47b412 100644 13 | --- a/third_party/pdfium/core/fxge/agg/fx_agg_driver.cpp 14 | +++ b/third_party/pdfium/core/fxge/agg/fx_agg_driver.cpp 15 | @@ -13,6 +13,7 @@ 16 | #include 17 | 18 | #include "build/build_config.h" 19 | +#include "core/fxcrt/byteorder.h" 20 | #include "core/fxcrt/fx_2d_size.h" 21 | #include "core/fxcrt/fx_safe_types.h" 22 | #include "core/fxge/cfx_cliprgn.h" 23 | @@ -73,7 +74,7 @@ void RgbByteOrderCompositeRect(const RetainPtr& pBitmap, 24 | int src_g = FXARGB_G(argb); 25 | int src_b = FXARGB_B(argb); 26 | int Bpp = pBitmap->GetBPP() / 8; 27 | - int dib_argb = FXARGB_TOBGRORDERDIB(argb); 28 | + int dib_argb = fxcrt::ByteSwapToLE32(FXARGB_TOBGRORDERDIB(argb)); 29 | pdfium::span pBuffer = pBitmap->GetBuffer(); 30 | if (src_alpha == 255) { 31 | for (int row = rect.top; row < rect.bottom; row++) { 32 | @@ -768,7 +769,7 @@ CFX_Renderer::CFX_Renderer(const RetainPtr& pDevice, 33 | bool bFullCover, 34 | bool bRgbByteOrder) 35 | : m_Alpha(FXARGB_A(color)), 36 | - m_Color(bRgbByteOrder ? FXARGB_TOBGRORDERDIB(color) : color), 37 | + m_Color(fxcrt::ByteSwapToLE32(bRgbByteOrder ? FXARGB_TOBGRORDERDIB(color) : color)), 38 | m_bFullCover(bFullCover), 39 | m_bRgbByteOrder(bRgbByteOrder), 40 | m_ClipBox(GetClipBoxFromRegion(pDevice, pClipRgn)), 41 | diff --git a/third_party/pdfium/core/fxge/skia/fx_skia_device.cpp b/third_party/pdfium/core/fxge/skia/fx_skia_device.cpp 42 | index ef3218d7f4..4f6cd46c87 100644 43 | --- a/third_party/pdfium/core/fxge/skia/fx_skia_device.cpp 44 | +++ b/third_party/pdfium/core/fxge/skia/fx_skia_device.cpp 45 | @@ -698,7 +698,11 @@ bool Upsample(const RetainPtr& pSource, 46 | if (!use_gray_colors) { 47 | dst32_storage = Fill32BppDestStorageWith1BppSource(pSource); 48 | rowBytes = width * sizeof(uint32_t); 49 | +#ifdef ARCH_CPU_BIG_ENDIAN 50 | + colorType = kARGB_8888_SkColorType; 51 | +#else 52 | colorType = kBGRA_8888_SkColorType; 53 | +#endif 54 | break; 55 | } 56 | 57 | @@ -731,7 +735,11 @@ bool Upsample(const RetainPtr& pSource, 58 | 59 | dst32_storage = Fill32BppDestStorageWithPalette(pSource, src_palette); 60 | rowBytes = width * sizeof(uint32_t); 61 | +#ifdef ARCH_CPU_BIG_ENDIAN 62 | + colorType = kARGB_8888_SkColorType; 63 | +#else 64 | colorType = kBGRA_8888_SkColorType; 65 | +#endif 66 | } 67 | break; 68 | case 24: { 69 | @@ -747,7 +755,7 @@ bool Upsample(const RetainPtr& pSource, 70 | } 71 | } 72 | rowBytes = width * sizeof(uint32_t); 73 | - colorType = kBGRA_8888_SkColorType; 74 | + colorType = SkColorType::kN32_SkColorType; 75 | alphaType = kOpaque_SkAlphaType; 76 | break; 77 | } 78 | -- 79 | 2.39.3 80 | 81 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/perfetto.patch: -------------------------------------------------------------------------------- 1 | From c020a3d0f94ca5c7172f0a5c2f8e4b81d94c8c0f Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/4] protozero: Implement byte swap macros 5 | 6 | --- 7 | third_party/perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/third_party/perfetto/src/protozero/proto_decoder.cc b/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index 0595c1ffc2..2c63ccdc5d 100644 12 | --- a/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -32,7 +32,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if !PERFETTO_IS_LITTLE_ENDIAN() 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -117,6 +121,7 @@ ParseFieldResult ParseOneField(const uint8_t* const buffer, 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -124,7 +129,9 @@ ParseFieldResult ParseOneField(const uint8_t* const buffer, 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.39.3 48 | 49 | 50 | From 0e14a58673aa0b38d31c63871c515e849185b3ee Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/4] protozero: Swap "fixed" types 54 | 55 | --- 56 | third_party/perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/third_party/perfetto/include/perfetto/protozero/message.h b/third_party/perfetto/include/perfetto/protozero/message.h 61 | index 069bc34db1..7181e978d3 100644 62 | --- a/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -135,6 +135,13 @@ class PERFETTO_EXPORT_COMPONENT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/third_party/perfetto/src/protozero/message.cc b/third_party/perfetto/src/protozero/message.cc 79 | index e33601c0c3..9bbccbbbfd 100644 80 | --- a/third_party/perfetto/src/protozero/message.cc 81 | +++ b/third_party/perfetto/src/protozero/message.cc 82 | @@ -24,12 +24,6 @@ 83 | #include "perfetto/protozero/message_arena.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if !PERFETTO_IS_LITTLE_ENDIAN() 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.39.3 97 | 98 | 99 | From 2f4a8d29563e9d779b54ea9a05f8ef3c8d4fc800 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/4] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/third_party/perfetto/include/perfetto/ext/base/utils.h b/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index 99a980253a..f555fee065 100644 112 | --- a/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -26,6 +26,7 @@ 115 | #include 116 | #include 117 | #include 118 | +#include 119 | 120 | #include "perfetto/base/build_config.h" 121 | #include "perfetto/base/compiler.h" 122 | @@ -79,7 +80,7 @@ struct FreeDeleter { 123 | template 124 | constexpr T AssumeLittleEndian(T value) { 125 | #if !PERFETTO_IS_LITTLE_ENDIAN() 126 | - static_assert(false, "Unimplemented on big-endian archs"); 127 | + static_assert(!std::is_same::value, "Unimplemented on big-endian archs"); 128 | #endif 129 | return value; 130 | } 131 | diff --git a/third_party/perfetto/src/protozero/field.cc b/third_party/perfetto/src/protozero/field.cc 132 | index 8f9418219c..681bac5fd5 100644 133 | --- a/third_party/perfetto/src/protozero/field.cc 134 | +++ b/third_party/perfetto/src/protozero/field.cc 135 | @@ -20,9 +20,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if !PERFETTO_IS_LITTLE_ENDIAN() 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -42,14 +44,15 @@ void Field::SerializeAndAppendToInternal(Container* dst) const { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.39.3 170 | 171 | 172 | From 561171d30159979560689665a002342034843142 Mon Sep 17 00:00:00 2001 173 | From: Marcus Comstedt 174 | Date: Sun, 14 Feb 2021 19:26:43 +0100 175 | Subject: [PATCH 4/4] BufferedFrameDeserializer: Fix endianness handling 176 | 177 | --- 178 | .../perfetto/src/ipc/buffered_frame_deserializer.cc | 13 ++++++++++--- 179 | 1 file changed, 10 insertions(+), 3 deletions(-) 180 | 181 | diff --git a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 182 | index 16d3c8630e..977f30c6f8 100644 183 | --- a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 184 | +++ b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 185 | @@ -96,7 +96,10 @@ bool BufferedFrameDeserializer::EndReceive(size_t recv_size) { 186 | // Read the header into |payload_size|. 187 | uint32_t payload_size = 0; 188 | const char* rd_ptr = buf() + consumed_size; 189 | - memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize); 190 | + memcpy(&payload_size, rd_ptr, kHeaderSize); 191 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 192 | + payload_size = __builtin_bswap32(payload_size); 193 | +#endif 194 | 195 | // Saturate the |payload_size| to prevent overflows. The > capacity_ check 196 | // below will abort the parsing. 197 | @@ -174,10 +177,14 @@ void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) { 198 | // static 199 | std::string BufferedFrameDeserializer::Serialize(const Frame& frame) { 200 | std::vector payload = frame.SerializeAsArray(); 201 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 202 | + const uint32_t payload_size = __builtin_bswap32(static_cast(payload.size())); 203 | +#else 204 | const uint32_t payload_size = static_cast(payload.size()); 205 | +#endif 206 | std::string buf; 207 | - buf.resize(kHeaderSize + payload_size); 208 | - memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize); 209 | + buf.resize(kHeaderSize + payload.size()); 210 | + memcpy(&buf[0], &payload_size, kHeaderSize); 211 | memcpy(&buf[kHeaderSize], payload.data(), payload.size()); 212 | return buf; 213 | } 214 | -- 215 | 2.39.3 216 | 217 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/quiche.patch: -------------------------------------------------------------------------------- 1 | From cf578708147c42e94f3d8ee8411c35cd4bf397ad Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 11 Apr 2021 15:52:01 +0200 4 | Subject: [PATCH 1/2] quiche_endian: Include for std::begin 5 | 6 | --- 7 | net/third_party/quiche/src/quiche/common/quiche_endian.h | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/net/third_party/quiche/src/quiche/common/quiche_endian.h b/net/third_party/quiche/src/quiche/common/quiche_endian.h 11 | index 2aaa478317..8c2fe62293 100644 12 | --- a/net/third_party/quiche/src/quiche/common/quiche_endian.h 13 | +++ b/net/third_party/quiche/src/quiche/common/quiche_endian.h 14 | @@ -8,6 +8,7 @@ 15 | #include 16 | #include 17 | #include 18 | +#include 19 | 20 | #include "quiche/common/platform/api/quiche_export.h" 21 | 22 | -- 23 | 2.39.3 24 | 25 | 26 | From 513a496cff0efefbe2423a87ce3e2bafd39c39c4 Mon Sep 17 00:00:00 2001 27 | From: Marcus Comstedt 28 | Date: Sun, 11 Apr 2021 15:52:57 +0200 29 | Subject: [PATCH 2/2] quiche_endian: Handle big endian hosts correctly 30 | 31 | --- 32 | .../quiche/src/quiche/common/quiche_endian.h | 11 +++++++++-- 33 | 1 file changed, 9 insertions(+), 2 deletions(-) 34 | 35 | diff --git a/net/third_party/quiche/src/quiche/common/quiche_endian.h b/net/third_party/quiche/src/quiche/common/quiche_endian.h 36 | index 8c2fe62293..7594bc1d53 100644 37 | --- a/net/third_party/quiche/src/quiche/common/quiche_endian.h 38 | +++ b/net/third_party/quiche/src/quiche/common/quiche_endian.h 39 | @@ -16,13 +16,14 @@ namespace quiche { 40 | 41 | enum Endianness { 42 | NETWORK_BYTE_ORDER, // big endian 43 | - HOST_BYTE_ORDER // little endian 44 | + HOST_BYTE_ORDER // either little or big endian 45 | }; 46 | 47 | // Provide utility functions that convert from/to network order (big endian) 48 | // to/from host order (little endian). 49 | class QUICHE_EXPORT QuicheEndian { 50 | public: 51 | +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 52 | // Convert |x| from host order (little endian) to network order (big endian). 53 | #if defined(__clang__) || \ 54 | (defined(__GNUC__) && \ 55 | @@ -35,8 +36,14 @@ class QUICHE_EXPORT QuicheEndian { 56 | static uint32_t HostToNet32(uint32_t x) { return PortableByteSwap(x); } 57 | static uint64_t HostToNet64(uint64_t x) { return PortableByteSwap(x); } 58 | #endif 59 | +#else 60 | + // Host order is the same as network order (big endian) 61 | + static uint16_t HostToNet16(uint16_t x) { return x; } 62 | + static uint32_t HostToNet32(uint32_t x) { return x; } 63 | + static uint64_t HostToNet64(uint64_t x) { return x; } 64 | +#endif 65 | 66 | - // Convert |x| from network order (big endian) to host order (little endian). 67 | + // Convert |x| from network order (big endian) to host order (little/big endian). 68 | static uint16_t NetToHost16(uint16_t x) { return HostToNet16(x); } 69 | static uint32_t NetToHost32(uint32_t x) { return HostToNet32(x); } 70 | static uint64_t NetToHost64(uint64_t x) { return HostToNet64(x); } 71 | -- 72 | 2.39.3 73 | 74 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/sandbox.patch: -------------------------------------------------------------------------------- 1 | From 3ab2fed6733b8a200aaaa40077e7f3738765fba5 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 28 Apr 2019 15:22:43 +0200 4 | Subject: [PATCH 1/2] sandbox: Fix SECCOMP_*_[LM]SB_IDX for ppc64 5 | 6 | --- 7 | sandbox/linux/bpf_dsl/seccomp_macros.h | 11 +++++++++++ 8 | 1 file changed, 11 insertions(+) 9 | 10 | diff --git a/sandbox/linux/bpf_dsl/seccomp_macros.h b/sandbox/linux/bpf_dsl/seccomp_macros.h 11 | index e2a6c24af8..49924b7012 100644 12 | --- a/sandbox/linux/bpf_dsl/seccomp_macros.h 13 | +++ b/sandbox/linux/bpf_dsl/seccomp_macros.h 14 | @@ -372,6 +372,7 @@ typedef struct pt_regs regs_struct; 15 | 16 | #define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr)) 17 | #define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch)) 18 | +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 19 | #define SECCOMP_IP_MSB_IDX \ 20 | (offsetof(struct arch_seccomp_data, instruction_pointer) + 4) 21 | #define SECCOMP_IP_LSB_IDX \ 22 | @@ -380,6 +381,16 @@ typedef struct pt_regs regs_struct; 23 | (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4) 24 | #define SECCOMP_ARG_LSB_IDX(nr) \ 25 | (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0) 26 | +#else 27 | +#define SECCOMP_IP_MSB_IDX \ 28 | + (offsetof(struct arch_seccomp_data, instruction_pointer) + 0) 29 | +#define SECCOMP_IP_LSB_IDX \ 30 | + (offsetof(struct arch_seccomp_data, instruction_pointer) + 4) 31 | +#define SECCOMP_ARG_MSB_IDX(nr) \ 32 | + (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0) 33 | +#define SECCOMP_ARG_LSB_IDX(nr) \ 34 | + (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4) 35 | +#endif 36 | 37 | #define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3] 38 | #define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0] 39 | -- 40 | 2.39.3 41 | 42 | 43 | From 8d10ca1802d0088f6a2e4ed315192c66896b1d7f Mon Sep 17 00:00:00 2001 44 | From: Marcus Comstedt 45 | Date: Sun, 14 Feb 2021 19:31:15 +0100 46 | Subject: [PATCH 2/2] sandbox: Add missing include of 47 | 48 | --- 49 | sandbox/policy/linux/bpf_renderer_policy_linux.cc | 1 + 50 | 1 file changed, 1 insertion(+) 51 | 52 | diff --git a/sandbox/policy/linux/bpf_renderer_policy_linux.cc b/sandbox/policy/linux/bpf_renderer_policy_linux.cc 53 | index 4397ff4aa1..9f70141df3 100644 54 | --- a/sandbox/policy/linux/bpf_renderer_policy_linux.cc 55 | +++ b/sandbox/policy/linux/bpf_renderer_policy_linux.cc 56 | @@ -6,6 +6,7 @@ 57 | 58 | #include 59 | #include 60 | +#include 61 | 62 | #include "build/build_config.h" 63 | #include "sandbox/linux/bpf_dsl/bpf_dsl.h" 64 | -- 65 | 2.39.3 66 | 67 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/swiftshader.patch: -------------------------------------------------------------------------------- 1 | From 52b2d1fe28717269f95ecd35ddc1df85385a1bd8 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:36:38 +0100 4 | Subject: [PATCH] Add a source needed on ppc64 to the build 5 | 6 | --- 7 | third_party/swiftshader/third_party/llvm-10.0/BUILD.gn | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 11 | index 59e52303c5..8efc3cbb91 100644 12 | --- a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 13 | +++ b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 14 | @@ -867,6 +867,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { 15 | "llvm/lib/Support/ARMAttributeParser.cpp", 16 | "llvm/lib/Support/ARMBuildAttrs.cpp", 17 | "llvm/lib/Support/ARMTargetParser.cpp", 18 | + "llvm/lib/Support/Atomic.cpp", 19 | "llvm/lib/Support/BinaryStreamError.cpp", 20 | "llvm/lib/Support/BinaryStreamReader.cpp", 21 | "llvm/lib/Support/BinaryStreamRef.cpp", 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/v8.patch: -------------------------------------------------------------------------------- 1 | From 5d5059dcc43c7c3d911b8fc6905fcffdeb59decb Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH 1/2] Support 64K pages 5 | 6 | --- 7 | v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/v8/src/base/platform/platform-posix.cc b/v8/src/base/platform/platform-posix.cc 11 | index 5365c4a3b8..7e3589de35 100644 12 | --- a/v8/src/base/platform/platform-posix.cc 13 | +++ b/v8/src/base/platform/platform-posix.cc 14 | @@ -335,7 +335,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.39.3 25 | 26 | 27 | From 34eaa5f0b5493a626d973c35525ba5f80e900e4c Mon Sep 17 00:00:00 2001 28 | From: Marcus Comstedt 29 | Date: Tue, 4 Jul 2023 18:23:41 +0200 30 | Subject: [PATCH 2/2] Use AIX calling conventions also for Linux with ELFv1 31 | 32 | --- 33 | .../heap/base/asm/ppc/push_registers_asm.cc | 21 +++++++++++++++---- 34 | 1 file changed, 17 insertions(+), 4 deletions(-) 35 | 36 | diff --git a/v8/src/heap/base/asm/ppc/push_registers_asm.cc b/v8/src/heap/base/asm/ppc/push_registers_asm.cc 37 | index f879980556..e65de0c413 100644 38 | --- a/v8/src/heap/base/asm/ppc/push_registers_asm.cc 39 | +++ b/v8/src/heap/base/asm/ppc/push_registers_asm.cc 40 | @@ -16,9 +16,22 @@ 41 | 42 | // AIX Runtime process stack: 43 | // https://www.ibm.com/support/knowledgecenter/ssw_aix_71/assembler/idalangref_runtime_process.html 44 | + 45 | +#include "src/codegen/ppc/constants-ppc.h" 46 | + 47 | asm( 48 | +#if ABI_USES_FUNCTION_DESCRIPTORS 49 | #if defined(_AIX) 50 | ".csect .text[PR] \n" 51 | +#else 52 | + /* Linux linker requires the function descriptor to be provided */ 53 | + ".section \".opd\",\"aw\" \n" 54 | + ".align 3 \n" 55 | + ".globl PushAllRegistersAndIterateStack, hidden \n" 56 | + "PushAllRegistersAndIterateStack: \n" 57 | + ".quad .PushAllRegistersAndIterateStack,.TOC.@tocbase,0 \n" 58 | + ".text \n" 59 | +#endif 60 | ".align 2 \n" 61 | ".globl .PushAllRegistersAndIterateStack, hidden \n" 62 | ".PushAllRegistersAndIterateStack: \n" 63 | @@ -36,7 +49,7 @@ asm( 64 | // At anytime, SP (r1) needs to be multiple of 16 (i.e. 16-aligned). 65 | " mflr 0 \n" 66 | " std 0, 16(1) \n" 67 | -#if defined(_AIX) 68 | +#if ABI_USES_FUNCTION_DESCRIPTORS 69 | " std 2, 40(1) \n" 70 | #else 71 | " std 2, 24(1) \n" 72 | @@ -64,7 +77,7 @@ asm( 73 | // Pass 2nd parameter (r4) unchanged (StackVisitor*). 74 | // Save 3rd parameter (r5; IterateStackCallback). 75 | " mr 6, 5 \n" 76 | -#if defined(_AIX) 77 | +#if ABI_USES_FUNCTION_DESCRIPTORS 78 | // Set up TOC for callee. 79 | " ld 2,8(5) \n" 80 | // AIX uses function descriptors, which means that 81 | @@ -75,7 +88,7 @@ asm( 82 | #endif 83 | // Pass 3rd parameter as sp (stack pointer). 84 | " mr 5, 1 \n" 85 | -#if !defined(_AIX) 86 | +#if !ABI_USES_FUNCTION_DESCRIPTORS 87 | // Set up r12 to be equal to the callee address (in order for TOC 88 | // relocation). Only needed on LE Linux. 89 | " mr 12, 6 \n" 90 | @@ -88,7 +101,7 @@ asm( 91 | // Restore lr. 92 | " ld 0, 16(1) \n" 93 | " mtlr 0 \n" 94 | -#if defined(_AIX) 95 | +#if ABI_USES_FUNCTION_DESCRIPTORS 96 | // Restore TOC pointer. 97 | " ld 2, 40(1) \n" 98 | #else 99 | -- 100 | 2.39.3 101 | 102 | -------------------------------------------------------------------------------- /chromium-114.0.5735.133/webp.patch: -------------------------------------------------------------------------------- 1 | From 34f2bb8624c33cc658b4fd943840819852b46bb2 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/media/parsers/webp_parser.cc b/media/parsers/webp_parser.cc 11 | index 2a3d37f3b1..ecf698b1a6 100644 12 | --- a/media/parsers/webp_parser.cc 13 | +++ b/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.39.3 27 | 28 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/breakpad.patch: -------------------------------------------------------------------------------- 1 | From 5307571c0a3012bed1cc3f8922f28c2b6071e38d Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:33:40 +0100 4 | Subject: [PATCH] breakpad: Disable getcontext on ppc64 5 | 6 | --- 7 | third_party/breakpad/BUILD.gn | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn 11 | index b5452e16a6..746a646e5e 100644 12 | --- a/third_party/breakpad/BUILD.gn 13 | +++ b/third_party/breakpad/BUILD.gn 14 | @@ -611,7 +611,6 @@ if (is_linux || is_chromeos || is_android) { 15 | "breakpad/src/client/minidump_file_writer.h", 16 | "breakpad/src/common/convert_UTF.cc", 17 | "breakpad/src/common/convert_UTF.h", 18 | - "breakpad/src/common/linux/breakpad_getcontext.S", 19 | "breakpad/src/common/linux/elf_core_dump.cc", 20 | "breakpad/src/common/linux/elf_core_dump.h", 21 | "breakpad/src/common/linux/elfutils.cc", 22 | @@ -649,6 +648,14 @@ if (is_linux || is_chromeos || is_android) { 23 | 24 | libs = [ "dl" ] 25 | 26 | + if (current_cpu == "ppc64") { 27 | + defines = [ "HAVE_GETCONTEXT" ] 28 | + } else { 29 | + sources += [ 30 | + "breakpad/src/common/linux/breakpad_getcontext.S" 31 | + ] 32 | + } 33 | + 34 | include_dirs = [ 35 | ".", 36 | "breakpad/src", 37 | @@ -699,7 +706,6 @@ if (is_linux || is_chromeos || is_android) { 38 | "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc", 39 | "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc", 40 | "breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc", 41 | - "breakpad/src/common/linux/breakpad_getcontext_unittest.cc", 42 | "breakpad/src/common/linux/elf_core_dump_unittest.cc", 43 | "breakpad/src/common/linux/file_id_unittest.cc", 44 | "breakpad/src/common/linux/linux_libc_support_unittest.cc", 45 | -- 46 | 2.26.2 47 | 48 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/closure_compiler.patch: -------------------------------------------------------------------------------- 1 | From f8315f14a0baa950aba946b3a71e1648fbdac002 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:32:08 +0100 4 | Subject: [PATCH] Remove unsupported -client option to JVM 5 | 6 | --- 7 | third_party/closure_compiler/compiler.py | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/third_party/closure_compiler/compiler.py b/third_party/closure_compiler/compiler.py 11 | index 4e9521c3bf..150964a849 100755 12 | --- a/third_party/closure_compiler/compiler.py 13 | +++ b/third_party/closure_compiler/compiler.py 14 | @@ -30,7 +30,6 @@ class Compiler(object): 15 | _JAVA_PATH, 16 | "-jar", 17 | "-Xms1024m", 18 | - "-client", 19 | "-XX:+TieredCompilation", 20 | ] 21 | 22 | -- 23 | 2.26.2 24 | 25 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/dav1d.patch: -------------------------------------------------------------------------------- 1 | From 060b899487bbf873f5191326500f52cf65b93dc3 Mon Sep 17 00:00:00 2001 2 | From: Georgy Yakovlev 3 | Date: Wed, 27 May 2020 03:00:22 -0700 4 | Subject: [PATCH 1/2] ppc64 patchset 5 | 6 | --- 7 | third_party/dav1d/BUILD.gn | 21 +++++++++++ 8 | third_party/dav1d/config/linux/ppc64/config.h | 35 +++++++++++++++++++ 9 | third_party/dav1d/dav1d_generated.gni | 5 +++ 10 | third_party/dav1d/generate_source.py | 3 +- 11 | third_party/dav1d/libdav1d/src/ppc/types.h | 15 ++++++++ 12 | 5 files changed, 78 insertions(+), 1 deletion(-) 13 | create mode 100644 third_party/dav1d/config/linux/ppc64/config.h 14 | 15 | diff --git a/third_party/dav1d/BUILD.gn b/third_party/dav1d/BUILD.gn 16 | index 7616b7f3f6..a7bdcaffd0 100644 17 | --- a/third_party/dav1d/BUILD.gn 18 | +++ b/third_party/dav1d/BUILD.gn 19 | @@ -183,6 +183,8 @@ static_library("dav1d_8bit") { 20 | sources += arm_template_sources 21 | } else if (current_cpu == "arm64") { 22 | sources += arm_template_sources 23 | + } else if (current_cpu == "ppc64") { 24 | + sources += ppc64_template_sources 25 | } 26 | 27 | cflags = dav1d_copts 28 | @@ -211,6 +213,8 @@ static_library("dav1d_10bit") { 29 | sources += arm_template_sources 30 | } else if (current_cpu == "arm64") { 31 | sources += arm_template_sources 32 | + } else if (current_cpu == "ppc64") { 33 | + sources += ppc64_template_sources 34 | } 35 | 36 | cflags = dav1d_copts 37 | @@ -262,6 +266,21 @@ if (current_cpu == "x86" || current_cpu == "x64") { 38 | defines = [ "PREFIX" ] 39 | } 40 | 41 | + cflags = dav1d_copts 42 | + } 43 | +} else if (current_cpu == "ppc64") { 44 | + static_library("dav1d_ppc") { 45 | + sources = [ 46 | + "libdav1d/src/ppc/cpu.c", 47 | + "libdav1d/src/ppc/cpu.h", 48 | + ] 49 | + 50 | + configs -= [ "//build/config/compiler:chromium_code" ] 51 | + configs += [ 52 | + "//build/config/compiler:no_chromium_code", 53 | + ":dav1d_config", 54 | + ] 55 | + 56 | cflags = dav1d_copts 57 | } 58 | } 59 | @@ -291,5 +310,7 @@ static_library("dav1d") { 60 | } 61 | } else if (current_cpu == "arm" || current_cpu == "arm64") { 62 | deps += [ ":dav1d_arm" ] 63 | + } else if (current_cpu == "ppc64") { 64 | + deps += [ ":dav1d_ppc" ] 65 | } 66 | } 67 | diff --git a/third_party/dav1d/config/linux/ppc64/config.h b/third_party/dav1d/config/linux/ppc64/config.h 68 | new file mode 100644 69 | index 0000000000..f6ca57f7f0 70 | --- /dev/null 71 | +++ b/third_party/dav1d/config/linux/ppc64/config.h 72 | @@ -0,0 +1,35 @@ 73 | +/* 74 | + * Autogenerated by the Meson build system. 75 | + * Do not edit, your changes will be lost. 76 | + */ 77 | + 78 | +#pragma once 79 | + 80 | +#define ARCH_AARCH64 0 81 | + 82 | +#define ARCH_ARM 0 83 | + 84 | +#define ARCH_PPC64LE 1 85 | + 86 | +#define ARCH_X86 0 87 | + 88 | +#define ARCH_X86_32 0 89 | + 90 | +#define ARCH_X86_64 0 91 | + 92 | +#define CONFIG_16BPC 1 93 | + 94 | +#define CONFIG_8BPC 1 95 | + 96 | +#define CONFIG_LOG 1 97 | + 98 | +#define ENDIANNESS_BIG 0 99 | + 100 | +#define HAVE_ASM 1 101 | + 102 | +#define HAVE_GETAUXVAL 1 103 | + 104 | +#define HAVE_POSIX_MEMALIGN 1 105 | + 106 | +#define HAVE_UNISTD_H 1 107 | + 108 | diff --git a/third_party/dav1d/dav1d_generated.gni b/third_party/dav1d/dav1d_generated.gni 109 | index 95fba31e1a..c3851ca37a 100644 110 | --- a/third_party/dav1d/dav1d_generated.gni 111 | +++ b/third_party/dav1d/dav1d_generated.gni 112 | @@ -76,6 +76,11 @@ arm_template_sources = [ 113 | "libdav1d/src/arm/mc_init_tmpl.c", 114 | ] 115 | 116 | +ppc64_template_sources = [ 117 | + "libdav1d/src/ppc/cdef_init_tmpl.c", 118 | + "libdav1d/src/ppc/looprestoration_init_tmpl.c", 119 | +] 120 | + 121 | template_sources = [ 122 | "libdav1d/src/cdef_apply_tmpl.c", 123 | "libdav1d/src/cdef_tmpl.c", 124 | diff --git a/third_party/dav1d/generate_source.py b/third_party/dav1d/generate_source.py 125 | index 9ab5e00b83..ad3feffee4 100755 126 | --- a/third_party/dav1d/generate_source.py 127 | +++ b/third_party/dav1d/generate_source.py 128 | @@ -50,7 +50,8 @@ def WriteGn(fd): 129 | WriteArray(fd, "arm32_asm_sources", glob.glob("libdav1d/src/arm/32/*.S")) 130 | WriteArray(fd, "arm64_asm_sources", glob.glob("libdav1d/src/arm/64/*.S")) 131 | WriteArray(fd, "arm_template_sources", glob.glob("libdav1d/src/arm/*_tmpl.c")) 132 | - 133 | + WriteArray(fd, "ppc64_template_sources", glob.glob("libdav1d/src/ppc/*_tmpl.c")) 134 | + 135 | template_sources = glob.glob("libdav1d/src/*_tmpl.c") 136 | WriteArray(fd, "template_sources", template_sources) 137 | 138 | diff --git a/third_party/dav1d/libdav1d/src/ppc/types.h b/third_party/dav1d/libdav1d/src/ppc/types.h 139 | index 0b4bd72f0e..a0caa5e710 100644 140 | --- a/third_party/dav1d/libdav1d/src/ppc/types.h 141 | +++ b/third_party/dav1d/libdav1d/src/ppc/types.h 142 | @@ -51,4 +51,19 @@ 143 | #define u16l_to_i32(v) ((i32x4) vec_mergel((u16x8) v, vec_splat_u16(0))) 144 | #define i16l_to_i32(v) ((i32x4) vec_unpackl((i16x8)v)) 145 | 146 | +#if defined(__clang__) 147 | +#undef vec_splats 148 | +#define vec_splats(N) \ 149 | + _Generic((N), \ 150 | + unsigned char: ((u8x16)(N)), \ 151 | + signed char: ((i8x16)(N)), \ 152 | + unsigned short: ((u16x8)(N)), \ 153 | + signed short: ((i16x8)(N)), \ 154 | + unsigned int: ((u32x4)(N)), \ 155 | + signed int: ((i32x4)(N)), \ 156 | + unsigned long long: ((u64x2)(N)), \ 157 | + signed long long: ((i64x2)(N)) \ 158 | + ) 159 | +#endif 160 | + 161 | #endif /* DAV1D_SRC_PPC_TYPES_H */ 162 | -- 163 | 2.26.2 164 | 165 | 166 | From 5da7e341a7dfcabc3fd72ea74daf9695e65b9fd8 Mon Sep 17 00:00:00 2001 167 | From: Marcus Comstedt 168 | Date: Wed, 6 Jan 2021 13:16:45 +0100 169 | Subject: [PATCH 2/2] Interpret "ppc64" as big endian 170 | 171 | --- 172 | third_party/dav1d/BUILD.gn | 4 ++++ 173 | third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 174 | third_party/dav1d/libdav1d/src/cpu.h | 2 +- 175 | 3 files changed, 10 insertions(+), 4 deletions(-) 176 | 177 | diff --git a/third_party/dav1d/BUILD.gn b/third_party/dav1d/BUILD.gn 178 | index a7bdcaffd0..ca9ee6f4aa 100644 179 | --- a/third_party/dav1d/BUILD.gn 180 | +++ b/third_party/dav1d/BUILD.gn 181 | @@ -121,6 +121,10 @@ if (is_win) { 182 | } 183 | } 184 | 185 | +if (current_cpu == "ppc64") { 186 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 187 | +} 188 | + 189 | if (enable_nasm) { 190 | nasm_assemble("dav1d_asm") { 191 | sources = x86_asm_sources 192 | diff --git a/third_party/dav1d/config/linux/ppc64/config.h b/third_party/dav1d/config/linux/ppc64/config.h 193 | index f6ca57f7f0..c3138078ab 100644 194 | --- a/third_party/dav1d/config/linux/ppc64/config.h 195 | +++ b/third_party/dav1d/config/linux/ppc64/config.h 196 | @@ -9,7 +9,9 @@ 197 | 198 | #define ARCH_ARM 0 199 | 200 | -#define ARCH_PPC64LE 1 201 | +#define ARCH_PPC64LE 0 202 | + 203 | +#define ARCH_PPC64 1 204 | 205 | #define ARCH_X86 0 206 | 207 | @@ -23,9 +25,9 @@ 208 | 209 | #define CONFIG_LOG 1 210 | 211 | -#define ENDIANNESS_BIG 0 212 | +#define ENDIANNESS_BIG 1 213 | 214 | -#define HAVE_ASM 1 215 | +#define HAVE_ASM 0 216 | 217 | #define HAVE_GETAUXVAL 1 218 | 219 | diff --git a/third_party/dav1d/libdav1d/src/cpu.h b/third_party/dav1d/libdav1d/src/cpu.h 220 | index d5299f243b..d65edfc389 100644 221 | --- a/third_party/dav1d/libdav1d/src/cpu.h 222 | +++ b/third_party/dav1d/libdav1d/src/cpu.h 223 | @@ -36,7 +36,7 @@ 224 | 225 | #if ARCH_AARCH64 || ARCH_ARM 226 | #include "src/arm/cpu.h" 227 | -#elif ARCH_PPC64LE 228 | +#elif ARCH_PPC64LE || ARCH_PPC64 229 | #include "src/ppc/cpu.h" 230 | #elif ARCH_X86 231 | #include "src/x86/cpu.h" 232 | -- 233 | 2.26.2 234 | 235 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From 42f7883736d279a18d40a001eaa6a304258cf00e Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/third_party/flatbuffers/src/include/flatbuffers/base.h b/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 86ecf2386a..161689c1e4 100644 19 | --- a/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -330,15 +330,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.26.2 42 | 43 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/perfetto.patch: -------------------------------------------------------------------------------- 1 | From a93c5b42ad842fc05f36060eb8d4d997bb3f677f Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/4] protozero: Implement byte swap macros 5 | 6 | --- 7 | third_party/perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/third_party/perfetto/src/protozero/proto_decoder.cc b/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index b606818a59..926af8282f 100644 12 | --- a/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -28,7 +28,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -113,6 +117,7 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -120,7 +125,9 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.26.2 48 | 49 | 50 | From 55216cdc15ecd5b46b2129da4ed9939ee1070035 Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/4] protozero: Swap "fixed" types 54 | 55 | --- 56 | third_party/perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/third_party/perfetto/include/perfetto/protozero/message.h b/third_party/perfetto/include/perfetto/protozero/message.h 61 | index a47db7edb3..41c41d0669 100644 62 | --- a/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -135,6 +135,13 @@ class PERFETTO_EXPORT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/third_party/perfetto/src/protozero/message.cc b/third_party/perfetto/src/protozero/message.cc 79 | index cfc9b37b53..66801e0567 100644 80 | --- a/third_party/perfetto/src/protozero/message.cc 81 | +++ b/third_party/perfetto/src/protozero/message.cc 82 | @@ -23,12 +23,6 @@ 83 | #include "perfetto/protozero/message_arena.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.26.2 97 | 98 | 99 | From ee6cdae4ceeff4f46c8b0db0986b9fc3dbfcbab9 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/4] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/third_party/perfetto/include/perfetto/ext/base/utils.h b/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index b702d4f729..57996be53e 100644 112 | --- a/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -23,6 +23,7 @@ 115 | #include 116 | #include 117 | #include 118 | +#include 119 | #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) 120 | #include 121 | #endif 122 | @@ -109,7 +110,7 @@ struct FreeDeleter { 123 | 124 | template 125 | constexpr T AssumeLittleEndian(T value) { 126 | - static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 127 | + static_assert(std::is_same::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 128 | "Unimplemented on big-endian archs"); 129 | return value; 130 | } 131 | diff --git a/third_party/perfetto/src/protozero/field.cc b/third_party/perfetto/src/protozero/field.cc 132 | index be1648219d..06109c5477 100644 133 | --- a/third_party/perfetto/src/protozero/field.cc 134 | +++ b/third_party/perfetto/src/protozero/field.cc 135 | @@ -19,9 +19,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -41,14 +43,15 @@ void Field::SerializeAndAppendToInternal(Container* dst) const { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.26.2 170 | 171 | 172 | From 78f1623e465e2e490fa46e4197b679bdacf4acc0 Mon Sep 17 00:00:00 2001 173 | From: Marcus Comstedt 174 | Date: Sun, 14 Feb 2021 19:26:43 +0100 175 | Subject: [PATCH 4/4] BufferedFrameDeserializer: Fix endianness handling 176 | 177 | --- 178 | .../perfetto/src/ipc/buffered_frame_deserializer.cc | 13 ++++++++++--- 179 | 1 file changed, 10 insertions(+), 3 deletions(-) 180 | 181 | diff --git a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 182 | index d893dfb5c5..e6a8c6fca9 100644 183 | --- a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 184 | +++ b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 185 | @@ -97,7 +97,10 @@ bool BufferedFrameDeserializer::EndReceive(size_t recv_size) { 186 | // Read the header into |payload_size|. 187 | uint32_t payload_size = 0; 188 | const char* rd_ptr = buf() + consumed_size; 189 | - memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize); 190 | + memcpy(&payload_size, rd_ptr, kHeaderSize); 191 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 192 | + payload_size = __builtin_bswap32(payload_size); 193 | +#endif 194 | 195 | // Saturate the |payload_size| to prevent overflows. The > capacity_ check 196 | // below will abort the parsing. 197 | @@ -175,10 +178,14 @@ void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) { 198 | // static 199 | std::string BufferedFrameDeserializer::Serialize(const Frame& frame) { 200 | std::vector payload = frame.SerializeAsArray(); 201 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 202 | + const uint32_t payload_size = __builtin_bswap32(static_cast(payload.size())); 203 | +#else 204 | const uint32_t payload_size = static_cast(payload.size()); 205 | +#endif 206 | std::string buf; 207 | - buf.resize(kHeaderSize + payload_size); 208 | - memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize); 209 | + buf.resize(kHeaderSize + payload.size()); 210 | + memcpy(&buf[0], &payload_size, kHeaderSize); 211 | memcpy(&buf[kHeaderSize], payload.data(), payload.size()); 212 | return buf; 213 | } 214 | -- 215 | 2.26.2 216 | 217 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/swiftshader.patch: -------------------------------------------------------------------------------- 1 | From 807b9e6b93359204c27c4e60cd307450de69a978 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:35:50 +0100 4 | Subject: [PATCH 1/3] Fix JIT arch for big endian ppc64 5 | 6 | --- 7 | third_party/swiftshader/src/Reactor/LLVMJIT.cpp | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/third_party/swiftshader/src/Reactor/LLVMJIT.cpp b/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 11 | index d156be89ba..49075b6e31 100644 12 | --- a/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 13 | +++ b/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 14 | @@ -175,6 +175,8 @@ JITGlobals JITGlobals::create() 15 | # endif 16 | #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 17 | march = "ppc64le"; 18 | +#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 19 | + march = "ppc64"; 20 | #else 21 | # error "unknown architecture" 22 | #endif 23 | -- 24 | 2.26.2 25 | 26 | 27 | From c2ad72370e46f784a45989f65cee9c5450406596 Mon Sep 17 00:00:00 2001 28 | From: Marcus Comstedt 29 | Date: Sun, 14 Feb 2021 19:36:38 +0100 30 | Subject: [PATCH 2/3] Add some sources needed on ppc64 to the build 31 | 32 | --- 33 | third_party/swiftshader/third_party/llvm-10.0/BUILD.gn | 3 +++ 34 | 1 file changed, 3 insertions(+) 35 | 36 | diff --git a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 37 | index 70e14c06fb..1ec640d076 100644 38 | --- a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 39 | +++ b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 40 | @@ -572,6 +572,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { 41 | "llvm/lib/MC/MCAsmBackend.cpp", 42 | "llvm/lib/MC/MCAsmInfo.cpp", 43 | "llvm/lib/MC/MCAsmInfoCOFF.cpp", 44 | + "llvm/lib/MC/MCAsmInfoXCOFF.cpp", 45 | "llvm/lib/MC/MCAsmInfoDarwin.cpp", 46 | "llvm/lib/MC/MCAsmInfoELF.cpp", 47 | "llvm/lib/MC/MCAsmMacro.cpp", 48 | @@ -629,6 +630,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { 49 | "llvm/lib/MC/MCWinCOFFStreamer.cpp", 50 | "llvm/lib/MC/MCWinEH.cpp", 51 | "llvm/lib/MC/MCXCOFFStreamer.cpp", 52 | + "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp", 53 | "llvm/lib/MC/MachObjectWriter.cpp", 54 | "llvm/lib/MC/StringTableBuilder.cpp", 55 | "llvm/lib/MC/SubtargetFeature.cpp", 56 | @@ -848,6 +850,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { 57 | "llvm/lib/Support/ARMAttributeParser.cpp", 58 | "llvm/lib/Support/ARMBuildAttrs.cpp", 59 | "llvm/lib/Support/ARMTargetParser.cpp", 60 | + "llvm/lib/Support/Atomic.cpp", 61 | "llvm/lib/Support/BinaryStreamError.cpp", 62 | "llvm/lib/Support/BinaryStreamReader.cpp", 63 | "llvm/lib/Support/BinaryStreamRef.cpp", 64 | -- 65 | 2.26.2 66 | 67 | 68 | From 242b44eb1c355d512c333734d7a10ca8a0e954c7 Mon Sep 17 00:00:00 2001 69 | From: Marcus Comstedt 70 | Date: Sun, 14 Feb 2021 20:52:18 +0100 71 | Subject: [PATCH 3/3] Implement support for ppc64 ELFv1 72 | 73 | This commit adds Yarn support for powerpc64 machines 74 | using the ELFv1 ABI. The changes have been tested on 75 | a POWER9 machine running in Big Endian mode and all 76 | unit tests pass. 77 | --- 78 | .../third_party/marl/src/osfiber_asm_ppc64.S | 12 ++++++++++++ 79 | .../third_party/marl/src/osfiber_asm_ppc64.h | 5 ----- 80 | .../third_party/marl/src/osfiber_ppc64.c | 14 ++++++++++++-- 81 | 3 files changed, 24 insertions(+), 7 deletions(-) 82 | 83 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 84 | index afc143dd76..6c0ba5ae2b 100644 85 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 86 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 87 | @@ -23,8 +23,20 @@ 88 | .text 89 | .global marl_fiber_swap 90 | .align 4 91 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 92 | +.global .marl_fiber_swap 93 | +.pushsection ".opd","aw" 94 | +marl_fiber_swap: 95 | +.quad .marl_fiber_swap 96 | +.quad .TOC.@tocbase 97 | +.quad 0 98 | +.popsection 99 | +.type .marl_fiber_swap,@function 100 | +.marl_fiber_swap: 101 | +#else 102 | .type marl_fiber_swap @function 103 | marl_fiber_swap: 104 | +#endif 105 | 106 | // Store non-volatile registers 107 | std 1, MARL_REG_R1(3) 108 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 109 | index 402bece9f1..f4d20a9e52 100644 110 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 111 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 112 | @@ -123,11 +123,6 @@ struct marl_fiber_context { 113 | uintptr_t vmx[12 * 2]; 114 | }; 115 | 116 | -// Only the ELFv2 ABI is supported for now. 117 | -#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 118 | -#error "Only the ppc64 ELFv2 ABI is supported." 119 | -#endif 120 | - 121 | #ifdef __cplusplus 122 | #include 123 | static_assert(offsetof(marl_fiber_context, r1) == MARL_REG_R1, 124 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c b/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 125 | index 104ef66501..11c10e2447 100644 126 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 127 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 128 | @@ -25,19 +25,29 @@ void marl_fiber_set_target(struct marl_fiber_context* ctx, 129 | uint32_t stack_size, 130 | void (*target)(void*), 131 | void* arg) { 132 | - uintptr_t stack_top = (uintptr_t)((uint8_t*)(stack) + stack_size); 133 | + uintptr_t stack_top = (uintptr_t)((uint8_t*)(stack) + stack_size - sizeof(uintptr_t)); 134 | if ((stack_top % 16) != 0) { 135 | stack_top -= (stack_top % 16); 136 | } 137 | 138 | - // Write a backchain and subtract a minimum stack frame size (32) 139 | + // Write a backchain and subtract a minimum stack frame size (32/48) 140 | *(uintptr_t*)stack_top = 0; 141 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 142 | + stack_top -= 48; 143 | + *(uintptr_t*)stack_top = stack_top + 48; 144 | +#else 145 | stack_top -= 32; 146 | *(uintptr_t*)stack_top = stack_top + 32; 147 | +#endif 148 | 149 | // Load registers 150 | ctx->r1 = stack_top; 151 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 152 | + ctx->lr = ((const uintptr_t *)marl_fiber_trampoline)[0]; 153 | + ctx->r2 = ((const uintptr_t *)marl_fiber_trampoline)[1]; 154 | +#else 155 | ctx->lr = (uintptr_t)marl_fiber_trampoline; 156 | +#endif 157 | ctx->r3 = (uintptr_t)target; 158 | ctx->r4 = (uintptr_t)arg; 159 | 160 | -- 161 | 2.26.2 162 | 163 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/v8.patch: -------------------------------------------------------------------------------- 1 | From df616a527607eee188684325037cb3af56888efa Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH] Support 64K pages 5 | 6 | --- 7 | v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/v8/src/base/platform/platform-posix.cc b/v8/src/base/platform/platform-posix.cc 11 | index 89173b593a..44185d90bb 100644 12 | --- a/v8/src/base/platform/platform-posix.cc 13 | +++ b/v8/src/base/platform/platform-posix.cc 14 | @@ -306,7 +306,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.26.2 25 | 26 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/webp.patch: -------------------------------------------------------------------------------- 1 | From 375be461eb932734ef3ae2c38cbffdda727fb984 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/media/parsers/webp_parser.cc b/media/parsers/webp_parser.cc 11 | index 9d2ba7a12a..f5ad730153 100644 12 | --- a/media/parsers/webp_parser.cc 13 | +++ b/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.26.2 27 | 28 | -------------------------------------------------------------------------------- /chromium-87.0.4280.66/webrtc.patch: -------------------------------------------------------------------------------- 1 | From 6dbb1d128dfea8d22764b05be946d03b9974b2b9 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 12 Mar 2021 23:27:16 +0100 4 | Subject: [PATCH 1/2] wav: Swap header fields as needed 5 | 6 | --- 7 | third_party/webrtc/common_audio/wav_header.cc | 48 +++++++++++++++++-- 8 | 1 file changed, 44 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/third_party/webrtc/common_audio/wav_header.cc b/third_party/webrtc/common_audio/wav_header.cc 11 | index d3dca9055d..63ef780f5b 100644 12 | --- a/third_party/webrtc/common_audio/wav_header.cc 13 | +++ b/third_party/webrtc/common_audio/wav_header.cc 14 | @@ -26,10 +26,6 @@ 15 | namespace webrtc { 16 | namespace { 17 | 18 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 19 | -#error "Code not working properly for big endian platforms." 20 | -#endif 21 | - 22 | #pragma pack(2) 23 | struct ChunkHeader { 24 | uint32_t ID; 25 | @@ -111,9 +107,15 @@ static_assert(sizeof(WavHeaderIeeeFloat) == kIeeeFloatWavHeaderSize, 26 | "no padding in header"); 27 | 28 | uint32_t PackFourCC(char a, char b, char c, char d) { 29 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 30 | + uint32_t packed_value = 31 | + static_cast(a) << 24 | static_cast(b) << 16 | 32 | + static_cast(c) << 8 | static_cast(d); 33 | +#else 34 | uint32_t packed_value = 35 | static_cast(a) | static_cast(b) << 8 | 36 | static_cast(c) << 16 | static_cast(d) << 24; 37 | +#endif 38 | return packed_value; 39 | } 40 | 41 | @@ -172,6 +174,9 @@ bool FindWaveChunk(ChunkHeader* chunk_header, 42 | if (readable->Read(chunk_header, sizeof(*chunk_header)) != 43 | sizeof(*chunk_header)) 44 | return false; // EOF. 45 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 46 | + chunk_header->Size = __builtin_bswap32(chunk_header->Size); 47 | +#endif 48 | if (ReadFourCC(chunk_header->ID) == sought_chunk_id) 49 | return true; // Sought chunk found. 50 | // Ignore current chunk by skipping its payload. 51 | @@ -185,6 +190,14 @@ bool ReadFmtChunkData(FmtPcmSubchunk* fmt_subchunk, WavHeaderReader* readable) { 52 | if (readable->Read(&(fmt_subchunk->AudioFormat), kFmtPcmSubchunkSize) != 53 | kFmtPcmSubchunkSize) 54 | return false; 55 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 56 | + fmt_subchunk->AudioFormat = __builtin_bswap16(fmt_subchunk->AudioFormat); 57 | + fmt_subchunk->NumChannels = __builtin_bswap16(fmt_subchunk->NumChannels); 58 | + fmt_subchunk->SampleRate = __builtin_bswap32(fmt_subchunk->SampleRate); 59 | + fmt_subchunk->ByteRate = __builtin_bswap32(fmt_subchunk->ByteRate); 60 | + fmt_subchunk->BlockAlign = __builtin_bswap16(fmt_subchunk->BlockAlign); 61 | + fmt_subchunk->BitsPerSample = __builtin_bswap16(fmt_subchunk->BitsPerSample); 62 | +#endif 63 | const uint32_t fmt_size = fmt_subchunk->header.Size; 64 | if (fmt_size != kFmtPcmSubchunkSize) { 65 | // There is an optional two-byte extension field permitted to be present 66 | @@ -225,6 +238,17 @@ void WritePcmWavHeader(size_t num_channels, 67 | header.fmt.BitsPerSample = static_cast(8 * bytes_per_sample); 68 | header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); 69 | header.data.header.Size = static_cast(bytes_in_payload); 70 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 71 | + header.riff.header.Size = __builtin_bswap32(header.riff.header.Size); 72 | + header.fmt.header.Size = __builtin_bswap32(header.fmt.header.Size); 73 | + header.fmt.AudioFormat = __builtin_bswap16(header.fmt.AudioFormat); 74 | + header.fmt.NumChannels = __builtin_bswap16(header.fmt.NumChannels); 75 | + header.fmt.SampleRate = __builtin_bswap32(header.fmt.SampleRate); 76 | + header.fmt.ByteRate = __builtin_bswap32(header.fmt.ByteRate); 77 | + header.fmt.BlockAlign = __builtin_bswap16(header.fmt.BlockAlign); 78 | + header.fmt.BitsPerSample = __builtin_bswap16(header.fmt.BitsPerSample); 79 | + header.data.header.Size = __builtin_bswap32(header.data.header.Size); 80 | +#endif 81 | 82 | // Do an extra copy rather than writing everything to buf directly, since buf 83 | // might not be correctly aligned. 84 | @@ -261,6 +285,19 @@ void WriteIeeeFloatWavHeader(size_t num_channels, 85 | header.fact.SampleLength = static_cast(num_channels * num_samples); 86 | header.data.header.ID = PackFourCC('d', 'a', 't', 'a'); 87 | header.data.header.Size = static_cast(bytes_in_payload); 88 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 89 | + header.riff.header.Size = __builtin_bswap32(header.riff.header.Size); 90 | + header.fmt.header.Size = __builtin_bswap32(header.fmt.header.Size); 91 | + header.fmt.AudioFormat = __builtin_bswap16(header.fmt.AudioFormat); 92 | + header.fmt.NumChannels = __builtin_bswap16(header.fmt.NumChannels); 93 | + header.fmt.SampleRate = __builtin_bswap32(header.fmt.SampleRate); 94 | + header.fmt.ByteRate = __builtin_bswap32(header.fmt.ByteRate); 95 | + header.fmt.BlockAlign = __builtin_bswap16(header.fmt.BlockAlign); 96 | + header.fmt.BitsPerSample = __builtin_bswap16(header.fmt.BitsPerSample); 97 | + header.fact.header.Size = __builtin_bswap32(header.fact.header.Size); 98 | + header.fact.SampleLength = __builtin_bswap32(header.fact.SampleLength); 99 | + header.data.header.Size = __builtin_bswap32(header.data.header.Size); 100 | +#endif 101 | 102 | // Do an extra copy rather than writing everything to buf directly, since buf 103 | // might not be correctly aligned. 104 | @@ -389,6 +426,9 @@ bool ReadWavHeader(WavHeaderReader* readable, 105 | return false; 106 | if (ReadFourCC(header.riff.Format) != "WAVE") 107 | return false; 108 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 109 | + header.riff.header.Size = __builtin_bswap32(header.riff.header.Size); 110 | +#endif 111 | 112 | // Find "fmt " and "data" chunks. While the official Wave file specification 113 | // does not put requirements on the chunks order, it is uncommon to find the 114 | -- 115 | 2.26.2 116 | 117 | 118 | From abd3d555b08aa2dad44ca83d0905cb19e81cae86 Mon Sep 17 00:00:00 2001 119 | From: Marcus Comstedt 120 | Date: Fri, 12 Mar 2021 23:28:25 +0100 121 | Subject: [PATCH 2/2] wav: Implement sample swapping 122 | 123 | --- 124 | third_party/webrtc/common_audio/wav_file.cc | 50 ++++++++++++++------- 125 | 1 file changed, 34 insertions(+), 16 deletions(-) 126 | 127 | diff --git a/third_party/webrtc/common_audio/wav_file.cc b/third_party/webrtc/common_audio/wav_file.cc 128 | index e49126f139..80891bcb2d 100644 129 | --- a/third_party/webrtc/common_audio/wav_file.cc 130 | +++ b/third_party/webrtc/common_audio/wav_file.cc 131 | @@ -89,10 +89,6 @@ void WavReader::Reset() { 132 | 133 | size_t WavReader::ReadSamples(const size_t num_samples, 134 | int16_t* const samples) { 135 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 136 | -#error "Need to convert samples to big-endian when reading from WAV file" 137 | -#endif 138 | - 139 | size_t num_samples_left_to_read = num_samples; 140 | size_t next_chunk_start = 0; 141 | while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { 142 | @@ -107,6 +103,9 @@ size_t WavReader::ReadSamples(const size_t num_samples, 143 | num_samples_read = num_bytes_read / sizeof(samples_to_convert[0]); 144 | 145 | for (size_t j = 0; j < num_samples_read; ++j) { 146 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 147 | + *(uint32_t*)&samples_to_convert[j] = __builtin_bswap32(*(uint32_t*)&samples_to_convert[j]); 148 | +#endif 149 | samples[next_chunk_start + j] = FloatToS16(samples_to_convert[j]); 150 | } 151 | } else { 152 | @@ -114,6 +113,11 @@ size_t WavReader::ReadSamples(const size_t num_samples, 153 | num_bytes_read = file_.Read(&samples[next_chunk_start], 154 | chunk_size * sizeof(samples[0])); 155 | num_samples_read = num_bytes_read / sizeof(samples[0]); 156 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 157 | + for (size_t j = 0; j < num_samples_read; ++j) { 158 | + samples[next_chunk_start + j] = __builtin_bswap16(samples[next_chunk_start + j]); 159 | + } 160 | +#endif 161 | } 162 | RTC_CHECK(num_samples_read == 0 || (num_bytes_read % num_samples_read) == 0) 163 | << "Corrupt file: file ended in the middle of a sample."; 164 | @@ -129,10 +133,6 @@ size_t WavReader::ReadSamples(const size_t num_samples, 165 | } 166 | 167 | size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { 168 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 169 | -#error "Need to convert samples to big-endian when reading from WAV file" 170 | -#endif 171 | - 172 | size_t num_samples_left_to_read = num_samples; 173 | size_t next_chunk_start = 0; 174 | while (num_samples_left_to_read > 0 && num_unread_samples_ > 0) { 175 | @@ -147,8 +147,13 @@ size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { 176 | num_samples_read = num_bytes_read / sizeof(samples_to_convert[0]); 177 | 178 | for (size_t j = 0; j < num_samples_read; ++j) { 179 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 180 | + samples[next_chunk_start + j] = 181 | + static_cast(static_cast(__builtin_bswap16(samples_to_convert[j]))); 182 | +#else 183 | samples[next_chunk_start + j] = 184 | static_cast(samples_to_convert[j]); 185 | +#endif 186 | } 187 | } else { 188 | RTC_CHECK_EQ(format_, WavFormat::kWavFormatIeeeFloat); 189 | @@ -157,6 +162,9 @@ size_t WavReader::ReadSamples(const size_t num_samples, float* const samples) { 190 | num_samples_read = num_bytes_read / sizeof(samples[0]); 191 | 192 | for (size_t j = 0; j < num_samples_read; ++j) { 193 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 194 | + *(uint32_t*)&samples[next_chunk_start + j] = __builtin_bswap32(*(uint32_t*)&samples[next_chunk_start + j]); 195 | +#endif 196 | samples[next_chunk_start + j] = 197 | FloatToFloatS16(samples[next_chunk_start + j]); 198 | } 199 | @@ -213,23 +221,31 @@ WavWriter::WavWriter(FileWrapper file, 200 | } 201 | 202 | void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) { 203 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 204 | -#error "Need to convert samples to little-endian when writing to WAV file" 205 | -#endif 206 | - 207 | for (size_t i = 0; i < num_samples; i += kMaxChunksize) { 208 | const size_t num_remaining_samples = num_samples - i; 209 | const size_t num_samples_to_write = 210 | std::min(kMaxChunksize, num_remaining_samples); 211 | 212 | if (format_ == WavFormat::kWavFormatPcm) { 213 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 214 | + std::array converted_samples; 215 | + for (size_t j = 0; j < num_samples_to_write; ++j) { 216 | + converted_samples[j] = __builtin_bswap16(samples[i + j]); 217 | + } 218 | + RTC_CHECK( 219 | + file_.Write(converted_samples.data(), num_samples_to_write * sizeof(samples[0]))); 220 | +#else 221 | RTC_CHECK( 222 | file_.Write(&samples[i], num_samples_to_write * sizeof(samples[0]))); 223 | +#endif 224 | } else { 225 | RTC_CHECK_EQ(format_, WavFormat::kWavFormatIeeeFloat); 226 | std::array converted_samples; 227 | for (size_t j = 0; j < num_samples_to_write; ++j) { 228 | converted_samples[j] = S16ToFloat(samples[i + j]); 229 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 230 | + *(uint32_t*)&converted_samples[j] = __builtin_bswap32(*(uint32_t*)&converted_samples[j]); 231 | +#endif 232 | } 233 | RTC_CHECK( 234 | file_.Write(converted_samples.data(), 235 | @@ -243,10 +259,6 @@ void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) { 236 | } 237 | 238 | void WavWriter::WriteSamples(const float* samples, size_t num_samples) { 239 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 240 | -#error "Need to convert samples to little-endian when writing to WAV file" 241 | -#endif 242 | - 243 | for (size_t i = 0; i < num_samples; i += kMaxChunksize) { 244 | const size_t num_remaining_samples = num_samples - i; 245 | const size_t num_samples_to_write = 246 | @@ -256,6 +268,9 @@ void WavWriter::WriteSamples(const float* samples, size_t num_samples) { 247 | std::array converted_samples; 248 | for (size_t j = 0; j < num_samples_to_write; ++j) { 249 | converted_samples[j] = FloatS16ToS16(samples[i + j]); 250 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 251 | + converted_samples[j] = __builtin_bswap16(converted_samples[j]); 252 | +#endif 253 | } 254 | RTC_CHECK( 255 | file_.Write(converted_samples.data(), 256 | @@ -265,6 +280,9 @@ void WavWriter::WriteSamples(const float* samples, size_t num_samples) { 257 | std::array converted_samples; 258 | for (size_t j = 0; j < num_samples_to_write; ++j) { 259 | converted_samples[j] = FloatS16ToFloat(samples[i + j]); 260 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 261 | + *(uint32_t*)&converted_samples[j] = __builtin_bswap32(*(uint32_t*)&converted_samples[j]); 262 | +#endif 263 | } 264 | RTC_CHECK( 265 | file_.Write(converted_samples.data(), 266 | -- 267 | 2.26.2 268 | 269 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/breakpad.patch: -------------------------------------------------------------------------------- 1 | From ce6430e2d28a7826a966c97559c945c64f7de55a Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:33:40 +0100 4 | Subject: [PATCH] breakpad: Disable getcontext on ppc64 5 | 6 | --- 7 | third_party/breakpad/BUILD.gn | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn 11 | index 4af3d7bbf0..5b4365d628 100644 12 | --- a/third_party/breakpad/BUILD.gn 13 | +++ b/third_party/breakpad/BUILD.gn 14 | @@ -596,7 +596,6 @@ if (is_linux || is_chromeos || is_android) { 15 | "breakpad/src/client/minidump_file_writer.h", 16 | "breakpad/src/common/convert_UTF.cc", 17 | "breakpad/src/common/convert_UTF.h", 18 | - "breakpad/src/common/linux/breakpad_getcontext.S", 19 | "breakpad/src/common/linux/elf_core_dump.cc", 20 | "breakpad/src/common/linux/elf_core_dump.h", 21 | "breakpad/src/common/linux/elfutils.cc", 22 | @@ -634,6 +633,14 @@ if (is_linux || is_chromeos || is_android) { 23 | 24 | libs = [ "dl" ] 25 | 26 | + if (current_cpu == "ppc64") { 27 | + defines = [ "HAVE_GETCONTEXT" ] 28 | + } else { 29 | + sources += [ 30 | + "breakpad/src/common/linux/breakpad_getcontext.S" 31 | + ] 32 | + } 33 | + 34 | include_dirs = [ 35 | ".", 36 | "breakpad/src", 37 | @@ -682,7 +689,6 @@ if (is_linux || is_chromeos || is_android) { 38 | "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc", 39 | "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc", 40 | "breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc", 41 | - "breakpad/src/common/linux/breakpad_getcontext_unittest.cc", 42 | "breakpad/src/common/linux/elf_core_dump_unittest.cc", 43 | "breakpad/src/common/linux/file_id_unittest.cc", 44 | "breakpad/src/common/linux/linux_libc_support_unittest.cc", 45 | -- 46 | 2.26.3 47 | 48 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/closure_compiler.patch: -------------------------------------------------------------------------------- 1 | From 1f0a8ea956afc247d55de0fd97e7d5852bf63677 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:32:08 +0100 4 | Subject: [PATCH] Remove unsupported -client option to JVM 5 | 6 | --- 7 | third_party/closure_compiler/compiler.py | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/third_party/closure_compiler/compiler.py b/third_party/closure_compiler/compiler.py 11 | index e36f24f4e6..cca3237ee1 100755 12 | --- a/third_party/closure_compiler/compiler.py 13 | +++ b/third_party/closure_compiler/compiler.py 14 | @@ -26,7 +26,6 @@ class Compiler(object): 15 | _JAVA_PATH, 16 | "-jar", 17 | "-Xms1024m", 18 | - "-client", 19 | "-XX:+TieredCompilation", 20 | ] 21 | 22 | -- 23 | 2.26.3 24 | 25 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/dav1d.patch: -------------------------------------------------------------------------------- 1 | From 2b0f7630d0f4707e654629a2896d01d30bd95f17 Mon Sep 17 00:00:00 2001 2 | From: Georgy Yakovlev 3 | Date: Wed, 27 May 2020 03:00:22 -0700 4 | Subject: [PATCH 1/2] ppc64 patchset 5 | 6 | --- 7 | third_party/dav1d/BUILD.gn | 21 +++++++++++ 8 | third_party/dav1d/config/linux/ppc64/config.h | 35 +++++++++++++++++++ 9 | third_party/dav1d/dav1d_generated.gni | 5 +++ 10 | third_party/dav1d/generate_source.py | 3 +- 11 | third_party/dav1d/libdav1d/src/ppc/types.h | 15 ++++++++ 12 | 5 files changed, 78 insertions(+), 1 deletion(-) 13 | create mode 100644 third_party/dav1d/config/linux/ppc64/config.h 14 | 15 | diff --git a/third_party/dav1d/BUILD.gn b/third_party/dav1d/BUILD.gn 16 | index 6b4566fc36..c07f732ad0 100644 17 | --- a/third_party/dav1d/BUILD.gn 18 | +++ b/third_party/dav1d/BUILD.gn 19 | @@ -184,6 +184,8 @@ static_library("dav1d_8bit") { 20 | sources += arm_template_sources 21 | } else if (current_cpu == "arm64") { 22 | sources += arm_template_sources 23 | + } else if (current_cpu == "ppc64") { 24 | + sources += ppc64_template_sources 25 | } 26 | 27 | cflags = dav1d_copts 28 | @@ -212,6 +214,8 @@ static_library("dav1d_10bit") { 29 | sources += arm_template_sources 30 | } else if (current_cpu == "arm64") { 31 | sources += arm_template_sources 32 | + } else if (current_cpu == "ppc64") { 33 | + sources += ppc64_template_sources 34 | } 35 | 36 | cflags = dav1d_copts 37 | @@ -263,6 +267,21 @@ if (current_cpu == "x86" || current_cpu == "x64") { 38 | defines = [ "PREFIX" ] 39 | } 40 | 41 | + cflags = dav1d_copts 42 | + } 43 | +} else if (current_cpu == "ppc64") { 44 | + static_library("dav1d_ppc") { 45 | + sources = [ 46 | + "libdav1d/src/ppc/cpu.c", 47 | + "libdav1d/src/ppc/cpu.h", 48 | + ] 49 | + 50 | + configs -= [ "//build/config/compiler:chromium_code" ] 51 | + configs += [ 52 | + "//build/config/compiler:no_chromium_code", 53 | + ":dav1d_config", 54 | + ] 55 | + 56 | cflags = dav1d_copts 57 | } 58 | } 59 | @@ -292,5 +311,7 @@ static_library("dav1d") { 60 | } 61 | } else if (current_cpu == "arm" || current_cpu == "arm64") { 62 | deps += [ ":dav1d_arm" ] 63 | + } else if (current_cpu == "ppc64") { 64 | + deps += [ ":dav1d_ppc" ] 65 | } 66 | } 67 | diff --git a/third_party/dav1d/config/linux/ppc64/config.h b/third_party/dav1d/config/linux/ppc64/config.h 68 | new file mode 100644 69 | index 0000000000..f6ca57f7f0 70 | --- /dev/null 71 | +++ b/third_party/dav1d/config/linux/ppc64/config.h 72 | @@ -0,0 +1,35 @@ 73 | +/* 74 | + * Autogenerated by the Meson build system. 75 | + * Do not edit, your changes will be lost. 76 | + */ 77 | + 78 | +#pragma once 79 | + 80 | +#define ARCH_AARCH64 0 81 | + 82 | +#define ARCH_ARM 0 83 | + 84 | +#define ARCH_PPC64LE 1 85 | + 86 | +#define ARCH_X86 0 87 | + 88 | +#define ARCH_X86_32 0 89 | + 90 | +#define ARCH_X86_64 0 91 | + 92 | +#define CONFIG_16BPC 1 93 | + 94 | +#define CONFIG_8BPC 1 95 | + 96 | +#define CONFIG_LOG 1 97 | + 98 | +#define ENDIANNESS_BIG 0 99 | + 100 | +#define HAVE_ASM 1 101 | + 102 | +#define HAVE_GETAUXVAL 1 103 | + 104 | +#define HAVE_POSIX_MEMALIGN 1 105 | + 106 | +#define HAVE_UNISTD_H 1 107 | + 108 | diff --git a/third_party/dav1d/dav1d_generated.gni b/third_party/dav1d/dav1d_generated.gni 109 | index c59cb0821b..3060284a84 100644 110 | --- a/third_party/dav1d/dav1d_generated.gni 111 | +++ b/third_party/dav1d/dav1d_generated.gni 112 | @@ -82,6 +82,11 @@ arm_template_sources = [ 113 | "libdav1d/src/arm/mc_init_tmpl.c", 114 | ] 115 | 116 | +ppc64_template_sources = [ 117 | + "libdav1d/src/ppc/cdef_init_tmpl.c", 118 | + "libdav1d/src/ppc/looprestoration_init_tmpl.c", 119 | +] 120 | + 121 | template_sources = [ 122 | "libdav1d/src/cdef_apply_tmpl.c", 123 | "libdav1d/src/cdef_tmpl.c", 124 | diff --git a/third_party/dav1d/generate_source.py b/third_party/dav1d/generate_source.py 125 | index 9ab5e00b83..ad3feffee4 100755 126 | --- a/third_party/dav1d/generate_source.py 127 | +++ b/third_party/dav1d/generate_source.py 128 | @@ -50,7 +50,8 @@ def WriteGn(fd): 129 | WriteArray(fd, "arm32_asm_sources", glob.glob("libdav1d/src/arm/32/*.S")) 130 | WriteArray(fd, "arm64_asm_sources", glob.glob("libdav1d/src/arm/64/*.S")) 131 | WriteArray(fd, "arm_template_sources", glob.glob("libdav1d/src/arm/*_tmpl.c")) 132 | - 133 | + WriteArray(fd, "ppc64_template_sources", glob.glob("libdav1d/src/ppc/*_tmpl.c")) 134 | + 135 | template_sources = glob.glob("libdav1d/src/*_tmpl.c") 136 | WriteArray(fd, "template_sources", template_sources) 137 | 138 | diff --git a/third_party/dav1d/libdav1d/src/ppc/types.h b/third_party/dav1d/libdav1d/src/ppc/types.h 139 | index 0b4bd72f0e..a0caa5e710 100644 140 | --- a/third_party/dav1d/libdav1d/src/ppc/types.h 141 | +++ b/third_party/dav1d/libdav1d/src/ppc/types.h 142 | @@ -51,4 +51,19 @@ 143 | #define u16l_to_i32(v) ((i32x4) vec_mergel((u16x8) v, vec_splat_u16(0))) 144 | #define i16l_to_i32(v) ((i32x4) vec_unpackl((i16x8)v)) 145 | 146 | +#if defined(__clang__) 147 | +#undef vec_splats 148 | +#define vec_splats(N) \ 149 | + _Generic((N), \ 150 | + unsigned char: ((u8x16)(N)), \ 151 | + signed char: ((i8x16)(N)), \ 152 | + unsigned short: ((u16x8)(N)), \ 153 | + signed short: ((i16x8)(N)), \ 154 | + unsigned int: ((u32x4)(N)), \ 155 | + signed int: ((i32x4)(N)), \ 156 | + unsigned long long: ((u64x2)(N)), \ 157 | + signed long long: ((i64x2)(N)) \ 158 | + ) 159 | +#endif 160 | + 161 | #endif /* DAV1D_SRC_PPC_TYPES_H */ 162 | -- 163 | 2.26.3 164 | 165 | 166 | From 3a87f841186f979890b65be2db3e0975c9853fdb Mon Sep 17 00:00:00 2001 167 | From: Marcus Comstedt 168 | Date: Wed, 6 Jan 2021 13:16:45 +0100 169 | Subject: [PATCH 2/2] Interpret "ppc64" as big endian 170 | 171 | --- 172 | third_party/dav1d/BUILD.gn | 4 ++++ 173 | third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 174 | third_party/dav1d/libdav1d/src/cpu.h | 2 +- 175 | 3 files changed, 10 insertions(+), 4 deletions(-) 176 | 177 | diff --git a/third_party/dav1d/BUILD.gn b/third_party/dav1d/BUILD.gn 178 | index c07f732ad0..ce02afa76c 100644 179 | --- a/third_party/dav1d/BUILD.gn 180 | +++ b/third_party/dav1d/BUILD.gn 181 | @@ -121,6 +121,10 @@ if (is_win) { 182 | } 183 | } 184 | 185 | +if (current_cpu == "ppc64") { 186 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 187 | +} 188 | + 189 | if (enable_nasm) { 190 | nasm_assemble("dav1d_asm") { 191 | sources = x86_asm_sources 192 | diff --git a/third_party/dav1d/config/linux/ppc64/config.h b/third_party/dav1d/config/linux/ppc64/config.h 193 | index f6ca57f7f0..c3138078ab 100644 194 | --- a/third_party/dav1d/config/linux/ppc64/config.h 195 | +++ b/third_party/dav1d/config/linux/ppc64/config.h 196 | @@ -9,7 +9,9 @@ 197 | 198 | #define ARCH_ARM 0 199 | 200 | -#define ARCH_PPC64LE 1 201 | +#define ARCH_PPC64LE 0 202 | + 203 | +#define ARCH_PPC64 1 204 | 205 | #define ARCH_X86 0 206 | 207 | @@ -23,9 +25,9 @@ 208 | 209 | #define CONFIG_LOG 1 210 | 211 | -#define ENDIANNESS_BIG 0 212 | +#define ENDIANNESS_BIG 1 213 | 214 | -#define HAVE_ASM 1 215 | +#define HAVE_ASM 0 216 | 217 | #define HAVE_GETAUXVAL 1 218 | 219 | diff --git a/third_party/dav1d/libdav1d/src/cpu.h b/third_party/dav1d/libdav1d/src/cpu.h 220 | index d5299f243b..d65edfc389 100644 221 | --- a/third_party/dav1d/libdav1d/src/cpu.h 222 | +++ b/third_party/dav1d/libdav1d/src/cpu.h 223 | @@ -36,7 +36,7 @@ 224 | 225 | #if ARCH_AARCH64 || ARCH_ARM 226 | #include "src/arm/cpu.h" 227 | -#elif ARCH_PPC64LE 228 | +#elif ARCH_PPC64LE || ARCH_PPC64 229 | #include "src/ppc/cpu.h" 230 | #elif ARCH_X86 231 | #include "src/x86/cpu.h" 232 | -- 233 | 2.26.3 234 | 235 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From 022dff7643b39fef66b82a85102b328eb76eb9b2 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/third_party/flatbuffers/src/include/flatbuffers/base.h b/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 9557380672..9607b2ff02 100644 19 | --- a/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -337,15 +337,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.26.3 42 | 43 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/perfetto.patch: -------------------------------------------------------------------------------- 1 | From 208d483a98e39519931f09737b84bc9066f72a09 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/4] protozero: Implement byte swap macros 5 | 6 | --- 7 | third_party/perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/third_party/perfetto/src/protozero/proto_decoder.cc b/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index f83c91fe95..bae031d8f6 100644 12 | --- a/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -29,7 +29,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if !PERFETTO_IS_LITTLE_ENDIAN() 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -114,6 +118,7 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -121,7 +126,9 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.26.3 48 | 49 | 50 | From cd72958f2012caad5a46a985b1b5492d0d269e1e Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/4] protozero: Swap "fixed" types 54 | 55 | --- 56 | third_party/perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/third_party/perfetto/include/perfetto/protozero/message.h b/third_party/perfetto/include/perfetto/protozero/message.h 61 | index a47db7edb3..41c41d0669 100644 62 | --- a/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -135,6 +135,13 @@ class PERFETTO_EXPORT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/third_party/perfetto/src/protozero/message.cc b/third_party/perfetto/src/protozero/message.cc 79 | index e33601c0c3..9bbccbbbfd 100644 80 | --- a/third_party/perfetto/src/protozero/message.cc 81 | +++ b/third_party/perfetto/src/protozero/message.cc 82 | @@ -24,12 +24,6 @@ 83 | #include "perfetto/protozero/message_arena.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if !PERFETTO_IS_LITTLE_ENDIAN() 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.26.3 97 | 98 | 99 | From bcf1b6647925733eea5960a8230de649a2f91fc4 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/4] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/third_party/perfetto/include/perfetto/ext/base/utils.h b/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index a680b5cd1c..f1ae36514a 100644 112 | --- a/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -28,6 +28,7 @@ 115 | 116 | #include 117 | #include 118 | +#include 119 | 120 | #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) 121 | // Even if Windows has errno.h, the all syscall-restart behavior does not apply. 122 | @@ -90,7 +91,7 @@ struct FreeDeleter { 123 | template 124 | constexpr T AssumeLittleEndian(T value) { 125 | #if !PERFETTO_IS_LITTLE_ENDIAN() 126 | - static_assert(false, "Unimplemented on big-endian archs"); 127 | + static_assert(!std::is_same::value, "Unimplemented on big-endian archs"); 128 | #endif 129 | return value; 130 | } 131 | diff --git a/third_party/perfetto/src/protozero/field.cc b/third_party/perfetto/src/protozero/field.cc 132 | index 8f9418219c..681bac5fd5 100644 133 | --- a/third_party/perfetto/src/protozero/field.cc 134 | +++ b/third_party/perfetto/src/protozero/field.cc 135 | @@ -20,9 +20,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if !PERFETTO_IS_LITTLE_ENDIAN() 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -42,14 +44,15 @@ void Field::SerializeAndAppendToInternal(Container* dst) const { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.26.3 170 | 171 | 172 | From 0a9428c5820934c82bcd8d39c08eeca30849864d Mon Sep 17 00:00:00 2001 173 | From: Marcus Comstedt 174 | Date: Sun, 14 Feb 2021 19:26:43 +0100 175 | Subject: [PATCH 4/4] BufferedFrameDeserializer: Fix endianness handling 176 | 177 | --- 178 | .../perfetto/src/ipc/buffered_frame_deserializer.cc | 13 ++++++++++--- 179 | 1 file changed, 10 insertions(+), 3 deletions(-) 180 | 181 | diff --git a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 182 | index d893dfb5c5..e6a8c6fca9 100644 183 | --- a/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 184 | +++ b/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 185 | @@ -97,7 +97,10 @@ bool BufferedFrameDeserializer::EndReceive(size_t recv_size) { 186 | // Read the header into |payload_size|. 187 | uint32_t payload_size = 0; 188 | const char* rd_ptr = buf() + consumed_size; 189 | - memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize); 190 | + memcpy(&payload_size, rd_ptr, kHeaderSize); 191 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 192 | + payload_size = __builtin_bswap32(payload_size); 193 | +#endif 194 | 195 | // Saturate the |payload_size| to prevent overflows. The > capacity_ check 196 | // below will abort the parsing. 197 | @@ -175,10 +178,14 @@ void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) { 198 | // static 199 | std::string BufferedFrameDeserializer::Serialize(const Frame& frame) { 200 | std::vector payload = frame.SerializeAsArray(); 201 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 202 | + const uint32_t payload_size = __builtin_bswap32(static_cast(payload.size())); 203 | +#else 204 | const uint32_t payload_size = static_cast(payload.size()); 205 | +#endif 206 | std::string buf; 207 | - buf.resize(kHeaderSize + payload_size); 208 | - memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize); 209 | + buf.resize(kHeaderSize + payload.size()); 210 | + memcpy(&buf[0], &payload_size, kHeaderSize); 211 | memcpy(&buf[kHeaderSize], payload.data(), payload.size()); 212 | return buf; 213 | } 214 | -- 215 | 2.26.3 216 | 217 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/quiche.patch: -------------------------------------------------------------------------------- 1 | From e5c68459e3ee99af26d85fae764d9c02fac7e8e3 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 11 Apr 2021 15:51:20 +0200 4 | Subject: [PATCH 1/3] simple_epoll_server: Include for strerror_r 5 | 6 | --- 7 | net/third_party/quiche/src/epoll_server/simple_epoll_server.cc | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/net/third_party/quiche/src/epoll_server/simple_epoll_server.cc b/net/third_party/quiche/src/epoll_server/simple_epoll_server.cc 11 | index 09831dbf76..5918447ce7 100644 12 | --- a/net/third_party/quiche/src/epoll_server/simple_epoll_server.cc 13 | +++ b/net/third_party/quiche/src/epoll_server/simple_epoll_server.cc 14 | @@ -7,6 +7,7 @@ 15 | #include // for errno and strerror_r 16 | #include // for abort 17 | #include // For read, pipe, close and write. 18 | +#include 19 | 20 | #include 21 | #include 22 | -- 23 | 2.26.3 24 | 25 | 26 | From 4269421ba2888c3a0a42401ad98ee02d39b6d169 Mon Sep 17 00:00:00 2001 27 | From: Marcus Comstedt 28 | Date: Sun, 11 Apr 2021 15:52:01 +0200 29 | Subject: [PATCH 2/3] quiche_endian: Include for std::begin 30 | 31 | --- 32 | net/third_party/quiche/src/common/quiche_endian.h | 1 + 33 | 1 file changed, 1 insertion(+) 34 | 35 | diff --git a/net/third_party/quiche/src/common/quiche_endian.h b/net/third_party/quiche/src/common/quiche_endian.h 36 | index f322b04406..f7ee929d70 100644 37 | --- a/net/third_party/quiche/src/common/quiche_endian.h 38 | +++ b/net/third_party/quiche/src/common/quiche_endian.h 39 | @@ -8,6 +8,7 @@ 40 | #include 41 | #include 42 | #include 43 | +#include 44 | 45 | #include "common/platform/api/quiche_export.h" 46 | 47 | -- 48 | 2.26.3 49 | 50 | 51 | From 2881a95ea125835bc7caa36e0d0601d84564fcbe Mon Sep 17 00:00:00 2001 52 | From: Marcus Comstedt 53 | Date: Sun, 11 Apr 2021 15:52:57 +0200 54 | Subject: [PATCH 3/3] quiche_endian: Handle big endian hosts correctly 55 | 56 | --- 57 | net/third_party/quiche/src/common/quiche_endian.h | 15 +++++++++++++-- 58 | 1 file changed, 13 insertions(+), 2 deletions(-) 59 | 60 | diff --git a/net/third_party/quiche/src/common/quiche_endian.h b/net/third_party/quiche/src/common/quiche_endian.h 61 | index f7ee929d70..029124c0b1 100644 62 | --- a/net/third_party/quiche/src/common/quiche_endian.h 63 | +++ b/net/third_party/quiche/src/common/quiche_endian.h 64 | @@ -16,7 +16,7 @@ namespace quiche { 65 | 66 | enum Endianness { 67 | NETWORK_BYTE_ORDER, // big endian 68 | - HOST_BYTE_ORDER // little endian 69 | + HOST_BYTE_ORDER // either little or big endian 70 | }; 71 | 72 | // Provide utility functions that convert from/to network order (big endian) 73 | @@ -24,6 +24,7 @@ enum Endianness { 74 | // platform). 75 | class QUICHE_EXPORT_PRIVATE QuicheEndian { 76 | public: 77 | +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 78 | // Convert |x| from host order (little endian) to network order (big endian). 79 | #if defined(__clang__) || \ 80 | (defined(__GNUC__) && \ 81 | @@ -36,14 +37,24 @@ class QUICHE_EXPORT_PRIVATE QuicheEndian { 82 | static uint32_t HostToNet32(uint32_t x) { return PortableByteSwap(x); } 83 | static uint64_t HostToNet64(uint64_t x) { return PortableByteSwap(x); } 84 | #endif 85 | +#else 86 | + // Host order is the same as network order (big endian) 87 | + static uint16_t HostToNet16(uint16_t x) { return x; } 88 | + static uint32_t HostToNet32(uint32_t x) { return x; } 89 | + static uint64_t HostToNet64(uint64_t x) { return x; } 90 | +#endif 91 | 92 | - // Convert |x| from network order (big endian) to host order (little endian). 93 | + // Convert |x| from network order (big endian) to host order (little/big endian). 94 | static uint16_t NetToHost16(uint16_t x) { return HostToNet16(x); } 95 | static uint32_t NetToHost32(uint32_t x) { return HostToNet32(x); } 96 | static uint64_t NetToHost64(uint64_t x) { return HostToNet64(x); } 97 | 98 | // Returns true if current host order is little endian. 99 | +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 100 | static bool HostIsLittleEndian() { return true; } 101 | +#else 102 | + static bool HostIsLittleEndian() { return false; } 103 | +#endif 104 | 105 | // Left public for tests. 106 | template 107 | -- 108 | 2.26.3 109 | 110 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/swiftshader.patch: -------------------------------------------------------------------------------- 1 | From 24c700ab79d901c99f000fde50d56707d6372ed6 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:36:38 +0100 4 | Subject: [PATCH 1/2] Add some sources needed on ppc64 to the build 5 | 6 | --- 7 | third_party/swiftshader/third_party/llvm-10.0/BUILD.gn | 3 +++ 8 | 1 file changed, 3 insertions(+) 9 | 10 | diff --git a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 11 | index 9ab811c288..d91874a500 100644 12 | --- a/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 13 | +++ b/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 14 | @@ -577,6 +577,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { 15 | "llvm/lib/MC/MCAsmBackend.cpp", 16 | "llvm/lib/MC/MCAsmInfo.cpp", 17 | "llvm/lib/MC/MCAsmInfoCOFF.cpp", 18 | + "llvm/lib/MC/MCAsmInfoXCOFF.cpp", 19 | "llvm/lib/MC/MCAsmInfoDarwin.cpp", 20 | "llvm/lib/MC/MCAsmInfoELF.cpp", 21 | "llvm/lib/MC/MCAsmMacro.cpp", 22 | @@ -634,6 +635,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { 23 | "llvm/lib/MC/MCWinCOFFStreamer.cpp", 24 | "llvm/lib/MC/MCWinEH.cpp", 25 | "llvm/lib/MC/MCXCOFFStreamer.cpp", 26 | + "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp", 27 | "llvm/lib/MC/MachObjectWriter.cpp", 28 | "llvm/lib/MC/StringTableBuilder.cpp", 29 | "llvm/lib/MC/SubtargetFeature.cpp", 30 | @@ -854,6 +856,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { 31 | "llvm/lib/Support/ARMAttributeParser.cpp", 32 | "llvm/lib/Support/ARMBuildAttrs.cpp", 33 | "llvm/lib/Support/ARMTargetParser.cpp", 34 | + "llvm/lib/Support/Atomic.cpp", 35 | "llvm/lib/Support/BinaryStreamError.cpp", 36 | "llvm/lib/Support/BinaryStreamReader.cpp", 37 | "llvm/lib/Support/BinaryStreamRef.cpp", 38 | -- 39 | 2.26.3 40 | 41 | 42 | From 4c2d9141f49181d403ed567f6e9bf01e9bae527f Mon Sep 17 00:00:00 2001 43 | From: Marcus Comstedt 44 | Date: Sun, 14 Feb 2021 20:52:18 +0100 45 | Subject: [PATCH 2/2] Implement support for ppc64 ELFv1 46 | 47 | This commit adds Yarn support for powerpc64 machines 48 | using the ELFv1 ABI. The changes have been tested on 49 | a POWER9 machine running in Big Endian mode and all 50 | unit tests pass. 51 | --- 52 | .../third_party/marl/src/osfiber_asm_ppc64.S | 12 ++++++++++++ 53 | .../third_party/marl/src/osfiber_asm_ppc64.h | 5 ----- 54 | .../third_party/marl/src/osfiber_ppc64.c | 14 ++++++++++++-- 55 | 3 files changed, 24 insertions(+), 7 deletions(-) 56 | 57 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 58 | index afc143dd76..6c0ba5ae2b 100644 59 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 60 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.S 61 | @@ -23,8 +23,20 @@ 62 | .text 63 | .global marl_fiber_swap 64 | .align 4 65 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 66 | +.global .marl_fiber_swap 67 | +.pushsection ".opd","aw" 68 | +marl_fiber_swap: 69 | +.quad .marl_fiber_swap 70 | +.quad .TOC.@tocbase 71 | +.quad 0 72 | +.popsection 73 | +.type .marl_fiber_swap,@function 74 | +.marl_fiber_swap: 75 | +#else 76 | .type marl_fiber_swap @function 77 | marl_fiber_swap: 78 | +#endif 79 | 80 | // Store non-volatile registers 81 | std 1, MARL_REG_R1(3) 82 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 83 | index 402bece9f1..f4d20a9e52 100644 84 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 85 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_asm_ppc64.h 86 | @@ -123,11 +123,6 @@ struct marl_fiber_context { 87 | uintptr_t vmx[12 * 2]; 88 | }; 89 | 90 | -// Only the ELFv2 ABI is supported for now. 91 | -#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 92 | -#error "Only the ppc64 ELFv2 ABI is supported." 93 | -#endif 94 | - 95 | #ifdef __cplusplus 96 | #include 97 | static_assert(offsetof(marl_fiber_context, r1) == MARL_REG_R1, 98 | diff --git a/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c b/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 99 | index c325d7de07..48c4d9af90 100644 100 | --- a/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 101 | +++ b/third_party/swiftshader/third_party/marl/src/osfiber_ppc64.c 102 | @@ -29,19 +29,29 @@ void marl_fiber_set_target(struct marl_fiber_context* ctx, 103 | uint32_t stack_size, 104 | void (*target)(void*), 105 | void* arg) { 106 | - uintptr_t stack_top = (uintptr_t)((uint8_t*)(stack) + stack_size); 107 | + uintptr_t stack_top = (uintptr_t)((uint8_t*)(stack) + stack_size - sizeof(uintptr_t)); 108 | if ((stack_top % 16) != 0) { 109 | stack_top -= (stack_top % 16); 110 | } 111 | 112 | - // Write a backchain and subtract a minimum stack frame size (32) 113 | + // Write a backchain and subtract a minimum stack frame size (32/48) 114 | *(uintptr_t*)stack_top = 0; 115 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 116 | + stack_top -= 48; 117 | + *(uintptr_t*)stack_top = stack_top + 48; 118 | +#else 119 | stack_top -= 32; 120 | *(uintptr_t*)stack_top = stack_top + 32; 121 | +#endif 122 | 123 | // Load registers 124 | ctx->r1 = stack_top; 125 | +#if !defined(_CALL_ELF) || (_CALL_ELF != 2) 126 | + ctx->lr = ((const uintptr_t *)marl_fiber_trampoline)[0]; 127 | + ctx->r2 = ((const uintptr_t *)marl_fiber_trampoline)[1]; 128 | +#else 129 | ctx->lr = (uintptr_t)marl_fiber_trampoline; 130 | +#endif 131 | ctx->r3 = (uintptr_t)target; 132 | ctx->r4 = (uintptr_t)arg; 133 | 134 | -- 135 | 2.26.3 136 | 137 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/v8.patch: -------------------------------------------------------------------------------- 1 | From 19cc8cda56a165f151d700d4cec7400052c0484a Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH] Support 64K pages 5 | 6 | --- 7 | v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/v8/src/base/platform/platform-posix.cc b/v8/src/base/platform/platform-posix.cc 11 | index ab0d7839a4..9c8332ac15 100644 12 | --- a/v8/src/base/platform/platform-posix.cc 13 | +++ b/v8/src/base/platform/platform-posix.cc 14 | @@ -304,7 +304,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.26.3 25 | 26 | -------------------------------------------------------------------------------- /chromium-89.0.4389.114/webp.patch: -------------------------------------------------------------------------------- 1 | From 6f618234242e261081d0803f47b9d7aca11284fe Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/media/parsers/webp_parser.cc b/media/parsers/webp_parser.cc 11 | index 9d2ba7a12a..f5ad730153 100644 12 | --- a/media/parsers/webp_parser.cc 13 | +++ b/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.26.3 27 | 28 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/0gyakovlev/enable-ppc64-build.patch: -------------------------------------------------------------------------------- 1 | From 463f1234c57a36e78ff666bd55094a9d4e68f296 Mon Sep 17 00:00:00 2001 2 | From: q66 3 | Date: Sat, 18 Jan 2020 23:52:55 +0100 4 | Subject: [PATCH 1/3] Enable ppc64 builds 5 | 6 | --- 7 | configure.pri | 1 + 8 | mkspecs/features/functions.prf | 1 + 9 | 2 files changed, 2 insertions(+) 10 | 11 | diff --git a/configure.pri b/configure.pri 12 | index 3a144e3f8..cabe8b24a 100644 13 | --- a/configure.pri 14 | +++ b/configure.pri 15 | @@ -144,6 +144,7 @@ defineTest(qtConfTest_detectArch) { 16 | contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true) 17 | contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true) 18 | contains(QT_ARCH, "mips"): return(true) 19 | + contains(QT_ARCH, "power64"): return(true) 20 | qtLog("Architecture not supported.") 21 | return(false) 22 | } 23 | diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf 24 | index 512e2523b..e31123654 100644 25 | --- a/mkspecs/features/functions.prf 26 | +++ b/mkspecs/features/functions.prf 27 | @@ -87,6 +87,7 @@ defineReplace(gnArch) { 28 | contains(qtArch, "arm64"): return(arm64) 29 | contains(qtArch, "mips"): return(mipsel) 30 | contains(qtArch, "mips64"): return(mips64el) 31 | + contains(qtArch, "power64"): return(ppc64) 32 | return(unknown) 33 | } 34 | 35 | -- 36 | 2.26.0 37 | 38 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/0gyakovlev/qtwebengine-5.15.0-ppc64-ffmpeg.patch: -------------------------------------------------------------------------------- 1 | From 10ed6360df1806805abd361aae7affe48a899507 Mon Sep 17 00:00:00 2001 2 | From: Georgy Yakovlev 3 | Date: Wed, 27 May 2020 03:01:09 -0700 4 | Subject: [PATCH 2/3] ppc64 ffmpeg patchset 5 | 6 | --- 7 | .../ffmpeg/chromium/scripts/build_ffmpeg.py | 10 ++++++++-- 8 | .../third_party/ffmpeg/chromium/scripts/copy_config.sh | 2 +- 9 | .../third_party/ffmpeg/chromium/scripts/generate_gn.py | 2 +- 10 | .../ffmpeg/chromium/scripts/generate_gn_unittest.py | 10 ++++++++-- 11 | .../chromium/third_party/ffmpeg/libavformat/utils.c | 2 +- 12 | 5 files changed, 19 insertions(+), 7 deletions(-) 13 | 14 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 15 | index 23d5c0f57..205048778 100755 16 | --- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 17 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 18 | @@ -36,7 +36,7 @@ ARCH_MAP = { 19 | 'android': ['ia32', 'x64', 'arm-neon', 'arm64'], 20 | 'linux': [ 21 | 'ia32', 'x64', 'mipsel', 'mips64el', 'noasm-x64', 'arm', 'arm-neon', 22 | - 'arm64' 23 | + 'arm64', 'ppc64' 24 | ], 25 | 'mac': ['x64'], 26 | 'win': ['ia32', 'x64', 'arm64'], 27 | @@ -128,6 +128,8 @@ def DetermineHostOsAndArch(): 28 | host_arch = 'mips64el' 29 | elif platform.machine().startswith('arm'): 30 | host_arch = 'arm' 31 | + elif platform.machine() == 'ppc64le': 32 | + host_arch = 'ppc64' 33 | else: 34 | return None 35 | 36 | @@ -789,6 +791,10 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, 37 | '--extra-cflags=--target=mips64el-linux-gnuabi64', 38 | '--extra-ldflags=--target=mips64el-linux-gnuabi64', 39 | ]) 40 | + elif target_arch == 'ppc64': 41 | + configure_flags['Common'].extend([ 42 | + '--arch=ppc64le' 43 | + ]) 44 | else: 45 | print( 46 | 'Error: Unknown target arch %r for target OS %r!' % (target_arch, 47 | @@ -814,7 +820,7 @@ def ConfigureAndBuild(target_arch, target_os, host_os, host_arch, parallel_jobs, 48 | # typically be the system one, so explicitly configure use of Clang's 49 | # ld.lld, to ensure that things like cross-compilation and LTO work. 50 | # This does not work for ia32 and is always used on mac. 51 | - if target_arch != 'ia32' and target_os != 'mac': 52 | + if target_arch not in ['ia32', 'ppc64'] and target_os != 'mac': 53 | configure_flags['Common'].append('--extra-ldflags=-fuse-ld=lld') 54 | 55 | # Should be run on Mac, unless we're cross-compiling on Linux. 56 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh 57 | index 0e5159d6f..7e4e8175f 100755 58 | --- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh 59 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/copy_config.sh 60 | @@ -10,7 +10,7 @@ for os in android linux linux-noasm mac win; do 61 | # Copy config files for various architectures: 62 | # - ia32/x64 have config.asm, config.h 63 | # - arm/arm-neon have config.h 64 | - for arch in arm arm-neon arm64 ia32 x64 mipsel mips64el; do 65 | + for arch in arm arm-neon arm64 ia32 x64 mipsel mips64el ppc64; do 66 | # Don't waste time on non-existent configs, if no config.h then skip. 67 | [ ! -e "build.$arch.$os/$target/config.h" ] && continue 68 | for f in config.h config.asm libavutil/avconfig.h libavutil/ffversion.h libavcodec/bsf_list.c libavcodec/codec_list.c libavcodec/parser_list.c libavformat/demuxer_list.c libavformat/muxer_list.c libavformat/protocol_list.c; do 69 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py 70 | index d2b3d1052..f6dfbcadd 100755 71 | --- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py 72 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn.py 73 | @@ -77,7 +77,7 @@ GN_SOURCE_END = """] 74 | Attr = enum('ARCHITECTURE', 'TARGET', 'PLATFORM') 75 | SUPPORT_MATRIX = { 76 | Attr.ARCHITECTURE: 77 | - set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'mipsel', 'mips64el']), 78 | + set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'mipsel', 'mips64el', 'ppc64']), 79 | Attr.TARGET: 80 | set(['Chromium', 'Chrome', 'ChromeOS']), 81 | Attr.PLATFORM: 82 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py 83 | index 9f3cf17e0..4bb4893a6 100755 84 | --- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py 85 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py 86 | @@ -324,6 +324,10 @@ class SourceSetUnittest(unittest.TestCase): 87 | f = SourceSet( 88 | set(['common', 'arm-neon', 'chrome', 'chromeos']), 89 | set([SourceListCondition('arm-neon', 'ChromeOS', 'linux')])) 90 | + g = SourceSet( 91 | + set(['common']), 92 | + set([SourceListCondition('ppc64', 'Chromium', 'linux')])) 93 | + 94 | 95 | expected = set() 96 | expected.add( 97 | @@ -335,7 +339,8 @@ class SourceSetUnittest(unittest.TestCase): 98 | SourceListCondition('x64', 'Chromium', 'linux'), 99 | SourceListCondition('x64', 'Chrome', 'linux'), 100 | SourceListCondition('arm', 'Chromium', 'linux'), 101 | - SourceListCondition('arm-neon', 'ChromeOS', 'linux') 102 | + SourceListCondition('arm-neon', 'ChromeOS', 'linux'), 103 | + SourceListCondition('ppc64', 'Chromium', 'linux') 104 | ]))) 105 | expected.add( 106 | SourceSet( 107 | @@ -363,7 +368,7 @@ class SourceSetUnittest(unittest.TestCase): 108 | set(['arm-neon', 'chromeos']), 109 | set([SourceListCondition('arm-neon', 'ChromeOS', 'linux')]))) 110 | 111 | - source_sets = gg.CreatePairwiseDisjointSets([a, b, c, d, e, f]) 112 | + source_sets = gg.CreatePairwiseDisjointSets([a, b, c, d, e, f, g]) 113 | self.assertEqualSourceSets(expected, set(source_sets)) 114 | 115 | def testReduceConditions(self): 116 | @@ -378,6 +383,7 @@ class SourceSetUnittest(unittest.TestCase): 117 | SourceListCondition('arm-neon', 'Chromium', 'linux'), 118 | SourceListCondition('mipsel', 'Chromium', 'linux'), 119 | SourceListCondition('mips64el', 'Chromium', 'linux'), 120 | + SourceListCondition('ppc64', 'Chromium', 'linux'), 121 | ])) 122 | gg.ReduceConditionalLogic(a) 123 | 124 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/libavformat/utils.c b/src/3rdparty/chromium/third_party/ffmpeg/libavformat/utils.c 125 | index 7f2b248bf..ad57c11f4 100644 126 | --- a/src/3rdparty/chromium/third_party/ffmpeg/libavformat/utils.c 127 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/libavformat/utils.c 128 | @@ -3349,7 +3349,7 @@ int ff_get_extradata(AVFormatContext *s, AVCodecParameters *par, AVIOContext *pb 129 | 130 | int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t ts) 131 | { 132 | - int i, j; 133 | + volatile int i, j; 134 | int64_t last = st->info->last_dts; 135 | 136 | if ( ts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && ts > last 137 | -- 138 | 2.26.2 139 | 140 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/dav1d.patch: -------------------------------------------------------------------------------- 1 | From 8fb9e37868c3fe5960fac2b72e432b087c7b88a4 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:16:45 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | src/3rdparty/chromium/third_party/dav1d/BUILD.gn | 4 ++++ 8 | .../third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 9 | .../chromium/third_party/dav1d/libdav1d/src/cpu.h | 2 +- 10 | 3 files changed, 10 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 13 | index 99cc13fd9..64e37dcd5 100644 14 | --- a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 15 | +++ b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 16 | @@ -115,6 +115,10 @@ if (is_win) { 17 | } 18 | } 19 | 20 | +if (current_cpu == "ppc64") { 21 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 22 | +} 23 | + 24 | if (enable_nasm) { 25 | nasm_assemble("dav1d_asm") { 26 | sources = x86_asm_sources 27 | diff --git a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 28 | index f6ca57f7f..c3138078a 100644 29 | --- a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 30 | +++ b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 31 | @@ -9,7 +9,9 @@ 32 | 33 | #define ARCH_ARM 0 34 | 35 | -#define ARCH_PPC64LE 1 36 | +#define ARCH_PPC64LE 0 37 | + 38 | +#define ARCH_PPC64 1 39 | 40 | #define ARCH_X86 0 41 | 42 | @@ -23,9 +25,9 @@ 43 | 44 | #define CONFIG_LOG 1 45 | 46 | -#define ENDIANNESS_BIG 0 47 | +#define ENDIANNESS_BIG 1 48 | 49 | -#define HAVE_ASM 1 50 | +#define HAVE_ASM 0 51 | 52 | #define HAVE_GETAUXVAL 1 53 | 54 | diff --git a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 55 | index dd9f7c913..187de616b 100644 56 | --- a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 57 | +++ b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 58 | @@ -36,7 +36,7 @@ 59 | 60 | #if ARCH_AARCH64 || ARCH_ARM 61 | #include "src/arm/cpu.h" 62 | -#elif ARCH_PPC64LE 63 | +#elif ARCH_PPC64LE || ARCH_PPC64 64 | #include "src/ppc/cpu.h" 65 | #elif ARCH_X86 66 | #include "src/x86/cpu.h" 67 | -- 68 | 2.26.2 69 | 70 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/ffmpeg.patch: -------------------------------------------------------------------------------- 1 | From 2f937ff78a3b90446ee8d1b8b9ee11d7d93751fc Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Mon, 24 Sep 2018 18:11:23 +0200 4 | Subject: [PATCH] build_ffmpeg: Recognize ppc64 5 | 6 | --- 7 | .../third_party/ffmpeg/chromium/scripts/build_ffmpeg.py | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 11 | index 205048778..85c29b0a7 100755 12 | --- a/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 13 | +++ b/src/3rdparty/chromium/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py 14 | @@ -128,7 +128,7 @@ def DetermineHostOsAndArch(): 15 | host_arch = 'mips64el' 16 | elif platform.machine().startswith('arm'): 17 | host_arch = 'arm' 18 | - elif platform.machine() == 'ppc64le': 19 | + elif platform.machine() == 'ppc64' or platform.machine() == 'ppc64le': 20 | host_arch = 'ppc64' 21 | else: 22 | return None 23 | -- 24 | 2.26.2 25 | 26 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From 0bc8325b38db60b161e2e8dd13cbaa8b7c7d4601 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | .../third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 86ecf2386..161689c1e 100644 19 | --- a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -330,15 +330,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.26.2 42 | 43 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/pdfium.patch: -------------------------------------------------------------------------------- 1 | From 25419959e25b165e391a56b0106b85c92ab8d399 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:30:09 +0100 4 | Subject: [PATCH] Support 64K pages on ppc64 5 | 6 | --- 7 | .../partition_allocator/page_allocator_constants.h | 6 ++++-- 8 | .../partition_allocator/partition_alloc_constants.h | 4 +++- 9 | 2 files changed, 7 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h 12 | index 945273b1f..c412b76c2 100644 13 | --- a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h 14 | +++ b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/page_allocator_constants.h 15 | @@ -11,7 +11,7 @@ 16 | 17 | namespace pdfium { 18 | namespace base { 19 | -#if defined(OS_WIN) 20 | +#if defined(OS_WIN) || defined(__powerpc64__) 21 | static constexpr size_t kPageAllocationGranularityShift = 16; // 64KB 22 | #elif defined(_MIPS_ARCH_LOONGSON) 23 | static constexpr size_t kPageAllocationGranularityShift = 14; // 16KB 24 | @@ -25,7 +25,9 @@ static constexpr size_t kPageAllocationGranularityOffsetMask = 25 | static constexpr size_t kPageAllocationGranularityBaseMask = 26 | ~kPageAllocationGranularityOffsetMask; 27 | 28 | -#if defined(_MIPS_ARCH_LOONGSON) 29 | +#if defined(__powerpc64__) 30 | +static constexpr size_t kSystemPageSize = 65536; 31 | +#elif defined(_MIPS_ARCH_LOONGSON) 32 | static constexpr size_t kSystemPageSize = 16384; 33 | #else 34 | static constexpr size_t kSystemPageSize = 4096; 35 | diff --git a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h 36 | index 437e4dffd..3f40c322b 100644 37 | --- a/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h 38 | +++ b/src/3rdparty/chromium/third_party/pdfium/third_party/base/allocator/partition_allocator/partition_alloc_constants.h 39 | @@ -34,7 +34,9 @@ static const size_t kBucketShift = (kAllocationGranularity == 8) ? 3 : 2; 40 | // other constant values, we pack _all_ `PartitionRootGeneric::Alloc` sizes 41 | // perfectly up against the end of a system page. 42 | 43 | -#if defined(_MIPS_ARCH_LOONGSON) 44 | +#if defined(__powerpc64__) 45 | +static const size_t kPartitionPageShift = 18; // 256 KiB 46 | +#elif defined(_MIPS_ARCH_LOONGSON) 47 | static const size_t kPartitionPageShift = 16; // 64 KiB 48 | #else 49 | static const size_t kPartitionPageShift = 14; // 16 KiB 50 | -- 51 | 2.26.2 52 | 53 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/perfetto.patch: -------------------------------------------------------------------------------- 1 | From 78dad940f2a5c1456e95e007f77c25b353c3d132 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/3] protozero: Implement byte swap macros 5 | 6 | --- 7 | .../perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index b606818a5..926af8282 100644 12 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -28,7 +28,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -113,6 +117,7 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -120,7 +125,9 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.26.2 48 | 49 | 50 | From 8b2e883abd92319e6d4dcf9d2275965e9be65e4a Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/3] protozero: Swap "fixed" types 54 | 55 | --- 56 | .../perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | .../chromium/third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 61 | index b53dcda3c..ade415116 100644 62 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -137,6 +137,13 @@ class PERFETTO_EXPORT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 79 | index 419f7f143..1a605040b 100644 80 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 81 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 82 | @@ -22,12 +22,6 @@ 83 | #include "perfetto/base/logging.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.26.2 97 | 98 | 99 | From 85d97337a52eea1a95a0c1891692859ef96a1743 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/3] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | .../third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index 9ec43ad44..06485d6b0 100644 112 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -23,6 +23,7 @@ 115 | #include 116 | #include 117 | #include 118 | +#include 119 | #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) 120 | #include 121 | #endif 122 | @@ -72,7 +73,7 @@ struct FreeDeleter { 123 | 124 | template 125 | constexpr T AssumeLittleEndian(T value) { 126 | - static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 127 | + static_assert(std::is_same::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 128 | "Unimplemented on big-endian archs"); 129 | return value; 130 | } 131 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 132 | index c92f7cee9..c4d27cb52 100644 133 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 134 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 135 | @@ -19,9 +19,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -40,14 +42,15 @@ void Field::SerializeAndAppendTo(std::string* dst) { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.26.2 170 | 171 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/qtcomposer.patch: -------------------------------------------------------------------------------- 1 | From dedc5c188caf11049f0de1acbe1fc9bb749e3fc2 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:35:58 +0100 4 | Subject: [PATCH] Fix compositing of kBGRA_8888_SkColorType on big endian 5 | 6 | --- 7 | src/core/compositor/display_software_output_surface.cpp | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp 11 | index ba99799f0..4f8e00167 100644 12 | --- a/src/core/compositor/display_software_output_surface.cpp 13 | +++ b/src/core/compositor/display_software_output_surface.cpp 14 | @@ -111,7 +111,12 @@ inline QImage::Format imageFormat(SkColorType colorType) 15 | { 16 | switch (colorType) { 17 | case kBGRA_8888_SkColorType: 18 | +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 19 | return QImage::Format_ARGB32_Premultiplied; 20 | +#else 21 | + // R/B swap needed... 22 | + return QImage::Format_RGBA8888_Premultiplied; 23 | +#endif 24 | case kRGBA_8888_SkColorType: 25 | return QImage::Format_RGBA8888_Premultiplied; 26 | default: 27 | @@ -135,6 +140,10 @@ QSGNode *DisplaySoftwareOutputSurface::Device::updatePaintNode( 28 | QImage image(reinterpret_cast(skPixmap.addr()), 29 | viewport_pixel_size_.width(), viewport_pixel_size_.height(), 30 | skPixmap.rowBytes(), imageFormat(skPixmap.colorType())); 31 | +#if Q_BYTE_ORDER == Q_BIG_ENDIAN 32 | + if (skPixmap.colorType() == kBGRA_8888_SkColorType) 33 | + image = image.rgbSwapped(); 34 | +#endif 35 | if (m_image.size() == image.size()) { 36 | QRect damageRect = toQt(damage_rect_); 37 | QPainter painter(&m_image); 38 | -- 39 | 2.26.2 40 | 41 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/v8.patch: -------------------------------------------------------------------------------- 1 | From 5162d9981a3154c9aec95187842ecc9da258e23d Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH 1/2] Support 64K pages 5 | 6 | --- 7 | src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 11 | index 0424d4c13..340a137d7 100644 12 | --- a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 13 | +++ b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 14 | @@ -273,7 +273,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.26.2 25 | 26 | 27 | From b7694dd416a17dad32d804b7d366cf836e5ff29a Mon Sep 17 00:00:00 2001 28 | From: Marcus Comstedt 29 | Date: Wed, 6 Jan 2021 13:52:44 +0100 30 | Subject: [PATCH 2/2] Change function descriptor tests to not rely on AIX 31 | 32 | --- 33 | .../chromium/v8/src/compiler/backend/instruction-selector.cc | 2 +- 34 | .../chromium/v8/src/compiler/backend/ppc/code-generator-ppc.cc | 2 +- 35 | src/3rdparty/chromium/v8/src/execution/simulator.h | 2 +- 36 | 3 files changed, 3 insertions(+), 3 deletions(-) 37 | 38 | diff --git a/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc b/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc 39 | index e5579d27e..64e017a9d 100644 40 | --- a/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc 41 | +++ b/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc 42 | @@ -2799,7 +2799,7 @@ void InstructionSelector::VisitCall(Node* node, BasicBlock* handler) { 43 | switch (call_descriptor->kind()) { 44 | case CallDescriptor::kCallAddress: { 45 | int misc_field = static_cast(call_descriptor->ParameterCount()); 46 | -#if defined(_AIX) 47 | +#if ABI_USES_FUNCTION_DESCRIPTORS 48 | // Highest misc_field bit is used on AIX to indicate if a CFunction call 49 | // has function descriptor or not. 50 | if (!call_descriptor->NoFunctionDescriptor()) { 51 | diff --git a/src/3rdparty/chromium/v8/src/compiler/backend/ppc/code-generator-ppc.cc b/src/3rdparty/chromium/v8/src/compiler/backend/ppc/code-generator-ppc.cc 52 | index e351cfb8f..bed31df69 100644 53 | --- a/src/3rdparty/chromium/v8/src/compiler/backend/ppc/code-generator-ppc.cc 54 | +++ b/src/3rdparty/chromium/v8/src/compiler/backend/ppc/code-generator-ppc.cc 55 | @@ -1032,7 +1032,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( 56 | bool isWasmCapiFunction = 57 | linkage()->GetIncomingDescriptor()->IsWasmCapiFunction(); 58 | int offset = 9 * kInstrSize; 59 | -#if defined(_AIX) 60 | +#if ABI_USES_FUNCTION_DESCRIPTORS 61 | // AIX/PPC64BE Linux uses a function descriptor 62 | int kNumParametersMask = kHasFunctionDescriptorBitMask - 1; 63 | num_parameters = kNumParametersMask & misc_field; 64 | diff --git a/src/3rdparty/chromium/v8/src/execution/simulator.h b/src/3rdparty/chromium/v8/src/execution/simulator.h 65 | index 4000973a2..23573ee9e 100644 66 | --- a/src/3rdparty/chromium/v8/src/execution/simulator.h 67 | +++ b/src/3rdparty/chromium/v8/src/execution/simulator.h 68 | @@ -128,7 +128,7 @@ class GeneratedCode { 69 | #if defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN) 70 | FATAL("Generated code execution not possible during cross-compilation."); 71 | #endif // defined(V8_TARGET_OS_WIN) && !defined(V8_OS_WIN) 72 | -#if V8_OS_AIX 73 | +#if USES_FUNCTION_DESCRIPTORS 74 | // AIX ABI requires function descriptors (FD). Artificially create a pseudo 75 | // FD to ensure correct dispatch to generated code. The 'volatile' 76 | // declaration is required to avoid the compiler from not observing the 77 | -- 78 | 2.26.2 79 | 80 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/webp.patch: -------------------------------------------------------------------------------- 1 | From d4a846bdb742c17e370e5934699a8a4756bf9fa1 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | src/3rdparty/chromium/media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/media/parsers/webp_parser.cc b/src/3rdparty/chromium/media/parsers/webp_parser.cc 11 | index b0348037e..efd8014a5 100644 12 | --- a/src/3rdparty/chromium/media/parsers/webp_parser.cc 13 | +++ b/src/3rdparty/chromium/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.26.2 27 | 28 | -------------------------------------------------------------------------------- /qtwebengine-5.15.1/webrtc.patch: -------------------------------------------------------------------------------- 1 | From a4bfa0a80a171cfe8791d9836fc016acd0948915 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:51:07 +0200 4 | Subject: [PATCH 1/2] wav: Implement be-to-le functions 5 | 6 | --- 7 | .../webrtc/common_audio/wav_header.cc | 21 ++++++++++++++++++- 8 | 1 file changed, 20 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc b/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc 11 | index 15eb1f844..ce32cb344 100644 12 | --- a/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc 13 | +++ b/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_header.cc 14 | @@ -86,7 +86,26 @@ static inline std::string ReadFourCC(uint32_t x) { 15 | return std::string(reinterpret_cast(&x), 4); 16 | } 17 | #else 18 | -#error "Write be-to-le conversion functions" 19 | +static inline void WriteLE16(uint16_t* f, uint16_t x) { 20 | + *f = __builtin_bswap16(x); 21 | +} 22 | +static inline void WriteLE32(uint32_t* f, uint32_t x) { 23 | + *f = __builtin_bswap32(x); 24 | +} 25 | +static inline void WriteFourCC(uint32_t* f, char a, char b, char c, char d) { 26 | + *f = static_cast(d) | static_cast(c) << 8 | 27 | + static_cast(b) << 16 | static_cast(a) << 24; 28 | +} 29 | + 30 | +static inline uint16_t ReadLE16(uint16_t x) { 31 | + return __builtin_bswap16(x); 32 | +} 33 | +static inline uint32_t ReadLE32(uint32_t x) { 34 | + return __builtin_bswap32(x); 35 | +} 36 | +static inline std::string ReadFourCC(uint32_t x) { 37 | + return std::string(reinterpret_cast(&x), 4); 38 | +} 39 | #endif 40 | 41 | static inline uint32_t RiffChunkSize(size_t bytes_in_payload) { 42 | -- 43 | 2.26.2 44 | 45 | 46 | From 96ec25c115a7edb2c35ce7cf8809b6254895dc03 Mon Sep 17 00:00:00 2001 47 | From: Marcus Comstedt 48 | Date: Sun, 24 Feb 2019 00:00:35 +0100 49 | Subject: [PATCH 2/2] wav: Implement sample swapping 50 | 51 | --- 52 | .../webrtc/common_audio/wav_file.cc | 23 +++++++++++++++---- 53 | 1 file changed, 18 insertions(+), 5 deletions(-) 54 | 55 | diff --git a/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc b/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc 56 | index 30968c25c..f95172bec 100644 57 | --- a/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc 58 | +++ b/src/3rdparty/chromium/third_party/webrtc/common_audio/wav_file.cc 59 | @@ -99,9 +99,6 @@ size_t WavReader::num_samples() const { 60 | } 61 | 62 | size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) { 63 | -#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 64 | -#error "Need to convert samples to big-endian when reading from WAV file" 65 | -#endif 66 | // There could be metadata after the audio; ensure we don't read it. 67 | num_samples = std::min(num_samples, num_samples_remaining_); 68 | const size_t num_bytes = num_samples * sizeof(*samples); 69 | @@ -111,6 +108,11 @@ size_t WavReader::ReadSamples(size_t num_samples, int16_t* samples) { 70 | RTC_CHECK_EQ(read_bytes % 2, 0) 71 | << "End of file in the middle of a 16-bit sample"; 72 | const size_t read_samples = read_bytes / 2; 73 | +#ifndef WEBRTC_ARCH_LITTLE_ENDIAN 74 | + for (size_t i = 0; i < read_samples; i++) { 75 | + samples[i] = __builtin_bswap16(samples[i]); 76 | + } 77 | +#endif 78 | RTC_CHECK_LE(read_samples, num_samples_remaining_); 79 | num_samples_remaining_ -= read_samples; 80 | return read_samples; 81 | @@ -178,11 +180,22 @@ size_t WavWriter::num_samples() const { 82 | 83 | void WavWriter::WriteSamples(const int16_t* samples, size_t num_samples) { 84 | #ifndef WEBRTC_ARCH_LITTLE_ENDIAN 85 | -#error "Need to convert samples to little-endian when writing to WAV file" 86 | -#endif 87 | + static const size_t kChunksize = 4096 / sizeof(uint16_t); 88 | + for (size_t i = 0; i < num_samples; i += kChunksize) { 89 | + int16_t isamples[kChunksize]; 90 | + const size_t chunk = std::min(kChunksize, num_samples - i); 91 | + for (size_t j = 0; j < chunk; j++) { 92 | + isamples[j] = __builtin_bswap16(samples[i + j]); 93 | + } 94 | + RTC_CHECK(file_.Write(isamples, sizeof(*isamples) * chunk)); 95 | + num_samples_ += chunk; 96 | + RTC_CHECK(num_samples_ >= chunk); // detect size_t overflow 97 | + } 98 | +#else 99 | RTC_CHECK(file_.Write(samples, sizeof(*samples) * num_samples)); 100 | num_samples_ += num_samples; 101 | RTC_CHECK(num_samples_ >= num_samples); // detect size_t overflow 102 | +#endif 103 | } 104 | 105 | void WavWriter::WriteSamples(const float* samples, size_t num_samples) { 106 | -- 107 | 2.26.2 108 | 109 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/0gyakovlev/0000-enable-ppc64.patch: -------------------------------------------------------------------------------- 1 | From 463f1234c57a36e78ff666bd55094a9d4e68f296 Mon Sep 17 00:00:00 2001 2 | From: q66 3 | Date: Sat, 18 Jan 2020 23:52:55 +0100 4 | Subject: [PATCH 1/3] Enable ppc64 builds 5 | 6 | --- 7 | configure.pri | 1 + 8 | mkspecs/features/functions.prf | 1 + 9 | 2 files changed, 2 insertions(+) 10 | 11 | diff --git a/configure.pri b/configure.pri 12 | index 3a144e3f8..cabe8b24a 100644 13 | --- a/configure.pri 2021-02-24 10:45:58.000000000 +0100 14 | +++ - 2021-03-07 21:18:43.124754796 +0100 15 | @@ -144,6 +144,7 @@ 16 | contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true) 17 | contains(QT_ARCH, "mips"): return(true) 18 | contains(QT_ARCH, "mips64"): return(true) 19 | + contains(QT_ARCH, "power64"): return(true) 20 | qtLog("Architecture not supported.") 21 | return(false) 22 | } 23 | diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf 24 | index 512e2523b..e31123654 100644 25 | --- a/mkspecs/features/functions.prf 2021-02-24 10:45:58.000000000 +0100 26 | +++ - 2021-03-07 21:19:21.345036293 +0100 27 | @@ -107,6 +107,7 @@ 28 | contains(qtArch, "mips"): return(mipsel) 29 | contains(qtArch, "mips64"): return(mips64el) 30 | contains(qtArch, "mips64el"): return(mips64el) 31 | + contains(qtArch, "power64"): return(ppc64) 32 | return(unknown) 33 | } 34 | 35 | -- 36 | 2.26.0 37 | 38 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/0gyakovlev/0001-ppc64le-libvpx.patch: -------------------------------------------------------------------------------- 1 | Uses generic target for now. To use ppc64le, change --target to ppc64le-gnu 2 | and add --enable-vsx, and change generic to ppc for the rtcd header. 3 | 4 | From 18e6c5c55cfae0cfb458d8210d7bc709360a0e90 Mon Sep 17 00:00:00 2001 5 | From: q66 6 | Date: Wed, 9 Sep 2020 19:08:25 +0200 7 | Subject: [PATCH] enable generation of ppc64 libvpx bits 8 | 9 | this doesn't update the gni file, that's done from 10 | the template by running the appropriate scripts 11 | --- 12 | third_party/libvpx/BUILD.gn | 4 ++++ 13 | third_party/libvpx/generate_gni.sh | 9 +++++++++ 14 | 2 files changed, 13 insertions(+) 15 | 16 | diff --git third_party/libvpx/BUILD.gn third_party/libvpx/BUILD.gn 17 | index 7198e59..3300485 100644 18 | --- third_party/libvpx/BUILD.gn 19 | +++ third_party/libvpx/BUILD.gn 20 | @@ -336,6 +336,8 @@ static_library("libvpx") { 21 | } else { 22 | sources = libvpx_srcs_arm64 23 | } 24 | + } else if (current_cpu == "ppc64") { 25 | + sources = libvpx_srcs_ppc64 26 | } 27 | 28 | configs -= [ "//build/config/compiler:chromium_code" ] 29 | diff --git third_party/libvpx/generate_gni.sh third_party/libvpx/generate_gni.sh 30 | index bcf84b0..8a3f4f1 100755 31 | --- third_party/libvpx/generate_gni.sh 32 | +++ third_party/libvpx/generate_gni.sh 33 | @@ -361,6 +361,7 @@ gen_config_files linux/arm-neon-highbd "--target=armv7-linux-gcc ${all_platforms 34 | gen_config_files linux/arm64-highbd "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}" 35 | gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" 36 | gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" 37 | +gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}" 38 | gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}" 39 | gen_config_files win/arm64 "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}" 40 | gen_config_files win/ia32 "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}" 41 | @@ -386,6 +387,7 @@ lint_config linux/arm-neon-highbd 42 | lint_config linux/arm64-highbd 43 | lint_config linux/mipsel 44 | lint_config linux/mips64el 45 | +lint_config linux/ppc64 46 | lint_config linux/generic 47 | lint_config win/arm64 48 | lint_config win/ia32 49 | @@ -415,6 +417,7 @@ gen_rtcd_header linux/arm-neon-highbd armv7 50 | gen_rtcd_header linux/arm64-highbd armv8 51 | gen_rtcd_header linux/mipsel mipsel 52 | gen_rtcd_header linux/mips64el mips64el 53 | +gen_rtcd_header linux/ppc64 generic 54 | gen_rtcd_header linux/generic generic 55 | gen_rtcd_header win/arm64 armv8 56 | gen_rtcd_header win/ia32 x86 "${require_sse2}" 57 | @@ -500,6 +503,12 @@ if [ -z $ONLY_CONFIGS ]; then 58 | 59 | echo "MIPS64 source list is identical to MIPS source list. No need to generate it." 60 | 61 | + echo "Generate ppc64 source list." 62 | + config=$(print_config_basic linux/ppc64) 63 | + make_clean 64 | + make libvpx_srcs.txt target=libs $config > /dev/null 65 | + convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64 66 | + 67 | echo "Generate NaCl source list." 68 | config=$(print_config_basic nacl) 69 | make_clean 70 | -- 71 | 2.28.0 72 | 73 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/0gyakovlev/0003-ppc64le-support-sandbox-linux-stat.patch: -------------------------------------------------------------------------------- 1 | --- sandbox/linux/system_headers/linux_stat.h 2 | +++ sandbox/linux/system_headers/linux_stat.h 3 | @@ -155,6 +155,28 @@ struct kernel_stat { 4 | unsigned int __unused4; 5 | unsigned int __unused5; 6 | }; 7 | +#elif defined(__powerpc64__) 8 | +struct kernel_stat { 9 | + unsigned long st_dev; 10 | + unsigned long st_ino; 11 | + unsigned long st_nlink; 12 | + unsigned int st_mode; 13 | + unsigned int st_uid; 14 | + unsigned int st_gid; 15 | + unsigned long st_rdev; 16 | + long st_size; 17 | + unsigned long st_blksize; 18 | + unsigned long st_blocks; 19 | + unsigned long st_atime_; 20 | + unsigned long st_atime_nsec_; 21 | + unsigned long st_mtime_; 22 | + unsigned long st_mtime_nsec_; 23 | + unsigned long st_ctime_; 24 | + unsigned long st_ctime_nsec_; 25 | + unsigned long __unused4; 26 | + unsigned long __unused5; 27 | + unsigned long __unused6; 28 | +}; 29 | #endif 30 | 31 | // On 32-bit systems, we default to the 64-bit stat struct like libc 32 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/0gyakovlev/0004-ppc64le-swiftshader.patch: -------------------------------------------------------------------------------- 1 | --- third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 2 | +++ third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 3 | @@ -574,6 +574,7 @@ swiftshader_llvm_source_set("swiftshader 4 | "llvm/lib/MC/MCAsmInfoCOFF.cpp", 5 | "llvm/lib/MC/MCAsmInfoDarwin.cpp", 6 | "llvm/lib/MC/MCAsmInfoELF.cpp", 7 | + "llvm/lib/MC/MCAsmInfoXCOFF.cpp", 8 | "llvm/lib/MC/MCAsmMacro.cpp", 9 | "llvm/lib/MC/MCAsmStreamer.cpp", 10 | "llvm/lib/MC/MCAssembler.cpp", 11 | @@ -629,6 +630,7 @@ swiftshader_llvm_source_set("swiftshader 12 | "llvm/lib/MC/MCWinCOFFStreamer.cpp", 13 | "llvm/lib/MC/MCWinEH.cpp", 14 | "llvm/lib/MC/MCXCOFFStreamer.cpp", 15 | + "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp", 16 | "llvm/lib/MC/MachObjectWriter.cpp", 17 | "llvm/lib/MC/StringTableBuilder.cpp", 18 | "llvm/lib/MC/SubtargetFeature.cpp", 19 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/closure_compiler.patch: -------------------------------------------------------------------------------- 1 | From 72d9bb0e21cc027aa30ccaf8dc775e41f0a36475 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:32:08 +0100 4 | Subject: [PATCH] Remove unsupported -client option to JVM 5 | 6 | --- 7 | src/3rdparty/chromium/third_party/closure_compiler/compiler.py | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/closure_compiler/compiler.py b/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 11 | index 4e9521c3b..150964a84 100755 12 | --- a/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 13 | +++ b/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 14 | @@ -30,7 +30,6 @@ class Compiler(object): 15 | _JAVA_PATH, 16 | "-jar", 17 | "-Xms1024m", 18 | - "-client", 19 | "-XX:+TieredCompilation", 20 | ] 21 | 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/dav1d.patch: -------------------------------------------------------------------------------- 1 | From 7ccec98ee8c9beaafbe38a2606c01d1e9c81bb6a Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:16:45 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | src/3rdparty/chromium/third_party/dav1d/BUILD.gn | 4 ++++ 8 | .../third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 9 | .../chromium/third_party/dav1d/libdav1d/src/cpu.h | 2 +- 10 | 3 files changed, 10 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 13 | index a7bdcaffd..ca9ee6f4a 100644 14 | --- a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 15 | +++ b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 16 | @@ -121,6 +121,10 @@ if (is_win) { 17 | } 18 | } 19 | 20 | +if (current_cpu == "ppc64") { 21 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 22 | +} 23 | + 24 | if (enable_nasm) { 25 | nasm_assemble("dav1d_asm") { 26 | sources = x86_asm_sources 27 | diff --git a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 28 | index f6ca57f7f..c3138078a 100644 29 | --- a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 30 | +++ b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 31 | @@ -9,7 +9,9 @@ 32 | 33 | #define ARCH_ARM 0 34 | 35 | -#define ARCH_PPC64LE 1 36 | +#define ARCH_PPC64LE 0 37 | + 38 | +#define ARCH_PPC64 1 39 | 40 | #define ARCH_X86 0 41 | 42 | @@ -23,9 +25,9 @@ 43 | 44 | #define CONFIG_LOG 1 45 | 46 | -#define ENDIANNESS_BIG 0 47 | +#define ENDIANNESS_BIG 1 48 | 49 | -#define HAVE_ASM 1 50 | +#define HAVE_ASM 0 51 | 52 | #define HAVE_GETAUXVAL 1 53 | 54 | diff --git a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 55 | index d5299f243..d65edfc38 100644 56 | --- a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 57 | +++ b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 58 | @@ -36,7 +36,7 @@ 59 | 60 | #if ARCH_AARCH64 || ARCH_ARM 61 | #include "src/arm/cpu.h" 62 | -#elif ARCH_PPC64LE 63 | +#elif ARCH_PPC64LE || ARCH_PPC64 64 | #include "src/ppc/cpu.h" 65 | #elif ARCH_X86 66 | #include "src/x86/cpu.h" 67 | -- 68 | 2.39.3 69 | 70 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From f744fa4841e417f26cf1269e6a16c9b531710af8 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | .../third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 86ecf2386..161689c1e 100644 19 | --- a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -330,15 +330,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.39.3 42 | 43 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/libvpx.patch: -------------------------------------------------------------------------------- 1 | From 5fd206884bd1f97fee2ac8ef6f7ff9fe4a8e0ae1 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:25:36 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | .../chromium/third_party/libvpx/BUILD.gn | 18 ++++++++++++++++ 8 | .../third_party/libvpx/generate_gni.sh | 18 ++++++++++++++-- 9 | .../third_party/libvpx/libvpx_srcs.gni | 21 +++++++++++++++++++ 10 | .../source/libvpx/build/make/configure.sh | 7 +++++++ 11 | .../libvpx/source/libvpx/configure | 1 + 12 | 5 files changed, 63 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/src/3rdparty/chromium/third_party/libvpx/BUILD.gn b/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 15 | index 8cdea06f2..91ba1a67f 100644 16 | --- a/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 17 | +++ b/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 18 | @@ -267,6 +267,19 @@ if (current_cpu == "arm") { 19 | } 20 | } 21 | 22 | +if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 23 | + source_set("libvpx_intrinsics_vsx") { 24 | + configs -= [ "//build/config/compiler:chromium_code" ] 25 | + configs += [ "//build/config/compiler:no_chromium_code" ] 26 | + configs += [ ":libvpx_config" ] 27 | + cflags = [ 28 | + "-maltivec", 29 | + "-mvsx", 30 | + ] 31 | + sources = libvpx_srcs_ppc64_vsx 32 | + } 33 | +} 34 | + 35 | # Converts ARM assembly files to GAS style. 36 | if (current_cpu == "arm" && arm_assembly_sources != []) { 37 | action_foreach("convert_arm_assembly") { 38 | @@ -328,6 +341,8 @@ static_library("bundled_libvpx") { 39 | } 40 | } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { 41 | sources = libvpx_srcs_mips 42 | + } else if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 43 | + sources = libvpx_srcs_ppc64 44 | } else if (current_cpu == "arm") { 45 | if (is_chromeos) { 46 | sources = libvpx_srcs_arm_neon_highbd 47 | @@ -373,6 +388,9 @@ static_library("bundled_libvpx") { 48 | if (current_cpu == "arm" && arm_assembly_sources != []) { 49 | deps += [ ":libvpx_assembly_arm" ] 50 | } 51 | + if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 52 | + deps += [ ":libvpx_intrinsics_vsx" ] 53 | + } 54 | 55 | public_configs = [ ":libvpx_external_config" ] 56 | } 57 | diff --git a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 58 | index 468cc441e..b9c432198 100755 59 | --- a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 60 | +++ b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 61 | @@ -135,6 +135,11 @@ function convert_srcs_to_project_files { 62 | egrep 'neon.*(\.c|\.asm)$') 63 | fi 64 | 65 | + if [ "libvpx_srcs_ppc64" == "$2" ]; then 66 | + local intrinsic_list=$(echo "$source_list" | \ 67 | + egrep 'vsx.*(\.c|\.asm)$') 68 | + fi 69 | + 70 | # Remove these files from the main list. 71 | source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) 72 | 73 | @@ -168,11 +173,15 @@ function convert_srcs_to_project_files { 74 | local assembly_sources=$(echo -e "$source_list\n$intrinsic_list" | \ 75 | egrep '.asm$') 76 | local neon_sources=$(echo "$intrinsic_list" | grep '_neon\.c$') 77 | + local vsx_sources=$(echo "$intrinsic_list" | grep '_vsx\.c$') 78 | write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" 79 | write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" 80 | if [ 0 -ne ${#neon_sources} ]; then 81 | write_gni neon_sources $2_neon "$BASE_DIR/libvpx_srcs.gni" 82 | fi 83 | + if [ 0 -ne ${#vsx_sources} ]; then 84 | + write_gni vsx_sources $2_vsx "$BASE_DIR/libvpx_srcs.gni" 85 | + fi 86 | fi 87 | } 88 | 89 | @@ -361,8 +370,9 @@ gen_config_files linux/arm-neon-highbd "--target=armv7-linux-gcc ${all_platforms 90 | gen_config_files linux/arm64-highbd "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}" 91 | gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" 92 | gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" 93 | -gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}" 94 | gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}" 95 | +gen_config_files linux/ppc64 "--target=ppc64-linux-gcc --enable-vsx ${all_platforms}" 96 | +gen_config_files linux/ppc64le "--target=ppc64le-linux-gcc --enable-vsx ${all_platforms}" 97 | gen_config_files win/arm64 "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}" 98 | gen_config_files win/ia32 "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}" 99 | gen_config_files win/x64 "--target=x86_64-win64-vs14 ${all_platforms} ${x86_platforms}" 100 | @@ -388,6 +398,7 @@ lint_config linux/arm64-highbd 101 | lint_config linux/mipsel 102 | lint_config linux/mips64el 103 | lint_config linux/ppc64 104 | +lint_config linux/ppc64le 105 | lint_config linux/generic 106 | lint_config win/arm64 107 | lint_config win/ia32 108 | @@ -417,7 +428,8 @@ gen_rtcd_header linux/arm-neon-highbd armv7 109 | gen_rtcd_header linux/arm64-highbd armv8 110 | gen_rtcd_header linux/mipsel mipsel 111 | gen_rtcd_header linux/mips64el mips64el 112 | -gen_rtcd_header linux/ppc64 generic 113 | +gen_rtcd_header linux/ppc64 ppc64 114 | +gen_rtcd_header linux/ppc64le ppc64le 115 | gen_rtcd_header linux/generic generic 116 | gen_rtcd_header win/arm64 armv8 117 | gen_rtcd_header win/ia32 x86 "${require_sse2}" 118 | @@ -509,6 +521,8 @@ if [ -z $ONLY_CONFIGS ]; then 119 | make libvpx_srcs.txt target=libs $config > /dev/null 120 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64 121 | 122 | + echo "PPC64LE source list is identical to PPC64 source list. No need to generate it." 123 | + 124 | echo "Generate NaCl source list." 125 | config=$(print_config_basic nacl) 126 | make_clean 127 | diff --git a/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni b/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 128 | index 24450c414..d5196e88c 100644 129 | --- a/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 130 | +++ b/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 131 | @@ -3737,6 +3737,21 @@ libvpx_srcs_mips = [ 132 | "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h", 133 | ] 134 | libvpx_srcs_mips_assembly = [] 135 | + libvpx_srcs_ppc64_assembly = [] 136 | +libvpx_srcs_ppc64_vsx = [ 137 | + "//third_party/libvpx/source/libvpx/vp9/common/ppc/vp9_idct_vsx.c", 138 | + "//third_party/libvpx/source/libvpx/vp9/encoder/ppc/vp9_quantize_vsx.c", 139 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/deblock_vsx.c", 140 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/fdct32x32_vsx.c", 141 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/hadamard_vsx.c", 142 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/intrapred_vsx.c", 143 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/inv_txfm_vsx.c", 144 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/quantize_vsx.c", 145 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/sad_vsx.c", 146 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/subtract_vsx.c", 147 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/variance_vsx.c", 148 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/vpx_convolve_vsx.c", 149 | +] 150 | libvpx_srcs_nacl = [ 151 | "//third_party/libvpx/source/libvpx/vp8/common/alloccommon.c", 152 | "//third_party/libvpx/source/libvpx/vp8/common/alloccommon.h", 153 | @@ -4026,6 +4041,10 @@ libvpx_srcs_nacl = [ 154 | "//third_party/libvpx/source/libvpx/vpx_dsp/inv_txfm.h", 155 | "//third_party/libvpx/source/libvpx/vpx_dsp/loopfilter.c", 156 | "//third_party/libvpx/source/libvpx/vpx_dsp/postproc.h", 157 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/bitdepth_conversion_vsx.h", 158 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/transpose_vsx.h", 159 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/txfm_common_vsx.h", 160 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/types_vsx.h", 161 | "//third_party/libvpx/source/libvpx/vpx_dsp/prob.c", 162 | "//third_party/libvpx/source/libvpx/vpx_dsp/prob.h", 163 | "//third_party/libvpx/source/libvpx/vpx_dsp/psnr.c", 164 | @@ -4055,6 +4074,8 @@ libvpx_srcs_nacl = [ 165 | "//third_party/libvpx/source/libvpx/vpx_ports/mem_ops.h", 166 | "//third_party/libvpx/source/libvpx/vpx_ports/mem_ops_aligned.h", 167 | "//third_party/libvpx/source/libvpx/vpx_ports/msvc.h", 168 | + "//third_party/libvpx/source/libvpx/vpx_ports/ppc.h", 169 | + "//third_party/libvpx/source/libvpx/vpx_ports/ppc_cpudetect.c", 170 | "//third_party/libvpx/source/libvpx/vpx_ports/static_assert.h", 171 | "//third_party/libvpx/source/libvpx/vpx_ports/system_state.h", 172 | "//third_party/libvpx/source/libvpx/vpx_ports/vpx_once.h", 173 | diff --git a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 174 | index 8bdfef39d..d19d5964a 100644 175 | --- a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 176 | +++ b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 177 | @@ -759,6 +759,9 @@ process_common_toolchain() { 178 | ;; 179 | power*64le*-*) 180 | tgt_isa=ppc64le 181 | + ;; 182 | + power*64*-*) 183 | + tgt_isa=ppc64 184 | ;; 185 | *mips64el*) 186 | tgt_isa=mips64 187 | @@ -827,8 +830,12 @@ process_common_toolchain() { 188 | mips*) 189 | enable_feature mips 190 | ;; 191 | + ppc*le) 192 | + enable_feature ppc 193 | + ;; 194 | ppc*) 195 | enable_feature ppc 196 | + enable_feature big_endian 197 | ;; 198 | esac 199 | 200 | diff --git a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 201 | index 32272ce36..3e46f725b 100755 202 | --- a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 203 | +++ b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 204 | @@ -114,6 +114,7 @@ all_platforms="${all_platforms} armv7s-darwin-gcc" 205 | all_platforms="${all_platforms} armv8-linux-gcc" 206 | all_platforms="${all_platforms} mips32-linux-gcc" 207 | all_platforms="${all_platforms} mips64-linux-gcc" 208 | +all_platforms="${all_platforms} ppc64-linux-gcc" 209 | all_platforms="${all_platforms} ppc64le-linux-gcc" 210 | all_platforms="${all_platforms} sparc-solaris-gcc" 211 | all_platforms="${all_platforms} x86-android-gcc" 212 | -- 213 | 2.39.3 214 | 215 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/perfetto.patch: -------------------------------------------------------------------------------- 1 | From 5cdb98ff98b25e04af293d5c9ff7190a17e735d6 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/4] protozero: Implement byte swap macros 5 | 6 | --- 7 | .../perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index b606818a5..926af8282 100644 12 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -28,7 +28,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -113,6 +117,7 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -120,7 +125,9 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.39.3 48 | 49 | 50 | From d0898ea12c88a1abbe0c118348e0a1fdac62815e Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/4] protozero: Swap "fixed" types 54 | 55 | --- 56 | .../perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | .../chromium/third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 61 | index a47db7edb..41c41d066 100644 62 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -135,6 +135,13 @@ class PERFETTO_EXPORT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 79 | index cfc9b37b5..66801e056 100644 80 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 81 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 82 | @@ -23,12 +23,6 @@ 83 | #include "perfetto/protozero/message_arena.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.39.3 97 | 98 | 99 | From c3a9218a4f2a650813c5906d8f6b77a9ec9c8955 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/4] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | .../third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index b702d4f72..57996be53 100644 112 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -23,6 +23,7 @@ 115 | #include 116 | #include 117 | #include 118 | +#include 119 | #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) 120 | #include 121 | #endif 122 | @@ -109,7 +110,7 @@ struct FreeDeleter { 123 | 124 | template 125 | constexpr T AssumeLittleEndian(T value) { 126 | - static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 127 | + static_assert(std::is_same::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 128 | "Unimplemented on big-endian archs"); 129 | return value; 130 | } 131 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 132 | index be1648219..06109c547 100644 133 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 134 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 135 | @@ -19,9 +19,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -41,14 +43,15 @@ void Field::SerializeAndAppendToInternal(Container* dst) const { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.39.3 170 | 171 | 172 | From 90a7af77cf4d90595a8ae09c85fe4080cf95099f Mon Sep 17 00:00:00 2001 173 | From: Marcus Comstedt 174 | Date: Sun, 14 Feb 2021 19:26:43 +0100 175 | Subject: [PATCH 4/4] BufferedFrameDeserializer: Fix endianness handling 176 | 177 | --- 178 | .../perfetto/src/ipc/buffered_frame_deserializer.cc | 13 ++++++++++--- 179 | 1 file changed, 10 insertions(+), 3 deletions(-) 180 | 181 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc b/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 182 | index d893dfb5c..e6a8c6fca 100644 183 | --- a/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 184 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 185 | @@ -97,7 +97,10 @@ bool BufferedFrameDeserializer::EndReceive(size_t recv_size) { 186 | // Read the header into |payload_size|. 187 | uint32_t payload_size = 0; 188 | const char* rd_ptr = buf() + consumed_size; 189 | - memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize); 190 | + memcpy(&payload_size, rd_ptr, kHeaderSize); 191 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 192 | + payload_size = __builtin_bswap32(payload_size); 193 | +#endif 194 | 195 | // Saturate the |payload_size| to prevent overflows. The > capacity_ check 196 | // below will abort the parsing. 197 | @@ -175,10 +178,14 @@ void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) { 198 | // static 199 | std::string BufferedFrameDeserializer::Serialize(const Frame& frame) { 200 | std::vector payload = frame.SerializeAsArray(); 201 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 202 | + const uint32_t payload_size = __builtin_bswap32(static_cast(payload.size())); 203 | +#else 204 | const uint32_t payload_size = static_cast(payload.size()); 205 | +#endif 206 | std::string buf; 207 | - buf.resize(kHeaderSize + payload_size); 208 | - memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize); 209 | + buf.resize(kHeaderSize + payload.size()); 210 | + memcpy(&buf[0], &payload_size, kHeaderSize); 211 | memcpy(&buf[kHeaderSize], payload.data(), payload.size()); 212 | return buf; 213 | } 214 | -- 215 | 2.39.3 216 | 217 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/qtcomposer.patch: -------------------------------------------------------------------------------- 1 | From ad1d2e0483d22ee4c89dc0be32afeda5df574d24 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:35:58 +0100 4 | Subject: [PATCH] Fix compositing of kBGRA_8888_SkColorType on big endian 5 | 6 | --- 7 | src/core/compositor/display_software_output_surface.cpp | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp 11 | index ba99799f0..4f8e00167 100644 12 | --- a/src/core/compositor/display_software_output_surface.cpp 13 | +++ b/src/core/compositor/display_software_output_surface.cpp 14 | @@ -111,7 +111,12 @@ inline QImage::Format imageFormat(SkColorType colorType) 15 | { 16 | switch (colorType) { 17 | case kBGRA_8888_SkColorType: 18 | +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 19 | return QImage::Format_ARGB32_Premultiplied; 20 | +#else 21 | + // R/B swap needed... 22 | + return QImage::Format_RGBA8888_Premultiplied; 23 | +#endif 24 | case kRGBA_8888_SkColorType: 25 | return QImage::Format_RGBA8888_Premultiplied; 26 | default: 27 | @@ -135,6 +140,10 @@ QSGNode *DisplaySoftwareOutputSurface::Device::updatePaintNode( 28 | QImage image(reinterpret_cast(skPixmap.addr()), 29 | viewport_pixel_size_.width(), viewport_pixel_size_.height(), 30 | skPixmap.rowBytes(), imageFormat(skPixmap.colorType())); 31 | +#if Q_BYTE_ORDER == Q_BIG_ENDIAN 32 | + if (skPixmap.colorType() == kBGRA_8888_SkColorType) 33 | + image = image.rgbSwapped(); 34 | +#endif 35 | if (m_image.size() == image.size()) { 36 | QRect damageRect = toQt(damage_rect_); 37 | QPainter painter(&m_image); 38 | -- 39 | 2.39.3 40 | 41 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/swiftshader.patch: -------------------------------------------------------------------------------- 1 | From 09c94c0e1756494d53f4be2c71091ca5a1e60dc8 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:35:50 +0100 4 | Subject: [PATCH 1/2] Fix JIT arch for big endian ppc64 5 | 6 | --- 7 | .../chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp b/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 11 | index d156be89b..49075b6e3 100644 12 | --- a/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 13 | +++ b/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 14 | @@ -175,6 +175,8 @@ JITGlobals JITGlobals::create() 15 | # endif 16 | #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 17 | march = "ppc64le"; 18 | +#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 19 | + march = "ppc64"; 20 | #else 21 | # error "unknown architecture" 22 | #endif 23 | -- 24 | 2.39.3 25 | 26 | 27 | From 92f531bb7884155c41e1069d8891b0ea529db9f3 Mon Sep 17 00:00:00 2001 28 | From: Marcus Comstedt 29 | Date: Sun, 14 Feb 2021 19:36:38 +0100 30 | Subject: [PATCH 2/2] Add some sources needed on ppc64 to the build 31 | 32 | --- 33 | .../third_party/swiftshader/third_party/llvm-10.0/BUILD.gn | 1 + 34 | 1 file changed, 1 insertion(+) 35 | 36 | diff --git a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 37 | index de93e072c..d8983e8f2 100644 38 | --- a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 39 | +++ b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 40 | @@ -850,6 +850,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { 41 | "llvm/lib/Support/ARMAttributeParser.cpp", 42 | "llvm/lib/Support/ARMBuildAttrs.cpp", 43 | "llvm/lib/Support/ARMTargetParser.cpp", 44 | + "llvm/lib/Support/Atomic.cpp", 45 | "llvm/lib/Support/BinaryStreamError.cpp", 46 | "llvm/lib/Support/BinaryStreamReader.cpp", 47 | "llvm/lib/Support/BinaryStreamRef.cpp", 48 | -- 49 | 2.39.3 50 | 51 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/v8.patch: -------------------------------------------------------------------------------- 1 | From 051ab41f8526baced4cc9818ae29e9c091239863 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH] Support 64K pages 5 | 6 | --- 7 | src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 11 | index 89173b593..44185d90b 100644 12 | --- a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 13 | +++ b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 14 | @@ -306,7 +306,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.39.3 25 | 26 | -------------------------------------------------------------------------------- /qtwebengine-5.15.10_p20230505/webp.patch: -------------------------------------------------------------------------------- 1 | From c74983de67554b00cad084cc4236790feeeb011c Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | src/3rdparty/chromium/media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/media/parsers/webp_parser.cc b/src/3rdparty/chromium/media/parsers/webp_parser.cc 11 | index 9d2ba7a12..f5ad73015 100644 12 | --- a/src/3rdparty/chromium/media/parsers/webp_parser.cc 13 | +++ b/src/3rdparty/chromium/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.39.3 27 | 28 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/closure_compiler.patch: -------------------------------------------------------------------------------- 1 | From 94e38ab8bc99517c5fe18a54058a72857fdff713 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:32:08 +0100 4 | Subject: [PATCH] Remove unsupported -client option to JVM 5 | 6 | --- 7 | src/3rdparty/chromium/third_party/closure_compiler/compiler.py | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/closure_compiler/compiler.py b/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 11 | index 4e9521c3b..150964a84 100755 12 | --- a/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 13 | +++ b/src/3rdparty/chromium/third_party/closure_compiler/compiler.py 14 | @@ -30,7 +30,6 @@ class Compiler(object): 15 | _JAVA_PATH, 16 | "-jar", 17 | "-Xms1024m", 18 | - "-client", 19 | "-XX:+TieredCompilation", 20 | ] 21 | 22 | -- 23 | 2.41.0 24 | 25 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/dav1d.patch: -------------------------------------------------------------------------------- 1 | From b69f7517edcdd3b4316e3b133af5d4eb80c3b5d6 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:16:45 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | src/3rdparty/chromium/third_party/dav1d/BUILD.gn | 4 ++++ 8 | .../third_party/dav1d/config/linux/ppc64/config.h | 8 +++++--- 9 | .../chromium/third_party/dav1d/libdav1d/src/cpu.h | 2 +- 10 | 3 files changed, 10 insertions(+), 4 deletions(-) 11 | 12 | diff --git a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 13 | index a7bdcaffd..ca9ee6f4a 100644 14 | --- a/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 15 | +++ b/src/3rdparty/chromium/third_party/dav1d/BUILD.gn 16 | @@ -121,6 +121,10 @@ if (is_win) { 17 | } 18 | } 19 | 20 | +if (current_cpu == "ppc64") { 21 | + dav1d_copts += [ "-maltivec", "-mvsx" ] 22 | +} 23 | + 24 | if (enable_nasm) { 25 | nasm_assemble("dav1d_asm") { 26 | sources = x86_asm_sources 27 | diff --git a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 28 | index f6ca57f7f..c3138078a 100644 29 | --- a/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 30 | +++ b/src/3rdparty/chromium/third_party/dav1d/config/linux/ppc64/config.h 31 | @@ -9,7 +9,9 @@ 32 | 33 | #define ARCH_ARM 0 34 | 35 | -#define ARCH_PPC64LE 1 36 | +#define ARCH_PPC64LE 0 37 | + 38 | +#define ARCH_PPC64 1 39 | 40 | #define ARCH_X86 0 41 | 42 | @@ -23,9 +25,9 @@ 43 | 44 | #define CONFIG_LOG 1 45 | 46 | -#define ENDIANNESS_BIG 0 47 | +#define ENDIANNESS_BIG 1 48 | 49 | -#define HAVE_ASM 1 50 | +#define HAVE_ASM 0 51 | 52 | #define HAVE_GETAUXVAL 1 53 | 54 | diff --git a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 55 | index d5299f243..d65edfc38 100644 56 | --- a/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 57 | +++ b/src/3rdparty/chromium/third_party/dav1d/libdav1d/src/cpu.h 58 | @@ -36,7 +36,7 @@ 59 | 60 | #if ARCH_AARCH64 || ARCH_ARM 61 | #include "src/arm/cpu.h" 62 | -#elif ARCH_PPC64LE 63 | +#elif ARCH_PPC64LE || ARCH_PPC64 64 | #include "src/ppc/cpu.h" 65 | #elif ARCH_X86 66 | #include "src/x86/cpu.h" 67 | -- 68 | 2.41.0 69 | 70 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/flatbuffers.patch: -------------------------------------------------------------------------------- 1 | From 53c3c18c6ae6704448e32b73ad3b1d9c974e5517 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Fri, 22 Feb 2019 19:12:28 +0100 4 | Subject: [PATCH] EndianSwap: Use a copy constructor rather than assignment to 5 | init the union 6 | 7 | This is necessary in C++11 and newer if the type being swapped has a 8 | non-trivial default constructor, in which case the default constructor 9 | of the union becomes deleted. 10 | 11 | This is the case with flatbuffers::Offset which is being swapped in 12 | the testcase ReflectionTest. 13 | --- 14 | .../third_party/flatbuffers/src/include/flatbuffers/base.h | 6 +++--- 15 | 1 file changed, 3 insertions(+), 3 deletions(-) 16 | 17 | diff --git a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 18 | index 86ecf2386..161689c1e 100644 19 | --- a/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 20 | +++ b/src/3rdparty/chromium/third_party/flatbuffers/src/include/flatbuffers/base.h 21 | @@ -330,15 +330,15 @@ template T EndianSwap(T t) { 22 | if (sizeof(T) == 1) { // Compile-time if-then's. 23 | return t; 24 | } else if (sizeof(T) == 2) { 25 | - union { T t; uint16_t i; } u = { t }; 26 | + union U { T t; uint16_t i; U(const T& t_) : t(t_) {}} u(t); 27 | u.i = FLATBUFFERS_BYTESWAP16(u.i); 28 | return u.t; 29 | } else if (sizeof(T) == 4) { 30 | - union { T t; uint32_t i; } u = { t }; 31 | + union U { T t; uint32_t i; U(const T& t_) : t(t_) {}} u(t); 32 | u.i = FLATBUFFERS_BYTESWAP32(u.i); 33 | return u.t; 34 | } else if (sizeof(T) == 8) { 35 | - union { T t; uint64_t i; } u = { t }; 36 | + union U { T t; uint64_t i; U(const T& t_) : t(t_) {}} u(t); 37 | u.i = FLATBUFFERS_BYTESWAP64(u.i); 38 | return u.t; 39 | } else { 40 | -- 41 | 2.41.0 42 | 43 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/libvpx.patch: -------------------------------------------------------------------------------- 1 | From 83c857ae99892f8e7b86f50252900437e05e0724 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:25:36 +0100 4 | Subject: [PATCH] Interpret "ppc64" as big endian 5 | 6 | --- 7 | .../chromium/third_party/libvpx/BUILD.gn | 18 ++++++++++++++++ 8 | .../third_party/libvpx/generate_gni.sh | 18 ++++++++++++++-- 9 | .../third_party/libvpx/libvpx_srcs.gni | 21 +++++++++++++++++++ 10 | .../source/libvpx/build/make/configure.sh | 7 +++++++ 11 | .../libvpx/source/libvpx/configure | 1 + 12 | 5 files changed, 63 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/src/3rdparty/chromium/third_party/libvpx/BUILD.gn b/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 15 | index 8cdea06f2..91ba1a67f 100644 16 | --- a/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 17 | +++ b/src/3rdparty/chromium/third_party/libvpx/BUILD.gn 18 | @@ -267,6 +267,19 @@ if (current_cpu == "arm") { 19 | } 20 | } 21 | 22 | +if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 23 | + source_set("libvpx_intrinsics_vsx") { 24 | + configs -= [ "//build/config/compiler:chromium_code" ] 25 | + configs += [ "//build/config/compiler:no_chromium_code" ] 26 | + configs += [ ":libvpx_config" ] 27 | + cflags = [ 28 | + "-maltivec", 29 | + "-mvsx", 30 | + ] 31 | + sources = libvpx_srcs_ppc64_vsx 32 | + } 33 | +} 34 | + 35 | # Converts ARM assembly files to GAS style. 36 | if (current_cpu == "arm" && arm_assembly_sources != []) { 37 | action_foreach("convert_arm_assembly") { 38 | @@ -328,6 +341,8 @@ static_library("bundled_libvpx") { 39 | } 40 | } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { 41 | sources = libvpx_srcs_mips 42 | + } else if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 43 | + sources = libvpx_srcs_ppc64 44 | } else if (current_cpu == "arm") { 45 | if (is_chromeos) { 46 | sources = libvpx_srcs_arm_neon_highbd 47 | @@ -373,6 +388,9 @@ static_library("bundled_libvpx") { 48 | if (current_cpu == "arm" && arm_assembly_sources != []) { 49 | deps += [ ":libvpx_assembly_arm" ] 50 | } 51 | + if (current_cpu == "ppc64" || current_cpu == "ppc64el") { 52 | + deps += [ ":libvpx_intrinsics_vsx" ] 53 | + } 54 | 55 | public_configs = [ ":libvpx_external_config" ] 56 | } 57 | diff --git a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 58 | index 0ec4f5941..156f93b1b 100755 59 | --- a/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 60 | +++ b/src/3rdparty/chromium/third_party/libvpx/generate_gni.sh 61 | @@ -135,6 +135,11 @@ function convert_srcs_to_project_files { 62 | egrep 'neon.*(\.c|\.asm)$') 63 | fi 64 | 65 | + if [ "libvpx_srcs_ppc64" == "$2" ]; then 66 | + local intrinsic_list=$(echo "$source_list" | \ 67 | + egrep 'vsx.*(\.c|\.asm)$') 68 | + fi 69 | + 70 | # Remove these files from the main list. 71 | source_list=$(comm -23 <(echo "$source_list") <(echo "$intrinsic_list")) 72 | 73 | @@ -168,11 +173,15 @@ function convert_srcs_to_project_files { 74 | local assembly_sources=$(echo -e "$source_list\n$intrinsic_list" | \ 75 | egrep '.asm$') 76 | local neon_sources=$(echo "$intrinsic_list" | grep '_neon\.c$') 77 | + local vsx_sources=$(echo "$intrinsic_list" | grep '_vsx\.c$') 78 | write_gni c_sources $2 "$BASE_DIR/libvpx_srcs.gni" 79 | write_gni assembly_sources $2_assembly "$BASE_DIR/libvpx_srcs.gni" 80 | if [ 0 -ne ${#neon_sources} ]; then 81 | write_gni neon_sources $2_neon "$BASE_DIR/libvpx_srcs.gni" 82 | fi 83 | + if [ 0 -ne ${#vsx_sources} ]; then 84 | + write_gni vsx_sources $2_vsx "$BASE_DIR/libvpx_srcs.gni" 85 | + fi 86 | fi 87 | } 88 | 89 | @@ -361,8 +370,9 @@ gen_config_files linux/arm-neon-highbd "--target=armv7-linux-gcc ${all_platforms 90 | gen_config_files linux/arm64-highbd "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}" 91 | gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" 92 | gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" 93 | -gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}" 94 | gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}" 95 | +gen_config_files linux/ppc64 "--target=ppc64-linux-gcc --enable-vsx ${all_platforms}" 96 | +gen_config_files linux/ppc64le "--target=ppc64le-linux-gcc --enable-vsx ${all_platforms}" 97 | gen_config_files win/arm64 "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}" 98 | gen_config_files win/ia32 "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}" 99 | gen_config_files win/x64 "--target=x86_64-win64-vs14 ${all_platforms} ${x86_platforms}" 100 | @@ -388,6 +398,7 @@ lint_config linux/arm64-highbd 101 | lint_config linux/mipsel 102 | lint_config linux/mips64el 103 | lint_config linux/ppc64 104 | +lint_config linux/ppc64le 105 | lint_config linux/generic 106 | lint_config win/arm64 107 | lint_config win/ia32 108 | @@ -417,7 +428,8 @@ gen_rtcd_header linux/arm-neon-highbd armv7 109 | gen_rtcd_header linux/arm64-highbd armv8 110 | gen_rtcd_header linux/mipsel mipsel 111 | gen_rtcd_header linux/mips64el mips64el 112 | -gen_rtcd_header linux/ppc64 generic 113 | +gen_rtcd_header linux/ppc64 ppc64 114 | +gen_rtcd_header linux/ppc64le ppc64le 115 | gen_rtcd_header linux/generic generic 116 | gen_rtcd_header win/arm64 armv8 117 | gen_rtcd_header win/ia32 x86 "${require_sse2}" 118 | @@ -509,6 +521,8 @@ if [ -z $ONLY_CONFIGS ]; then 119 | make libvpx_srcs.txt target=libs $config > /dev/null 120 | convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64 121 | 122 | + echo "PPC64LE source list is identical to PPC64 source list. No need to generate it." 123 | + 124 | echo "Generate NaCl source list." 125 | config=$(print_config_basic nacl) 126 | make_clean 127 | diff --git a/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni b/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 128 | index 24450c414..d5196e88c 100644 129 | --- a/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 130 | +++ b/src/3rdparty/chromium/third_party/libvpx/libvpx_srcs.gni 131 | @@ -3737,6 +3737,21 @@ libvpx_srcs_mips = [ 132 | "//third_party/libvpx/source/libvpx/vpx_util/vpx_write_yuv_frame.h", 133 | ] 134 | libvpx_srcs_mips_assembly = [] 135 | + libvpx_srcs_ppc64_assembly = [] 136 | +libvpx_srcs_ppc64_vsx = [ 137 | + "//third_party/libvpx/source/libvpx/vp9/common/ppc/vp9_idct_vsx.c", 138 | + "//third_party/libvpx/source/libvpx/vp9/encoder/ppc/vp9_quantize_vsx.c", 139 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/deblock_vsx.c", 140 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/fdct32x32_vsx.c", 141 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/hadamard_vsx.c", 142 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/intrapred_vsx.c", 143 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/inv_txfm_vsx.c", 144 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/quantize_vsx.c", 145 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/sad_vsx.c", 146 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/subtract_vsx.c", 147 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/variance_vsx.c", 148 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/vpx_convolve_vsx.c", 149 | +] 150 | libvpx_srcs_nacl = [ 151 | "//third_party/libvpx/source/libvpx/vp8/common/alloccommon.c", 152 | "//third_party/libvpx/source/libvpx/vp8/common/alloccommon.h", 153 | @@ -4026,6 +4041,10 @@ libvpx_srcs_nacl = [ 154 | "//third_party/libvpx/source/libvpx/vpx_dsp/inv_txfm.h", 155 | "//third_party/libvpx/source/libvpx/vpx_dsp/loopfilter.c", 156 | "//third_party/libvpx/source/libvpx/vpx_dsp/postproc.h", 157 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/bitdepth_conversion_vsx.h", 158 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/transpose_vsx.h", 159 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/txfm_common_vsx.h", 160 | + "//third_party/libvpx/source/libvpx/vpx_dsp/ppc/types_vsx.h", 161 | "//third_party/libvpx/source/libvpx/vpx_dsp/prob.c", 162 | "//third_party/libvpx/source/libvpx/vpx_dsp/prob.h", 163 | "//third_party/libvpx/source/libvpx/vpx_dsp/psnr.c", 164 | @@ -4055,6 +4074,8 @@ libvpx_srcs_nacl = [ 165 | "//third_party/libvpx/source/libvpx/vpx_ports/mem_ops.h", 166 | "//third_party/libvpx/source/libvpx/vpx_ports/mem_ops_aligned.h", 167 | "//third_party/libvpx/source/libvpx/vpx_ports/msvc.h", 168 | + "//third_party/libvpx/source/libvpx/vpx_ports/ppc.h", 169 | + "//third_party/libvpx/source/libvpx/vpx_ports/ppc_cpudetect.c", 170 | "//third_party/libvpx/source/libvpx/vpx_ports/static_assert.h", 171 | "//third_party/libvpx/source/libvpx/vpx_ports/system_state.h", 172 | "//third_party/libvpx/source/libvpx/vpx_ports/vpx_once.h", 173 | diff --git a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 174 | index 8bdfef39d..d19d5964a 100644 175 | --- a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 176 | +++ b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/build/make/configure.sh 177 | @@ -759,6 +759,9 @@ process_common_toolchain() { 178 | ;; 179 | power*64le*-*) 180 | tgt_isa=ppc64le 181 | + ;; 182 | + power*64*-*) 183 | + tgt_isa=ppc64 184 | ;; 185 | *mips64el*) 186 | tgt_isa=mips64 187 | @@ -827,8 +830,12 @@ process_common_toolchain() { 188 | mips*) 189 | enable_feature mips 190 | ;; 191 | + ppc*le) 192 | + enable_feature ppc 193 | + ;; 194 | ppc*) 195 | enable_feature ppc 196 | + enable_feature big_endian 197 | ;; 198 | esac 199 | 200 | diff --git a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 201 | index 32272ce36..3e46f725b 100755 202 | --- a/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 203 | +++ b/src/3rdparty/chromium/third_party/libvpx/source/libvpx/configure 204 | @@ -114,6 +114,7 @@ all_platforms="${all_platforms} armv7s-darwin-gcc" 205 | all_platforms="${all_platforms} armv8-linux-gcc" 206 | all_platforms="${all_platforms} mips32-linux-gcc" 207 | all_platforms="${all_platforms} mips64-linux-gcc" 208 | +all_platforms="${all_platforms} ppc64-linux-gcc" 209 | all_platforms="${all_platforms} ppc64le-linux-gcc" 210 | all_platforms="${all_platforms} sparc-solaris-gcc" 211 | all_platforms="${all_platforms} x86-android-gcc" 212 | -- 213 | 2.41.0 214 | 215 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/perfetto.patch: -------------------------------------------------------------------------------- 1 | From b47111f5384a172af7831a53d09d268842ebbfab Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Tue, 2 Oct 2018 23:53:33 +0200 4 | Subject: [PATCH 1/4] protozero: Implement byte swap macros 5 | 6 | --- 7 | .../perfetto/src/protozero/proto_decoder.cc | 11 +++++++++-- 8 | 1 file changed, 9 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 11 | index b606818a5..926af8282 100644 12 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 13 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/proto_decoder.cc 14 | @@ -28,7 +28,11 @@ namespace protozero { 15 | using namespace proto_utils; 16 | 17 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 18 | -#error Unimplemented for big endian archs. 19 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 20 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 21 | +#else 22 | +#define BYTE_SWAP_TO_LE32(x) (x) 23 | +#define BYTE_SWAP_TO_LE64(x) (x) 24 | #endif 25 | 26 | namespace { 27 | @@ -113,6 +117,7 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 28 | if (PERFETTO_UNLIKELY(new_pos > end)) 29 | return res; 30 | memcpy(&int_value, pos, sizeof(uint64_t)); 31 | + int_value = BYTE_SWAP_TO_LE64(int_value); 32 | break; 33 | } 34 | 35 | @@ -120,7 +125,9 @@ ParseOneField(const uint8_t* const buffer, const uint8_t* const end) { 36 | new_pos = pos + sizeof(uint32_t); 37 | if (PERFETTO_UNLIKELY(new_pos > end)) 38 | return res; 39 | - memcpy(&int_value, pos, sizeof(uint32_t)); 40 | + uint32_t tmp; 41 | + memcpy(&tmp, pos, sizeof(uint32_t)); 42 | + int_value = BYTE_SWAP_TO_LE32(tmp); 43 | break; 44 | } 45 | 46 | -- 47 | 2.41.0 48 | 49 | 50 | From 4503586dd2f435c9cb405ea28cd3326a0ce4ad01 Mon Sep 17 00:00:00 2001 51 | From: Marcus Comstedt 52 | Date: Sat, 23 Feb 2019 17:38:21 +0100 53 | Subject: [PATCH 2/4] protozero: Swap "fixed" types 54 | 55 | --- 56 | .../perfetto/include/perfetto/protozero/message.h | 7 +++++++ 57 | .../chromium/third_party/perfetto/src/protozero/message.cc | 6 ------ 58 | 2 files changed, 7 insertions(+), 6 deletions(-) 59 | 60 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 61 | index a47db7edb..41c41d066 100644 62 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 63 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/protozero/message.h 64 | @@ -135,6 +135,13 @@ class PERFETTO_EXPORT Message { 65 | 66 | pos = proto_utils::WriteVarInt(proto_utils::MakeTagFixed(field_id), pos); 67 | memcpy(pos, &value, sizeof(T)); 68 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 69 | + for (size_t i = sizeof(T)/2; i--; ) { 70 | + uint8_t tmp = pos[i]; 71 | + pos[i] = pos[sizeof(T)-1-i]; 72 | + pos[sizeof(T)-1-i] = tmp; 73 | + } 74 | +#endif 75 | pos += sizeof(T); 76 | // TODO: Optimize memcpy performance, see http://crbug.com/624311 . 77 | WriteToStream(buffer, pos); 78 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 79 | index cfc9b37b5..66801e056 100644 80 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 81 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/message.cc 82 | @@ -23,12 +23,6 @@ 83 | #include "perfetto/protozero/message_arena.h" 84 | #include "perfetto/protozero/message_handle.h" 85 | 86 | -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 87 | -// The memcpy() for float and double below needs to be adjusted if we want to 88 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 89 | -#error Unimplemented for big endian archs. 90 | -#endif 91 | - 92 | namespace protozero { 93 | 94 | namespace { 95 | -- 96 | 2.41.0 97 | 98 | 99 | From cce0a0bababd9821567f37a78cdb972659eab5e1 Mon Sep 17 00:00:00 2001 100 | From: Marcus Comstedt 101 | Date: Sat, 23 Feb 2019 17:39:49 +0100 102 | Subject: [PATCH 3/4] Prevent AssumeLittleEndian template from asserting when 103 | not instantiated 104 | 105 | --- 106 | .../perfetto/include/perfetto/ext/base/utils.h | 3 ++- 107 | .../third_party/perfetto/src/protozero/field.cc | 13 ++++++++----- 108 | 2 files changed, 10 insertions(+), 6 deletions(-) 109 | 110 | diff --git a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 111 | index b702d4f72..57996be53 100644 112 | --- a/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 113 | +++ b/src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/utils.h 114 | @@ -23,6 +23,7 @@ 115 | #include 116 | #include 117 | #include 118 | +#include 119 | #if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) 120 | #include 121 | #endif 122 | @@ -109,7 +110,7 @@ struct FreeDeleter { 123 | 124 | template 125 | constexpr T AssumeLittleEndian(T value) { 126 | - static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 127 | + static_assert(std::is_same::value && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, 128 | "Unimplemented on big-endian archs"); 129 | return value; 130 | } 131 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 132 | index be1648219..06109c547 100644 133 | --- a/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 134 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/protozero/field.cc 135 | @@ -19,9 +19,11 @@ 136 | #include "perfetto/base/logging.h" 137 | 138 | #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 139 | -// The memcpy() for fixed32/64 below needs to be adjusted if we want to 140 | -// support big endian CPUs. There doesn't seem to be a compelling need today. 141 | -#error Unimplemented for big endian archs. 142 | +#define BYTE_SWAP_TO_LE32(x) __builtin_bswap32(x) 143 | +#define BYTE_SWAP_TO_LE64(x) __builtin_bswap64(x) 144 | +#else 145 | +#define BYTE_SWAP_TO_LE32(x) (x) 146 | +#define BYTE_SWAP_TO_LE64(x) (x) 147 | #endif 148 | 149 | namespace protozero { 150 | @@ -41,14 +43,15 @@ void Field::SerializeAndAppendToInternal(Container* dst) const { 151 | } 152 | case static_cast(pu::ProtoWireType::kFixed32): { 153 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 154 | - uint32_t value32 = static_cast(int_value_); 155 | + uint32_t value32 = BYTE_SWAP_TO_LE32(static_cast(int_value_)); 156 | memcpy(wptr, &value32, sizeof(value32)); 157 | wptr += sizeof(uint32_t); 158 | break; 159 | } 160 | case static_cast(pu::ProtoWireType::kFixed64): { 161 | wptr = pu::WriteVarInt(pu::MakeTagFixed(id_), wptr); 162 | - memcpy(wptr, &int_value_, sizeof(int_value_)); 163 | + uint64_t value64 = BYTE_SWAP_TO_LE64(static_cast(int_value_)); 164 | + memcpy(wptr, &value64, sizeof(value64)); 165 | wptr += sizeof(uint64_t); 166 | break; 167 | } 168 | -- 169 | 2.41.0 170 | 171 | 172 | From 5cdead03476d49c3379de6e771eade6d24cb064e Mon Sep 17 00:00:00 2001 173 | From: Marcus Comstedt 174 | Date: Sun, 14 Feb 2021 19:26:43 +0100 175 | Subject: [PATCH 4/4] BufferedFrameDeserializer: Fix endianness handling 176 | 177 | --- 178 | .../perfetto/src/ipc/buffered_frame_deserializer.cc | 13 ++++++++++--- 179 | 1 file changed, 10 insertions(+), 3 deletions(-) 180 | 181 | diff --git a/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc b/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 182 | index d893dfb5c..e6a8c6fca 100644 183 | --- a/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 184 | +++ b/src/3rdparty/chromium/third_party/perfetto/src/ipc/buffered_frame_deserializer.cc 185 | @@ -97,7 +97,10 @@ bool BufferedFrameDeserializer::EndReceive(size_t recv_size) { 186 | // Read the header into |payload_size|. 187 | uint32_t payload_size = 0; 188 | const char* rd_ptr = buf() + consumed_size; 189 | - memcpy(base::AssumeLittleEndian(&payload_size), rd_ptr, kHeaderSize); 190 | + memcpy(&payload_size, rd_ptr, kHeaderSize); 191 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 192 | + payload_size = __builtin_bswap32(payload_size); 193 | +#endif 194 | 195 | // Saturate the |payload_size| to prevent overflows. The > capacity_ check 196 | // below will abort the parsing. 197 | @@ -175,10 +178,14 @@ void BufferedFrameDeserializer::DecodeFrame(const char* data, size_t size) { 198 | // static 199 | std::string BufferedFrameDeserializer::Serialize(const Frame& frame) { 200 | std::vector payload = frame.SerializeAsArray(); 201 | +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ 202 | + const uint32_t payload_size = __builtin_bswap32(static_cast(payload.size())); 203 | +#else 204 | const uint32_t payload_size = static_cast(payload.size()); 205 | +#endif 206 | std::string buf; 207 | - buf.resize(kHeaderSize + payload_size); 208 | - memcpy(&buf[0], base::AssumeLittleEndian(&payload_size), kHeaderSize); 209 | + buf.resize(kHeaderSize + payload.size()); 210 | + memcpy(&buf[0], &payload_size, kHeaderSize); 211 | memcpy(&buf[kHeaderSize], payload.data(), payload.size()); 212 | return buf; 213 | } 214 | -- 215 | 2.41.0 216 | 217 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/qtcomposer.patch: -------------------------------------------------------------------------------- 1 | From 7f87cd3333a329c46e585ca3450a1c80a7b428e8 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:35:58 +0100 4 | Subject: [PATCH] Fix compositing of kBGRA_8888_SkColorType on big endian 5 | 6 | --- 7 | src/core/compositor/display_software_output_surface.cpp | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp 11 | index ba99799f0..4f8e00167 100644 12 | --- a/src/core/compositor/display_software_output_surface.cpp 13 | +++ b/src/core/compositor/display_software_output_surface.cpp 14 | @@ -111,7 +111,12 @@ inline QImage::Format imageFormat(SkColorType colorType) 15 | { 16 | switch (colorType) { 17 | case kBGRA_8888_SkColorType: 18 | +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 19 | return QImage::Format_ARGB32_Premultiplied; 20 | +#else 21 | + // R/B swap needed... 22 | + return QImage::Format_RGBA8888_Premultiplied; 23 | +#endif 24 | case kRGBA_8888_SkColorType: 25 | return QImage::Format_RGBA8888_Premultiplied; 26 | default: 27 | @@ -135,6 +140,10 @@ QSGNode *DisplaySoftwareOutputSurface::Device::updatePaintNode( 28 | QImage image(reinterpret_cast(skPixmap.addr()), 29 | viewport_pixel_size_.width(), viewport_pixel_size_.height(), 30 | skPixmap.rowBytes(), imageFormat(skPixmap.colorType())); 31 | +#if Q_BYTE_ORDER == Q_BIG_ENDIAN 32 | + if (skPixmap.colorType() == kBGRA_8888_SkColorType) 33 | + image = image.rgbSwapped(); 34 | +#endif 35 | if (m_image.size() == image.size()) { 36 | QRect damageRect = toQt(damage_rect_); 37 | QPainter painter(&m_image); 38 | -- 39 | 2.41.0 40 | 41 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/swiftshader.patch: -------------------------------------------------------------------------------- 1 | From 9e35c666638aa84ffe7c0bd6575e0e3104a7df98 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Sun, 14 Feb 2021 19:35:50 +0100 4 | Subject: [PATCH 1/2] Fix JIT arch for big endian ppc64 5 | 6 | --- 7 | .../chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp b/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 11 | index d156be89b..49075b6e3 100644 12 | --- a/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 13 | +++ b/src/3rdparty/chromium/third_party/swiftshader/src/Reactor/LLVMJIT.cpp 14 | @@ -175,6 +175,8 @@ JITGlobals JITGlobals::create() 15 | # endif 16 | #elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ 17 | march = "ppc64le"; 18 | +#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ 19 | + march = "ppc64"; 20 | #else 21 | # error "unknown architecture" 22 | #endif 23 | -- 24 | 2.41.0 25 | 26 | 27 | From 1e20621341ad7454f72237eeb0758310a3c66d79 Mon Sep 17 00:00:00 2001 28 | From: Marcus Comstedt 29 | Date: Sun, 14 Feb 2021 19:36:38 +0100 30 | Subject: [PATCH 2/2] Add some sources needed on ppc64 to the build 31 | 32 | --- 33 | .../third_party/swiftshader/third_party/llvm-10.0/BUILD.gn | 1 + 34 | 1 file changed, 1 insertion(+) 35 | 36 | diff --git a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 37 | index de93e072c..d8983e8f2 100644 38 | --- a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 39 | +++ b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn 40 | @@ -850,6 +850,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { 41 | "llvm/lib/Support/ARMAttributeParser.cpp", 42 | "llvm/lib/Support/ARMBuildAttrs.cpp", 43 | "llvm/lib/Support/ARMTargetParser.cpp", 44 | + "llvm/lib/Support/Atomic.cpp", 45 | "llvm/lib/Support/BinaryStreamError.cpp", 46 | "llvm/lib/Support/BinaryStreamReader.cpp", 47 | "llvm/lib/Support/BinaryStreamRef.cpp", 48 | -- 49 | 2.41.0 50 | 51 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/v8.patch: -------------------------------------------------------------------------------- 1 | From 3cf99285ff79d85a695a91850a0f358a9b900021 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:51:28 +0100 4 | Subject: [PATCH] Support 64K pages 5 | 6 | --- 7 | src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 11 | index 89173b593..44185d90b 100644 12 | --- a/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 13 | +++ b/src/3rdparty/chromium/v8/src/base/platform/platform-posix.cc 14 | @@ -306,7 +306,7 @@ void* OS::GetRandomMmapAddr() { 15 | raw_addr += uint64_t{0x400000000000}; 16 | #elif V8_TARGET_BIG_ENDIAN 17 | // Big-endian Linux: 42 bits of virtual addressing. 18 | - raw_addr &= uint64_t{0x03FFFFFFF000}; 19 | + raw_addr &= uint64_t{0x03FFFFFF0000}; 20 | #else 21 | // Little-endian Linux: 46 bits of virtual addressing. 22 | raw_addr &= uint64_t{0x3FFFFFFF0000}; 23 | -- 24 | 2.41.0 25 | 26 | -------------------------------------------------------------------------------- /qtwebengine-5.15.11_p20231102/webp.patch: -------------------------------------------------------------------------------- 1 | From c6db4229f849130084f104fe6364c8bc202d9929 Mon Sep 17 00:00:00 2001 2 | From: Marcus Comstedt 3 | Date: Wed, 6 Jan 2021 13:53:50 +0100 4 | Subject: [PATCH] Remove #error on big endian 5 | 6 | --- 7 | src/3rdparty/chromium/media/parsers/webp_parser.cc | 4 ---- 8 | 1 file changed, 4 deletions(-) 9 | 10 | diff --git a/src/3rdparty/chromium/media/parsers/webp_parser.cc b/src/3rdparty/chromium/media/parsers/webp_parser.cc 11 | index 9d2ba7a12..f5ad73015 100644 12 | --- a/src/3rdparty/chromium/media/parsers/webp_parser.cc 13 | +++ b/src/3rdparty/chromium/media/parsers/webp_parser.cc 14 | @@ -14,10 +14,6 @@ 15 | #include "build/build_config.h" 16 | #include "media/parsers/vp8_parser.h" 17 | 18 | -#if !defined(ARCH_CPU_LITTLE_ENDIAN) 19 | -#error Big-Endian architecture not supported. 20 | -#endif 21 | - 22 | namespace media { 23 | 24 | namespace { 25 | -- 26 | 2.41.0 27 | 28 | --------------------------------------------------------------------------------