diff options
Diffstat (limited to 'meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch')
-rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs-128/riscv32.patch | 59 |
1 files changed, 59 insertions, 0 deletions
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 @@ | |||
1 | From 0cc41bc953974d4852b263708bf8d12f823ca8ad Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 24 Oct 2021 22:32:50 -0700 | ||
4 | Subject: [PATCH] Add RISCV32 support | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-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 | |||
14 | diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure | ||
15 | index 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" | ||
28 | diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py | ||
29 | index 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__"), | ||
48 | diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | ||
49 | index 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 | } | ||