!170 fix build error for loongarch64

From: @zhangwenlong01 
Reviewed-by: @wk333 
Signed-off-by: @wk333
This commit is contained in:
openeuler-ci-bot 2024-05-31 06:51:47 +00:00 committed by Gitee
commit 55f9961a2b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 669 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,34 @@
From e2dbfb2757ec5c45b7d1f0082031f27378c147c2 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Thu, 14 Dec 2023 07:50:41 +0000
Subject: [PATCH 2/6] add loongarch64 support for cty
---
third_party/rust/cty/.cargo-checksum.json | 2 +-
third_party/rust/cty/src/lib.rs | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/third_party/rust/cty/.cargo-checksum.json b/third_party/rust/cty/.cargo-checksum.json
index 902714f58a..3e65dbf70a 100644
--- a/third_party/rust/cty/.cargo-checksum.json
+++ b/third_party/rust/cty/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"077c738b5f2c05d66a12209edaabca887091db727d61164a7a414da23d8bf08f","Cargo.toml":"94a517ea6c7dad4634a9a2bd356f3a8035927e7ff8367bd5a975b4db4ccf8e6e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"035e70219855119df4273b3c5b97543ae82e0dd60c520416e759107c602f651b","README.md":"19687c50697e6abc991e4c35e6d674db56bd5e5ae0d5b833440718f8f154a74d","ci/install.sh":"9b34273d9e79ec59f63d5e3e7aea27b0db66194667f9730a21158740fa1b99f1","ci/script.sh":"54962430ca4d3528e5c0d44ff590b1504be13147db5cbe8bb82f1358528ef5f3","src/lib.rs":"33a38ce6df718fb0191f34ff2cefdcbd3ad9d93f0c4073b78eaf937c07fb7614"},"package":"b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"077c738b5f2c05d66a12209edaabca887091db727d61164a7a414da23d8bf08f","Cargo.toml":"94a517ea6c7dad4634a9a2bd356f3a8035927e7ff8367bd5a975b4db4ccf8e6e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"035e70219855119df4273b3c5b97543ae82e0dd60c520416e759107c602f651b","README.md":"19687c50697e6abc991e4c35e6d674db56bd5e5ae0d5b833440718f8f154a74d","ci/install.sh":"9b34273d9e79ec59f63d5e3e7aea27b0db66194667f9730a21158740fa1b99f1","ci/script.sh":"54962430ca4d3528e5c0d44ff590b1504be13147db5cbe8bb82f1358528ef5f3","src/lib.rs":"3e9ec28a0d13cfb47546e044b8fc3a32007f7c76994704c4164c4430a7167e39"},"package":"b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"}
diff --git a/third_party/rust/cty/src/lib.rs b/third_party/rust/cty/src/lib.rs
index 971c9cb3a9..80b8f3f291 100644
--- a/third_party/rust/cty/src/lib.rs
+++ b/third_party/rust/cty/src/lib.rs
@@ -24,6 +24,7 @@ pub use pwd::*;
target_arch = "powerpc",
target_arch = "powerpc64",
target_arch = "s390x",
+ target_arch = "loongarch64",
target_arch = "riscv32",
target_arch = "riscv64"))]
mod ad {
--
2.41.0

View File

@ -0,0 +1,27 @@
From 4f9ab53eeabdc5966156601bda09f77fce057ba6 Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Thu, 14 Dec 2023 09:47:06 +0000
Subject: [PATCH] add loongarch64 support for ipc
---
ipc/chromium/src/build/build_config.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
index 511f36858c..f3a96feaf7 100644
--- a/ipc/chromium/src/build/build_config.h
+++ b/ipc/chromium/src/build/build_config.h
@@ -129,6 +129,9 @@
#elif defined(__riscv) && __riscv_xlen == 64
# define ARCH_CPU_RISCV64 1
# define ARCH_CPU_64_BITS 1
+#elif defined(__loongarch64)
+# define ARCH_CPU_LOONGARCH64 1
+# define ARCH_CPU_64_BITS 1
#else
# error Please add support for your architecture in build/build_config.h
#endif
--
2.41.0

View File

@ -0,0 +1,28 @@
From 744dac8eb17bba89242b74181c28523974e7e88c Mon Sep 17 00:00:00 2001
From: Wenlong Zhang <zhangwenlong@loongson.cn>
Date: Thu, 14 Dec 2023 10:47:13 +0000
Subject: [PATCH] add loongarch64 support for libwebrtc
---
third_party/libwebrtc/build/build_config.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/third_party/libwebrtc/build/build_config.h b/third_party/libwebrtc/build/build_config.h
index c39ae9da50..4c44dbae12 100644
--- a/third_party/libwebrtc/build/build_config.h
+++ b/third_party/libwebrtc/build/build_config.h
@@ -201,6 +201,10 @@
#define ARCH_CPU_RISCV64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
+#elif defined(__loongarch64)
+#define ARCH_CPU_LOONGARCH64 1
+#define ARCH_CPU_64_BITS 1
+#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__sparc__)
#if defined(__LP64__)
#define ARCH_CPU_SPARC64 1
--
2.41.0

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,469 @@
From 01ea3f7cf670d9e1f62a8f97474c84831d2e0e18 Mon Sep 17 00:00:00 2001
From: wujiahuan <wujiahuan161@gmail.com>
Date: Thu, 14 Dec 2023 12:40:12 +0000
Subject: [PATCH] backport Bug 1782159 to support loongarch64
https://hg.mozilla.org/mozilla-central/rev/f01044248c8595683ca1f625080c9aee51655966
---
xpcom/reflect/xptcall/md/unix/moz.build | 8 +
.../md/unix/xptcinvoke_asm_loongarch64.S | 91 ++++++++++
.../md/unix/xptcinvoke_loongarch64.cpp | 100 +++++++++++
.../md/unix/xptcstubs_asm_loongarch64.S | 53 ++++++
.../xptcall/md/unix/xptcstubs_loongarch64.cpp | 160 ++++++++++++++++++
5 files changed, 412 insertions(+)
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
create mode 100644 xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build
index 1779c148cb..e74c936c38 100644
--- a/xpcom/reflect/xptcall/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/md/unix/moz.build
@@ -271,6 +271,14 @@ if CONFIG["OS_ARCH"] == "Linux" and CONFIG["CPU_ARCH"] == "riscv64":
"xptcstubs_riscv64.cpp",
]
+if CONFIG["OS_ARCH"] == "Linux" and CONFIG["CPU_ARCH"] == "loongarch64":
+ SOURCES += [
+ "xptcinvoke_asm_loongarch64.S",
+ "xptcinvoke_loongarch64.cpp",
+ "xptcstubs_asm_loongarch64.S",
+ "xptcstubs_loongarch64.cpp",
+ ]
+
FINAL_LIBRARY = "xul"
LOCAL_INCLUDES += [
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
new file mode 100644
index 0000000000..8769060aed
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_loongarch64.S
@@ -0,0 +1,91 @@
+/* This Source Code Form subject to the terms of Mozilla Public
+ * License, v. 2.0 If a copy of the MPL was not distributed with
+ * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+ .set NGPREGS, 8
+ .set NFPREGS, 8
+
+ .text
+ .globl _NS_InvokeByIndex
+ .type _NS_InvokeByIndex, @function
+/*
+ * _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ * uint32_t paramCount, nsXPTCVariant* params)
+ */
+_NS_InvokeByIndex:
+ .cfi_startproc
+ addi.d $sp, $sp, -32
+ .cfi_def_cfa_offset 32
+ st.d $s0, $sp, 16
+ .cfi_offset 23, -16
+ st.d $s1, $sp, 8
+ .cfi_offset 24, -24
+ st.d $s2, $sp, 0
+ .cfi_offset 25, -32
+ st.d $ra, $sp, 24
+ .cfi_offset 1, -8
+
+ move $s2, $a0
+ move $s1, $a1
+ move $s0, $sp
+ .cfi_def_cfa_register 23
+
+ /* 16-bytes alignment */
+ addi.d $a0, $a2, 1
+ li.d $t4, 0xfffffffffffffffe
+ and $a0, $a0, $t4
+ slli.d $a0, $a0, 3
+ sub.d $sp, $sp, $a0
+ move $a4, $sp
+
+ addi.d $sp, $sp, -8*(NFPREGS+NGPREGS)
+ move $a0, $sp
+ addi.d $a1, $sp, 8*NGPREGS
+
+ bl invoke_copy_to_stack
+
+ /* 1st argument is this */
+ move $a0, $s2
+
+ ld.d $a1, $sp, 8
+ ld.d $a2, $sp, 16
+ ld.d $a3, $sp, 24
+ ld.d $a4, $sp, 32
+ ld.d $a5, $sp, 40
+ ld.d $a6, $sp, 48
+ ld.d $a7, $sp, 56
+
+ fld.d $fa0, $sp, 64
+ fld.d $fa1, $sp, 72
+ fld.d $fa2, $sp, 80
+ fld.d $fa3, $sp, 88
+ fld.d $fa4, $sp, 96
+ fld.d $fa5, $sp, 104
+ fld.d $fa6, $sp, 112
+ fld.d $fa7, $sp, 120
+
+ addi.d $sp, $sp, 8*(NGPREGS+NFPREGS)
+
+ ld.d $s2, $s2, 0
+ slli.w $s1, $s1, 3
+ add.d $s2, $s2, $s1
+ ld.d $t3, $s2, 0
+ jirl $ra, $t3, 0
+
+ move $sp, $s0
+ .cfi_def_cfa_register 3
+ ld.d $s0, $sp, 16
+ .cfi_restore 23
+ ld.d $s1, $sp, 8
+ .cfi_restore 24
+ ld.d $s2, $sp, 0
+ .cfi_restore 25
+ ld.d $ra, $sp, 24
+ .cfi_restore 1
+ addi.d $sp, $sp, 32
+ .cfi_def_cfa_offset -32
+ jirl $zero, $ra, 0
+ .cfi_endproc
+ .size _NS_InvokeByIndex, .-_NS_InvokeByIndex
+ .section .note.GNU-stack, "", @progbits
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
new file mode 100644
index 0000000000..61bb7b2efd
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_loongarch64.cpp
@@ -0,0 +1,100 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+// Platform specific code to invoke XPCOM methods on native objects
+
+#include "xptcprivate.h"
+
+extern "C" void invoke_copy_to_stack(uint64_t* gpregs, double* fpregs,
+ uint32_t paramCount, nsXPTCVariant* s,
+ uint64_t* d) {
+ static const uint32_t GPR_COUNT = 8;
+ static const uint32_t FPR_COUNT = 8;
+
+ uint32_t nr_gpr = 1; // skip one GPR register for "this"
+ uint32_t nr_fpr = 0;
+ uint64_t value = 0;
+
+ for (uint32_t i = 0; i < paramCount; i++, s++) {
+ if (s->IsIndirect()) {
+ value = (uint64_t)&s->val;
+ } else {
+ switch (s->type) {
+ case nsXPTType::T_FLOAT:
+ break;
+ case nsXPTType::T_DOUBLE:
+ break;
+ case nsXPTType::T_I8:
+ value = s->val.i8;
+ break;
+ case nsXPTType::T_I16:
+ value = s->val.i16;
+ break;
+ case nsXPTType::T_I32:
+ value = s->val.i32;
+ break;
+ case nsXPTType::T_I64:
+ value = s->val.i64;
+ break;
+ case nsXPTType::T_U8:
+ value = s->val.u8;
+ break;
+ case nsXPTType::T_U16:
+ value = s->val.u16;
+ break;
+ case nsXPTType::T_U32:
+ value = s->val.u32;
+ break;
+ case nsXPTType::T_U64:
+ value = s->val.u64;
+ break;
+ case nsXPTType::T_BOOL:
+ value = s->val.b;
+ break;
+ case nsXPTType::T_CHAR:
+ value = s->val.c;
+ break;
+ case nsXPTType::T_WCHAR:
+ value = s->val.wc;
+ break;
+ default:
+ value = (uint64_t)s->val.p;
+ break;
+ }
+ }
+
+ if (!s->IsIndirect() && s->type == nsXPTType::T_DOUBLE) {
+ if (nr_fpr < FPR_COUNT) {
+ fpregs[nr_fpr++] = s->val.d;
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&gpregs[nr_gpr++], &(s->val.d), sizeof(s->val.d));
+ } else {
+ memcpy(d++, &(s->val.d), sizeof(s->val.d));
+ }
+ } else if (!s->IsIndirect() && s->type == nsXPTType::T_FLOAT) {
+ if (nr_fpr < FPR_COUNT) {
+ memcpy(&fpregs[nr_fpr++], &(s->val.f), sizeof(s->val.f));
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&gpregs[nr_gpr++], &(s->val.f), sizeof(s->val.f));
+ } else {
+ memcpy(d++, &(s->val.f), sizeof(s->val.f));
+ }
+ } else {
+ if (nr_gpr < GPR_COUNT) {
+ gpregs[nr_gpr++] = value;
+ } else {
+ *d++ = value;
+ }
+ }
+ }
+}
+
+extern "C" nsresult _NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
+ uint32_t paramCount,
+ nsXPTCVariant* params);
+EXPORT_XPCOM_API(nsresult)
+NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex, uint32_t paramCount,
+ nsXPTCVariant* params) {
+ return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
+}
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
new file mode 100644
index 0000000000..5041de962c
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_loongarch64.S
@@ -0,0 +1,53 @@
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+ .set NGPRGES, 8
+ .set NFPREGS, 8
+
+ .text
+ .globl SharedStub
+ .hidden SharedStub
+ .type SharedStub,@function
+
+SharedStub:
+ .cfi_startproc
+ move $t0, $sp
+ addi.d $sp, $sp, -8*(NGPRGES+NFPREGS)-16
+ .cfi_def_cfa_offset 8*(NGPRGES+NFPREGS)+16
+ st.d $a0, $sp, 0
+ st.d $a1, $sp, 8
+ st.d $a2, $sp, 16
+ st.d $a3, $sp, 24
+ st.d $a4, $sp, 32
+ st.d $a5, $sp, 40
+ st.d $a6, $sp, 48
+ st.d $a7, $sp, 56
+ fst.d $fa0, $sp, 64
+ fst.d $fa1, $sp, 72
+ fst.d $fa2, $sp, 80
+ fst.d $fa3, $sp, 88
+ fst.d $fa4, $sp, 96
+ fst.d $fa5, $sp, 104
+ fst.d $fa6, $sp, 112
+ fst.d $fa7, $sp, 120
+ st.d $ra, $sp, 136
+ .cfi_offset 1, 136
+
+ /* methodIndex is passed from stub */
+ move $a1, $t6
+ move $a2, $t0
+ move $a3, $sp
+ addi.d $a4, $sp, 8*NGPRGES
+
+ bl PrepareAndDispatch
+
+ ld.d $ra, $sp, 136
+ .cfi_restore 1
+ addi.d $sp, $sp, 8*(NGPRGES+NFPREGS)+16
+ .cfi_def_cfa_offset -8*(NGPRGES+NFPREGS)-16
+ jirl $zero, $ra, 0
+ .cfi_endproc
+
+ .size SharedStub, .-SharedStub
+ .section .note.GNU-stack, "", @progbits
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
new file mode 100644
index 0000000000..1ea4289045
--- /dev/null
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_loongarch64.cpp
@@ -0,0 +1,160 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, V. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "xptcprivate.h"
+
+extern "C" nsresult ATTRIBUTE_USED PrepareAndDispatch(nsXPTCStubBase* self,
+ uint32_t methodIndex,
+ uint64_t* args,
+ uint64_t* gpregs,
+ double* fpregs) {
+ static const uint32_t GPR_COUNT = 8;
+ static const uint32_t FPR_COUNT = 8;
+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
+ const nsXPTMethodInfo* info;
+
+ self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
+
+ uint32_t paramCount = info->GetParamCount();
+ const uint8_t indexOfJSContext = info->IndexOfJSContext();
+
+ uint64_t* ap = args;
+ uint32_t nr_gpr = 1; // skip the arg which is 'self'
+ uint32_t nr_fpr = 0;
+ uint64_t value;
+
+ for (uint32_t i = 0; i < paramCount; i++) {
+ const nsXPTParamInfo& param = info->GetParam(i);
+ const nsXPTType& type = param.GetType();
+ nsXPTCMiniVariant* dp = &paramBuffer[i];
+
+ if (i == indexOfJSContext) {
+ if (nr_gpr < GPR_COUNT)
+ nr_gpr++;
+ else
+ ap++;
+ }
+
+ if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
+ if (nr_fpr < FPR_COUNT) {
+ dp->val.d = fpregs[nr_fpr++];
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&dp->val.d, &gpregs[nr_gpr++], sizeof(dp->val.d));
+ } else {
+ memcpy(&dp->val.d, ap++, sizeof(dp->val.d));
+ }
+ continue;
+ }
+
+ if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
+ if (nr_fpr < FPR_COUNT) {
+ memcpy(&dp->val.f, &fpregs[nr_fpr++], sizeof(dp->val.f));
+ } else if (nr_gpr < GPR_COUNT) {
+ memcpy(&dp->val.f, &gpregs[nr_gpr++], sizeof(dp->val.f));
+ } else {
+ memcpy(&dp->val.f, ap++, sizeof(dp->val.f));
+ }
+ continue;
+ }
+
+ if (nr_gpr < GPR_COUNT) {
+ value = gpregs[nr_gpr++];
+ } else {
+ value = *ap++;
+ }
+
+ if (param.IsOut() || !type.IsArithmetic()) {
+ dp->val.p = (void*)value;
+ continue;
+ }
+
+ switch (type) {
+ case nsXPTType::T_I8:
+ dp->val.i8 = (int8_t)value;
+ break;
+ case nsXPTType::T_I16:
+ dp->val.i16 = (int16_t)value;
+ break;
+ case nsXPTType::T_I32:
+ dp->val.i32 = (int32_t)value;
+ break;
+ case nsXPTType::T_I64:
+ dp->val.i64 = (int64_t)value;
+ break;
+ case nsXPTType::T_U8:
+ dp->val.u8 = (uint8_t)value;
+ break;
+ case nsXPTType::T_U16:
+ dp->val.u16 = (uint16_t)value;
+ break;
+ case nsXPTType::T_U32:
+ dp->val.u32 = (uint32_t)value;
+ break;
+ case nsXPTType::T_U64:
+ dp->val.u64 = (uint64_t)value;
+ break;
+ case nsXPTType::T_BOOL:
+ dp->val.b = (bool)(uint8_t)value;
+ break;
+ case nsXPTType::T_CHAR:
+ dp->val.c = (char)value;
+ break;
+ case nsXPTType::T_WCHAR:
+ dp->val.wc = (wchar_t)value;
+ break;
+ default:
+ NS_ERROR("bad type");
+ break;
+ }
+ }
+
+ nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
+ paramBuffer);
+ return result;
+}
+
+// Load $t6 with the constant 'n' and branch to SharedStub().
+// clang-format off
+#define STUB_ENTRY(n) \
+ __asm__( \
+ ".text\n\t" \
+ ".if "#n" < 10 \n\t" \
+ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase5Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase5Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase5Stub"#n"Ev: \n\t" \
+ ".elseif "#n" < 100 \n\t" \
+ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase6Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase6Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase6Stub"#n"Ev: \n\t" \
+ ".elseif "#n" < 1000 \n\t" \
+ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
+ ".hidden _ZN14nsXPTCStubBase7Stub"#n"Ev \n\t" \
+ ".type _ZN14nsXPTCStubBase7Stub"#n"Ev,@function \n\n" \
+ "_ZN14nsXPTCStubBase7Stub"#n"Ev: \n\t" \
+ ".else \n\t" \
+ ".err \"stub number "#n" >= 1000 not yet supported\"\n" \
+ ".endif \n\t" \
+ "li.d $t6, "#n" \n\t" \
+ "b SharedStub \n" \
+ ".if "#n" < 10 \n\t" \
+ ".size _ZN14nsXPTCStubBase5Stub"#n"Ev,.-_ZN14nsXPTCStubBase5Stub"#n"Ev\n\t" \
+ ".elseif "#n" < 100 \n\t" \
+ ".size _ZN14nsXPTCStubBase6Stub"#n"Ev,.-_ZN14nsXPTCStubBase6Stub"#n"Ev\n\t" \
+ ".else \n\t" \
+ ".size _ZN14nsXPTCStubBase7Stub"#n"Ev,.-_ZN14nsXPTCStubBase7Stub"#n"Ev\n\t" \
+ ".endif" \
+);
+// clang-format on
+
+#define SENTINEL_ENTRY(n) \
+ nsresult nsXPTCStubBase::Sentinel##n() { \
+ NS_ERROR("nsXPTCStubBase::Sentinel called"); \
+ return NS_ERROR_NOT_IMPLEMENTED; \
+ }
+
+#include "xptcstubsdef.inc"
--
2.41.0

View File

@ -45,7 +45,7 @@
Summary: Mozilla Firefox Web browser
Name: firefox
Version: 115.9.0
Release: 1
Release: 2
URL: https://www.mozilla.org/firefox/
License: MPL-1.1 or GPL-2.0-or-later or LGPL-2.0-or-later
Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
@ -125,6 +125,12 @@ Patch801: bmo-1559213-fix-system-av1-libs.patch
# https://phabricator.services.mozilla.com/D188068
Patch1001: D188068.diff
Patch1002: add-loongarch64-support-for-nix.patch
Patch1003: add-loongarch64-support-for-cty.patch
Patch1004: add-loongarch64-support-for-authenticator.patch
Patch1005: add-loongarch64-support-for-ipc.patch
Patch1006: add-loongarch64-support-for-libwebrtc.patch
Patch1007: backport-Bug-1782159-to-support-loongarch64.patch
# BUILD REQURES/REQUIRES
%if %{?system_nss}
BuildRequires: pkgconfig(nspr) >= %{nspr_version}
@ -438,6 +444,13 @@ cd -
# RISCV64 patches
%patch -P1001 -p1 -b .D188068
#LoongArch64 patches
%patch1002 -p1
%patch1003 -p1
%patch1004 -p1
%patch1005 -p1
%patch1006 -p1
%patch1007 -p1
%{__rm} -f .mozconfig
%{__cp} %{SOURCE10} .mozconfig
%{__cp} %{SOURCE24} mozilla-api-key
@ -955,6 +968,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%endif
%changelog
* Wed May 29 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 115.9.0-2
- fix build error for loongarch64
* Wed Mar 20 2024 wangkai <13474090681@163.com> - 115.9.0-1
- Update to 115.9.0
- Fix CVE-2024-2616 CVE-2024-2608 CVE-2024-2610 CVE-2024-2612 CVE-2024-2614 CVE-2023-5388 CVE-2024-2607 CVE-2024-2611