[packages/gtk-webkit4.1] - patch to split GeneratedSerializers.cpp (3GB file is impossible to compile on 32-bit host)
qboosh
qboosh at pld-linux.org
Thu Jun 11 19:59:17 CEST 2026
commit 601f5465c32ce2dce5e95d639f438bd2bf5f4183
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Thu Jun 11 19:59:16 2026 +0200
- patch to split GeneratedSerializers.cpp (3GB file is impossible to compile on 32-bit host)
gtk-webkit4.1.spec | 12 +--
webkitgtk-serializers.patch | 209 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 216 insertions(+), 5 deletions(-)
---
diff --git a/gtk-webkit4.1.spec b/gtk-webkit4.1.spec
index 607caed..bf149b4 100644
--- a/gtk-webkit4.1.spec
+++ b/gtk-webkit4.1.spec
@@ -39,6 +39,7 @@ Patch1: gtk-webkit4-icu59.patch
Patch2: parallel-gir.patch
Patch3: gtk-webkit4-driver-version-suffix.patch
Patch4: max-bundle-size.patch
+Patch5: webkitgtk-serializers.patch
URL: https://webkitgtk.org/
BuildRequires: /usr/bin/ld.gold
BuildRequires: EGL-devel
@@ -252,11 +253,12 @@ Dokumentacja API portu WebKitu do GTK 4.
%prep
%setup -q -n webkitgtk-%{version}
-%patch -P 0 -p1
-%patch -P 1 -p1
-%patch -P 2 -p1
-%patch -P 3 -p1
-%patch -P 4 -p1
+%patch -P0 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
%build
CXXFLAGS="%{rpmcxxflags} -DNDEBUG %{?with_lowmem:--param ggc-min-expand=20 --param ggc-min-heapsize=65536}"
diff --git a/webkitgtk-serializers.patch b/webkitgtk-serializers.patch
new file mode 100644
index 0000000..bdbbf11
--- /dev/null
+++ b/webkitgtk-serializers.patch
@@ -0,0 +1,209 @@
+Based on commit https://github.com/WebKit/WebKit/commit/9823057a18307774342fa90acf9c0e1c189e30a8
+but with "Shared" part split additionally in 4 files to let compilation fit in 3GB address space
+
+--- webkitgtk-2.52.4/Source/WebKit/CMakeLists.txt.orig 2026-06-11 06:12:49.003188621 +0200
++++ webkitgtk-2.52.4/Source/WebKit/CMakeLists.txt 2026-06-11 06:27:30.225366168 +0200
+@@ -943,7 +943,17 @@ list(APPEND WebKit_SERIALIZATION_DEPENDE
+
+ list(APPEND WebKit_DERIVED_SOURCES
+ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializers.h
+- ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializers.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersShared.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedRemoteLayerTree.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedWebCoreArgumentCoders.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedWebGPU.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersWebProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersGPUProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersNetworkProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersPlatform.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersModelProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersUIProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersCommon.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ ${WebKit_DERIVED_SOURCES_DIR}/SerializedTypeInfo.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ ${WebKit_DERIVED_SOURCES_DIR}/WebKitPlatformGeneratedSerializers.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ )
+@@ -951,7 +961,17 @@ list(APPEND WebKit_DERIVED_SOURCES
+ add_custom_command(
+ OUTPUT
+ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializers.h
+- ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializers.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersShared.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedRemoteLayerTree.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedWebCoreArgumentCoders.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersSharedWebGPU.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersWebProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersGPUProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersNetworkProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersPlatform.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersModelProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersUIProcess.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
++ ${WebKit_DERIVED_SOURCES_DIR}/GeneratedSerializersCommon.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ ${WebKit_DERIVED_SOURCES_DIR}/SerializedTypeInfo.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ ${WebKit_DERIVED_SOURCES_DIR}/WebKitPlatformGeneratedSerializers.${WebKit_GENERATED_SERIALIZERS_SUFFIX}
+ MAIN_DEPENDENCY ${WEBKIT_DIR}/Scripts/generate-serializers.py
+--- webkitgtk-2.52.4/Source/WebKit/Scripts/generate-serializers.py.orig 2026-06-11 06:13:09.926528604 +0200
++++ webkitgtk-2.52.4/Source/WebKit/Scripts/generate-serializers.py 2026-06-11 06:28:56.328233042 +0200
+@@ -30,6 +30,40 @@ import sys
+
+ from webkit.opaque_ipc_types import is_opaque_type, opaque_ipc_types
+
++# Directories under Source/WebKit/ that get their own per-domain
++# GeneratedSerializers<Domain>.{mm,cpp} translation unit when invoked with
++# --split-by-directory. Anything not matching one of these falls into
++# GeneratedSerializersCommon.{mm,cpp} (the residual bucket).
++KNOWN_DOMAINS = ['Shared', 'SharedRemoteLayerTree', 'SharedWebGPU', 'SharedWebCoreArgumentCoders', 'WebProcess', 'GPUProcess', 'NetworkProcess', 'Platform', 'ModelProcess', 'UIProcess']
++RESIDUAL_DOMAIN = '__residual__'
++
++
++def derive_source_directory(input_file_path):
++ """Return the top-level subdirectory under Source/WebKit/ for a .serialization.in path,
++ or None if the file doesn't live under Source/WebKit/<DIR>/...
++ """
++ parts = os.path.normpath(input_file_path).split(os.sep)
++ for i in range(len(parts) - 2):
++ if parts[i] == 'Source' and parts[i + 1] == 'WebKit':
++ if parts[i + 2] == "Shared":
++ if parts[i + 3] in {"WebGPU", "RemoteLayerTree"}:
++ return f"Shared{parts[i+3]}"
++ elif parts[i + 3].startswith("WebCoreArgumentCoders"):
++ return "SharedWebCoreArgumentCoders"
++ return "Shared"
++ return parts[i + 2]
++ return None
++
++
++def matches_domain(item, domain_filter):
++ """Filter helper used by argument_coder_declarations and generate_impl."""
++ if domain_filter is None:
++ return True
++ source_directory = getattr(item, 'source_directory', None)
++ if domain_filter == RESIDUAL_DOMAIN:
++ return source_directory not in KNOWN_DOMAINS
++ return source_directory == domain_filter
++
+ # Supported type attributes:
+ #
+ # AdditionalEncoder - generate serializers for StreamConnectionEncoder in addition to IPC::Encoder.
+@@ -106,6 +140,7 @@ class SerializedType(object):
+ self.disableMissingMemberCheck = False
+ self.debug_decoding_failure = False
+ self.generic_wrapper = None
++ self.source_directory = None
+ if attributes is not None:
+ for attribute in attributes.split(', '):
+ if '=' in attribute:
+@@ -273,6 +308,7 @@ class SerializedEnum(object):
+ self.valid_values = valid_values
+ self.condition = condition
+ self.attributes = attributes
++ self.source_directory = None
+
+ def namespace_and_name(self):
+ if self.namespace is None:
+@@ -572,13 +608,15 @@ def one_argument_coder_declaration(type,
+ return result
+
+
+-def argument_coder_declarations(serialized_types, skip_nested, webkit_platform):
++def argument_coder_declarations(serialized_types, skip_nested, webkit_platform, domain_filter=None):
+ result = []
+ for type in serialized_types:
+ if type.nested == skip_nested:
+ continue
+ if (webkit_platform is not None and type.webkit_platform != webkit_platform):
+ continue
++ if not matches_domain(type, domain_filter):
++ continue
+ if type.templates:
+ for template in type.templates:
+ result.extend(one_argument_coder_declaration(type, template))
+@@ -1157,7 +1195,7 @@ def generate_one_impl(type, template_arg
+ return result
+
+
+-def generate_impl(serialized_types, serialized_enums, headers, generating_webkit_platform_impl, objc_wrapped_types):
++def generate_impl(serialized_types, serialized_enums, headers, generating_webkit_platform_impl, objc_wrapped_types, domain_filter=None):
+ result = []
+ result.append(_license_header)
+ result.append('#include "config.h"')
+@@ -1218,12 +1256,14 @@ def generate_impl(serialized_types, seri
+ result.append(f'#endif // {type.condition}')
+ result.append('')
+
+- result = result + argument_coder_declarations(serialized_types, False, generating_webkit_platform_impl)
++ result = result + argument_coder_declarations(serialized_types, False, generating_webkit_platform_impl, domain_filter=domain_filter)
+ result.append('')
+
+ for type in serialized_types:
+ if type.webkit_platform != generating_webkit_platform_impl:
+ continue
++ if not matches_domain(type, domain_filter):
++ continue
+ if type.templates:
+ for template in type.templates:
+ result.extend(generate_one_impl(type, template, serialized_types))
+@@ -1237,6 +1277,8 @@ def generate_impl(serialized_types, seri
+ continue
+ if not type.members_are_subclasses:
+ continue
++ if not matches_domain(type, domain_filter):
++ continue
+ result.append('')
+ if type.condition is not None:
+ result.append(f'#if {type.condition}')
+@@ -1261,6 +1303,8 @@ def generate_impl(serialized_types, seri
+ for enum in serialized_enums:
+ if enum.is_webkit_platform() != generating_webkit_platform_impl:
+ continue
++ if not matches_domain(enum, domain_filter):
++ continue
+ result.append('')
+ if enum.condition is not None:
+ result.append(f'#if {enum.condition}')
+@@ -2026,6 +2070,7 @@ def generate_webkit_secure_coding_header
+
+
+ def main(argv):
++ split_by_directory = True
+ serialized_types = []
+ serialized_enums = []
+ using_statements = []
+@@ -2036,12 +2081,15 @@ def main(argv):
+ additional_forward_declarations_list = []
+ file_extension = argv[1]
+ for i in range(2, len(argv)):
++ source_directory = derive_source_directory(argv[i])
+ with open(argv[i]) as file:
+ new_types, new_enums, new_headers, new_using_statements, new_additional_forward_declarations, new_objc_wrapped_types = parse_serialized_types(file)
+ for type in new_types:
+ type.enforce_opaque_ipc_types_usage()
++ type.source_directory = source_directory
+ serialized_types.append(type)
+ for enum in new_enums:
++ enum.source_directory = source_directory
+ serialized_enums.append(enum)
+ for using_statement in new_using_statements:
+ using_statement.enforce_opaque_ipc_types_usage()
+@@ -2058,8 +2106,20 @@ def main(argv):
+
+ with open('GeneratedSerializers.h', "w+") as output:
+ output.write(generate_header(serialized_types, serialized_enums, additional_forward_declarations_list))
+- with open('GeneratedSerializers.%s' % file_extension, "w+") as output:
+- output.write(generate_impl(serialized_types, serialized_enums, headers, False, []))
++ if split_by_directory:
++ for domain in KNOWN_DOMAINS:
++ with open(f'GeneratedSerializers{domain}.{file_extension}', "w+") as output:
++ output.write(generate_impl(serialized_types, serialized_enums, headers, False, [], domain_filter=domain))
++ with open(f'GeneratedSerializersCommon.{file_extension}', "w+") as output:
++ output.write(generate_impl(serialized_types, serialized_enums, headers, False, [], domain_filter=RESIDUAL_DOMAIN))
++
++ residual_types = [t.namespace_and_name() for t in serialized_types
++ if not t.webkit_platform and t.source_directory not in KNOWN_DOMAINS]
++ if residual_types:
++ sys.stderr.write(f'generate-serializers.py: {len(residual_types)} type(s) fell into GeneratedSerializersCommon.{file_extension} (residual bucket): {", ".join(sorted(set(residual_types))[:10])}{"..." if len(residual_types) > 10 else ""}\n')
++ else:
++ with open('GeneratedSerializers.%s' % file_extension, "w+") as output:
++ output.write(generate_impl(serialized_types, serialized_enums, headers, False, []))
+ with open('WebKitPlatformGeneratedSerializers.%s' % file_extension, "w+") as output:
+ output.write(generate_impl(serialized_types, serialized_enums, headers, True, objc_wrapped_types))
+ with open('SerializedTypeInfo.%s' % file_extension, "w+") as output:
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gtk-webkit4.1.git/commitdiff/601f5465c32ce2dce5e95d639f438bd2bf5f4183
More information about the pld-cvs-commit
mailing list