aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2021-10-24 22:32:50 -0700
committerKhem Raj <raj.khem@gmail.com>2021-10-25 08:38:43 -0700
commit7937fa5a8aa2d50b65ce9340b9c0ac0ae2856673 (patch)
tree79b43311db8d51656dc18adfd160eaff6e8329ff
parent4e1eb06fb121cbddcdd9eb3f534e70f32274afa9 (diff)
downloadmeta-openembedded-contrib-7937fa5a8aa2d50b65ce9340b9c0ac0ae2856673.tar.gz
meta-openembedded-contrib-7937fa5a8aa2d50b65ce9340b9c0ac0ae2856673.tar.bz2
meta-openembedded-contrib-7937fa5a8aa2d50b65ce9340b9c0ac0ae2856673.zip
mozjs: Add riscv32 support
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch55
-rw-r--r--meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.1.0.bb2
2 files changed, 57 insertions, 0 deletions
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch
new file mode 100644
index 0000000000..1f1f93987a
--- /dev/null
+++ b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/riscv32.patch
@@ -0,0 +1,55 @@
+Add RISCV32 support
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+--- a/build/moz.configure/init.configure
++++ b/build/moz.configure/init.configure
+@@ -765,6 +765,9 @@ def split_triplet(triplet, allow_msvc=Fa
+ elif cpu.startswith("aarch64"):
+ canonical_cpu = "aarch64"
+ endianness = "little"
++ elif cpu in ("riscv32", "riscv32gc"):
++ canonical_cpu = "riscv32"
++ endianness = "little"
+ elif cpu in ("riscv64", "riscv64gc"):
+ canonical_cpu = "riscv64"
+ endianness = "little"
+--- a/python/mozbuild/mozbuild/configure/constants.py
++++ b/python/mozbuild/mozbuild/configure/constants.py
+@@ -52,6 +52,7 @@ CPU_bitness = {
+ "mips64": 64,
+ "ppc": 32,
+ "ppc64": 64,
++ 'riscv32': 32,
+ "riscv64": 64,
+ "s390": 32,
+ "s390x": 64,
+@@ -94,6 +95,7 @@ CPU_preprocessor_checks = OrderedDict(
+ ("m68k", "__m68k__"),
+ ("mips64", "__mips64"),
+ ("mips32", "__mips__"),
++ ("riscv32", "__riscv && __riscv_xlen == 32"),
+ ("riscv64", "__riscv && __riscv_xlen == 64"),
+ ("sh4", "__sh__"),
+ ("wasm32", "__wasm32__"),
+--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
++++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py
+@@ -1186,6 +1186,7 @@ class LinuxCrossCompileToolchainTest(Bas
+ "m68k-unknown-linux-gnu": big_endian + {"__m68k__": 1},
+ "mips64-unknown-linux-gnuabi64": big_endian + {"__mips64": 1, "__mips__": 1},
+ "mips-unknown-linux-gnu": big_endian + {"__mips__": 1},
++ "riscv32-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 32},
+ "riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64},
+ "sh4-unknown-linux-gnu": little_endian + {"__sh__": 1},
+ }
+--- a/js/src/wasm/WasmFrame.h
++++ b/js/src/wasm/WasmFrame.h
+@@ -230,6 +230,7 @@ class DebugFrame {
+ // Avoid -Wunused-private-field warnings.
+ protected:
+ #if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \
++ (defined(JS_CODEGEN_NONE) && defined(__riscv) && __riscv_xlen == 32) || \
+ defined(JS_CODEGEN_X86) || defined(__wasi__)
+ // See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only
+ // 4-byte aligned, so we add another word to get up to 8-byte
diff --git a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.1.0.bb b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.1.0.bb
index 57bedaa70a..ff0d7bd6ab 100644
--- a/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.1.0.bb
+++ b/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs_91.1.0.bb
@@ -10,6 +10,7 @@ SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/fire
file://0004-use-asm-sgidefs.h.patch \
file://fix-musl-build.patch \
file://0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch \
+ file://riscv32.patch \
"
SRC_URI[sha256sum] = "3b913d6a52c95a8986123c98543f1273812a2d59f2891b4b1c604e35f4580766"
@@ -36,6 +37,7 @@ export RUSTFLAGS
JIT ?= ""
JIT:mipsarch = "--disable-jit"
+JIT:riscv32 = "--disable-jit"
do_configure() {
cd ${B}