From 3008fac76ff1ba1d9c2933c02a284b49e631f8c8 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 26 Jul 2024 08:22:44 +0200 Subject: [PATCH 1/3] refresh source, remove unused stuffs --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index 20a7d42c..1e661e94 100644 --- a/sources +++ b/sources @@ -2,4 +2,4 @@ SHA512 (node-v20.6.1-linux-arm64.tar.xz) = adfcaf2c22614797fd69fb46d94c1cbf64dea SHA512 (node-v20.6.1-linux-x64.tar.xz) = 7e15c05041a9a50f0046266aadb2e092a5aefbec19be1c7c809471add520cb57c7df3c47d88b1888b29bf2979dca3c92adddfd965370fa2a9da4ea02186464fd SHA512 (linux-arm64-0.19.2.tgz) = 8a0d8fec6786fffcd6954d00820037a55d61e60762c74300df0801f8db27057562c221a063bedfb8df56af9ba80abb366336987e881782c5996e6f871abd3dc6 SHA512 (linux-x64-0.19.2.tgz) = a31cc74c4bfa54f9b75d735a1cfc944d3b5efb7c06bfba9542da9a642ae0b2d235ea00ae84d3ad0572c406405110fe7b61377af0fd15803806ef78d20fc6f05d -SHA512 (chromium-127.0.6533.72-clean.tar.xz) = 838b460966197bee587bd95d4244f1ba16544a6f733c7e2b481abad2b1953a97fa7e4fa0ff72d1691fd3f827b1d0eb27e38c63c70ddddf9cda547955037a1b8d +SHA512 (chromium-127.0.6533.72-clean.tar.xz) = 6faa0b0df800bafb31acb003d23f62e5eeea12c49ed3b9bf52c2e4f7ef3a7d7f6069f41026092bcb1e222dcbf4f0a3a0595e9be52502375f0b1094551cc7a98c From 172edf5cd41edc4fb8db24bef3adcb164cff9091 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 26 Jul 2024 17:13:08 +0200 Subject: [PATCH 2/3] - refresh patches for aarch64 - add workaround for build error on aarch64 (highway) - update chromium-latest.py (removing unused sttuffs) - add bindgen for el8 build - add upstream patch to fix build dep in crabbyavif --- .gitignore | 1 + chromium-126-el8-ifunc-header.patch | 15 --- chromium-127-crabbyavif.patch | 38 ++++++++ chromium-127-el8-ifunc-header.patch | 15 +++ ....patch => chromium-127-rust-clanglib.patch | 12 +++ chromium-latest.py | 6 +- chromium.spec | 97 ++++++++++++------- sources | 1 + 8 files changed, 136 insertions(+), 49 deletions(-) delete mode 100644 chromium-126-el8-ifunc-header.patch create mode 100644 chromium-127-crabbyavif.patch create mode 100644 chromium-127-el8-ifunc-header.patch rename chromium-124-rust-clang_lib.patch => chromium-127-rust-clanglib.patch (80%) diff --git a/.gitignore b/.gitignore index f1ff2221..6a2d41a5 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /node-v20.6.1-linux-x64.tar.xz /linux-arm64-0.19.2.tgz /linux-x64-0.19.2.tgz +/v0.69.4.tar.gz diff --git a/chromium-126-el8-ifunc-header.patch b/chromium-126-el8-ifunc-header.patch deleted file mode 100644 index 72368df0..00000000 --- a/chromium-126-el8-ifunc-header.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up chromium-126.0.6478.55/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h.me chromium-126.0.6478.55/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h ---- chromium-126.0.6478.55/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h.me 2024-06-12 13:09:47.539620293 -0400 -+++ chromium-126.0.6478.55/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h 2024-06-12 13:12:10.570739701 -0400 -@@ -10,9 +10,11 @@ - #include "partition_alloc/build_config.h" - #include "partition_alloc/partition_alloc_buildflags.h" - -+#if 0 - #if BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_LINUX) - #define HAS_HW_CAPS - #endif -+#endif - - #if defined(ARCH_CPU_ARM64) && defined(HAS_HW_CAPS) - #include diff --git a/chromium-127-crabbyavif.patch b/chromium-127-crabbyavif.patch new file mode 100644 index 00000000..a72200e6 --- /dev/null +++ b/chromium-127-crabbyavif.patch @@ -0,0 +1,38 @@ +commit 89dcd2d419755421290f85e32617acabdd81cac1 +Author: lauren n. liberda +Date: Thu Jun 20 18:55:57 2024 +0000 + + unbundle: add missing dav1d targets + + fixes "ERROR Unresolved dependencies. + //third_party/crabbyavif:crabbyavif_dav1d_bindings(//build/toolchain/linux/unbundle:default) + needs //third_party/dav1d:dav1d_config(//build/toolchain/linux/unbundle:default) + //third_party/crabbyavif:crabbyavif_dav1d_bindings(//build/toolchain/linux/unbundle:default) + needs //third_party/dav1d:dav1d_headers(//build/toolchain/linux/unbundle:default)" + + Change-Id: I85442e5fb67a804985354570fba453cc619c83d7 + Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5642761 + Reviewed-by: Lei Zhang + Reviewed-by: Thomas Anderson + Commit-Queue: Thomas Anderson + Cr-Commit-Position: refs/heads/main@{#1317534} + +diff --git a/build/linux/unbundle/dav1d.gn b/build/linux/unbundle/dav1d.gn +index 3d65158bc6144..a6d005a6622e3 100644 +--- a/build/linux/unbundle/dav1d.gn ++++ b/build/linux/unbundle/dav1d.gn +@@ -21,3 +21,14 @@ source_set("dav1d") { + deps = [ ":dav1d_shim" ] + public_configs = [ ":system_dav1d" ] + } ++ ++group("dav1d_headers") { ++ public_deps = [ ":dav1d_shim" ] ++} ++ ++config("dav1d_config") { ++ configs = [ ++ ":system_dav1d", ++ ":dav1d_shim_config", ++ ] ++} diff --git a/chromium-127-el8-ifunc-header.patch b/chromium-127-el8-ifunc-header.patch new file mode 100644 index 00000000..985b118e --- /dev/null +++ b/chromium-127-el8-ifunc-header.patch @@ -0,0 +1,15 @@ +diff -up chromium-127.0.6533.72/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h.me chromium-127.0.6533.72/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h +--- chromium-127.0.6533.72/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h.me 2024-07-25 23:58:19.751616508 +0200 ++++ chromium-127.0.6533.72/base/allocator/partition_allocator/src/partition_alloc/aarch64_support.h 2024-07-26 00:01:46.391800969 +0200 +@@ -10,9 +10,11 @@ + #include "partition_alloc/build_config.h" + #include "partition_alloc/partition_alloc_buildflags.h" + ++#if 0 + #if PA_BUILDFLAG(IS_ANDROID) || PA_BUILDFLAG(IS_LINUX) + #define HAS_HW_CAPS + #endif ++#endif + + #if PA_BUILDFLAG(PA_ARCH_CPU_ARM64) && defined(HAS_HW_CAPS) + #include diff --git a/chromium-124-rust-clang_lib.patch b/chromium-127-rust-clanglib.patch similarity index 80% rename from chromium-124-rust-clang_lib.patch rename to chromium-127-rust-clanglib.patch index cc152ecc..55b3ce73 100644 --- a/chromium-124-rust-clang_lib.patch +++ b/chromium-127-rust-clanglib.patch @@ -1,3 +1,15 @@ +diff -up chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me chromium-127.0.6533.72/build/rust/rust_bindgen.gni +--- chromium-127.0.6533.72/build/rust/rust_bindgen.gni.me 2024-07-25 16:11:18.754551595 +0200 ++++ chromium-127.0.6533.72/build/rust/rust_bindgen.gni 2024-07-25 16:11:33.997837660 +0200 +@@ -22,7 +22,7 @@ _libclang_path = rust_bindgen_root + if (host_os == "win") { + _libclang_path += "/bin" + } else { +- _libclang_path += "/lib" ++ _libclang_path += "/lib64" + } + + # Template to build Rust/C bindings with bindgen. diff -up chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib chromium-121.0.6167.57/build/config/clang/BUILD.gn --- chromium-121.0.6167.57/build/config/clang/BUILD.gn.rust-clang_lib 2024-01-10 16:43:01.000000000 +0100 +++ chromium-121.0.6167.57/build/config/clang/BUILD.gn 2024-01-20 19:51:38.481992799 +0100 diff --git a/chromium-latest.py b/chromium-latest.py index eb2d3f00..e06be497 100755 --- a/chromium-latest.py +++ b/chromium-latest.py @@ -315,7 +315,11 @@ if __name__ == '__main__': nacl_versions(chromium_version) if (args.cleansources): - junk_dirs = ['build/linux/debian_bullseye_amd64-sysroot', 'build/linux/debian_bullseye_i386-sysroot'] + junk_dirs = ['build/linux/debian_bullseye_amd64-sysroot', + 'build/linux/debian_bullseye_i386-sysroot', + 'third_party/node/linux/node-linux-x64', + 'third_party/rust-toolchain', + 'third_party/rust-src'] # First, the dirs: for directory in junk_dirs: diff --git a/chromium.spec b/chromium.spec index 47fe68ea..9c073919 100644 --- a/chromium.spec +++ b/chromium.spec @@ -197,8 +197,22 @@ %global bundlelibaom 1 %global bundlelibavif 1 %global bundlesnappy 1 +%global bundlezstd 1 %global bundleicu 1 %global bundledav1d 1 +%global bundlebrotli 1 +%global bundlelibwebp 1 +%global bundlecrc32c 1 +%global bundleharfbuzz 1 +%global bundlelibpng 1 +%global bundlelibjpeg 1 +%global bundlefreetype 1 +%global bundlelibdrm 1 +%global bundlefontconfig 1 +%global bundleffmpegfree 1 +%global bundlelibopenjpeg2 1 +%global bundlelibtiff 1 +%global bundlelibxml 1 %global bundlepylibs 0 %global bundlelibxslt 0 %global bundleflac 0 @@ -211,7 +225,11 @@ %global bundleopus 0 %global bundlelcms2 0 -# RHEL 7.9 dropped minizip. +# workaround for build error on aarch64 +%ifarch aarch64 +%global bundlehighway 1 +%endif + # enable bundleminizip for Fedora > 39 due to switch to minizip-ng # which breaks the build %global bundleminizip 0 @@ -219,44 +237,21 @@ %global bundleminizip 1 %endif -%if 0%{?rhel} == 8 -%global bundleharfbuzz 1 -%global bundlelibwebp 1 -%global bundlelibpng 1 -%global bundlelibjpeg 1 -%global bundlefreetype 1 -%global bundlelibdrm 1 -%global bundlefontconfig 1 -%global bundleffmpegfree 1 -%global bundlebrotli 1 -%global bundlelibopenjpeg2 1 -%global bundlelibtiff 1 -%global bundlecrc32c 1 -%global bundlelibxml 1 -%global bundledav1d 1 -%else -%if 0%{?fedora} > 38 || 0%{?rhel} > 9 +%if 0%{?fedora} >= 39 || 0%{?rhel} > 9 %global bundlebrotli 0 %global bundlelibwebp 0 -%else -%global bundlebrotli 1 -%global bundlelibwebp 1 -%endif +%global bundlezstd 0 +%global bundlecrc32c 0 +%global bundleharfbuzz 0 +%global bundlefontconfig 0 +%global bundledav1d 0 %global bundlelibpng 0 %global bundlelibjpeg 0 %global bundlelibdrm 0 -%global bundlefontconfig 0 %global bundleffmpegfree 0 %global bundlefreetype 0 %global bundlelibopenjpeg2 0 %global bundlelibtiff 0 -%if 0%{?rhel} == 9 -%global bundlecrc32c 1 -%global bundleharfbuzz 1 -%else -%global bundlecrc32c 0 -%global bundleharfbuzz 0 -%endif %global bundlelibxml 0 %endif @@ -371,7 +366,7 @@ Patch150: chromium-124-qt6.patch # disable memory tagging (epel8 on aarch64) due to new feature IFUNC-Resolver # it is not supported in old glibc < 2.30, error: fatal error: 'sys/ifunc.h' file not found Patch305: chromium-124-el8-arm64-memory_tagging.patch -Patch306: chromium-126-el8-ifunc-header.patch +Patch306: chromium-127-el8-ifunc-header.patch # build error: unknown architectural extension on aarch64 (epel8) Patch307: chromium-124-el8-libdav1d-aarch64.patch # 64kpage support on aarch64 (el8) @@ -395,7 +390,7 @@ Patch354: chromium-126-split-threshold-for-reg-with-hint.patch Patch355: chromium-126-system-libstdc++.patch # set clang_lib path -Patch358: chromium-124-rust-clang_lib.patch +Patch358: chromium-127-rust-clanglib.patch # PowerPC64 LE support # Timothy Pearson's patchset @@ -475,6 +470,7 @@ Patch501: chromium-127-ninja-1.21.1-deps-part0.patch Patch502: chromium-127-ninja-1.21.1-deps-part1.patch Patch503: chromium-127-ninja-1.21.1-deps-part2.patch Patch504: chromium-127-ninja-1.21.1-deps-part3.patch +Patch505: chromium-127-crabbyavif.patch # Use chromium-latest.py to generate clean tarball from released build tarballs, found here: # http://build.chromium.org/buildbot/official/ @@ -509,6 +505,9 @@ Source14: https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-%{esbuild_ve Source15: https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-%{esbuild_version}.tgz %endif +# bindgen for epel8 +Source16: https://github.com/rust-lang/rust-bindgen/archive/refs/tags/v0.69.4.tar.gz + # esbuild binary from fedora %if 0%{?fedora} BuildRequires: golang-github-evanw-esbuild @@ -535,6 +534,16 @@ BuildRequires: binutils %endif BuildRequires: rustc +%if 0%{?rhel} == 8 +# need to build bindgen on el8 +BuildRequires: cargo +%else +BuildRequires: bindgen-cli +%endif + +%if ! %{bundlezstd} +BuildRequires: libzstd-devel +%endif # build with system ffmpeg-free %if ! %{bundleffmpegfree} @@ -1191,13 +1200,13 @@ Qt6 UI for chromium. %patch -P503 -p1 -b .ninja-1.21.1-deps %patch -P504 -p1 -b .ninja-1.21.1-deps %endif +%patch -P505 -p1 -b .crabbyavif # 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]\?=#!%{chromium_pybin}=' {} + # Add correct path for nodejs binary -rm -rf third_party/node/linux/node-linux-x64* %if ! %{system_nodejs} pushd third_party/node/linux %ifarch x86_64 @@ -1258,6 +1267,18 @@ cp -a third_party/dav1d/version/version.h third_party/dav1d/libdav1d/include/dav %endif %build +# build bindgen on el8 +%if 0%{?rhel} == 8 +%__rpmuncompress -x %{SOURCE16} +pushd rust-bindgen-0.69.4 +cargo build +mkdir -p ..%{_bindir} ..%{_libdir} +cp target/debug/bindgen ..%{_bindir} +pushd ..%{_libdir} +ln -fs %{_libdir}/libclang* . +popd +popd +%endif # reduce warnings %if %{clang} @@ -1314,6 +1335,12 @@ export RUSTC_BOOTSTRAP=1 # set rustc version rustc_version="$(rustc --version)" +# set rust bindgen root +%if 0%{?rhel} == 8 +rust_bindgen_root="$PWD%{_prefix}" +%else +rust_bindgen_root="%{_prefix}" +%endif # set clang version clang_version="$(clang --version | sed -n 's/clang version //p' | cut -d. -f1)" @@ -1363,6 +1390,7 @@ CHROMIUM_CORE_GN_DEFINES+=' use_lld=false' # enable system rust CHROMIUM_CORE_GN_DEFINES+=' rust_sysroot_absolute="%{_prefix}"' +CHROMIUM_CORE_GN_DEFINES+=" rust_bindgen_root=\"$rust_bindgen_root\"" CHROMIUM_CORE_GN_DEFINES+=" rustc_version=\"$rustc_version\"" CHROMIUM_CORE_GN_DEFINES+=' use_sysroot=false' @@ -1568,6 +1596,9 @@ system_libs=() %if ! %{bundleflac} system_libs+=(flac) %endif +%if ! %{bundlezstd} + system_libs+=(zstd) +%endif %if 0%{?noopenh264} system_libs+=(openh264) %endif diff --git a/sources b/sources index 1e661e94..60b93c8d 100644 --- a/sources +++ b/sources @@ -3,3 +3,4 @@ SHA512 (node-v20.6.1-linux-x64.tar.xz) = 7e15c05041a9a50f0046266aadb2e092a5aefbe SHA512 (linux-arm64-0.19.2.tgz) = 8a0d8fec6786fffcd6954d00820037a55d61e60762c74300df0801f8db27057562c221a063bedfb8df56af9ba80abb366336987e881782c5996e6f871abd3dc6 SHA512 (linux-x64-0.19.2.tgz) = a31cc74c4bfa54f9b75d735a1cfc944d3b5efb7c06bfba9542da9a642ae0b2d235ea00ae84d3ad0572c406405110fe7b61377af0fd15803806ef78d20fc6f05d SHA512 (chromium-127.0.6533.72-clean.tar.xz) = 6faa0b0df800bafb31acb003d23f62e5eeea12c49ed3b9bf52c2e4f7ef3a7d7f6069f41026092bcb1e222dcbf4f0a3a0595e9be52502375f0b1094551cc7a98c +SHA512 (v0.69.4.tar.gz) = a493474c89255c801c6fd4eb44e6a94f4d23830dc13c0bbae08c46e5c364e0df176fc00174d6462b70239578d0821e9ff1aaf127d8c60688f38a50a62cf292f4 From 56046b9dcc449c102aadae39a949ce0aa3ad3daf Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Fri, 26 Jul 2024 18:00:24 +0200 Subject: [PATCH 3/3] cleanup bundle libs --- chromium.spec | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/chromium.spec b/chromium.spec index 9c073919..484e190b 100644 --- a/chromium.spec +++ b/chromium.spec @@ -237,12 +237,8 @@ %global bundleminizip 1 %endif -%if 0%{?fedora} >= 39 || 0%{?rhel} > 9 -%global bundlebrotli 0 -%global bundlelibwebp 0 +%if 0%{?fedora} || 0%{?rhel} >= 9 %global bundlezstd 0 -%global bundlecrc32c 0 -%global bundleharfbuzz 0 %global bundlefontconfig 0 %global bundledav1d 0 %global bundlelibpng 0 @@ -253,6 +249,19 @@ %global bundlelibopenjpeg2 0 %global bundlelibtiff 0 %global bundlelibxml 0 +%if 0%{?rhel} == 9 +%global bundlecrc32c 1 +%global bundleharfbuzz 1 +%global bundlebrotli 1 +%global bundleicu 1 +%global bundlelibwebp 1 +%else +%global bundlecrc32c 0 +%global bundleharfbuzz 0 +%global bundlebrotli 0 +%global bundleicu 0 +%global bundlelibwebp 0 +%endif %endif ### From 2013 until early 2021, Google permitted distribution builds of