Browse Source

rebase patchset to tag 104.0.5070.0

Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
Rebecca Chang Swee Fun 1 year ago
parent
commit
71536691a9

+ 1 - 1
0001-linux-sysroot-script-to-create-riscv-sysroot-from-De.patch

@@ -1,7 +1,7 @@
 From 89e1e2acf8c1c57d5f833b60a5f40a9b89440e51 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Wed, 18 May 2022 06:00:28 +0000
-Subject: [PATCH 01/22] linux: sysroot: script to create riscv sysroot from
+Subject: [PATCH 01/23] linux: sysroot: script to create riscv sysroot from
  Debian ports
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>

+ 1 - 1
0002-sandbox-add-riscv-arch-definition-and-define-syscall.patch

@@ -1,7 +1,7 @@
 From 04f0043bacafe896df0633fd6450a3b751399fcc Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Wed, 30 Mar 2022 06:38:26 +0000
-Subject: [PATCH 02/22] sandbox: add riscv arch definition and define syscall
+Subject: [PATCH 02/23] sandbox: add riscv arch definition and define syscall
  header
 
 Credit to work contributed in Github.

+ 1 - 1
0003-sandbox-linux-pass-fPIE-to-compiler.patch

@@ -1,7 +1,7 @@
 From 8f7c059991efa63ee7037a91427aab1235ec627f Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 13 Jan 2022 03:50:24 +0000
-Subject: [PATCH 03/22] sandbox: linux: pass -fPIE to compiler
+Subject: [PATCH 03/23] sandbox: linux: pass -fPIE to compiler
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0004-skia-add-riscv64.patch

@@ -1,7 +1,7 @@
 From 47d5b9768c18033ff740de7e2c072b247bfe2852 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Fri, 14 Jan 2022 01:04:19 +0000
-Subject: [PATCH 04/22] skia: add riscv64
+Subject: [PATCH 04/23] skia: add riscv64
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0005-base-allocator-partition_allocator-add-riscv64-suppo.patch

@@ -1,7 +1,7 @@
 From 3a0f884a18211957feb88fd6ee650c75051e3c8e Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Tue, 5 Apr 2022 02:22:48 +0000
-Subject: [PATCH 05/22] base: allocator: partition_allocator: add riscv64
+Subject: [PATCH 05/23] base: allocator: partition_allocator: add riscv64
  support
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>

+ 1 - 1
0006-base-process-add-riscv64-arch-definition.patch

@@ -1,7 +1,7 @@
 From 87a9190952f0cd3b47d55c37e6125a95028aa4a1 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Tue, 10 May 2022 02:21:16 +0000
-Subject: [PATCH 06/22] base: process: add riscv64 arch definition
+Subject: [PATCH 06/23] base: process: add riscv64 arch definition
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0007-remoting-fix-missing-cstring-header.patch

@@ -1,7 +1,7 @@
 From 583d891f4642244c5249065bdde985aa9940d4f0 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 13 Jan 2022 09:44:47 +0000
-Subject: [PATCH 07/22] remoting: fix missing cstring header
+Subject: [PATCH 07/23] remoting: fix missing cstring header
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0008-remoting-codec-fix-missing-cmath-header.patch

@@ -1,7 +1,7 @@
 From 5a9eff06278e30dd09775f4cbed32c2c693bd9c5 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 13 Jan 2022 09:48:12 +0000
-Subject: [PATCH 08/22] remoting: codec: fix missing cmath header
+Subject: [PATCH 08/23] remoting: codec: fix missing cmath header
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0009-components-update_client-add-riscv64-arch-definition.patch

@@ -1,7 +1,7 @@
 From b919c1f1a31b647ef3f5f124c22f5ee0b5950f08 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Tue, 5 Apr 2022 02:27:27 +0000
-Subject: [PATCH 09/22] components: update_client: add riscv64 arch definition
+Subject: [PATCH 09/23] components: update_client: add riscv64 arch definition
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0010-build-config-compiler-use_gold-linker-option.patch

@@ -1,7 +1,7 @@
 From 75e05df5b897b869e57063d14d1035ad5b258f78 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Mon, 17 Jan 2022 04:48:24 +0000
-Subject: [PATCH 10/22] build: config: compiler: use_gold linker option
+Subject: [PATCH 10/23] build: config: compiler: use_gold linker option
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0011-build-config-compiler-remove-flags-not-available-in-.patch

@@ -1,7 +1,7 @@
 From 1cce24d3de450d4ea65b66886f64b3a769d119d3 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Mon, 17 Jan 2022 08:15:52 +0000
-Subject: [PATCH 11/22] build: config: compiler: remove flags not available in
+Subject: [PATCH 11/23] build: config: compiler: remove flags not available in
  custom clang
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>

+ 1 - 1
0012-build-config-add-atomic-build-flag.patch

@@ -1,7 +1,7 @@
 From d20f32720eac124195f162317c8187ce0670f21d Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Wed, 30 Mar 2022 05:43:35 +0000
-Subject: [PATCH 12/22] build: config: add atomic build flag
+Subject: [PATCH 12/23] build: config: add atomic build flag
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0013-build-config-compiler-set-generic-riscv64-flags.patch

@@ -1,7 +1,7 @@
 From 34419d06a338f38be840773b44c049e694146962 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Fri, 14 Jan 2022 05:06:56 +0000
-Subject: [PATCH 13/22] build: config: compiler: set generic riscv64 flags
+Subject: [PATCH 13/23] build: config: compiler: set generic riscv64 flags
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0014-chrome-common-remove-unrar-code.patch

@@ -1,7 +1,7 @@
 From 796fe4577f25873b97485b430b1fd17d72d4fcea Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 13 Jan 2022 08:57:34 +0000
-Subject: [PATCH 14/22] chrome: common: remove unrar code
+Subject: [PATCH 14/23] chrome: common: remove unrar code
 
 Upstream-status: Inappropriate
 

+ 1 - 1
0015-third_party-libaom-add-riscv-target.patch

@@ -1,7 +1,7 @@
 From 7c1c6ca12315892184dcdc154e0f1254dbf7b062 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Wed, 30 Mar 2022 11:24:25 +0000
-Subject: [PATCH 15/22] third_party: libaom: add riscv target
+Subject: [PATCH 15/23] third_party: libaom: add riscv target
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0016-third_party-libvpx-add-riscv-target.patch

@@ -1,7 +1,7 @@
 From 81299de9e6388b34a00e8731dab6b5081a3b2214 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Wed, 30 Mar 2022 11:26:18 +0000
-Subject: [PATCH 16/22] third_party: libvpx: add riscv target
+Subject: [PATCH 16/23] third_party: libvpx: add riscv target
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0017-third_party-crashpad-add-support-for-riscv.patch

@@ -1,7 +1,7 @@
 From 62457fa5271a6b22210ec0adefe6fee944f785f7 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 31 Mar 2022 00:35:10 +0000
-Subject: [PATCH 17/22] third_party: crashpad: add support for riscv
+Subject: [PATCH 17/23] third_party: crashpad: add support for riscv
 
 Credit to work contributed in Github.
 https://github.com/felixonmars/archriscv-packages/tree/master/chromium

+ 1 - 1
0018-third_party-lzma_sdk-add-riscv-arch-definition.patch

@@ -1,7 +1,7 @@
 From bdd1bde72c2c366d2e2a3effc6ddabb2db714f28 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Fri, 14 Jan 2022 05:07:31 +0000
-Subject: [PATCH 18/22] third_party: lzma_sdk: add riscv arch definition
+Subject: [PATCH 18/23] third_party: lzma_sdk: add riscv arch definition
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0019-build-linux-sysroot-create-a-sysroot-for-riscv.patch

@@ -1,7 +1,7 @@
 From 5254439289bd00f5fb9269f3abfa3625c4c80040 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Tue, 5 Apr 2022 06:40:16 +0000
-Subject: [PATCH 19/22] build: linux: sysroot: create a sysroot for riscv
+Subject: [PATCH 19/23] build: linux: sysroot: create a sysroot for riscv
 
 Upstream-status: Unidentified
 

+ 1 - 1
0020-workaround-for-files-not-found-in-sysroot.patch

@@ -1,7 +1,7 @@
 From 69881d81443cd78aa9aca83ffc15298325ab9bdc Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 28 Apr 2022 01:03:56 +0000
-Subject: [PATCH 20/22] workaround for files not found in sysroot
+Subject: [PATCH 20/23] workaround for files not found in sysroot
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0021-v8-settings.patch

@@ -1,7 +1,7 @@
 From 6ca882e4e194fdddac7c66bc2dee2907093a3796 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 28 Apr 2022 01:04:27 +0000
-Subject: [PATCH 21/22] v8 settings
+Subject: [PATCH 21/23] v8 settings
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 1 - 1
0022-compiler-workaround.patch

@@ -1,7 +1,7 @@
 From 00827741648ebd7d5f98e5f9fd718ad2f7435785 Mon Sep 17 00:00:00 2001
 From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 Date: Thu, 28 Apr 2022 01:04:59 +0000
-Subject: [PATCH 22/22] compiler workaround
+Subject: [PATCH 22/23] compiler workaround
 
 Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
 ---

+ 52 - 4
README.md

@@ -5,6 +5,46 @@
 Ubuntu 20.04.4 LTS
 
 
+## llvm / clang
+
+1. Build a cross-compile toolchain for llvm and clang.
+```
+$ sudo apt-get -y install binutils build-essential libtool \
+  texinfo gzip zip unzip patchutils curl git make cmake \
+  ninja-build automake bison flex gperf grep sed gawk \
+  python bc zlib1g-dev libexpat1-dev libmpc-dev \
+  libglib2.0-dev libfdt-dev libpixman-1-dev 
+$ mkdir ~/riscv
+$ cd ~/riscv
+$ mkdir _install
+$ export PATH=`pwd`/_install/bin:$PATH
+$ hash -r
+# gcc, binutils, newlib, qemu
+$ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
+$ pushd riscv-gnu-toolchain
+$ ./configure --prefix=`pwd`/../_install --enable-multilib
+$ make -j`nproc` linux
+$ make -j`nproc` build-qemu
+$ popd
+# llvm
+$ git clone https://github.com/llvm/llvm-project.git riscv-llvm
+$ pushd riscv-llvm
+$ ln -s ../../clang llvm/tools || true
+$ mkdir _build
+$ cd _build
+$ cmake -G Ninja -DCMAKE_BUILD_TYPE="Release" \
+  -DBUILD_SHARED_LIBS=True -DLLVM_USE_SPLIT_DWARF=True \
+  -DCMAKE_INSTALL_PREFIX="../../_install" \
+  -DLLVM_OPTIMIZED_TABLEGEN=True -DLLVM_BUILD_TESTS=False \
+  -DDEFAULT_SYSROOT="../../_install/riscv64-unknown-linux-gnu" \
+  -DLLVM_DEFAULT_TARGET_TRIPLE="riscv64-unknown-linux-gnu" \
+  -DLLVM_TARGETS_TO_BUILD="RISCV" \
+  ../llvm
+$ cmake --build . --target install
+$ popd
+```
+
+
 ## Chromium
 
 1. Follow the Chromium official build instruction for Linux host to get the source code.
@@ -25,10 +65,10 @@ solutions = [
 ]
 ```
 
-4. Checkout to specific commits where the patchset are based on.
+4. Checkout to 104.0.5070.0 tag where the patchset are based on.
 ```
 $ cd ~/chromium/src
-$ git checkout 99ce2ebd79dc6
+$ git checkout 104.0.5070.0
 
 ```
 
@@ -45,12 +85,18 @@ $ vim out/riscv64/args.gn
 target_os="linux"
 target_cpu="riscv64"
 
+use_custom_libcxx=false
+use_custom_libcxx_for_host=true
+
 is_component_build = true
 is_debug=false
 symbol_level=0
 v8_symbol_level=0
 blink_symbol_level=0
 
+enable_swiftshader=true
+enable_libaom=true
+
 # Disable broken features
 use_gnome_keyring=false
 enable_nacl=false
@@ -59,14 +105,16 @@ fatal_linker_warnings=false
 enable_dav1d_decoder = false
 enable_reading_list=false
 enable_vr=false
-enable_swiftshader=false
 supports_subzero=false
-enable_libaom=false
 enable_openscreen=false
 enable_jxl_decoder=false
 
 # For clang
 is_clang = true
+clang_base_path=getenv("HOME") + "/riscv/_install"
+clang_use_chrome_plugins=false
+use_lld=true
+#use_thin_lto=false
 ```
 
 7. Apply the patches from this repository.

+ 2 - 2
third_party/0001-third-party-angle.patch

@@ -16,10 +16,10 @@ index b92e52fc2..8fd77fe35 100644
  
    if (is_gcc) {
 diff --git a/gni/angle.gni b/gni/angle.gni
-index 20cef2679..1b23c9f6d 100644
+index cbe35e044..ef47c651a 100644
 --- a/gni/angle.gni
 +++ b/gni/angle.gni
-@@ -76,7 +76,8 @@ declare_args() {
+@@ -77,7 +77,8 @@ declare_args() {
  
    if (current_cpu == "arm64" || current_cpu == "x64" ||
        current_cpu == "mips64el" || current_cpu == "s390x" ||

+ 2 - 15
third_party/0006-third-party-webrtc.patch

@@ -23,19 +23,6 @@ index da328b48b0..719da297a9 100644
  #include "absl/types/optional.h"
  #include "rtc_base/bitstream_reader.h"
  
-diff --git a/modules/desktop_capture/differ_block.cc b/modules/desktop_capture/differ_block.cc
-index 4f0c5430c9..a89fcc9753 100644
---- a/modules/desktop_capture/differ_block.cc
-+++ b/modules/desktop_capture/differ_block.cc
-@@ -30,7 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) {
-   static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr;
- 
-   if (!diff_proc) {
--#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY)
-+#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY) || defined(WEBRTC_ARCH_RISCV_FAMILY)
-     // For ARM and MIPS processors, always use C version.
-     // TODO(hclam): Implement a NEON version.
-     diff_proc = &VectorDifference_C;
 diff --git a/modules/include/module_common_types_public.h b/modules/include/module_common_types_public.h
 index 345e45ce12..8338a51462 100644
 --- a/modules/include/module_common_types_public.h
@@ -49,10 +36,10 @@ index 345e45ce12..8338a51462 100644
  
  #include "absl/types/optional.h"
 diff --git a/modules/video_coding/codecs/av1/BUILD.gn b/modules/video_coding/codecs/av1/BUILD.gn
-index 2e4d824821..ab151582a3 100644
+index 73b22d46dc..e24f9cc473 100644
 --- a/modules/video_coding/codecs/av1/BUILD.gn
 +++ b/modules/video_coding/codecs/av1/BUILD.gn
-@@ -36,7 +36,6 @@ rtc_library("dav1d_decoder") {
+@@ -38,7 +38,6 @@ rtc_library("dav1d_decoder") {
      "../../../../api/video_codecs:video_codecs_api",
      "../../../../common_video",
      "../../../../rtc_base:logging",