OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
185 stars 194 forks source link

chromium-ozone-wayland: without angle "--in-process-gpu" crashes #680

Closed MastaG closed 1 year ago

MastaG commented 1 year ago

Hi there,

As the title says, chromium-ozone-wayland will crash when trying to start it with --in-process-gpu (I cannot test it without this flag as my platform doesn't provide full blown kms/drm/dri/gbm/mesa drivers).

With: https://github.com/OSSystems/meta-browser/commit/0f11e5ed0da3a622bbd7952400e7470815ded96a

# Angle is not used by Wayland yet, but it was still built. It wasn't a problem
# until wayland-protocols were updated to 1.20 in newest yocto releases, which
# changed the implementation of the wayland-scanner tool. That tool uses a new
# API, which is not part of older wayland-protocols. And given ANGLE includes
# libwayland headers from //third_party/wayland instead of relaying on the
# system ones, that results in undeclared methods.
# TODO(msisov): remove this once Chromium's //third_party/wayland is updated
# to >=1.20. This tracks https://crbug.com/1359189
GN_ARGS += "\
        angle_use_wayland=false \
"

I'm no expert on this, but the folks over at arch use this patch:

diff -upr third_party/angle.orig/BUILD.gn third_party/angle/BUILD.gn
--- third_party/angle.orig/BUILD.gn 2022-08-17 19:38:11.000000000 +0000
+++ third_party/angle/BUILD.gn  2022-08-18 11:04:09.061751111 +0000
@@ -489,6 +489,12 @@ config("angle_vulkan_wayland_config") {
   if (angle_enable_vulkan && angle_use_wayland &&
       defined(vulkan_wayland_include_dirs)) {
     include_dirs = vulkan_wayland_include_dirs
+  } else if (angle_enable_vulkan && angle_use_wayland) {
+    include_dirs = [
+      "$wayland_gn_dir/src/src",
+      "$wayland_gn_dir/include/src",
+      "$wayland_gn_dir/include/protocol",
+    ]
   }
 }

@@ -1073,6 +1079,7 @@ if (angle_use_wayland) {
     include_dirs = [
       "$wayland_dir/egl",
       "$wayland_dir/src",
+      "$wayland_gn_dir/include/protocol",
     ]
   }

diff -upr third_party/angle.orig/src/third_party/volk/BUILD.gn third_party/angle/src/third_party/volk/BUILD.gn
--- third_party/angle.orig/src/third_party/volk/BUILD.gn    2022-08-17 19:38:12.000000000 +0000
+++ third_party/angle/src/third_party/volk/BUILD.gn 2022-08-18 11:04:36.499828006 +0000
@@ -21,6 +21,9 @@ source_set("volk") {
   configs += [ "$angle_root:angle_no_cfi_icall" ]
   public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ]
   if (angle_use_wayland) {
-    include_dirs = [ "$wayland_dir/src" ]
+    include_dirs = [
+      "$wayland_dir/src",
+      "$wayland_gn_dir/include/protocol",
+    ]
   }
 }

Using the above patch and removing: angle_use_wayland=false fixes the issue for me.

MastaG commented 1 year ago

I will close this for now.. as the above patch works for me.