diff --git a/devel/electron34/files/patch-build_rust_std_BUILD.gn b/devel/electron34/files/patch-build_rust_std_BUILD.gn index 7314d062a541..a832cbab6e35 100644 --- a/devel/electron34/files/patch-build_rust_std_BUILD.gn +++ b/devel/electron34/files/patch-build_rust_std_BUILD.gn @@ -1,84 +1,92 @@ --- build/rust/std/BUILD.gn.orig 2025-02-24 19:59:26 UTC +++ build/rust/std/BUILD.gn @@ -22,29 +22,6 @@ if (toolchain_has_rust) { import("//build/config/sanitizers/sanitizers.gni") if (toolchain_has_rust) { - # If clang performs the link step, we need to provide the allocator symbols - # that are normally injected by rustc during linking. - # - # We also "happen to" use this to redirect allocations to PartitionAlloc, - # though that would be better done through a #[global_allocator] crate (see - # above). - source_set("remap_alloc") { - public_deps = [ "//base/allocator/partition_allocator:buildflags" ] - if (use_partition_alloc_as_malloc) { - public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ] - } - sources = [ - # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been - # copied from `//base`. - # TODO(crbug.com/40279749): Avoid duplication / reuse code. - "alias.cc", - "alias.h", - "compiler_specific.h", - "immediate_crash.h", - "remap_alloc.cc", - ] - } - # List of Rust stdlib rlibs which are present in the official Rust toolchain # we are using from the Android team. This is usually a version or two behind # nightly. Generally this matches the toolchain we build ourselves, but if -@@ -74,13 +51,20 @@ if (toolchain_has_rust) { +@@ -66,7 +43,6 @@ if (toolchain_has_rust) { + "rustc_demangle", + "std_detect", + "test", +- "unicode_width", + "unwind", + ] + +@@ -74,13 +50,20 @@ if (toolchain_has_rust) { # These are no longer present in the Windows toolchain. stdlib_files += [ "addr2line", - "adler", "gimli", "libc", "memchr", "miniz_oxide", "object", ] + + rust_revision_pieces = string_split(rustc_revision, " ") + rust_version_pieces = string_split(rust_revision_pieces[1], ".") + if (rust_version_pieces[1] == "85") { + stdlib_files += [ "adler" ] + } else { + stdlib_files += [ "adler2" ] + } } if (toolchain_for_rust_host_build_tools) { -@@ -100,7 +84,6 @@ if (toolchain_has_rust) { +@@ -100,7 +83,6 @@ if (toolchain_has_rust) { # don't need to pass to the C++ linker because they're used for specialized # purposes. skip_stdlib_files = [ - "profiler_builtins", "rustc_std_workspace_alloc", "rustc_std_workspace_core", "rustc_std_workspace_std", -@@ -254,8 +237,6 @@ if (toolchain_has_rust) { +@@ -254,8 +236,6 @@ if (toolchain_has_rust) { foreach(libname, stdlib_files + skip_stdlib_files) { deps += [ "rules:$libname" ] } - - public_deps = [ ":remap_alloc" ] } } else { action("find_stdlib") { -@@ -381,12 +362,6 @@ if (toolchain_has_rust) { +@@ -381,12 +361,6 @@ if (toolchain_has_rust) { ":stdlib_public_dependent_libs", ] deps = [ ":prebuilt_rustc_copy_to_sysroot" ] - - # The host builds tools toolchain supports Rust only and does not use - # the allocator remapping to point it to PartitionAlloc. - if (!toolchain_for_rust_host_build_tools) { - deps += [ ":remap_alloc" ] - } } } } diff --git a/devel/electron36/files/patch-build_rust_std_BUILD.gn b/devel/electron36/files/patch-build_rust_std_BUILD.gn index c6c2801bd47d..002ea97d51cd 100644 --- a/devel/electron36/files/patch-build_rust_std_BUILD.gn +++ b/devel/electron36/files/patch-build_rust_std_BUILD.gn @@ -1,106 +1,114 @@ ---- build/rust/std/BUILD.gn.orig 2025-05-20 09:16:26 UTC +--- build/rust/std/BUILD.gn.orig 2025-06-16 18:02:10 UTC +++ build/rust/std/BUILD.gn @@ -15,51 +15,12 @@ # allocator functions to PartitionAlloc when `use_partition_alloc_as_malloc` is # true, so that Rust and C++ use the same allocator backend. -import("//build/buildflag_header.gni") import("//build/config/compiler/compiler.gni") import("//build/config/coverage/coverage.gni") import("//build/config/rust.gni") import("//build/config/sanitizers/sanitizers.gni") -rust_allocator_uses_partition_alloc = false -if (build_with_chromium) { - import("//base/allocator/partition_allocator/partition_alloc.gni") - rust_allocator_uses_partition_alloc = use_partition_alloc_as_malloc -} - -buildflag_header("buildflags") { - header = "buildflags.h" - flags = [ - "RUST_ALLOCATOR_USES_PARTITION_ALLOC=$rust_allocator_uses_partition_alloc", - ] - visibility = [ ":*" ] -} - if (toolchain_has_rust) { - # If clang performs the link step, we need to provide the allocator symbols - # that are normally injected by rustc during linking. - # - # We also "happen to" use this to redirect allocations to PartitionAlloc, - # though that would be better done through a #[global_allocator] crate (see - # above). - source_set("remap_alloc") { - public_deps = [] - if (rust_allocator_uses_partition_alloc) { - public_deps += [ "//base/allocator/partition_allocator:partition_alloc" ] - } - deps = [ ":buildflags" ] - sources = [ - # `alias.*`, `compiler_specific.h`, and `immediate_crash.*` have been - # copied from `//base`. - # TODO(crbug.com/40279749): Avoid duplication / reuse code. - "alias.cc", - "alias.h", - "compiler_specific.h", - "immediate_crash.h", - "remap_alloc.cc", - ] - } - # List of Rust stdlib rlibs which are present in the official Rust toolchain # we are using from the Android team. This is usually a version or two behind # nightly. Generally this matches the toolchain we build ourselves, but if -@@ -89,13 +50,20 @@ if (toolchain_has_rust) { +@@ -81,7 +42,6 @@ if (toolchain_has_rust) { + "rustc_demangle", + "std_detect", + "test", +- "unicode_width", + "unwind", + ] + +@@ -89,13 +49,20 @@ if (toolchain_has_rust) { # These are no longer present in the Windows toolchain. stdlib_files += [ "addr2line", - "adler2", "gimli", "libc", "memchr", "miniz_oxide", "object", ] + + rust_revision_pieces = string_split(rustc_revision, " ") + rust_version_pieces = string_split(rust_revision_pieces[1], ".") + if (rust_version_pieces[1] == "85") { + stdlib_files += [ "adler" ] + } else { + stdlib_files += [ "adler2" ] + } } if (toolchain_for_rust_host_build_tools) { -@@ -115,7 +83,6 @@ if (toolchain_has_rust) { +@@ -115,7 +82,6 @@ if (toolchain_has_rust) { # don't need to pass to the C++ linker because they're used for specialized # purposes. skip_stdlib_files = [ - "profiler_builtins", "rustc_std_workspace_alloc", "rustc_std_workspace_core", "rustc_std_workspace_std", -@@ -269,8 +236,6 @@ if (toolchain_has_rust) { +@@ -269,8 +235,6 @@ if (toolchain_has_rust) { foreach(libname, stdlib_files + skip_stdlib_files) { deps += [ "rules:$libname" ] } - - public_deps = [ ":remap_alloc" ] } } else { action("find_stdlib") { -@@ -396,12 +361,6 @@ if (toolchain_has_rust) { +@@ -396,12 +360,6 @@ if (toolchain_has_rust) { ":stdlib_public_dependent_libs", ] deps = [ ":prebuilt_rustc_copy_to_sysroot" ] - - # The host builds tools toolchain supports Rust only and does not use - # the allocator remapping to point it to PartitionAlloc. - if (!toolchain_for_rust_host_build_tools) { - deps += [ ":remap_alloc" ] - } } } } diff --git a/devel/electron36/files/patch-third__party_crabbyavif_BUILD.gn b/devel/electron36/files/patch-third__party_crabbyavif_BUILD.gn new file mode 100644 index 000000000000..ebe51ae2acfd --- /dev/null +++ b/devel/electron36/files/patch-third__party_crabbyavif_BUILD.gn @@ -0,0 +1,16 @@ +--- third_party/crabbyavif/BUILD.gn.orig 2025-06-16 18:02:10 UTC ++++ third_party/crabbyavif/BUILD.gn +@@ -162,7 +162,12 @@ rust_static_library("crabbyavif") { + "dav1d", + "libyuv", + "capi", +- "disable_cfi", ++ ++ # TODO: crbug.com/440481923 - Un-comment this once the new rust roll ++ # (http://crrev.com/c/6874449) lands and ++ # https://github.com/webmproject/CrabbyAvif/pull/654 is rolled into ++ # chromium. ++ #"disable_cfi", + ] + + # Required for disable_cfi feature. diff --git a/devel/electron37/files/patch-build_rust_std_BUILD.gn b/devel/electron37/files/patch-build_rust_std_BUILD.gn index 13c2985f1be5..e4d989a8bdd3 100644 --- a/devel/electron37/files/patch-build_rust_std_BUILD.gn +++ b/devel/electron37/files/patch-build_rust_std_BUILD.gn @@ -1,32 +1,40 @@ ---- build/rust/std/BUILD.gn.orig 2025-06-30 07:04:30 UTC +--- build/rust/std/BUILD.gn.orig 2025-08-25 14:15:51 UTC +++ build/rust/std/BUILD.gn -@@ -50,13 +50,20 @@ if (toolchain_has_rust) { +@@ -42,7 +42,6 @@ if (toolchain_has_rust) { + "rustc_demangle", + "std_detect", + "test", +- "unicode_width", + "unwind", + ] + +@@ -50,13 +49,20 @@ if (toolchain_has_rust) { # These are no longer present in the Windows toolchain. stdlib_files += [ "addr2line", - "adler2", "gimli", "libc", "memchr", "miniz_oxide", "object", ] + + rust_revision_pieces = string_split(rustc_revision, " ") + rust_version_pieces = string_split(rust_revision_pieces[1], ".") + if (rust_version_pieces[1] == "85") { + stdlib_files += [ "adler" ] + } else { + stdlib_files += [ "adler2" ] + } } if (toolchain_for_rust_host_build_tools) { -@@ -76,7 +83,6 @@ if (toolchain_has_rust) { +@@ -76,7 +82,6 @@ if (toolchain_has_rust) { # don't need to pass to the C++ linker because they're used for specialized # purposes. skip_stdlib_files = [ - "profiler_builtins", "rustc_std_workspace_alloc", "rustc_std_workspace_core", "rustc_std_workspace_std", diff --git a/devel/electron37/files/patch-third__party_crabbyavif_BUILD.gn b/devel/electron37/files/patch-third__party_crabbyavif_BUILD.gn new file mode 100644 index 000000000000..03f918243d1d --- /dev/null +++ b/devel/electron37/files/patch-third__party_crabbyavif_BUILD.gn @@ -0,0 +1,16 @@ +--- third_party/crabbyavif/BUILD.gn.orig 2025-08-25 14:15:51 UTC ++++ third_party/crabbyavif/BUILD.gn +@@ -190,7 +190,12 @@ rust_static_library("crabbyavif") { + "dav1d", + "libyuv", + "capi", +- "disable_cfi", ++ ++ # TODO: crbug.com/440481923 - Un-comment this once the new rust roll ++ # (http://crrev.com/c/6874449) lands and ++ # https://github.com/webmproject/CrabbyAvif/pull/654 is rolled into ++ # chromium. ++ #"disable_cfi", + ] + + # Required for disable_cfi feature. diff --git a/devel/electron38/files/patch-build_rust_std_BUILD.gn b/devel/electron38/files/patch-build_rust_std_BUILD.gn index 13c2985f1be5..6c1c09bc621b 100644 --- a/devel/electron38/files/patch-build_rust_std_BUILD.gn +++ b/devel/electron38/files/patch-build_rust_std_BUILD.gn @@ -1,32 +1,40 @@ ---- build/rust/std/BUILD.gn.orig 2025-06-30 07:04:30 UTC +--- build/rust/std/BUILD.gn.orig 2025-10-13 21:25:57 UTC +++ build/rust/std/BUILD.gn -@@ -50,13 +50,20 @@ if (toolchain_has_rust) { +@@ -42,7 +42,6 @@ if (toolchain_has_rust) { + "rustc_demangle", + "std_detect", + "test", +- "unicode_width", + "unwind", + ] + +@@ -50,13 +49,20 @@ if (toolchain_has_rust) { # These are no longer present in the Windows toolchain. stdlib_files += [ "addr2line", - "adler2", "gimli", "libc", "memchr", "miniz_oxide", "object", ] + + rust_revision_pieces = string_split(rustc_revision, " ") + rust_version_pieces = string_split(rust_revision_pieces[1], ".") + if (rust_version_pieces[1] == "85") { + stdlib_files += [ "adler" ] + } else { + stdlib_files += [ "adler2" ] + } } if (toolchain_for_rust_host_build_tools) { -@@ -76,7 +83,6 @@ if (toolchain_has_rust) { +@@ -76,7 +82,6 @@ if (toolchain_has_rust) { # don't need to pass to the C++ linker because they're used for specialized # purposes. skip_stdlib_files = [ - "profiler_builtins", "rustc_std_workspace_alloc", "rustc_std_workspace_core", "rustc_std_workspace_std", diff --git a/devel/electron38/files/patch-third__party_crabbyavif_BUILD.gn b/devel/electron38/files/patch-third__party_crabbyavif_BUILD.gn new file mode 100644 index 000000000000..e7e8a010e88f --- /dev/null +++ b/devel/electron38/files/patch-third__party_crabbyavif_BUILD.gn @@ -0,0 +1,16 @@ +--- third_party/crabbyavif/BUILD.gn.orig 2025-10-13 21:25:57 UTC ++++ third_party/crabbyavif/BUILD.gn +@@ -190,7 +190,12 @@ rust_static_library("crabbyavif") { + "dav1d", + "libyuv", + "capi", +- "disable_cfi", ++ ++ # TODO: crbug.com/440481923 - Un-comment this once the new rust roll ++ # (http://crrev.com/c/6874449) lands and ++ # https://github.com/webmproject/CrabbyAvif/pull/654 is rolled into ++ # chromium. ++ #"disable_cfi", + ] + + # Required for disable_cfi feature.