File partition_alloc-no-lto.patch of Package nodejs-electron.v3

Compile files which declare functions in inline assembly without LTO due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57703

--- src/base/allocator/partition_allocator/BUILD.gn.old	2022-10-01 13:53:03.367797474 +0200
+++ src/base/allocator/partition_allocator/BUILD.gn	2022-10-05 14:23:53.999860356 +0200
@@ -51,6 +51,24 @@
   }
 }
 
+static_library("partition_alloc_asm") {
+  defines = [ "PA_PCSCAN_STACK_SUPPORTED" ]
+  if (gcc_lto) {
+    configs -= [ "//build/config/compiler:gcc_lto" ]
+  }
+  if (current_cpu == "x64") {
+    sources = [ "starscan/stack/asm/x64/push_registers_asm.cc" ]
+  } else if (current_cpu == "x86") {
+    sources = [ "starscan/stack/asm/x86/push_registers_asm.cc" ]
+  } else if (current_cpu == "arm") {
+    sources = [ "starscan/stack/asm/arm/push_registers_asm.cc" ]
+  } else if (current_cpu == "arm64") {
+    sources = [ "starscan/stack/asm/arm64/push_registers_asm.cc" ]
+  } else {
+    # To support a trampoline for another arch, please refer to v8/src/heap/base.
+  }
+}
+
 component("partition_alloc") {
   sources = [
     "address_pool_manager.cc",
@@ -262,20 +278,10 @@
     }
   }
   if (build_with_chromium) {
-    if (current_cpu == "x64") {
-      defines += [ "PA_PCSCAN_STACK_SUPPORTED" ]
-      sources += [ "starscan/stack/asm/x64/push_registers_asm.cc" ]
-    } else if (current_cpu == "x86") {
-      defines += [ "PA_PCSCAN_STACK_SUPPORTED" ]
-      sources += [ "starscan/stack/asm/x86/push_registers_asm.cc" ]
-    } else if (current_cpu == "arm") {
-      defines += [ "PA_PCSCAN_STACK_SUPPORTED" ]
-      sources += [ "starscan/stack/asm/arm/push_registers_asm.cc" ]
-    } else if (current_cpu == "arm64") {
+    deps = []
+    if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm" || current_cpu == "arm64") {
       defines += [ "PA_PCSCAN_STACK_SUPPORTED" ]
-      sources += [ "starscan/stack/asm/arm64/push_registers_asm.cc" ]
-    } else {
-      # To support a trampoline for another arch, please refer to v8/src/heap/base.
+      deps += [ ":partition_alloc_asm" ]
     }
   }
   public_deps = [
@@ -289,7 +295,6 @@
     ":partition_alloc_implementation",
     ":memory_tagging",
   ]
-  deps = []
   public_configs = []
   if (is_android) {
     # tagging.cc requires __arm_mte_set_* functions.
openSUSE Build Service is sponsored by