diff options
Diffstat (limited to 'meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch')
| -rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs-115/riscv32.patch | 60 |
1 files changed, 60 insertions, 0 deletions
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 @@ | |||
| 1 | From d6aff068170e56e6773feba42a463dd8c50bc4ff 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 | --- | ||
| 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 | |||
| 15 | diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure | ||
| 16 | index 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" | ||
| 29 | diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py | ||
| 30 | index 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__"), | ||
| 49 | diff --git a/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py b/python/mozbuild/mozbuild/test/configure/test_toolchain_configure.py | ||
| 50 | index 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 | } | ||
