summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0001-Cargo.toml-do-not-abort-on-panic.patch32
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0001-add-arm-to-list-of-mozinline.patch32
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch29
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0001-rewrite-cargo-host-linker-in-python3.patch54
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0001-util.configure-fix-one-occasionally-reproduced-confi.patch48
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0002-moz.configure-do-not-look-for-llvm-objdump.patch44
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch66
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/0004-use-asm-sgidefs.h.patch38
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/fix-musl-build.patch27
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/musl-disable-stackwalk.patch27
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch60
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs-115_115.2.0.bb78
12 files changed, 535 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0001-Cargo.toml-do-not-abort-on-panic.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-Cargo.toml-do-not-abort-on-panic.patch
new file mode 100644
index 0000000000..e8dfdea1e9
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-Cargo.toml-do-not-abort-on-panic.patch
@@ -0,0 +1,32 @@
1From f501f7c02df4f0ff5d5f100d9eeb74cd4d12ea3d 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---
12 Cargo.toml | 2 --
13 1 file changed, 2 deletions(-)
14
15diff --git a/Cargo.toml b/Cargo.toml
16index a2718b2f35..4e231c30e8 100644
17--- a/Cargo.toml
18+++ b/Cargo.toml
19@@ -59,13 +59,11 @@ opt-level = 1
20 rpath = false
21 lto = false
22 debug-assertions = true
23-panic = "abort"
24
25 [profile.release]
26 opt-level = 2
27 rpath = false
28 debug-assertions = false
29-panic = "abort"
30
31 # Optimize build dependencies, because bindgen and proc macros / style
32 # compilation take more to run than to build otherwise.
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0001-add-arm-to-list-of-mozinline.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-add-arm-to-list-of-mozinline.patch
new file mode 100644
index 0000000000..83187861c7
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-add-arm-to-list-of-mozinline.patch
@@ -0,0 +1,32 @@
1From c5cfb8aa591afd5ad3aedc58fe7f410e89013605 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---
17 js/src/jit/GenerateAtomicOperations.py | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/js/src/jit/GenerateAtomicOperations.py b/js/src/jit/GenerateAtomicOperations.py
21index 24b5a191cf..e41948c5af 100644
22--- a/js/src/jit/GenerateAtomicOperations.py
23+++ b/js/src/jit/GenerateAtomicOperations.py
24@@ -860,7 +860,7 @@ def generate_atomics_header(c_out):
25
26 # Work around a GCC issue on 32-bit x86 by adding MOZ_NEVER_INLINE.
27 # See bug 1756347.
28- if is_gcc and cpu_arch == "x86":
29+ if is_gcc and cpu_arch in ("x86", "arm"):
30 contents = contents.replace("INLINE_ATTR", "MOZ_NEVER_INLINE inline")
31 else:
32 contents = contents.replace("INLINE_ATTR", "inline")
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch
new file mode 100644
index 0000000000..fe905fe4dd
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch
@@ -0,0 +1,29 @@
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
17diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
18index 81f500a0b7..0b7a2ff60f 100644
19--- a/build/moz.configure/init.configure
20+++ b/build/moz.configure/init.configure
21@@ -585,7 +585,7 @@ def help_host_target(help, host, target):
22
23 def config_sub(shell, triplet):
24 config_sub = os.path.join(os.path.dirname(__file__), "..", "autoconf", "config.sub")
25- return check_cmd_output(shell, config_sub, triplet).strip()
26+ return triplet
27
28
29 @depends("--host", shell)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0001-rewrite-cargo-host-linker-in-python3.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-rewrite-cargo-host-linker-in-python3.patch
new file mode 100644
index 0000000000..83f384e6c2
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-rewrite-cargo-host-linker-in-python3.patch
@@ -0,0 +1,54 @@
1From c6a84863454b882695058187cd282987613474ef 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---
23 build/cargo-host-linker | 24 +++++++++++++++++++++---
24 1 file changed, 21 insertions(+), 3 deletions(-)
25
26diff --git a/build/cargo-host-linker b/build/cargo-host-linker
27index cbd0472bf7..87d43ce9ec 100755
28--- a/build/cargo-host-linker
29+++ b/build/cargo-host-linker
30@@ -1,3 +1,21 @@
31-#!/bin/sh
32-# See comment in cargo-linker.
33-eval ${MOZ_CARGO_WRAP_HOST_LD} ${MOZ_CARGO_WRAP_HOST_LDFLAGS} '"$@"'
34+#!/usr/bin/env python3
35+
36+import os,sys
37+
38+if os.environ['MOZ_CARGO_WRAP_HOST_LD'].strip():
39+ binary=os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]
40+else:
41+ sys.exit(0)
42+
43+if os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS'].strip():
44+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
45+ 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:]
46+ else:
47+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + [os.environ['MOZ_CARGO_WRAP_HOST_LDFLAGS']] + sys.argv[1:]
48+else:
49+ if os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:]:
50+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[1:] + sys.argv[1:]
51+ else:
52+ args=[os.environ['MOZ_CARGO_WRAP_HOST_LD'].split()[0]] + sys.argv[1:]
53+
54+os.execvp(binary, args)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0001-util.configure-fix-one-occasionally-reproduced-confi.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-util.configure-fix-one-occasionally-reproduced-confi.patch
new file mode 100644
index 0000000000..4921a9028c
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0001-util.configure-fix-one-occasionally-reproduced-confi.patch
@@ -0,0 +1,48 @@
1From 0d28cd65efe14022e1d645db71dec74f11ab2ae8 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---
33 build/moz.configure/util.configure | 2 +-
34 1 file changed, 1 insertion(+), 1 deletion(-)
35
36diff --git a/build/moz.configure/util.configure b/build/moz.configure/util.configure
37index f5ff3acd79..44f69deceb 100644
38--- a/build/moz.configure/util.configure
39+++ b/build/moz.configure/util.configure
40@@ -254,7 +254,7 @@ def try_invoke_compiler(
41 "C++": ".cpp",
42 }[language]
43
44- fd, path = mkstemp(prefix="conftest.", suffix=suffix, text=True)
45+ fd, path = mkstemp(prefix="try_invoke_compiler_conftest.", suffix=suffix, text=True)
46 try:
47 source = source.encode("ascii", "replace")
48
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0002-moz.configure-do-not-look-for-llvm-objdump.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0002-moz.configure-do-not-look-for-llvm-objdump.patch
new file mode 100644
index 0000000000..4c69155a68
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0002-moz.configure-do-not-look-for-llvm-objdump.patch
@@ -0,0 +1,44 @@
1From 49cb509abd309e3b74ef4c872ae773f18dabca19 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---
13 moz.configure | 18 +++++++++---------
14 1 file changed, 9 insertions(+), 9 deletions(-)
15
16diff --git a/moz.configure b/moz.configure
17index 3a9461200d..33b3f49b0c 100755
18--- a/moz.configure
19+++ b/moz.configure
20@@ -723,15 +723,15 @@ check_prog(
21 )
22
23
24-llvm_objdump = check_prog(
25- "LLVM_OBJDUMP",
26- llvm_tool("llvm-objdump"),
27- what="llvm-objdump",
28- when="--enable-compile-environment",
29- paths=clang_search_path,
30-)
31-
32-add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
33+#llvm_objdump = check_prog(
34+# "LLVM_OBJDUMP",
35+# llvm_tool("llvm-objdump"),
36+# what="llvm-objdump",
37+# when="--enable-compile-environment",
38+# paths=clang_search_path,
39+#)
40+#
41+#add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
42
43
44 def validate_readelf(path):
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch
new file mode 100644
index 0000000000..0f9d062205
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0003-rust.configure-do-not-try-to-find-a-suitable-upstrea.patch
@@ -0,0 +1,66 @@
1From ac6a3711917ff3f2b64662cbf4681c22a09da403 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---
12 build/moz.configure/rust.configure | 34 ++----------------------------
13 1 file changed, 2 insertions(+), 32 deletions(-)
14
15diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
16index 7a2fd1ae70..e11f13b253 100644
17--- a/build/moz.configure/rust.configure
18+++ b/build/moz.configure/rust.configure
19@@ -486,33 +486,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
20 def rust_host_triple(
21 rustc, host, compiler_info, rustc_host, rust_supported_targets, arm_target
22 ):
23- rustc_target = detect_rustc_target(
24- host, compiler_info, arm_target, rust_supported_targets
25- )
26- if rustc_target != rustc_host:
27- if host.alias == rustc_target:
28- configure_host = host.alias
29- else:
30- configure_host = "{}/{}".format(host.alias, rustc_target)
31- die(
32- dedent(
33- """\
34- The rust compiler host ({rustc}) is not suitable for the configure host ({configure}).
35-
36- You can solve this by:
37- * Set your configure host to match the rust compiler host by editing your
38- mozconfig and adding "ac_add_options --host={rustc}".
39- * Or, install the rust toolchain for {configure}, if supported, by running
40- "rustup default stable-{rustc_target}"
41- """.format(
42- rustc=rustc_host,
43- configure=configure_host,
44- rustc_target=rustc_target,
45- )
46- )
47- )
48- assert_rust_compile(host, rustc_target, rustc)
49- return rustc_target
50+ return rustc_host
51
52
53 @depends(
54@@ -522,11 +496,7 @@ def rust_host_triple(
55 def rust_target_triple(
56 rustc, target, compiler_info, rust_supported_targets, arm_target
57 ):
58- rustc_target = detect_rustc_target(
59- target, compiler_info, arm_target, rust_supported_targets
60- )
61- assert_rust_compile(target, rustc_target, rustc)
62- return rustc_target
63+ return target.alias
64
65
66 set_config("RUST_TARGET", rust_target_triple)
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/0004-use-asm-sgidefs.h.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/0004-use-asm-sgidefs.h.patch
new file mode 100644
index 0000000000..6443d46b2c
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/0004-use-asm-sgidefs.h.patch
@@ -0,0 +1,38 @@
1From 607aa4d822b0e074ae1b2fc16d7c140c3e889680 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---
23 mfbt/RandomNum.cpp | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/mfbt/RandomNum.cpp b/mfbt/RandomNum.cpp
27index 96de5d4055..2cfb2e10ee 100644
28--- a/mfbt/RandomNum.cpp
29+++ b/mfbt/RandomNum.cpp
30@@ -53,7 +53,7 @@ extern "C" BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer,
31 # elif defined(__s390__)
32 # define GETRANDOM_NR 349
33 # elif defined(__mips__)
34-# include <sgidefs.h>
35+# include <asm/sgidefs.h>
36 # if _MIPS_SIM == _MIPS_SIM_ABI32
37 # define GETRANDOM_NR 4353
38 # elif _MIPS_SIM == _MIPS_SIM_ABI64
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/fix-musl-build.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/fix-musl-build.patch
new file mode 100644
index 0000000000..d2b87e8033
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/fix-musl-build.patch
@@ -0,0 +1,27 @@
1From e4d8016d0dc56b02e22898d83aad9f80a94d1c3c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 20 Oct 2021 16:21:14 -0700
4Subject: [PATCH] mozjs: Fix musl miscompiles with HAVE_THREAD_TLS_KEYWORD
5
6Upstream: No
7Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD:
8https://github.com/void-linux/void-packages/issues/2598
9
10---
11 js/src/old-configure.in | 3 +++
12 1 file changed, 3 insertions(+)
13
14diff --git a/js/src/old-configure.in b/js/src/old-configure.in
15index cabd72a2b6..0f08d91cbf 100644
16--- a/js/src/old-configure.in
17+++ b/js/src/old-configure.in
18@@ -807,6 +807,9 @@ if test "$ac_cv_thread_keyword" = yes; then
19 *-android*|*-linuxandroid*)
20 :
21 ;;
22+ *-musl*)
23+ :
24+ ;;
25 *)
26 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
27 ;;
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/musl-disable-stackwalk.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/musl-disable-stackwalk.patch
new file mode 100644
index 0000000000..590cddfe5f
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/musl-disable-stackwalk.patch
@@ -0,0 +1,27 @@
1From 9aae71c6ee73431d2609be0ef74ffd4b22b36c75 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 not assume that its always available on musl, we do need to check for target
6 environment as well which could be musl or glibc.
7
8Upstream-Status: Pending
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
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 307715b170..a8d3cb40c0 100644
17--- a/mozglue/misc/StackWalk.cpp
18+++ b/mozglue/misc/StackWalk.cpp
19@@ -43,7 +43,7 @@ using namespace mozilla;
20 # define MOZ_STACKWALK_SUPPORTS_MACOSX 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 # define MOZ_STACKWALK_SUPPORTS_LINUX 1
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch b/meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch
new file mode 100644
index 0000000000..16f95659e2
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch
@@ -0,0 +1,60 @@
1From d6aff068170e56e6773feba42a463dd8c50bc4ff 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---
10 build/moz.configure/init.configure | 3 +++
11 python/mozbuild/mozbuild/configure/constants.py | 2 ++
12 .../mozbuild/test/configure/test_toolchain_configure.py | 1 +
13 3 files changed, 6 insertions(+)
14
15diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
16index 53bbc4203f..2ac40d3d39 100644
17--- a/build/moz.configure/init.configure
18+++ b/build/moz.configure/init.configure
19@@ -584,6 +584,9 @@ def split_triplet(triplet, allow_wasi=False):
20 elif cpu.startswith("aarch64"):
21 canonical_cpu = "aarch64"
22 endianness = "little"
23+ elif cpu in ("riscv32", "riscv32gc"):
24+ canonical_cpu = "riscv32"
25+ endianness = "little"
26 elif cpu in ("riscv64", "riscv64gc"):
27 canonical_cpu = "riscv64"
28 endianness = "little"
29diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
30index a36152651d..a6050be5d8 100644
31--- a/python/mozbuild/mozbuild/configure/constants.py
32+++ b/python/mozbuild/mozbuild/configure/constants.py
33@@ -51,6 +51,7 @@ CPU_bitness = {
34 "mips64": 64,
35 "ppc": 32,
36 "ppc64": 64,
37+ 'riscv32': 32,
38 "riscv64": 64,
39 "s390": 32,
40 "s390x": 64,
41@@ -98,6 +99,7 @@ CPU_preprocessor_checks = OrderedDict(
42 ("m68k", "__m68k__"),
43 ("mips64", "__mips64"),
44 ("mips32", "__mips__"),
45+ ("riscv32", "__riscv && __riscv_xlen == 32"),
46 ("riscv64", "__riscv && __riscv_xlen == 64"),
47 ("loongarch64", "__loongarch64"),
48 ("sh4", "__sh__"),
49diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
50index c6af3d99d4..7ef02e1a85 100644
51--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
52+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
53@@ -1325,6 +1325,7 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
54 "m68k-unknown-linux-gnu": big_endian + {"__m68k__": 1},
55 "mips64-unknown-linux-gnuabi64": big_endian + {"__mips64": 1, "__mips__": 1},
56 "mips-unknown-linux-gnu": big_endian + {"__mips__": 1},
57+ "riscv32-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 32},
58 "riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64},
59 "sh4-unknown-linux-gnu": little_endian + {"__sh__": 1},
60 }
diff --git a/meta-oe/recipes-extended/mozjs/mozjs-115_115.2.0.bb b/meta-oe/recipes-extended/mozjs/mozjs-115_115.2.0.bb
new file mode 100644
index 0000000000..799b8abd90
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs-115_115.2.0.bb
@@ -0,0 +1,78 @@
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://fix-musl-build.patch \
12 file://riscv32.patch \
13 file://0001-util.configure-fix-one-occasionally-reproduced-confi.patch \
14 file://0001-rewrite-cargo-host-linker-in-python3.patch \
15 file://musl-disable-stackwalk.patch \
16 file://0001-add-arm-to-list-of-mozinline.patch \
17 "
18SRC_URI[sha256sum] = "51534dd2a158d955a2cb67cc1308f100f6c9def0788713ed8b4d743f3ad72457"
19
20S = "${WORKDIR}/firefox-${PV}"
21
22inherit pkgconfig perlnative python3native rust
23
24DEPENDS += "zlib cargo-native python3 icu"
25DEPENDS:remove:mipsarch = "icu"
26DEPENDS:remove:powerpc:toolchain-clang = "icu"
27
28B = "${WORKDIR}/build"
29
30export PYTHONPATH = "${S}/build:${S}/third_party/python/PyYAML/lib3:${S}/testing/mozbase/mozfile:${S}/python/mozboot:${S}/third_party/python/distro:${S}/testing/mozbase/mozinfo:${S}/config:${S}/testing/mozbase/manifestparser:${S}/third_party/python/pytoml:${S}/testing/mozbase/mozprocess:${S}/third_party/python/six:${S}/python/mozbuild:${S}/python/mozbuild/mozbuild:${S}/python/mach:${S}/third_party/python/jsmin:${S}/python/mozversioncontrol"
31
32export HOST_CC = "${BUILD_CC}"
33export HOST_CXX = "${BUILD_CXX}"
34export HOST_CFLAGS = "${BUILD_CFLAGS}"
35export HOST_CPPFLAGS = "${BUILD_CPPFLAGS}"
36export HOST_CXXFLAGS = "${BUILD_CXXFLAGS}"
37
38export AS = "${CC}"
39
40export RUSTFLAGS
41
42JIT ?= ""
43JIT:mipsarch = "--disable-jit"
44ICU ?= "--with-system-icu"
45ICU:mipsarch = ""
46ICU:powerpc:toolchain-clang = ""
47
48do_configure() {
49 cd ${B}
50 python3 ${S}/configure.py \
51 --enable-project=js \
52 --target=${RUST_HOST_SYS} \
53 --host=${BUILD_SYS} \
54 --prefix=${prefix} \
55 --libdir=${libdir} \
56 --disable-jemalloc \
57 --disable-strip \
58 ${JIT} \
59 ${ICU}
60}
61
62do_install() {
63 oe_runmake 'DESTDIR=${D}' install
64}
65
66inherit multilib_script multilib_header
67
68MULTILIB_SCRIPTS += " ${PN}-dev:${bindir}/js102-config"
69
70do_install:append() {
71 oe_multilib_header mozjs-115/js-config.h
72 sed -e 's@${STAGING_DIR_HOST}@@g' \
73 -i ${D}${bindir}/js115-config
74 rm -f ${D}${libdir}/libjs_static.ajs
75}
76
77PACKAGES =+ "lib${BPN}"
78FILES:lib${BPN} += "${libdir}/lib*"