Skip to content

Commit

Permalink
updpatch: chromium 128.0.6613.84-1
Browse files Browse the repository at this point in the history
- Fix rotten patches and drop merged patches
- Add two runtime_api_delegate patches from electron riscv fork to fix
  a new crash caused by chromium making a check fatal.
- V8 FTBFS with some errors regarding F16x8 and cherry-picking is hard,
  so v8 is bumped to last known good revision of riscv64(2b368def [riscv][wasm]
  Turboshaft hardware support for F16x8 FMA instructions)
  - Revert the removal of some deprecated API to make it work with
    chromium 128
  • Loading branch information
kxxt authored and felixonmars committed Aug 25, 2024
1 parent 7dbd93f commit beb42b3
Show file tree
Hide file tree
Showing 5 changed files with 5,142 additions and 1,000 deletions.
34 changes: 34 additions & 0 deletions chromium/0001-chrome-runtime_api_delegate-add-riscv64-define.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 81033cc7b695b94f8932c29f7812c41fb057aa2b Mon Sep 17 00:00:00 2001
From: kxxt <rsworktech@outlook.com>
Date: Sun, 25 Aug 2024 10:46:25 +0200
Subject: [PATCH] chrome: runtime_api_delegate: add riscv64 define

---
.../extensions/api/runtime/chrome_runtime_api_delegate.cc | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
index 0c2f88ce0d92c..113a8e0010075 100644
--- a/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
+++ b/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc
@@ -303,6 +303,8 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
info->arch = extensions::api::runtime::PlatformArch::kMips;
} else if (strcmp(arch, "mips64el") == 0) {
info->arch = extensions::api::runtime::PlatformArch::kMips64;
+ } else if (strcmp(arch, "riscv64") == 0) {
+ info->arch = extensions::api::runtime::PlatformArch::kRiscv64;
} else {
NOTREACHED_IN_MIGRATION();
return false;
@@ -319,6 +321,8 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kMips;
} else if (strcmp(nacl_arch, "mips64") == 0) {
info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kMips64;
+ } else if (strcmp(arch, "riscv64") == 0) {
+ info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kRiscv64;
} else {
NOTREACHED_IN_MIGRATION();
return false;
--
2.39.2

26 changes: 12 additions & 14 deletions chromium/Debian-fix-rust-linking.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Index: chromium-121.0.6167.75/build/toolchain/gcc_toolchain.gni
===================================================================
--- chromium-121.0.6167.75.orig/build/toolchain/gcc_toolchain.gni
+++ chromium-121.0.6167.75/build/toolchain/gcc_toolchain.gni
@@ -464,7 +464,13 @@ template("single_gcc_toolchain") {
--- build/toolchain/gcc_toolchain.gni.orig 2024-08-19 14:13:35.233954725 +0200
+++ build/toolchain/gcc_toolchain.gni 2024-08-22 00:56:01.438433033 +0200
@@ -441,7 +441,13 @@
# -soname flag is not available on aix ld
soname_flag = "-Wl,-soname=\"$soname\""
}
Expand All @@ -17,7 +15,7 @@ Index: chromium-121.0.6167.75/build/toolchain/gcc_toolchain.gni

# Generate a map file to be used for binary size analysis.
# Map file adds ~10% to the link time on a z620.
@@ -576,7 +582,13 @@ template("single_gcc_toolchain") {
@@ -553,7 +559,13 @@
whole_archive_flag = "-Wl,--whole-archive"
no_whole_archive_flag = "-Wl,--no-whole-archive"
}
Expand All @@ -32,18 +30,18 @@ Index: chromium-121.0.6167.75/build/toolchain/gcc_toolchain.gni

if (defined(invoker.strip)) {
strip_command = "${invoker.strip} -o \"$sofile\" \"$unstripped_sofile\""
@@ -636,7 +648,13 @@ template("single_gcc_toolchain") {
start_group_flag = "-Wl,--start-group"
end_group_flag = "-Wl,--end-group "
}
- link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" {{solibs}} $end_group_flag {{libs}} {{rlibs}}"
@@ -617,8 +629,12 @@
# We need to specify link groups, at least, for single pass linkers. I.e.
# Rust libraries are alpha-sorted instead of by dependencies so they fail
# to link if not properly ordered or grouped.
- link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" $end_group_flag {{solibs}} {{libs}} $start_group_flag {{rlibs}} $end_group_flag"
-
+ if (target_cpu == "riscv64") {
+ # Work around linker failures due to Rust libraries and the use of whole-archive
+ link_command = "$ld -Wl,--start-group {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" @\"$rspfile\" {{solibs}} {{libs}} {{rlibs}} -Wl,--end-group"
+ }
+ else {
+ link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" {{solibs}} $end_group_flag {{libs}} {{rlibs}}"
+ link_command = "$ld {{ldflags}}${extra_ldflags} -o \"$unstripped_outfile\" $start_group_flag @\"$rspfile\" $end_group_flag {{solibs}} {{libs}} $start_group_flag {{rlibs}} $end_group_flag"
+ }

# Generate a map file to be used for binary size analysis.
# Map file adds ~10% to the link time on a z620.
# With target_os="android", libchrome.so.map.gz is ~20MB.
Loading

0 comments on commit beb42b3

Please sign in to comment.