#37 Support ppc64le architecture
Opened 6 months ago by tle. Modified 6 months ago
rpms/ tle/chromium ppc64le  into  rawhide

file modified
+6 -9
@@ -1,4 +1,3 @@ 

- /chromium-52.0.2743.75-clean.tar.xz

  /depot_tools.git-master.tar.gz

  /policy_templates.zip

  /chromium-*.tar.xz
@@ -19,15 +18,13 @@ 

  /Tinos-Italic.ttf

  /Tinos-Regular.ttf

  /Ahem.ttf

- /node-v8.9.1-linux-x64.tar.gz

- /node-v10.15.3-linux-x64.tar.gz

  /xcb-proto-1.14.tar.xz

  /NotoSansSymbols2-Regular.ttf

  /NotoSansTibetan-Regular.ttf

- /node-v12.22.6-linux-arm64.tar.xz

- /node-v12.22.6-linux-x64.tar.xz

- /node-v16.17.0-linux-x64.tar.xz

- /node-v16.17.0-linux-arm64.tar.xz

+ /node-*-linux-arm64.tar.xz

+ /node-*-linux-x64.tar.xz

+ /node-*-linux-ppc64le.tar.xz

+ /linux-arm64-*.tgz

+ /linux-x64-*.tgz

+ /linux-ppc64-*.tgz

  /testupload

- /node-v19.8.1-linux-arm64.tar.xz

- /node-v19.8.1-linux-x64.tar.xz

file modified
+262 -41
@@ -40,8 +40,16 @@ 

  # enable|disable chrome-remote-desktop build

  %global build_remoting 0

  

- # set nodejs_version

- %global nodejs_version v19.8.1

+ %global esbuild_version 0.19.2

+ 

+ # install nodejs from Nodesource

+ %global nodejs_version v18.17.1

+ %global use_nodesource_binary 0

+ 

+ # RHEL 8 NodeJS RPM is out of date

+ %if 0%{?rhel} == 8

+ %global use_nodesource_binary 1

+ %endif

  

  # set version for devtoolset and gcc-toolset

  %global dts_version 12
@@ -236,7 +244,7 @@ 

  

  Name:	chromium%{chromium_channel}

  Version: 116.0.5845.179

- Release: 1%{?dist}

+ Release: 2%{?dist}

  Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use

  Url: http://www.chromium.org/Home

  License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
@@ -382,6 +390,96 @@ 

  # in fedora < 39

  Patch352: chromium-116-v4l2-num_delta_pocs_of_ref_rps_idx.patch

  

+ 

+ # PowerPC64 LE support

+ # Patches taken from Timothy Pearson's patchset

+ # https://quickbuild.io/~raptor-engineering-public/+archive/ubuntu/chromium/+files/chromium_115.0.5790.102-1raptor0~deb11u2.debian.tar.xz

+ Patch353: ppc64le/sandbox/0001-linux-seccomp-bpf-ppc64-glibc-workaround-in-SIGSYS-h.patch

+ Patch354: ppc64le/sandbox/0001-sandbox-Enable-seccomp_bpf-for-ppc64.patch

+ Patch355: ppc64le/sandbox/0001-services-service_manager-sandbox-linux-Fix-TCGETS-de.patch

+ Patch356: ppc64le/sandbox/0001-sandbox-linux-bpf_dsl-Update-syscall-ranges-for-ppc6.patch

+ Patch357: ppc64le/sandbox/0001-sandbox-linux-Implement-partial-support-for-ppc64-sy.patch

+ Patch358: ppc64le/sandbox/0001-sandbox-linux-Update-IsSyscallAllowed-in-broker_proc.patch

+ Patch359: ppc64le/sandbox/0001-sandbox-linux-Update-syscall-helpers-lists-for-ppc64.patch

+ Patch360: ppc64le/sandbox/0002-sandbox-linux-bpf_dsl-Modify-seccomp_macros-to-add-s.patch

+ Patch361: ppc64le/sandbox/0003-sandbox-linux-system_headers-Update-linux-seccomp-he.patch

+ Patch362: ppc64le/sandbox/0004-sandbox-linux-system_headers-Update-linux-signal-hea.patch

+ Patch363: ppc64le/sandbox/0005-sandbox-linux-seccomp-bpf-Add-ppc64-syscall-stub.patch

+ Patch364: ppc64le/sandbox/0005-sandbox-linux-update-unit-test-for-ppc64.patch

+ Patch365: ppc64le/sandbox/0006-sandbox-linux-disable-timedwait-time64-ppc64.patch

+ Patch366: ppc64le/sandbox/0007-sandbox-linux-add-ppc64-stat.patch

+ Patch367: ppc64le/sandbox/Sandbox-linux-services-credentials.cc-PPC.patch

+ Patch368: ppc64le/sandbox/0008-sandbox-fix-ppc64le-glibc234.patch

+ 

+ Patch369: ppc64le/third_party/0001-third_party-angle-Include-missing-header-cstddef-in-.patch

+ Patch370: ppc64le/third_party/0001-Add-PPC64-support-for-boringssl.patch

+ Patch371: ppc64le/third_party/0001-third_party-boringssl-Properly-detect-ppc64le-in-BUI.patch

+ Patch372: ppc64le/third_party/0001-third_party-libvpx-Properly-generate-gni-on-ppc64.patch

+ Patch373: ppc64le/third_party/0001-third_party-lss-Don-t-look-for-mmap2-on-ppc64.patch

+ Patch374: ppc64le/third_party/0001-third_party-pffft-Include-altivec.h-on-ppc64-with-SI.patch

+ Patch375: ppc64le/third_party/0002-third_party-lss-kernel-structs.patch

+ 

+ Patch376: ppc64le/webrtc/Rtc_base-system-arch.h-PPC.patch

+ 

+ Patch377: ppc64le/crashpad/0002-Include-cstddef-to-fix-build.patch

+ Patch378: ppc64le/third_party/0004-third_party-crashpad-port-curl-transport-ppc64.patch

+ 

+ Patch379: ppc64le/workarounds/HACK-third_party-libvpx-use-generic-gnu.patch

+ Patch380: ppc64le/workarounds/HACK-debian-clang-disable-skia-musttail.patch

+ 

+ Patch381: ppc64le/libaom/0001-Add-ppc64-target-to-libaom.patch

+ Patch382: ppc64le/libaom/0001-Add-pregenerated-config-for-libaom-on-ppc64.patch

+ 

+ Patch383: ppc64le/third_party/0002-third_party-libvpx-Remove-bad-ppc64-config.patch

+ Patch384: ppc64le/third_party/0002-third-party-boringssl-add-generated-files.patch

+ Patch385: ppc64le/third_party/0003-third_party-libvpx-Add-ppc64-generated-config.patch

+ # Enabling VSX causes artifacts to appear in VP9 videos

+ # Patch386: ppc64le/third_party/0003-third_party-libvpx-Add-ppc64-vsx-files.patch

+ Patch387: ppc64le/third_party/0003-third_party-ffmpeg-Add-ppc64-generated-config.patch

+ Patch388: ppc64le/third_party/0004-third_party-libvpx-work-around-ambiguous-vsx.patch

+ 

+ # Enable VSX acceleration in Skia. Requires POWER8 or higher.

+ Patch389: ppc64le/third_party/skia-vsx-instructions.patch

+ 

+ Patch390: ppc64le/ffmpeg/0001-Add-support-for-ppc64.patch

+ Patch391: ppc64le/breakpad/0001-Implement-support-for-ppc64-on-Linux.patch

+ Patch392: ppc64le/crashpad/0001-Implement-support-for-PPC64-on-Linux.patch

+ Patch393: ppc64le/database/0001-Properly-detect-little-endian-PPC64-systems.patch

+ Patch394: ppc64le/third_party/0001-Force-baseline-POWER8-AltiVec-VSX-CPU-features-when-.patch

+ Patch395: ppc64le/fixes/fix-breakpad-compile.patch

+ Patch396: ppc64le/fixes/fix-partition-alloc-compile.patch

+ Patch397: ppc64le/v8/0002-Add-ppc64-trap-instructions.patch

+ Patch398: ppc64le/third_party/0001-Fix-highway-ppc-hwcap.patch

+ 

+ Patch399: ppc64le/third_party/0001-Add-PPC64-support-for-libdav1d.patch

+ Patch400: ppc64le/third_party/0001-Fix-libdav1d-compilation-on-clang-ppc.patch

+ Patch401: ppc64le/sandbox/fix-ppc64-linux-syscalls-headers.patch

+ Patch402: ppc64le/third_party/0003-thirdparty-fix-dav1d-gn.patch

+ Patch403: ppc64le/third_party/use-sysconf-page-size-on-ppc64.patch

+ 

+ Patch404: ppc64le/third_party/dawn-fix-typos.patch

+ Patch405: ppc64le/third_party/dawn-fix-ppc64le-detection.patch

+ 

+ # Suppress harmless compiler warning messages that appear on ppc64 due to arch-specific warning flags being passed

+ Patch406: ppc64le/fixes/fix-unknown-warning-option-messages.patch

+ 

+ # While POWER8 remains the build target

+ # POWER9 enables hardware 128 bit vector support (ISA 3.0),

+ # and Highway gets confused when building in POWER8 mode

+ # (POWER8 compiler flags) on POWER9 hosts.

+ Patch407: ppc64le/third_party/0002-Highway-disable-128-bit-vsx.patch

+ 

+ # These patches enable full POWER ISA 3.0 (POWER9) acceleration when applied

+ # They will not work on POWER8 (ISA 2.07) or below

+ Patch408: ppc64le/core/baseline-isa-3-0.patch

+ 

+ Patch409: ppc64le/fixes/fix-swiftshader-compile.patch

+ 

+ # Patches taken from https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/chromium-116.0.5845.96.ebuild

+ Patch410: ppc64le/third_party/0005-chromium-ppc64-libpng.patch

+ Patch411: ppc64le/third_party/0005-libpng-pdfium-compile-98.patch

+ 

+ 

  # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:

  # http://build.chromium.org/buildbot/official/

  # For Chromium Fedora use chromium-latest.py --stable --ffmpegclean --ffmpegarm
@@ -404,10 +502,18 @@ 

  Source11: chrome-remote-desktop@.service

  Source13: master_preferences

  

- # RHEL 8 needs newer nodejs

- %if 0%{?rhel} == 8

- Source19: https://nodejs.org/dist/latest-v16.x/node-%{nodejs_version}-linux-x64.tar.xz

- Source21: https://nodejs.org/dist/latest-v16.x/node-%{nodejs_version}-linux-arm64.tar.xz

+ %if %{use_nodesource_binary}

+ Source19: https://nodejs.org/dist/${nodejs_version}/node-%{nodejs_version}-linux-x64.tar.xz

+ Source20: https://nodejs.org/dist/${nodejs_version}/node-%{nodejs_version}-linux-arm64.tar.xz

+ Source21: https://nodejs.org/dist/${nodejs_version}/node-%{nodejs_version}-linux-ppc64le.tar.xz

+ %endif

+ 

+ %if 0%{?fedora}

+ BuildRequires: golang-github-evanw-esbuild-%{esbuild_version}

+ %else

+ Source22: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-%{esbuild_version}.tgz

+ Source23: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-%{esbuild_version}.tgz

+ Source24: https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-%{esbuild_version}.tgz

  %endif

  

  %if %{clang}
@@ -504,10 +610,7 @@ 

  %endif

  %endif

  

- # RHEL 8 needs newer nodejs

- %if 0%{?rhel} == 8

- # nothing

- %else

+ %if ! %{use_nodesource_binary}

  BuildRequires: nodejs

  %endif

  
@@ -532,7 +635,7 @@ 

  BuildRequires: libstdc++-static

  %endif

  

- # Fedora tries to use system libs whenever it can.

+ ## Fedora tries to use system libs whenever it can.

  BuildRequires:	bzip2-devel

  BuildRequires:	dbus-glib-devel

  # For eu-strip
@@ -678,15 +781,14 @@ 

  

  Requires: chromium-common%{_isa} = %{version}-%{release}

  

- # rhel 7: ia32 x86_64

- # rhel 8+: ia32, x86_64, aarch64

- # fedora 32 or older: ia32, x86_64, aarch64

- # fedora 33+: x86_64 aarch64 only

+ # rhel 7: x86_64

+ # fedora 37 or older: x86_64, aarch64

+ # fedora 38 or newer: x86_64, aarch64, ppc64le

  %if 0%{?rhel} == 7

  ExclusiveArch: x86_64

  %else

- %if 0%{?fedora} > 32

- ExclusiveArch: x86_64 aarch64

+ %if 0%{?fedora} >= 38

+ ExclusiveArch: x86_64 aarch64 ppc64le

  %else

  ExclusiveArch: x86_64 aarch64

  %endif
@@ -987,30 +1089,135 @@ 

  %endif 

  %endif

  

+ %ifarch ppc64le

+ cp %{_sourcedir}/ppc64le/**/*.patch %{_sourcedir}/

+ 

+ %patch -P353 -p1 -b .ppc64le_sandbox_0001-linux-seccomp-bpf-ppc64-glibc-workaround-in-SIGSYS-h

+ %patch -P354 -p1 -b .ppc64le_sandbox_0001-sandbox-Enable-seccomp_bpf-for-ppc64

+ %patch -P355 -p1 -b .ppc64le_sandbox_0001-services-service_manager-sandbox-linux-Fix-TCGETS-de

+ %patch -P356 -p1 -b .ppc64le_sandbox_0001-sandbox-linux-bpf_dsl-Update-syscall-ranges-for-ppc6

+ %patch -P357 -p1 -b .ppc64le_sandbox_0001-sandbox-linux-Implement-partial-support-for-ppc64-sy

+ %patch -P358 -p1 -b .ppc64le_sandbox_0001-sandbox-linux-Update-IsSyscallAllowed-in-broker_proc

+ %patch -P359 -p1 -b .ppc64le_sandbox_0001-sandbox-linux-Update-syscall-helpers-lists-for-ppc64

+ %patch -P360 -p1 -b .ppc64le_sandbox_0002-sandbox-linux-bpf_dsl-Modify-seccomp_macros-to-add-s

+ %patch -P361 -p1 -b .ppc64le_sandbox_0003-sandbox-linux-system_headers-Update-linux-seccomp-he

+ %patch -P362 -p1 -b .ppc64le_sandbox_0004-sandbox-linux-system_headers-Update-linux-signal-hea

+ %patch -P363 -p1 -b .ppc64le_sandbox_0005-sandbox-linux-seccomp-bpf-Add-ppc64-syscall-stub

+ %patch -P364 -p1 -b .ppc64le_sandbox_0005-sandbox-linux-update-unit-test-for-ppc64

+ %patch -P365 -p1 -b .ppc64le_sandbox_0006-sandbox-linux-disable-timedwait-time64-ppc64

+ %patch -P366 -p1 -b .ppc64le_sandbox_0007-sandbox-linux-add-ppc64-stat

+ %patch -P367 -p1 -b .ppc64le_sandbox_Sandbox-linux-services-credentials.cc-PPC

+ %patch -P368 -p1 -b .ppc64le_sandbox_0008-sandbox-fix-ppc64le-glibc234

+ 

+ %patch -P369 -p1 -b .ppc64le_third_party_0001-third_party-angle-Include-missing-header-cstddef-in-

+ %patch -P370 -p1 -b .ppc64le_third_party_0001-Add-PPC64-support-for-boringssl

+ %patch -P371 -p1 -b .ppc64le_third_party_0001-third_party-boringssl-Properly-detect-ppc64le-in-BUI

+ %patch -P372 -p1 -b .ppc64le_third_party_0001-third_party-libvpx-Properly-generate-gni-on-ppc64

+ %patch -P373 -p1 -b .ppc64le_third_party_0001-third_party-lss-Don-t-look-for-mmap2-on-ppc64

+ %patch -P374 -p1 -b .ppc64le_third_party_0001-third_party-pffft-Include-altivec.h-on-ppc64-with-SI

+ %patch -P375 -p1 -b .ppc64le_third_party_0002-third_party-lss-kernel-structs

+ 

+ %patch -P376 -p1 -b .ppc64le_webrtc_Rtc_base-system-arch.h-PPC

+ 

+ %patch -P377 -p1 -b .ppc64le_crashpad_0002-Include-cstddef-to-fix-build

+ %patch -P378 -p1 -b .ppc64le_third_party_0004-third_party-crashpad-port-curl-transport-ppc64

+ 

+ %patch -P379 -p1 -b .ppc64le_workarounds_HACK-third_party-libvpx-use-generic-gnu

+ %patch -P380 -p1 -b .ppc64le_workarounds_HACK-debian-clang-disable-skia-musttail

+ 

+ %patch -P381 -p1 -b .ppc64le_libaom_0001-Add-ppc64-target-to-libaom

+ %patch -P382 -p1 -b .ppc64le_libaom_0001-Add-pregenerated-config-for-libaom-on-ppc64

+ 

+ %patch -P383 -p1 -b .ppc64le_third_party_0002-third_party-libvpx-Remove-bad-ppc64-config

+ %patch -P384 -p1 -b .ppc64le_third_party_0002-third-party-boringssl-add-generated-files

+ %patch -P385 -p1 -b .ppc64le_third_party_0003-third_party-libvpx-Add-ppc64-generated-config

+ # %patch -P386 -p1 -b .ppc64le_third_party_0003-third_party-libvpx-Add-ppc64-vsx-files

+ %patch -P387 -p1 -b .ppc64le_third_party_0003-third_party-ffmpeg-Add-ppc64-generated-config

+ %patch -P388 -p1 -b .ppc64le_third_party_0004-third_party-libvpx-work-around-ambiguous-vsx

+ 

+ %patch -P389 -p1 -b .ppc64le_third_party_skia-vsx-instructions

+ 

+ %patch -P390 -p1 -b .ppc64le_ffmpeg_0001-Add-support-for-ppc64

+ %patch -P391 -p1 -b .ppc64le_breakpad_0001-Implement-support-for-ppc64-on-Linux

+ %patch -P392 -p1 -b .ppc64le_crashpad_0001-Implement-support-for-PPC64-on-Linux

+ %patch -P393 -p1 -b .ppc64le_database_0001-Properly-detect-little-endian-PPC64-systems

+ %patch -P394 -p1 -b .ppc64le_third_party_0001-Force-baseline-POWER8-AltiVec-VSX-CPU-features-when-

+ %patch -P395 -p1 -b .ppc64le_fixes_fix-breakpad-compile

+ %patch -P396 -p1 -b .ppc64le_fixes_fix-partition-alloc-compile

+ %patch -P397 -p1 -b .ppc64le_v8_0002-Add-ppc64-trap-instructions

+ %patch -P398 -p1 -b .ppc64le_third_party_0001-Fix-highway-ppc-hwcap

+ 

+ %patch -P399 -p1 -b .ppc64le_third_party_0001-Add-PPC64-support-for-libdav1d

+ %patch -P400 -p1 -b .ppc64le_third_party_0001-Fix-libdav1d-compilation-on-clang-ppc

+ %patch -P401 -p1 -b .ppc64le_sandbox_fix-ppc64-linux-syscalls-headers

+ %patch -P402 -p1 -b .ppc64le_third_party_0003-thirdparty-fix-dav1d-gn

+ %patch -P403 -p1 -b .ppc64le_third_party_use-sysconf-page-size-on-ppc64

+ 

+ %patch -P404 -p1 -b .ppc64le_third_party_dawn-fix-typos

+ %patch -P405 -p1 -b .ppc64le_third_party_dawn-fix-ppc64le-detection

+ 

+ %patch -P406 -p1 -b .ppc64le_fixes_fix-unknown-warning-option-messages

+ 

+ %patch -P407 -p1 -b .ppc64le_third_party_0002-Highway-disable-128-bit-vsx

+ 

+ # Uncomment this line when the distro officially cease support for POWER8

+ # %patch -P408 -p1 -b .ppc64le_core_baseline-isa-3-0

+ 

+ %patch -P409 -p1 -b .ppc64le_fixes_fix-swiftshader-compile

+ 

+ %if %{bundlelibpng}

+ %patch -P410 -p1 -b .ppc64le_third_party_0005-chromium-ppc64-libpng

+ %patch -P411 -p1 -b .ppc64le_third_party_0005-libpng-pdfium-compile-98

+ %endif

+ 

+ %endif

  

  # Change shebang in all relevant files in this directory and all subdirectories

  # See `man find` for how the `-exec command {} +` syntax works

  find -type f \( -iname "*.py" \) -exec sed -i '1s=^#! */usr/bin/\(python\|env python\)[23]\?=#!%{__python3}=' {} +

  

- 

- %if 0%{?rhel} == 8

+ %if %{use_nodesource_binary}

    pushd third_party/node/linux

- %ifarch x86_64

-   tar xf %{SOURCE19}

-   mv node-%{nodejs_version}-linux-x64 node-linux-x64

- %endif

- %ifarch aarch64

-   tar xf %{SOURCE21}

-   mv node-%{nodejs_version}-linux-arm64 node-linux-arm64

-   # This is weird, but whatever

-   ln -s node-linux-arm64 node-linux-x64

- %endif

- popd

+   %ifarch x86_64

+     tar xf %{SOURCE19}

+     mv node-%{nodejs_version}-linux-x64 node-linux-x64

+   %endif

+   %ifarch aarch64

+     tar xf %{SOURCE20}

+     mv node-%{nodejs_version}-linux-arm64 node-linux-arm64

+     # This is weird, but whatever

+     ln -s node-linux-arm64 node-linux-x64

+   %endif

+   %ifarch ppc64le

+     tar xf %{SOURCE21}

+     mv node-%{nodejs_version}-linux-ppc64le node-linux-ppc64le

+     # This is weird, but whatever

+     ln -s node-linux-ppc64le node-linux-x64

+   %endif

+   popd

  %else

+   # use system nodejs

    mkdir -p third_party/node/linux/node-linux-x64/bin

    ln -s %{_bindir}/node third_party/node/linux/node-linux-x64/bin/node

  %endif

  

+ # Get rid of the bundled esbuild, it only support x86_64

+ %if 0%{?fedora}

+   ln -sf %{_bindir}/esbuild third_party/devtools-frontend/src/third_party/esbuild/esbuild

+ %else

+   pushd third_party/devtools-frontend/src/third_party/esbuild/

+   %ifarch x86_64

+     tar -zxf %{SOURCE22} --directory %{_tmppath}

+   %endif

+   %ifarch aarch64

+     tar -zxf %{SOURCE23} --directory %{_tmppath}

+   %endif

+   %ifarch ppc64le

+     tar -zxf %{SOURCE24} --directory %{_tmppath}

+   %endif

+   mv %{_tmppath}/package/bin/esbuild third_party/devtools-frontend/src/third_party/esbuild/esbuild

+ %endif

+ 

  # Get rid of the pre-built eu-strip binary, it is x86_64 and of mysterious origin

  rm -rf buildtools/third_party/eu-strip/bin/eu-strip

    
@@ -1145,6 +1352,10 @@ 

  CHROMIUM_CORE_GN_DEFINES+=' target_cpu="arm64"'

  %endif

  

+ %ifarch ppc64le

+ CHROMIUM_CORE_GN_DEFINES+=' target_cpu="ppc64"'

+ %endif

+ 

  CHROMIUM_CORE_GN_DEFINES+=' icu_use_data_file=true'

  CHROMIUM_CORE_GN_DEFINES+=' target_os="linux"'

  CHROMIUM_CORE_GN_DEFINES+=' current_os="linux"'
@@ -1351,7 +1562,7 @@ 

  pushd %{builddir}

  	cp -a chrom*.pak resources.pak icudtl.dat %{buildroot}%{chromium_path}

  	cp -a locales/*.pak %{buildroot}%{chromium_path}/locales/

- 	%ifarch x86_64 aarch64

+ 	%ifarch x86_64 aarch64 ppc64le

  		cp -a libvk_swiftshader.so %{buildroot}%{chromium_path}

  		strip %{buildroot}%{chromium_path}/libvk_swiftshader.so

  		cp -a libvulkan.so.1 %{buildroot}%{chromium_path}
@@ -1386,12 +1597,18 @@ 

  	%if %{build_clear_key_cdm}

  		%ifarch x86_64

  			cp -a ClearKeyCdm/_platform_specific/linux_x64/libclearkeycdm.so %{buildroot}%{chromium_path}

- 		%else

- 			%ifarch aarch64

- 				cp -a ClearKeyCdm/_platform_specific/linux_arm64/libclearkeycdm.so %{buildroot}%{chromium_path}

- 			%else

- 				cp -a libclearkeycdm.so %{buildroot}%{chromium_path}

- 			%endif

+ 		%endif

+ 

+ 		%ifarch aarch64

+ 			cp -a ClearKeyCdm/_platform_specific/linux_arm64/libclearkeycdm.so %{buildroot}%{chromium_path}

+ 		%endif

+ 

+ 		%ifarch ppc64le

+ 			cp -a ClearKeyCdm/_platform_specific/linux_ppc64/libclearkeycdm.so %{buildroot}%{chromium_path}

+ 		%endif

+ 

+ 		%ifnarch x86_64 aarch64 ppc64le

+ 			cp -a libclearkeycdm.so %{buildroot}%{chromium_path}

  		%endif

  		strip %{buildroot}%{chromium_path}/libclearkeycdm.so

  	%endif
@@ -1561,7 +1778,7 @@ 

  %if %{build_clear_key_cdm}

  %{chromium_path}/libclearkeycdm.so

  %endif

- %ifarch x86_64 aarch64

+ %ifarch x86_64 aarch64 ppc64le

  %{chromium_path}/libvk_swiftshader.so*

  %{chromium_path}/libvulkan.so*

  %{chromium_path}/vk_swiftshader_icd.json
@@ -1668,11 +1885,16 @@ 

  %{chromium_path}/chromedriver

  

  %changelog

+ * Mon Sep 11 2023 Trung Lê <8@tle.id.au> - 116.0.5845.179-2

+ - use Node LTS 18.17.1 instead of non-LTS 19.8.1

+ - use SHA256 checksums for NodeJS sources

+ - support PowerPC64 LE

+ 

  * Fri Sep 08 2023 Than Ngo <than@redhat.com> - 116.0.5845.179-1

  - update to 116.0.5845.179

  

  * Tue Aug 15 2023 Than Ngo <than@redhat.com> - 116.0.5845.96-1

- - update to 116.0.5845.96 

+ - update to 116.0.5845.96

  

  * Wed Aug 09 2023 Than Ngo <than@redhat.com> - 115.0.5790.170-2

  - set use_all_cpus=1 for aarch64
@@ -3140,4 +3362,3 @@ 

  

  * Mon Sep 9 2013 Tomas Popela <tpopela@redhat.com> 29.0.1547.65-1

  - Initial version based on Tom Callaway's <spot@fedoraproject.org> work

- 

@@ -0,0 +1,728 @@ 

+ From cda9400739dfa064907d822f00578bb51b24a404 Mon Sep 17 00:00:00 2001

+ From: Shawn Anastasio <shawnanastasio@yahoo.com>

+ Date: Fri, 17 Aug 2018 14:18:33 -0500

+ Subject: [PATCH] Implement support for ppc64 on Linux

+ 

+ This patch implements support for the ppc64 architecture on Linux systems.

+ 

+ Notable changes include:

+ * Modification of tests to support non-4K page sizes

+ * minidump_writer: Determine size of stack to capture based on page size

+ * dump_writer_common: Introduce member function GetVectorRegisters to

+   ThreadInfo on ppc64 systems. This allows Altivec/VMX registers to be

+   dumped like they are on OS X. linux_ptrace_dumper has been updated

+   to utilize this function along with the ptrace mode NT_PPC_VMX.

+ * processor/exploitability_unittest.cc: Tests were disabled on

+   non-x86 systems. They assume the system objdump is capable of

+   disassembling x86 binaries which is not the case on other

+   architectures.

+ 

+ To-do:

+ * tools/linux/md2core has been updated as well, but functionality

+   has not been confirmed and restoration of Altivec/VMX registers

+   has not been implemented

+ 

+ Note that proper functionality depends on updates to third_party/LSS

+ that introduce PPC64 support. An in-progress patch that allows

+ breakpad to build and run successfully is available at:

+ https://wiki.raptorcs.com/wiki/Porting/Chromium

+ ---

+  .../dump_writer_common/raw_context_cpu.h      |  2 +

+  .../linux/dump_writer_common/thread_info.cc   | 56 ++++++++++++++++++-

+  .../linux/dump_writer_common/thread_info.h    |  9 +++

+  .../dump_writer_common/ucontext_reader.cc     | 42 ++++++++++++++

+  .../dump_writer_common/ucontext_reader.h      |  3 +

+  src/client/linux/handler/exception_handler.cc | 22 +++++++-

+  src/client/linux/handler/exception_handler.h  |  6 +-

+  .../handler/exception_handler_unittest.cc     |  8 ++-

+  .../microdump_writer/microdump_writer.cc      | 14 ++++-

+  .../microdump_writer_unittest.cc              | 15 ++++-

+  .../minidump_writer/linux_core_dumper.cc      |  8 ++-

+  .../linux/minidump_writer/linux_dumper.cc     |  4 +-

+  .../linux/minidump_writer/linux_dumper.h      |  3 +-

+  .../linux_dumper_unittest_helper.cc           |  2 +

+  .../minidump_writer/linux_ptrace_dumper.cc    | 19 +++++--

+  .../linux_ptrace_dumper_unittest.cc           |  5 ++

+  .../linux/minidump_writer/minidump_writer.cc  | 18 ++++--

+  .../linux/minidump_writer/minidump_writer.h   |  2 +

+  .../minidump_writer_unittest.cc               |  3 +

+  src/common/linux/memory_mapped_file.cc        |  3 +-

+  .../linux/memory_mapped_file_unittest.cc      |  7 ++-

+  src/common/memory_allocator_unittest.cc       |  3 +-

+  src/processor/exploitability_linux.cc         |  2 +

+  src/processor/exploitability_unittest.cc      | 15 +++--

+  src/tools/linux/md2core/minidump-2-core.cc    | 45 +++++++++++++++

+  25 files changed, 281 insertions(+), 35 deletions(-)

+ 

+ --- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h

+ @@ -51,6 +51,8 @@ typedef MDRawContextRISCV64 RawContextCP

+  # else

+  #  error "Unexpected __riscv_xlen"

+  # endif

+ +#elif defined(__powerpc64__)

+ +typedef MDRawContextPPC64 RawContextCPU;

+  #else

+  #error "This code has not been ported to your platform yet."

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc

+ @@ -336,7 +336,42 @@ void ThreadInfo::FillCPUContext(RawConte

+  #error "Unexpected __riscv_xlen"

+  #endif

+  }

+ -#endif  // __riscv

+ +

+ +#elif defined(__powerpc64__)

+ +

+ +uintptr_t ThreadInfo::GetInstructionPointer() const {

+ +    return mcontext.gp_regs[PT_NIP];

+ +}

+ +

+ +void ThreadInfo::FillCPUContext(RawContextCPU* out) const {

+ +    out->context_flags = MD_CONTEXT_PPC64_FULL;

+ +    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)

+ +        out->gpr[i] = mcontext.gp_regs[i];

+ +

+ +    out->lr = mcontext.gp_regs[PT_LNK];

+ +    out->srr0 = mcontext.gp_regs[PT_NIP];

+ +    out->srr1 = mcontext.gp_regs[PT_MSR];

+ +    out->cr = mcontext.gp_regs[PT_CCR];

+ +    out->xer = mcontext.gp_regs[PT_XER];

+ +    out->ctr = mcontext.gp_regs[PT_CTR];

+ +    

+ +    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)

+ +        out->float_save.fpregs[i] = mcontext.fp_regs[i];

+ +

+ +    out->float_save.fpscr = mcontext.fp_regs[NFPREG-1];

+ +

+ +    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)

+ +        out->vector_save.save_vr[i] = \

+ +            {(((uint64_t)vregs.vrregs[i][0]) << 32) 

+ +                          | vregs.vrregs[i][1], 

+ +            (((uint64_t)vregs.vrregs[i][2]) << 32)

+ +                         | vregs.vrregs[i][3]};

+ +

+ +    out->vrsave = vregs.vrsave;

+ +    out->vector_save.save_vscr = {0, vregs.vscr.vscr_word};

+ +    out->vector_save.save_vrvalid = 0xFFFFFFFF; 

+ +}

+ +#endif  // __powerpc64__

+  

+  void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {

+    assert(gp_regs || size);

+ @@ -350,6 +385,11 @@ void ThreadInfo::GetGeneralPurposeRegist

+      *gp_regs = mcontext.__gregs;

+    if (size)

+      *size = sizeof(mcontext.__gregs);

+ +#elif defined(__powerpc64__)

+ +  if (gp_regs)

+ +    *gp_regs = mcontext.gp_regs;

+ +  if (size)

+ +    *size = sizeof(mcontext.gp_regs);

+  #else

+    if (gp_regs)

+      *gp_regs = &regs;

+ @@ -384,6 +424,11 @@ void ThreadInfo::GetFloatingPointRegiste

+  # else

+  #  error "Unexpected __riscv_flen"

+  # endif

+ +#elif defined(__powerpc64__)

+ +  if (fp_regs)

+ +    *fp_regs = &mcontext.fp_regs;

+ +  if (size)

+ +    *size = sizeof(mcontext.fp_regs);

+  #else

+    if (fp_regs)

+      *fp_regs = &fpregs;

+ @@ -392,4 +437,13 @@ void ThreadInfo::GetFloatingPointRegiste

+  #endif

+  }

+  

+ +#if defined(__powerpc64__)

+ +void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) {

+ +    if (v_regs)

+ +        *v_regs = &vregs;

+ +    if (size)

+ +        *size = sizeof(vregs);

+ +}

+ +#endif

+ +

+  }  // namespace google_breakpad

+ --- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h

+ @@ -67,6 +67,10 @@ struct ThreadInfo {

+    // Use the structures defined in <sys/user.h>

+    struct user_regs_struct regs;

+    struct user_fpsimd_struct fpregs;

+ +#elif defined(__powerpc64__)

+ +  // Use the structures defined in <sys/ucontext.h>.

+ +  mcontext_t mcontext;

+ +  struct _libc_vrstate vregs;

+  #elif defined(__mips__) || defined(__riscv)

+    // Use the structure defined in <sys/ucontext.h>.

+    mcontext_t mcontext;

+ @@ -83,6 +87,11 @@ struct ThreadInfo {

+  

+    // Returns the pointer and size of float point register area.

+    void GetFloatingPointRegisters(void** fp_regs, size_t* size);

+ +

+ +#if defined(__powerpc64__)

+ +  // Returns the pointer and size of the vector register area. (PPC64 only)

+ +  void GetVectorRegisters(void** v_regs, size_t* size);

+ +#endif

+  };

+  

+  }  // namespace google_breakpad

+ --- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc

+ @@ -324,6 +324,48 @@ void UContextReader::FillCPUContext(RawC

+  #error "Unexpected __riscv_xlen"

+  #endif

+  }

+ +

+ +#elif defined(__powerpc64__)

+ +

+ +uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {

+ +    return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP];

+ +}

+ +

+ +uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {

+ +    return uc->uc_mcontext.gp_regs[PT_NIP];

+ +}

+ +

+ +void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc,

+ +                                    const struct _libc_vrstate* vregs) {

+ +    out->context_flags = MD_CONTEXT_PPC64_FULL;

+ +

+ +    for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)

+ +        out->gpr[i] = uc->uc_mcontext.gp_regs[i];

+ +

+ +    out->lr = uc->uc_mcontext.gp_regs[PT_LNK];    

+ +    out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP];

+ +    out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR];

+ +    out->cr = uc->uc_mcontext.gp_regs[PT_CCR];

+ +    out->xer = uc->uc_mcontext.gp_regs[PT_XER];

+ +    out->ctr = uc->uc_mcontext.gp_regs[PT_CTR];

+ +    

+ +    for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)

+ +        out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i];

+ +

+ +    out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1];

+ +

+ +    for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++)

+ +        out->vector_save.save_vr[i] =

+ +            {(((uint64_t)vregs->vrregs[i][0]) << 32) 

+ +                         | vregs->vrregs[i][1], 

+ +             (((uint64_t)vregs->vrregs[i][2]) << 32)

+ +                         | vregs->vrregs[i][3]};

+ +

+ +    out->vrsave = vregs->vrsave;

+ +    out->vector_save.save_vscr = {0, vregs->vscr.vscr_word};

+ +    out->vector_save.save_vrvalid = 0xFFFFFFFF; 

+ +}

+ +

+  #endif

+  

+  }  // namespace google_breakpad

+ --- a/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h

+ @@ -54,6 +54,9 @@ struct UContextReader {

+  #elif defined(__aarch64__)

+    static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc,

+                               const struct fpsimd_context* fpregs);

+ +#elif defined(__powerpc64__)

+ +  static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,

+ +                             const struct _libc_vrstate* vregs);

+  #else

+    static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc);

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc

+ @@ -464,6 +464,13 @@ bool ExceptionHandler::HandleSignal(int

+      memcpy(&g_crash_context_.float_state, fp_ptr,

+             sizeof(g_crash_context_.float_state));

+    }

+ +#elif defined(__powerpc64__)

+ +  // On PPC64, we must copy VR state

+ +  ucontext_t* uc_ptr = (ucontext_t*)uc;

+ +  if (uc_ptr->uc_mcontext.v_regs) {

+ +    memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs,

+ +           sizeof(g_crash_context_.vector_state));

+ +  }

+  #elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+    ucontext_t* uc_ptr = (ucontext_t*)uc;

+    if (uc_ptr->uc_mcontext.fpregs) {

+ @@ -701,10 +708,18 @@ bool ExceptionHandler::WriteMinidump() {

+    }

+  #endif

+  

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__)

+ +#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE && !defined(__aarch64__) \

+ +    && !defined(__powerpc64__)

+    memcpy(&context.float_state, context.context.uc_mcontext.fpregs,

+           sizeof(context.float_state));

+  #endif

+ +

+ +#if defined(__powerpc64__)

+ +  // Vector registers must be copied on PPC64

+ +  memcpy(&context.vector_state, context.context.uc_mcontext.v_regs,

+ +         sizeof(context.vector_state));

+ +#endif

+ +

+    context.tid = sys_gettid();

+  

+    // Add an exception stream to the minidump for better reporting.

+ @@ -725,6 +740,9 @@ bool ExceptionHandler::WriteMinidump() {

+  #elif defined(__mips__)

+    context.siginfo.si_addr =

+        reinterpret_cast<void*>(context.context.uc_mcontext.pc);

+ +#elif defined(__powerpc64__)

+ +  context.siginfo.si_addr =

+ +      reinterpret_cast<void*>(context.context.uc_mcontext.gp_regs[PT_NIP]);

+  #elif defined(__riscv)

+    context.siginfo.si_addr =

+        reinterpret_cast<void*>(context.context.uc_mcontext.__gregs[REG_PC]);

+ --- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h

+ @@ -200,7 +200,11 @@ class ExceptionHandler {

+      siginfo_t siginfo;

+      pid_t tid;  // the crashing thread.

+      ucontext_t context;

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +    // PPC64's FP state is a part of ucontext_t like MIPS but the vector

+ +    // state is not, so a struct is needed.

+ +    vstate_t vector_state;

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+      fpstate_t float_state;

+  #endif

+    };

+ --- a/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc

+ @@ -321,7 +321,7 @@ TEST(ExceptionHandlerTest, ParallelChild

+        ASSERT_EQ(SIGSEGV, WTERMSIG(status));

+        return;

+      } else {

+ -      usleep(100000);

+ +      usleep(200000);

+      }

+    }

+  

+ @@ -576,6 +576,8 @@ const unsigned char kIllegalInstruction[

+  #if defined(__mips__)

+    // mfc2 zero,Impl - usually illegal in userspace.

+    0x48, 0x00, 0x00, 0x48

+ +#elif defined(__powerpc64__)

+ +  0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu

+  #else

+    // This crashes with SIGILL on x86/x86-64/arm.

+    0xff, 0xff, 0xff, 0xff

+ @@ -771,10 +773,10 @@ TEST(ExceptionHandlerTest, InstructionPo

+  

+    // These are defined here so the parent can use them to check the

+    // data from the minidump afterwards.

+ -  // Use 4k here because the OS will hand out a single page even

+ +  // Use the page size here because the OS will hand out a single page even

+    // if a smaller size is requested, and this test wants to

+    // test the upper bound of the memory range.

+ -  const uint32_t kMemorySize = 4096;  // bytes

+ +  const uint32_t kMemorySize = getpagesize();  // bytes

+    const int kOffset = kMemorySize - sizeof(kIllegalInstruction);

+  

+    const pid_t child = fork();

+ --- a/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc

+ @@ -141,7 +141,9 @@ class MicrodumpWriter {

+                    const MicrodumpExtraInfo& microdump_extra_info,

+                    LinuxDumper* dumper)

+        : ucontext_(context ? &context->context : NULL),

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +        vector_state_(context ? &context->vector_state : NULL),

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+          float_state_(context ? &context->float_state : NULL),

+  #endif

+          dumper_(dumper),

+ @@ -348,6 +350,8 @@ class MicrodumpWriter {

+  # else

+  #  error "Unexpected __riscv_xlen"

+  # endif

+ +#elif defined(__powerpc64__)

+ +    const char kArch[] = "ppc64";

+  #else

+  # error "This code has not been ported to your platform yet"

+  #endif

+ @@ -420,7 +424,9 @@ class MicrodumpWriter {

+    void DumpCPUState() {

+      RawContextCPU cpu;

+      my_memset(&cpu, 0, sizeof(RawContextCPU));

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +    UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_);

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+      UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);

+  #else

+      UContextReader::FillCPUContext(&cpu, ucontext_);

+ @@ -616,7 +622,9 @@ class MicrodumpWriter {

+    void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }

+  

+    const ucontext_t* const ucontext_;

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +  const google_breakpad::vstate_t* const vector_state_;

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+    const google_breakpad::fpstate_t* const float_state_;

+  #endif

+    LinuxDumper* dumper_;

+ --- a/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc

+ @@ -282,10 +282,19 @@ TEST(MicrodumpWriterTest, BasicWithMappi

+    CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);

+    ASSERT_TRUE(ContainsMicrodump(buf));

+  

+ +  int page_size = getpagesize();

+  #ifdef __LP64__

+ -  ASSERT_NE(std::string::npos,

+ -            buf.find("M 0000000000001000 000000000000002A 0000000000001000 "

+ -                     "33221100554477668899AABBCCDDEEFF0 libfoo.so"));

+ +  // This test is only available for the following page sizes

+ +  ASSERT_TRUE((page_size == 4096) || (page_size == 65536));

+ +  if (page_size == 4096) { 

+ +    ASSERT_NE(std::string::npos,

+ +              buf.find("M 0000000000001000 000000000000002A 0000000000001000 "

+ +                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));

+ +  } else {

+ +    ASSERT_NE(std::string::npos,

+ +              buf.find("M 0000000000010000 000000000000002A 0000000000010000 "

+ +                       "33221100554477668899AABBCCDDEEFF0 libfoo.so"));

+ +  }

+  #else

+    ASSERT_NE(std::string::npos,

+              buf.find("M 00001000 0000002A 00001000 "

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc

+ @@ -118,6 +118,9 @@ bool LinuxCoreDumper::GetThreadInfoByInd

+  #elif defined(__riscv)

+      stack_pointer = reinterpret_cast<uint8_t*>(

+          info->mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP]);

+ +#elif defined(__powerpc64__)

+ +  stack_pointer =

+ +      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);

+  #else

+  # error "This code hasn't been ported to your platform yet."

+  #endif

+ @@ -213,7 +216,10 @@ bool LinuxCoreDumper::EnumerateThreads()

+          memset(&info, 0, sizeof(ThreadInfo));

+          info.tgid = status->pr_pgrp;

+          info.ppid = status->pr_ppid;

+ -#if defined(__mips__)

+ +#if defined(__powerpc64__)

+ +        for (int i = 0; i < 31; i++)

+ +            info.mcontext.gp_regs[i] = status->pr_reg[i];

+ +#elif defined(__mips__)

+  # if defined(__ANDROID__)

+          for (int i = EF_R0; i <= EF_R31; i++)

+            info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc

+ @@ -770,7 +770,9 @@ bool LinuxDumper::GetStackInfo(const voi

+        reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));

+  

+    // The number of bytes of stack which we try to capture.

+ -  static const ptrdiff_t kStackToCapture = 32 * 1024;

+ +  // This now depends on page_size to avoid missing data

+ +  // on systems with larger page sizes.

+ +  static const ptrdiff_t kStackToCapture = 8 * page_size;

+  

+    const MappingInfo* mapping = FindMapping(stack_pointer);

+    if (!mapping)

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h

+ @@ -64,7 +64,8 @@ namespace google_breakpad {

+  typedef Elf32_auxv_t elf_aux_entry;

+  #elif defined(__x86_64) || defined(__aarch64__) || \

+       (defined(__mips__) && _MIPS_SIM != _ABIO32) || \

+ -     (defined(__riscv) && __riscv_xlen == 64)

+ +     (defined(__riscv) && __riscv_xlen == 64) || \

+ +     defined(__powerpc64__)

+  typedef Elf64_auxv_t elf_aux_entry;

+  #endif

+  

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc

+ @@ -56,6 +56,8 @@

+  #define TID_PTR_REGISTER "$1"

+  #elif defined(__riscv)

+  #define TID_PTR_REGISTER "x4"

+ +#elif defined(__powerpc64__)

+ +#define TID_PTR_REGISTER "r8"

+  #else

+  #error This test has not been ported to this platform.

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc

+ @@ -152,19 +152,27 @@ bool LinuxPtraceDumper::CopyFromProcess(

+    return true;

+  }

+  

+ -bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid)

+ -{

+ +bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) {

+  #ifdef PTRACE_GETREGSET

+    struct iovec io;

+    info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);

+ -  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {

+ +  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {

+      return false;

+    }

+  

+    info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);

+ -  if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {

+ +  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {

+      return false;

+    }

+ +

+ +#if defined(__powerpc64__)

+ +  // Grab the vector registers on PPC64 too

+ +  info->GetVectorRegisters(&io.iov_base, &io.iov_len);

+ +  if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) {

+ +    return false;

+ +  }

+ +#endif // defined(__powerpc64__)

+ +

+    return true;

+  #else

+    return false;

+ @@ -312,6 +320,9 @@ bool LinuxPtraceDumper::GetThreadInfoByI

+  #elif defined(__riscv)

+    stack_pointer = reinterpret_cast<uint8_t*>(

+        info->mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP]);

+ +#elif defined(__powerpc64__)

+ +  stack_pointer =

+ +      reinterpret_cast<uint8_t*>(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]);

+  #else

+  # error "This code hasn't been ported to your platform yet."

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc

+ @@ -470,6 +470,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackR

+  #elif defined(__riscv)

+      pid_t* process_tid_location =

+          reinterpret_cast<pid_t*>(one_thread.mcontext.__gregs[4]);

+ +#elif defined(__powerpc64__)

+ +    pid_t* process_tid_location =

+ +        reinterpret_cast<pid_t*>(one_thread.mcontext.gp_regs[8]);

+  #else

+  #error This test has not been ported to this platform.

+  #endif

+ @@ -569,6 +572,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeSt

+    uintptr_t heap_addr = thread_info.mcontext.gregs[1];

+  #elif defined(__riscv)

+    uintptr_t heap_addr = thread_info.mcontext.__gregs[4];

+ +#elif defined(__powerpc64__)

+ +  uintptr_t heap_addr = thread_info.mcontext.gp_regs[8];

+  #else

+  #error This test has not been ported to this platform.

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc

+ @@ -144,7 +144,9 @@ class MinidumpWriter {

+        : fd_(minidump_fd),

+          path_(minidump_path),

+          ucontext_(context ? &context->context : NULL),

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +        vector_state_(context ? &context->vector_state : NULL),

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+          float_state_(context ? &context->float_state : NULL),

+  #endif

+          dumper_(dumper),

+ @@ -476,7 +478,9 @@ class MinidumpWriter {

+          if (!cpu.Allocate())

+            return false;

+          my_memset(cpu.get(), 0, sizeof(RawContextCPU));

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +        UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_);

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+          UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);

+  #else

+          UContextReader::FillCPUContext(cpu.get(), ucontext_);

+ @@ -953,7 +957,7 @@ class MinidumpWriter {

+      dirent->location.rva = 0;

+    }

+  

+ -#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)

+ +#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__)

+    bool WriteCPUInformation(MDRawSystemInfo* sys_info) {

+      char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};

+      static const char vendor_id_name[] = "vendor_id";

+ @@ -973,7 +977,9 @@ class MinidumpWriter {

+  

+      // processor_architecture should always be set, do this first

+      sys_info->processor_architecture =

+ -#if defined(__mips__)

+ +#if defined(__powerpc64__)

+ +        MD_CPU_ARCHITECTURE_PPC64;

+ +#elif defined(__mips__)

+  # if _MIPS_SIM == _ABIO32

+          MD_CPU_ARCHITECTURE_MIPS;

+  # elif _MIPS_SIM == _ABI64

+ @@ -1440,7 +1446,9 @@ class MinidumpWriter {

+    const char* path_;  // Path to the file where the minidum should be written.

+  

+    const ucontext_t* const ucontext_;  // also from the signal handler

+ -#if GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+ +#if defined(__powerpc64__)

+ +  const google_breakpad::vstate_t* const vector_state_;

+ +#elif GOOGLE_BREAKPAD_CRASH_CONTEXT_HAS_FLOAT_STATE

+    const google_breakpad::fpstate_t* const float_state_;  // ditto

+  #endif

+    LinuxDumper* dumper_;

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h

+ @@ -47,6 +47,8 @@ class ExceptionHandler;

+  

+  #if defined(__aarch64__)

+  typedef struct fpsimd_context fpstate_t;

+ +#elif defined(__powerpc64__)

+ +typedef struct _libc_vrstate vstate_t;

+  #elif !defined(__ARM_EABI__) && !defined(__mips__)

+  typedef std::remove_pointer<fpregset_t>::type fpstate_t;

+  #endif

+ --- a/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc

+ @@ -723,6 +723,9 @@ TEST(MinidumpWriterTest, InvalidStackPoi

+  #elif defined(__riscv)

+    context.context.uc_mcontext.__gregs[MD_CONTEXT_RISCV_REG_SP] =

+        invalid_stack_pointer;

+ +#elif defined(__powerpc64__)

+ +  context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] =

+ +      invalid_stack_pointer;

+  #else

+  # error "This code has not been ported to your platform yet."

+  #endif

+ --- a/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc

+ +++ b/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc

+ @@ -72,8 +72,7 @@ bool MemoryMappedFile::Map(const char* p

+  

+  #if defined(__x86_64__) || defined(__aarch64__) || \

+     (defined(__mips__) && _MIPS_SIM == _ABI64) || \

+ -   (defined(__riscv) && __riscv_xlen == 64)

+ -

+ +      (defined(__riscv) && __riscv_xlen == 64) || defined(__powerpc64__)

+    struct kernel_stat st;

+    if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {

+  #else

+ --- a/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc

+ @@ -179,9 +179,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterM

+  TEST_F(MemoryMappedFileTest, MapWithOffset) {

+    // Put more data in the test file this time. Offsets can only be

+    // done on page boundaries, so we need a two page file to test this.

+ -  const int page_size = 4096;

+ -  char data1[2 * page_size];

+ -  size_t data1_size = sizeof(data1);

+ +  const int page_size = getpagesize();

+ +  char *data1 = static_cast<char*>(malloc(2 * page_size));

+ +  EXPECT_TRUE(data1 != NULL);

+ +  size_t data1_size = (2 * page_size);

+    for (size_t i = 0; i < data1_size; ++i) {

+      data1[i] = i & 0x7f;

+    }

+ --- a/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc

+ +++ b/third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc

+ @@ -60,8 +60,9 @@ TEST(PageAllocatorTest, LargeObject) {

+  

+    EXPECT_EQ(0U, allocator.pages_allocated());

+    uint8_t* p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));

+ +  uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize());

+    ASSERT_FALSE(p == NULL);

+ -  EXPECT_EQ(3U, allocator.pages_allocated());

+ +  EXPECT_EQ(expected_pages, allocator.pages_allocated());

+    for (unsigned i = 1; i < 10; ++i) {

+      uint8_t* p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));

+      ASSERT_FALSE(p == NULL);

+ --- a/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc

+ +++ b/third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc

+ @@ -82,6 +82,8 @@

+    #define ELF_ARCH  EM_AARCH64

+  #elif defined(__riscv)

+    #define ELF_ARCH  EM_RISCV

+ +#elif defined(__powerpc64__)

+ +  #define ELF_ARCH  EM_PPC64

+  #endif

+  

+  #if defined(__arm__)

+ @@ -92,6 +94,8 @@ typedef user_regs user_regs_struct;

+  #elif defined (__mips__) || defined(__riscv)

+  // This file-local typedef simplifies the source code.

+  typedef gregset_t user_regs_struct;

+ +#elif defined(__powerpc64__)

+ +typedef struct pt_regs user_regs_struct;

+  #endif

+  

+  using google_breakpad::MDTypeHelper;

+ @@ -324,6 +328,9 @@ struct CrashedProcess {

+  #if defined(__aarch64__)

+      user_fpsimd_struct fpregs;

+  #endif

+ +#if defined(__powerpc64__)

+ +    mcontext_t mcontext;

+ +#endif

+      uintptr_t stack_addr;

+      const uint8_t* stack;

+      size_t stack_length;

+ @@ -599,6 +606,38 @@ ParseThreadRegisters(CrashedProcess::Thr

+  #error "Unexpected __riscv_xlen"

+  #endif

+  }

+ +#elif defined(__powerpc64__)

+ +static void

+ +ParseThreadRegisters(CrashedProcess::Thread* thread,

+ +                     const MinidumpMemoryRange& range) {

+ +  const MDRawContextPPC64* rawregs = range.GetData<MDRawContextPPC64>(0);

+ +

+ +  for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++)

+ +    thread->mcontext.gp_regs[i] = rawregs->gpr[i];

+ +

+ +  thread->mcontext.gp_regs[PT_LNK] = rawregs->lr;

+ +  thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0;

+ +  thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1;

+ +  thread->mcontext.gp_regs[PT_CCR] = rawregs->cr;

+ +  thread->mcontext.gp_regs[PT_XER] = rawregs->xer;

+ +  thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr;

+ +  thread->mcontext.v_regs->vrsave = rawregs->vrsave;

+ +

+ +  for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++)

+ +      thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i];

+ +

+ +  thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr;

+ +

+ +  for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) {

+ +      thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32;

+ +      thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high;

+ +      thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32;

+ +      thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low;

+ +  }

+ +

+ +  thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF;

+ +}

+ +

+  #else

+  #error "This code has not been ported to your platform yet"

+  #endif

+ @@ -704,6 +743,12 @@ ParseSystemInfo(const Options& options,

+  # else

+  #  error "Unexpected __riscv_xlen"

+  # endif

+ +#elif defined(__powerpc64__)

+ +  if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) {

+ +    fprintf(stderr,

+ +            "This version of minidump-2-core only supports PPC64.\n");

+ +    exit(1);

+ +  }

+  #else

+  #error "This code has not been ported to your platform yet"

+  #endif

@@ -0,0 +1,33 @@ 

+ --- a/build/config/compiler/BUILD.gn

+ +++ b/build/config/compiler/BUILD.gn

+ @@ -1250,7 +1250,7 @@

+          cflags += [ "-maix64" ]

+          ldflags += [ "-maix64" ]

+        } else {

+ -        cflags += [ "-m64" ]

+ +        cflags += [ "-m64", "-mcpu=power9", "-mtune=power9" ]

+          ldflags += [ "-m64" ]

+        }

+      } else if (current_cpu == "riscv64") {

+ --- a/third_party/libvpx/BUILD.gn

+ +++ b/third_party/libvpx/BUILD.gn

+ @@ -93,7 +93,7 @@

+  

+    if (current_cpu == "ppc64") {

+      cflags += [

+ -      "-mcpu=power8",

+ +      "-mcpu=power9",

+        "-maltivec",

+        "-mvsx",

+      ]

+ --- a/v8/BUILD.gn

+ +++ b/v8/BUILD.gn

+ @@ -1251,7 +1251,7 @@

+        defines += [ "V8_TARGET_ARCH_PPC_LE" ]

+          cflags += [

+          # Enable usage of AltiVec, VSX, and other POWER8 and higher features

+ -        "-mcpu=power8",

+ +        "-mcpu=power9",

+          "-maltivec",

+          "-mvsx",

+        ]

@@ -0,0 +1,21 @@ 

+ From 82922bf486e9926a171152f61030dfcd53f017b8 Mon Sep 17 00:00:00 2001

+ From: Timothy Pearson <tpearson@raptorengineering.com>

+ Date: Thu, 30 Aug 2018 17:32:05 -0500

+ Subject: [PATCH] Include cstddef to fix build

+ 

+ size_t is not defined unless cstddef is included.

+ ---

+  third_party/crashpad/crashpad/compat/linux/sys/user.h  |   1 +

+ 

+ Index: chromium-110.0.5481.77/third_party/crashpad/crashpad/compat/linux/sys/user.h

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/crashpad/crashpad/compat/linux/sys/user.h

+ +++ chromium-110.0.5481.77/third_party/crashpad/crashpad/compat/linux/sys/user.h

+ @@ -15,6 +15,7 @@

+  #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_

+  #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_

+  

+ +#include <cstddef>

+  #include_next <sys/user.h>

+  

+  #include <features.h>

@@ -0,0 +1,56 @@ 

+ Index: chromium-110.0.5481.77/third_party/sqlite/src/amalgamation/sqlite3.c

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/sqlite/src/amalgamation/sqlite3.c

+ +++ chromium-110.0.5481.77/third_party/sqlite/src/amalgamation/sqlite3.c

+ @@ -14390,7 +14390,8 @@ typedef INT16_TYPE LogEst;

+  # if defined(i386)      || defined(__i386__)      || defined(_M_IX86) ||    \

+       defined(__x86_64)  || defined(__x86_64__)    || defined(_M_X64)  ||    \

+       defined(_M_AMD64)  || defined(_M_ARM)        || defined(__x86)   ||    \

+ -     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)

+ +     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||   \

+ +     defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)

+  #   define SQLITE_BYTEORDER    1234

+  # elif defined(sparc)     || defined(__ppc__) || \

+         defined(__ARMEB__) || defined(__AARCH64EB__)

+ Index: chromium-110.0.5481.77/third_party/sqlite/src/amalgamation_dev/sqlite3.c

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/sqlite/src/amalgamation_dev/sqlite3.c

+ +++ chromium-110.0.5481.77/third_party/sqlite/src/amalgamation_dev/sqlite3.c

+ @@ -14403,7 +14403,8 @@ typedef INT16_TYPE LogEst;

+  # if defined(i386)      || defined(__i386__)      || defined(_M_IX86) ||    \

+       defined(__x86_64)  || defined(__x86_64__)    || defined(_M_X64)  ||    \

+       defined(_M_AMD64)  || defined(_M_ARM)        || defined(__x86)   ||    \

+ -     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)

+ +     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||   \

+ +     defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)

+  #   define SQLITE_BYTEORDER    1234

+  # elif defined(sparc)     || defined(__ppc__) || \

+         defined(__ARMEB__) || defined(__AARCH64EB__)

+ Index: chromium-110.0.5481.77/third_party/sqlite/src/ext/rtree/rtree.c

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/sqlite/src/ext/rtree/rtree.c

+ +++ chromium-110.0.5481.77/third_party/sqlite/src/ext/rtree/rtree.c

+ @@ -474,7 +474,8 @@ struct RtreeMatchArg {

+  # if defined(i386)      || defined(__i386__)      || defined(_M_IX86) ||    \

+       defined(__x86_64)  || defined(__x86_64__)    || defined(_M_X64)  ||    \

+       defined(_M_AMD64)  || defined(_M_ARM)        || defined(__x86)   ||    \

+ -     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)

+ +     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||  \

+ +     defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)

+  #   define SQLITE_BYTEORDER    1234

+  # elif defined(sparc)     || defined(__ppc__) || \

+         defined(__ARMEB__) || defined(__AARCH64EB__)

+ Index: chromium-110.0.5481.77/third_party/sqlite/src/src/sqliteInt.h

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/sqlite/src/src/sqliteInt.h

+ +++ chromium-110.0.5481.77/third_party/sqlite/src/src/sqliteInt.h

+ @@ -904,7 +904,8 @@ typedef INT16_TYPE LogEst;

+  # if defined(i386)      || defined(__i386__)      || defined(_M_IX86) ||    \

+       defined(__x86_64)  || defined(__x86_64__)    || defined(_M_X64)  ||    \

+       defined(_M_AMD64)  || defined(_M_ARM)        || defined(__x86)   ||    \

+ -     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64)

+ +     defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ||   \

+ +     defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)

+  #   define SQLITE_BYTEORDER    1234

+  # elif defined(sparc)     || defined(__ppc__) || \

+         defined(__ARMEB__) || defined(__AARCH64EB__)

@@ -0,0 +1,114 @@ 

+ From bfdb97e53b1b6d037d00711f4601aabf167dbfbf Mon Sep 17 00:00:00 2001

+ From: Shawn Anastasio <shawnanastasio@yahoo.com>

+ Date: Sat, 1 Sep 2018 16:43:48 -0500

+ Subject: [PATCH] Add support for ppc64

+ 

+ ---

+  chromium/scripts/build_ffmpeg.py         | 11 +++++++++--

+  chromium/scripts/copy_config.sh          |  2 +-

+  chromium/scripts/generate_gn.py          |  2 +-

+  chromium/scripts/generate_gn_unittest.py | 10 ++++++++--

+  4 files changed, 19 insertions(+), 6 deletions(-)

+ 

+ Index: chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py

+ +++ chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/build_ffmpeg.py

+ @@ -40,7 +40,7 @@ BRANDINGS = [

+  ARCH_MAP = {

+      'android': ['ia32', 'x64', 'arm-neon', 'arm64'],

+      'linux': [

+ -        'ia32', 'x64', 'noasm-x64', 'arm', 'arm-neon', 'arm64'

+ +        'ia32', 'x64', 'noasm-x64', 'arm', 'arm-neon', 'arm64', 'ppc64'

+      ],

+      'mac': ['x64', 'arm64'],

+      'win': ['ia32', 'x64', 'arm64'],

+ @@ -142,6 +142,8 @@ def DetermineHostOsAndArch():

+      host_arch = 'mips64el'

+    elif platform.machine().startswith('arm'):

+      host_arch = 'arm'

+ +  elif platform.machine() == 'ppc64le':

+ +    host_arch = 'ppc64'

+    else:

+      return None

+  

+ @@ -911,6 +913,11 @@ def ConfigureAndBuild(target_arch, targe

+              '--extra-cflags=--target=mips64el-linux-gnuabi64',

+              '--extra-ldflags=--target=mips64el-linux-gnuabi64',

+          ])

+ +    elif target_arch == 'ppc64':

+ +      configure_flags['Common'].extend([

+ +        '--arch=ppc64le',

+ +        '--extra-cflags=-mcpu=power8'

+ +      ])

+      else:

+        print(

+            'Error: Unknown target arch %r for target OS %r!' % (target_arch,

+ Index: chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/copy_config.sh

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/ffmpeg/chromium/scripts/copy_config.sh

+ +++ chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/copy_config.sh

+ @@ -10,7 +10,7 @@ for os in android linux linux-noasm mac

+      # Copy config files for various architectures:

+      #   - ia32/x64 have config.asm, config.h

+      #   - arm/arm-neon have config.h

+ -    for arch in arm arm-neon arm64 ia32 x64 mipsel mips64el; do

+ +    for arch in arm arm-neon arm64 ia32 x64 mipsel mips64el ppc64; do

+        # Don't waste time on non-existent configs, if no config.h then skip.

+        [ ! -e "build.$arch.$os/$target/config.h" ] && continue

+        for f in config.h config_components.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

+ Index: chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/generate_gn.py

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/ffmpeg/chromium/scripts/generate_gn.py

+ +++ chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/generate_gn.py

+ @@ -78,7 +78,7 @@ _Attrs = ('ARCHITECTURE', 'TARGET', 'PLA

+  Attr = collections.namedtuple('Attr', _Attrs)(*_Attrs)

+  SUPPORT_MATRIX = {

+      Attr.ARCHITECTURE:

+ -        set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon']),

+ +        set(['ia32', 'x64', 'arm', 'arm64', 'arm-neon', 'ppc64']),

+      Attr.TARGET:

+          set(['Chromium', 'Chrome', 'ChromeOS']),

+      Attr.PLATFORM:

+ Index: chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py

+ ===================================================================

+ --- chromium-110.0.5481.77.orig/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py

+ +++ chromium-110.0.5481.77/third_party/ffmpeg/chromium/scripts/generate_gn_unittest.py

+ @@ -323,6 +323,10 @@ class SourceSetUnittest(unittest.TestCas

+      f = SourceSet(

+          set(['common', 'arm-neon', 'chrome', 'chromeos']),

+          set([SourceListCondition('arm-neon', 'ChromeOS', 'linux')]))

+ +    g = SourceSet(

+ +        set(['common']),

+ +        set([SourceListCondition('ppc64', 'Chromium', 'linux')]))

+ +

+  

+      expected = set()

+      expected.add(

+ @@ -334,7 +338,8 @@ class SourceSetUnittest(unittest.TestCas

+                  SourceListCondition('x64', 'Chromium', 'linux'),

+                  SourceListCondition('x64', 'Chrome', 'linux'),

+                  SourceListCondition('arm', 'Chromium', 'linux'),

+ -                SourceListCondition('arm-neon', 'ChromeOS', 'linux')

+ +                SourceListCondition('arm-neon', 'ChromeOS', 'linux'),

+ +                SourceListCondition('ppc64', 'Chromium', 'linux')

+              ])))

+      expected.add(

+          SourceSet(

+ @@ -362,7 +367,7 @@ class SourceSetUnittest(unittest.TestCas

+              set(['arm-neon', 'chromeos']),

+              set([SourceListCondition('arm-neon', 'ChromeOS', 'linux')])))

+  

+ -    source_sets = gg.CreatePairwiseDisjointSets([a, b, c, d, e, f])

+ +    source_sets = gg.CreatePairwiseDisjointSets([a, b, c, d, e, f, g])

+      self.assertEqualSourceSets(expected, set(source_sets))

+  

+    def testReduceConditions(self):

+ @@ -375,6 +380,7 @@ class SourceSetUnittest(unittest.TestCas

+              SourceListCondition('arm', 'Chromium', 'linux'),

+              SourceListCondition('arm64', 'Chromium', 'linux'),

+              SourceListCondition('arm-neon', 'Chromium', 'linux'),

+ +            SourceListCondition('ppc64', 'Chromium', 'linux'),

+          ]))

+      gg.ReduceConditionalLogic(a)

+  

@@ -0,0 +1,29 @@ 

+ diff --git a/third_party/breakpad/BUILD.gn b/third_party/breakpad/BUILD.gn

+ index ca8ac723d..0dcc78653 100644

+ --- a/third_party/breakpad/BUILD.gn

+ +++ b/third_party/breakpad/BUILD.gn

+ @@ -593,7 +593,6 @@ if (is_linux || is_chromeos || is_android) {

+        "breakpad/src/client/minidump_file_writer.h",

+        "breakpad/src/common/convert_UTF.cc",

+        "breakpad/src/common/convert_UTF.h",

+ -      "breakpad/src/common/linux/breakpad_getcontext.S",

+        "breakpad/src/common/linux/elf_core_dump.cc",

+        "breakpad/src/common/linux/elf_core_dump.h",

+        "breakpad/src/common/linux/elfutils.cc",

+ @@ -625,6 +624,8 @@ if (is_linux || is_chromeos || is_android) {

+      configs += [ "//build/config/compiler:no_chromium_code" ]

+      public_configs = [ ":client_config" ]

+  

+ +    defines = [ "HAVE_GETCONTEXT" ]

+ +

+      if (current_cpu == "arm" && is_chromeos_ash) {

+        # Avoid running out of registers in

+        # linux_syscall_support.h:sys_clone()'s inline assembly.

+ @@ -682,7 +683,6 @@ if (is_linux || is_chromeos || is_android) {

+        "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc",

+        "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc",

+        "breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc",

+ -      "breakpad/src/common/linux/breakpad_getcontext_unittest.cc",

+        "breakpad/src/common/linux/elf_core_dump_unittest.cc",

+        "breakpad/src/common/linux/file_id_unittest.cc",

+        "breakpad/src/common/linux/linux_libc_support_unittest.cc",

@@ -0,0 +1,16 @@ 

+ kIndex: chromium-114.0.5735.45/base/allocator/partition_allocator/partition_alloc.gni

+ ===================================================================

+ Index: chromium-115.0.5790.56/base/allocator/partition_allocator/partition_alloc.gni

+ ===================================================================

+ --- chromium-115.0.5790.56.orig/base/allocator/partition_allocator/partition_alloc.gni

+ +++ chromium-115.0.5790.56/base/allocator/partition_allocator/partition_alloc.gni

+ @@ -16,7 +16,8 @@ if (is_nacl) {

+    # NaCl targets don't use 64-bit pointers.

+    has_64_bit_pointers = false

+  } else if (current_cpu == "x64" || current_cpu == "arm64" ||

+ -           current_cpu == "loong64" || current_cpu == "riscv64") {

+ +           current_cpu == "loong64" || current_cpu == "riscv64" ||

+ +           current_cpu == "ppc64") {

+    has_64_bit_pointers = true

+  } else if (current_cpu == "x86" || current_cpu == "arm") {

+    has_64_bit_pointers = false

@@ -0,0 +1,26 @@ 

+ --- chromium-101.0.4951.54/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn.orig	2022-05-15 10:30:50.887333316 +0200

+ +++ chromium-101.0.4951.54/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn	2022-05-15 10:31:43.477318032 +0200

+ @@ -133,7 +133,6 @@ swiftshader_llvm_source_set("swiftshader_llvm") {

+    if (is_ubsan_vptr) {

+      sources = [

+        "llvm/lib/MC/MCWasmObjectTargetWriter.cpp",

+ -      "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp",

+        "llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp",

+        "llvm/lib/Target/TargetIntrinsicInfo.cpp",

+      ]

+ @@ -583,6 +582,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") {

+      "llvm/lib/MC/MCAsmInfoCOFF.cpp",

+      "llvm/lib/MC/MCAsmInfoDarwin.cpp",

+      "llvm/lib/MC/MCAsmInfoELF.cpp",

+ +    "llvm/lib/MC/MCAsmInfoXCOFF.cpp",

+      "llvm/lib/MC/MCAsmMacro.cpp",

+      "llvm/lib/MC/MCAsmStreamer.cpp",

+      "llvm/lib/MC/MCAssembler.cpp",

+ @@ -637,6 +637,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") {

+      "llvm/lib/MC/MCWin64EH.cpp",

+      "llvm/lib/MC/MCWinCOFFStreamer.cpp",

+      "llvm/lib/MC/MCWinEH.cpp",

+ +    "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp",

+      "llvm/lib/MC/MCXCOFFStreamer.cpp",

+      "llvm/lib/MC/MachObjectWriter.cpp",

+      "llvm/lib/MC/StringTableBuilder.cpp",

@@ -0,0 +1,33 @@ 

+ --- ./build/config/compiler/BUILD.gn

+ +++ ./build/config/compiler/BUILD.gn

+ @@ -1565,7 +1565,7 @@

+  

+        # -Wno-class-memaccess warns about hash table and vector in blink.

+        # But the violation is intentional.

+ -      if (!is_nacl) {

+ +      if ((!is_nacl) && (current_cpu != "ppc64")) {

+          cflags_cc += [ "-Wno-class-memaccess" ]

+        }

+  

+ @@ -1575,7 +1575,9 @@

+  

+        # Don't warn about "maybe" uninitialized. Clang doesn't include this

+        # in -Wall but gcc does, and it gives false positives.