summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorMarkus Volk <f_l_k@t-online.de>2024-12-16 10:07:04 +0100
committerKhem Raj <raj.khem@gmail.com>2024-12-16 08:42:01 -0800
commit21eb35aa278d9a04c76e79dfa63239116b3c44e2 (patch)
treef9a3a571fa0e160f7a7884bc3159abd22eda511f /meta-oe/recipes-extended
parent8eefff9de682aad7ddff265b11d9db1a820743c9 (diff)
downloadmeta-openembedded-21eb35aa278d9a04c76e79dfa63239116b3c44e2.tar.gz
mozjs: add recipe for mozjs-128
mozjs-128 is the current esr release based on firefox 128 Add a new recipe and keep mozjs-115 as its still supported and used by polkit - Remove two backported patches - Remove a (hopefully) unneeded patches for musl (build for qemuarm/musl succeeded) - Add dependency for cbindgen-native Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-Cargo.toml-do-not-abort-on-panic.patch31
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-Link-with-icu-uc-to-fix-build-with-ICU-76.patch27
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-add-arm-to-list-of-mozinline.patch31
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch44
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch53
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0001-util.configure-fix-one-occasionally-reproduced-confi.patch47
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0002-moz.configure-do-not-look-for-llvm-objdump.patch43
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch65
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/0004-use-asm-sgidefs.h.patch37
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/armv5.patch28
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/musl-disable-stackwalk.patch27
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch59
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb102
13 files changed, 594 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Cargo.toml-do-not-abort-on-panic.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Cargo.toml-do-not-abort-on-panic.patch
new file mode 100644
index 0000000000..97a4439628
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Cargo.toml-do-not-abort-on-panic.patch
@@ -0,0 +1,31 @@
1From ddd23f8547f3a56aa542924aa400d3535f734bff Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 1 Oct 2021 13:00:24 +0200
4Subject: [PATCH] Cargo.toml: do not abort on panic
5
6OE's rust is configured to unwind, and this setting clashes with it/
7
8Upstream-Status: Inappropriate [oe-core specific]
9Signed-off-by: Alexander Kanavin <alex@linutronix.de>
10---
11 Cargo.toml | 2 --
12 1 file changed, 2 deletions(-)
13
14diff --git a/Cargo.toml b/Cargo.toml
15index a4248187be..eed8964b3a 100644
16--- a/Cargo.toml
17+++ b/Cargo.toml
18@@ -67,13 +67,11 @@ opt-level = 1
19 rpath = false
20 lto = false
21 debug-assertions = true
22-panic = "abort"
23
24 [profile.release]
25 opt-level = 2
26 rpath = false
27 debug-assertions = false
28-panic = "abort"
29
30 # Optimize build dependencies, because bindgen and proc macros / style
31 # compilation take more to run than to build otherwise.
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Link-with-icu-uc-to-fix-build-with-ICU-76.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Link-with-icu-uc-to-fix-build-with-ICU-76.patch
new file mode 100644
index 0000000000..4fb7a28eeb
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-Link-with-icu-uc-to-fix-build-with-ICU-76.patch
@@ -0,0 +1,27 @@
1From cbb5cc1022cc27edefc8eabbe21458cac9bda6fb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 23 Nov 2024 13:28:33 -0800
4Subject: [PATCH] Link with icu-uc to fix build with ICU-76
5
6Fixes
7https://bugzilla.mozilla.org/show_bug.cgi?id=1927380
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 js/moz.configure | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/js/moz.configure b/js/moz.configure
16index 593b93acee..2181dca34b 100644
17--- a/js/moz.configure
18+++ b/js/moz.configure
19@@ -1305,7 +1305,7 @@ def enable_system_icu_option(enable_system_icu):
20 return enable_system_icu
21
22
23-system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 73.1", when="--with-system-icu")
24+system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 73.1 icu-uc", when="--with-system-icu")
25
26
27 @depends(enable_system_icu_option)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-add-arm-to-list-of-mozinline.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-add-arm-to-list-of-mozinline.patch
new file mode 100644
index 0000000000..960b4593c2
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-add-arm-to-list-of-mozinline.patch
@@ -0,0 +1,31 @@
1From 2d1fb35bd81acadc12cc077de86361ac59cee2f1 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Fri, 22 Sep 2023 22:59:59 +0000
4Subject: [PATCH] Backport patch from firefox bugzilla to fix compile error for
5 qemuarm with some armv7ve tunes such as 'armv7vethf' and 'armv7vet-vfpv3d16':
6
7| /path/to/build/tmp/work/armv7vet2hf-vfp-poky-linux-gnueabi/mozjs-102/102.5.0-r0/build/js/src/jit/AtomicOperationsGenerated.h:240:17:
8 error: 'asm' operand has impossible constraints
9| 240 | asm volatile (
10| | ^~~
11
12Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1761665]
13
14Signed-off-by: Kai Kang <kai.kang@windriver.com>
15---
16 js/src/jit/GenerateAtomicOperations.py | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py
20index 9194b8b685..145563bb37 100644
21--- a/js/src/jit/GenerateAtomicOperations.py
22+++ b/js/src/jit/GenerateAtomicOperations.py
23@@ -850,7 +850,7 @@ def generate_atomics_header(c_out):
24
25 # Work around a GCC issue on 32-bit x86 by adding MOZ_NEVER_INLINE.
26 # See bug 1756347.
27- if is_gcc and cpu_arch == "x86":
28+ if is_gcc and cpu_arch in ("x86", "arm"):
29 contents = contents.replace("INLINE_ATTR", "MOZ_NEVER_INLINE inline")
30 else:
31 contents = contents.replace("INLINE_ATTR", "inline")
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch
new file mode 100644
index 0000000000..38496ea56c
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch
@@ -0,0 +1,44 @@
1From c860dcbe63b0e393c95bfb0131238f91aaac11d3 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Thu, 7 Oct 2021 12:44:18 +0200
4Subject: [PATCH] build: do not use autoconf's config.sub to 'canonicalize'
5 names
6
7The outcome is that processed names no longer match our custom rust
8target definitions, and the build fails.
9
10Upstream-Status: Inappropriate [oe-core specific]
11Signed-off-by: Alexander Kanavin <alex@linutronix.de>
12
13---
14 build/moz.configure/init.configure | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17--- a/build/moz.configure/init.configure
18+++ b/build/moz.configure/init.configure
19@@ -647,24 +647,7 @@ def help_host_target(help, host, target)
20
21 def config_sub(shell, triplet):
22 config_sub = os.path.join(os.path.dirname(__file__), "..", "autoconf", "config.sub")
23- # Config.sub doesn't like the *-windows-msvc/*-windows-gnu triplets, so
24- # munge those before and after calling config.sub.
25- suffix = None
26- munging = {
27- "-windows-msvc": "-mingw32",
28- "-windows-gnu": "-mingw32",
29- }
30- for check_suffix, replacement in munging.items():
31- if triplet.endswith(check_suffix):
32- suffix = check_suffix
33- triplet = triplet[: -len(suffix)] + replacement
34- break
35- result = check_cmd_output(shell, config_sub, triplet).strip()
36- if suffix:
37- assert result.endswith(replacement)
38- result = result[: -len(replacement)] + suffix
39- return result
40-
41+ return triplet
42
43 @depends("--host", shell)
44 @checking("for host system type", lambda h: h.alias)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch
new file mode 100644
index 0000000000..94e1651b33
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-rewrite-cargo-host-linker-in-python3.patch
@@ -0,0 +1,53 @@
1From 6f6b78628a8edc834aa147c87ebce3eb8e670e7a Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 18 Nov 2021 07:16:39 +0000
4Subject: [PATCH] Rewrite cargo-host-linker in python3
5
6Mozjs compile failed with this failure:
7/bin/sh: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /build/tmp-glibc/work/corei7-64-wrs-linux/mozjs/91.1.0-r0/recipe-sysroot-native/usr/lib/libtinfo.so.5)
8
9Root Cause:
10cargo-host-linker has /bin/sh as it's interpreter, but cargo run the cmd
11with LD_LIBRARY_PATH set to recipe-sysroot-native. The host /bin/sh links
12libtinfo.so.5 under recipe-sysroot-native, which needs higher libc. But
13host libc is older libc. So the incompatible problem occurred.
14
15Solution:
16rewrite cargo-host-linker in python3
17
18Upstream-Status: Inappropriate [oe specific]
19
20Signed-off-by: Changqing Li <changqing.li@windriver.com>
21---
22 build/cargo-host-linker | 24 +++++++++++++++++++++---
23 1 file changed, 21 insertions(+), 3 deletions(-)
24
25diff --git a/build/cargo-host-linker b/build/cargo-host-linker
26index cbd0472bf7..87d43ce9ec 100755
27--- a/build/cargo-host-linker
28+++ b/build/cargo-host-linker
29@@ -1,3 +1,21 @@
30-#!/bin/sh
31-# See comment in cargo-linker.
32-eval ${MOZ_CARGO_WRAP_HOST_LD} ${MOZ_CARGO_WRAP_HOST_LDFLAGS} '"$@"'
33+#!/usr/bin/env python3
34+
35+import os,sys
36+
37+if os.environ['MOZ_CARGO_WRAP_HOST_LD'].strip():
38+ binary=os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]
39+else:
40+ sys.exit(0)
41+
42+if os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS'].strip():
43+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
44+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
45+ else:
46+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
47+else:
48+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
49+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + sys.argv[1:]
50+ else:
51+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + sys.argv[1:]
52+
53+os.execvp(binary, args)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0001-util.configure-fix-one-occasionally-reproduced-confi.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-util.configure-fix-one-occasionally-reproduced-confi.patch
new file mode 100644
index 0000000000..d53cc2bd41
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0001-util.configure-fix-one-occasionally-reproduced-confi.patch
@@ -0,0 +1,47 @@
1From 683cd23dd269509a1d913adb2b049b84771e0a94 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 11 Nov 2021 16:05:54 +0800
4Subject: [PATCH] util.configure: fix one occasionally reproduced configure
5 failure
6
7error:
8| checking whether the C++ compiler supports -Wno-range-loop-analysis...
9| DEBUG: Creating /tmp/conftest.jr1qrcw3.cpp with content:
10| DEBUG: | int
11| DEBUG: | main(void)
12| DEBUG: | {
13| DEBUG: |
14| DEBUG: | ;
15| DEBUG: | return 0;
16| DEBUG: | }
17| DEBUG: Executing: aarch64-wrs-linux-g++ -mcpu=cortex-a53 -march=armv8-a+crc -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mozjs/91.1.0-r0/recipe-sysroot /tmp/conftest.jr1qrcw3.cpp -Werror -Wrange-loop-analysis -c
18| DEBUG: The command returned non-zero exit status 1.
19| DEBUG: Its error output was:
20...
21| File "/mozjs/91.1.0-r0/firefox-91.1.0/build/moz.configure/util.configure", line 239, in try_invoke_compiler
22| os.remove(path)
23| FileNotFoundError: [Errno 2] No such file or directory: '/tmp/conftest.jr1qrcw3.cpp'
24
25It should be another process that deleted this file by using
26"rm -rf conftest*" inappropriately
27
28Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1740667]
29
30Signed-off-by: Changqing Li <changqing.li@windriver.com>
31---
32 build/moz.configure/util.configure | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35diff --git a/build/moz.configure/util.configure b/build/moz.configure/util.configure
36index d93b91fcdd..47ab8b92b9 100644
37--- a/build/moz.configure/util.configure
38+++ b/build/moz.configure/util.configure
39@@ -256,7 +256,7 @@ def try_invoke_compiler(
40 "C++": ".cpp",
41 }[language]
42
43- fd, path = mkstemp(prefix="conftest.", suffix=suffix, text=True)
44+ fd, path = mkstemp(prefix="try_invoke_compiler_conftest.", suffix=suffix, text=True)
45 try:
46 source = source.encode("ascii", "replace")
47
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0002-moz.configure-do-not-look-for-llvm-objdump.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0002-moz.configure-do-not-look-for-llvm-objdump.patch
new file mode 100644
index 0000000000..9a82acf77b
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0002-moz.configure-do-not-look-for-llvm-objdump.patch
@@ -0,0 +1,43 @@
1From 1a5331f1997788e9a25bbc2b10eb14e2ee418be9 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 1 Oct 2021 13:01:10 +0200
4Subject: [PATCH] moz.configure: do not look for llvm-objdump
5
6This avoid dragging in a dependency that isn't even needed
7for js builds.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 moz.configure | 18 +++++++++---------
13 1 file changed, 9 insertions(+), 9 deletions(-)
14
15diff --git a/moz.configure b/moz.configure
16index 804b9a375a..402e79e3b3 100755
17--- a/moz.configure
18+++ b/moz.configure
19@@ -390,15 +390,15 @@ def plain_llvm_or_prefixed(name, llvm_name=None):
20 return plain_llvm_or_prefixed
21
22
23-llvm_objdump = check_prog(
24- "LLVM_OBJDUMP",
25- llvm_tool("llvm-objdump"),
26- what="llvm-objdump",
27- when="--enable-compile-environment",
28- paths=clang_search_path,
29-)
30-
31-add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
32+#llvm_objdump = check_prog(
33+# "LLVM_OBJDUMP",
34+# llvm_tool("llvm-objdump"),
35+# what="llvm-objdump",
36+# when="--enable-compile-environment",
37+# paths=clang_search_path,
38+#)
39+#
40+#add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
41
42
43 def validate_readelf(path):
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch
new file mode 100644
index 0000000000..40025fbc68
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch
@@ -0,0 +1,65 @@
1From 2d7f06cdf631e4d4d94e9d8e33a953dc57672750 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 1 Oct 2021 13:02:17 +0200
4Subject: [PATCH] rust.configure: do not try to find a suitable upstream target
5
6OE is using custom targets and so this is bound to fail.
7
8Upstream-Status: Inappropriate [oe-core specific]
9Signed-off-by: Alexander Kanavin <alex@linutronix.de>
10---
11 build/moz.configure/rust.configure | 34 ++----------------------------
12 1 file changed, 2 insertions(+), 32 deletions(-)
13
14diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
15index acac34ec05..ff3b8fc0fd 100644
16--- a/build/moz.configure/rust.configure
17+++ b/build/moz.configure/rust.configure
18@@ -486,33 +486,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
19 def rust_host_triple(
20 rustc, host, compiler_info, rustc_host, rust_supported_targets, arm_target
21 ):
22- rustc_target = detect_rustc_target(
23- host, compiler_info, arm_target, rust_supported_targets
24- )
25- if rustc_target != rustc_host:
26- if host.alias == rustc_target:
27- configure_host = host.alias
28- else:
29- configure_host = "{}/{}".format(host.alias, rustc_target)
30- die(
31- dedent(
32- """\
33- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
34-
35- You can solve this by:
36- * Set your configure host to match the rust compiler host by editing your
37- mozconfig and adding "ac_add_options --host={rustc}".
38- * Or, install the rust toolchain for {configure}, if supported, by running
39- "rustup default stable-{rustc_target}"
40- """.format(
41- rustc=rustc_host,
42- configure=configure_host,
43- rustc_target=rustc_target,
44- )
45- )
46- )
47- assert_rust_compile(host, rustc_target, rustc)
48- return rustc_target
49+ return rustc_host
50
51
52 @depends(
53@@ -522,11 +496,7 @@ def rust_host_triple(
54 def rust_target_triple(
55 rustc, target, compiler_info, rust_supported_targets, arm_target
56 ):
57- rustc_target = detect_rustc_target(
58- target, compiler_info, arm_target, rust_supported_targets
59- )
60- assert_rust_compile(target, rustc_target, rustc)
61- return rustc_target
62+ return target.alias
63
64
65 set_config("RUST_TARGET", rust_target_triple)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/0004-use-asm-sgidefs.h.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/0004-use-asm-sgidefs.h.patch
new file mode 100644
index 0000000000..eb3ff452b3
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/0004-use-asm-sgidefs.h.patch
@@ -0,0 +1,37 @@
1From 1691939a22ec12245f008993e0b9a1b1dfb91e9c Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <amccurdy@gmail.com>
3Date: Sat, 30 Apr 2016 15:29:06 -0700
4Subject: [PATCH] use <asm/sgidefs.h>
5
6Build fix for MIPS with musl libc
7
8The MIPS specific header <sgidefs.h> is provided by glibc and uclibc
9but not by musl. Regardless of the libc, the kernel headers provide
10<asm/sgidefs.h> which provides the same definitions, so use that
11instead.
12
13Upstream-Status: Pending
14
15[Vincent:
16Taken from: https://sourceware.org/bugzilla/show_bug.cgi?id=21070]
17
18Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
19Signed-off-by: Khem Raj <raj.khem@gmail.com>
20Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
21---
22 mfbt/RandomNum.cpp | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25diff --git a/mfbt/RandomNum.cpp b/mfbt/RandomNum.cpp
26index 96de5d4055..2cfb2e10ee 100644
27--- a/mfbt/RandomNum.cpp
28+++ b/mfbt/RandomNum.cpp
29@@ -53,7 +53,7 @@ extern "C" BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer,
30 # elif defined(__s390__)
31 # define GETRANDOM_NR 349
32 # elif defined(__mips__)
33-# include <sgidefs.h>
34+# include <asm/sgidefs.h>
35 # if _MIPS_SIM == _MIPS_SIM_ABI32
36 # define GETRANDOM_NR 4353
37 # elif _MIPS_SIM == _MIPS_SIM_ABI64
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/armv5.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/armv5.patch
new file mode 100644
index 0000000000..564f423fb4
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/armv5.patch
@@ -0,0 +1,28 @@
1From 0dd6fdbf6a821898617f1bd8e57123be048c07f5 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 16 Dec 2024 05:49:57 +0000
4Subject: [PATCH] The ISB instruction isn't available in ARMv5 or v6, so guard
5 it's use to fix the build on qemuarmv5.
6
7Upstream-Status: Pending
8Signed-off-by: Ross Burton <ross.burton@arm.com>
9---
10 js/src/jit/arm/Architecture-arm.cpp | 2 ++
11 1 file changed, 2 insertions(+)
12
13diff --git a/js/src/jit/arm/Architecture-arm.cpp b/js/src/jit/arm/Architecture-arm.cpp
14index d4c5026705..fc0455eaff 100644
15--- a/js/src/jit/arm/Architecture-arm.cpp
16+++ b/js/src/jit/arm/Architecture-arm.cpp
17@@ -528,9 +528,11 @@ void FlushICache(void* code, size_t size) {
18
19 void FlushExecutionContext() {
20 #ifndef JS_SIMULATOR_ARM
21+#if __ARM_ARCH >= 7
22 // Ensure that any instructions already in the pipeline are discarded and
23 // reloaded from the icache.
24 asm volatile("isb\n" : : : "memory");
25+#endif
26 #else
27 // We assume the icache flushing routines on other platforms take care of this
28 #endif
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/musl-disable-stackwalk.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/musl-disable-stackwalk.patch
new file mode 100644
index 0000000000..3d5452ce4d
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/musl-disable-stackwalk.patch
@@ -0,0 +1,27 @@
1From d96e9a40e9da9163e0a4b3475178fe30c26deb19 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 22 Sep 2023 22:59:56 +0000
4Subject: [PATCH] Musl does not have stack unwinder like glibc therefore we can
5
6 not assume that its always available on musl, we do need to check for target
7 environment as well which could be musl or glibc.
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 mozglue/misc/StackWalk.cpp | 2 +-
13 1 file changed, 1 insertion(+), 1 deletion(-)
14
15diff --git a/mozglue/misc/StackWalk.cpp b/mozglue/misc/StackWalk.cpp
16index 18fd3464b0..d3d9208fdb 100644
17--- a/mozglue/misc/StackWalk.cpp
18+++ b/mozglue/misc/StackWalk.cpp
19@@ -50,7 +50,7 @@ using namespace mozilla;
20 # define HAVE___LIBC_STACK_END 0
21 #endif
22
23-#if (defined(linux) && \
24+#if (defined(linux) && defined(__GLIBC__) && \
25 ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
26 defined(HAVE__UNWIND_BACKTRACE)) && \
27 (HAVE___LIBC_STACK_END || ANDROID))
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch b/meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch
new file mode 100644
index 0000000000..67e23c5fcc
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch
@@ -0,0 +1,59 @@
1From 0cc41bc953974d4852b263708bf8d12f823ca8ad Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 24 Oct 2021 22:32:50 -0700
4Subject: [PATCH] Add RISCV32 support
5
6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9 build/moz.configure/init.configure | 3 +++
10 python/mozbuild/mozbuild/configure/constants.py | 2 ++
11 .../mozbuild/test/configure/test_toolchain_configure.py | 1 +
12 3 files changed, 6 insertions(+)
13
14diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
15index 97b9bab167..d9a5a2035d 100644
16--- a/build/moz.configure/init.configure
17+++ b/build/moz.configure/init.configure
18@@ -594,6 +594,9 @@ def split_triplet(triplet, allow_wasi=False):
19 elif cpu.startswith("aarch64"):
20 canonical_cpu = "aarch64"
21 endianness = "little"
22+ elif cpu in ("riscv32", "riscv32gc"):
23+ canonical_cpu = "riscv32"
24+ endianness = "little"
25 elif cpu in ("riscv64", "riscv64gc"):
26 canonical_cpu = "riscv64"
27 endianness = "little"
28diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
29index 25f43bb9f8..3335e69405 100644
30--- a/python/mozbuild/mozbuild/configure/constants.py
31+++ b/python/mozbuild/mozbuild/configure/constants.py
32@@ -73,6 +73,7 @@ CPU_bitness = {
33 "mips64": 64,
34 "ppc": 32,
35 "ppc64": 64,
36+ 'riscv32': 32,
37 "riscv64": 64,
38 "s390": 32,
39 "s390x": 64,
40@@ -129,6 +130,7 @@ CPU_preprocessor_checks = OrderedDict(
41 ("m68k", "__m68k__"),
42 ("mips64", "__mips64"),
43 ("mips32", "__mips__"),
44+ ("riscv32", "__riscv && __riscv_xlen == 32"),
45 ("riscv64", "__riscv && __riscv_xlen == 64"),
46 ("loongarch64", "__loongarch64"),
47 ("sh4", "__sh__"),
48diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
49index d438b68eb8..1be0d02e54 100644
50--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
51+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
52@@ -1325,6 +1325,7 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
53 "m68k-unknown-linux-gnu": big_endian + {"__m68k__": 1},
54 "mips64-unknown-linux-gnuabi64": big_endian + {"__mips64": 1, "__mips__": 1},
55 "mips-unknown-linux-gnu": big_endian + {"__mips__": 1},
56+ "riscv32-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 32},
57 "riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64},
58 "sh4-unknown-linux-gnu": little_endian + {"__sh__": 1},
59 }
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb b/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb
new file mode 100644
index 0000000000..0fbf3d43f9
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-128_128.5.2.bb
@@ -0,0 +1,102 @@
1SUMMARY = "SpiderMonkey is Mozilla's JavaScript engine written in C/C++"
2HOMEPAGE = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=dc9b6ecd19a14a54a628edaaf23733bf"
5
6SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/firefox-${PV}esr.source.tar.xz \
7 file://0001-Cargo.toml-do-not-abort-on-panic.patch \
8 file://0002-moz.configure-do-not-look-for-llvm-objdump.patch \
9 file://0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch \
10 file://0004-use-asm-sgidefs.h.patch \
11 file://riscv32.patch \
12 file://0001-util.configure-fix-one-occasionally-reproduced-confi.patch \
13 file://0001-rewrite-cargo-host-linker-in-python3.patch \
14 file://musl-disable-stackwalk.patch \
15 file://0001-add-arm-to-list-of-mozinline.patch \
16 file://armv5.patch \
17 file://0001-Link-with-icu-uc-to-fix-build-with-ICU-76.patch \
18 "
19SRC_URI[sha256sum] = "25d633eb81499cbda44b8c64fa1c1a5879d55024b864ef495d4997154d68358f"
20
21UPSTREAM_CHECK_URI = "https://tracker.debian.org/pkg/mozjs128"
22UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
23
24S = "${WORKDIR}/firefox-${PV}"
25
26inherit pkgconfig perlnative python3native rust
27
28DEPENDS += "zlib cbindgen-native python3 icu"
29DEPENDS:remove:mipsarch = "icu"
30DEPENDS:remove:powerpc:toolchain-clang = "icu"
31
32B = "${WORKDIR}/build"
33
34export PYTHONPATH = "${S}/build:\
35${S}/third_party/python/PyYAML/lib3:\
36${S}/testing/mozbase/mozfile:\
37${S}/python/mozboot:\
38${S}/third_party/python/distro:\
39${S}/testing/mozbase/mozinfo:\
40${S}/config:\
41${S}/testing/mozbase/manifestparser:\
42${S}/third_party/python/pytoml:\
43${S}/testing/mozbase/mozprocess:\
44${S}/third_party/python/six:\
45${S}/python/mozbuild:\
46${S}/python/mozbuild/mozbuild:\
47${S}/python/mach:\
48${S}/third_party/python/jsmin:\
49${S}/python/mozversioncontrol"
50
51export HOST_CC = "${BUILD_CC}"
52export HOST_CXX = "${BUILD_CXX}"
53export HOST_CFLAGS = "${BUILD_CFLAGS}"
54export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
55export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
56
57export AS = "${CC}"
58
59export RUSTFLAGS
60
61JIT ?= ""
62JIT:mipsarch = "--disable-jit"
63ICU ?= "--with-system-icu"
64ICU:mipsarch = ""
65ICU:powerpc:toolchain-clang = ""
66
67LDFLAGS:append:riscv32 = " -latomic"
68
69do_configure() {
70 cd ${B}
71 python3 ${S}/configure.py \
72 --enable-project=js \
73 --target=${RUST_HOST_SYS} \
74 --host=${BUILD_SYS} \
75 --prefix=${prefix} \
76 --libdir=${libdir} \
77 --disable-jemalloc \
78 --disable-strip \
79 ${JIT} \
80 ${ICU}
81}
82do_configure[cleandirs] += "${B}"
83
84do_install() {
85 oe_runmake 'DESTDIR=${D}' install
86}
87
88inherit multilib_script multilib_header
89
90MAJ_VER = "${@oe.utils.trim_version("${PV}", 1)}"
91MULTILIB_SCRIPTS += "${PN}-dev:${bindir}/js${MAJ_VER}-config"
92
93do_install:append() {
94 oe_multilib_header mozjs-${MAJ_VER}/js-config.h
95 sed -e 's@${STAGING_DIR_HOST}@@g' \
96 -i ${D}${bindir}/js${MAJ_VER}-config
97 rm -f ${D}${libdir}/libjs_static.ajs
98}
99
100PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
101PACKAGES =+ "lib${BPN}"
102FILES:lib${BPN} += "${libdir}/lib*"