diff options
| author | Ricardo Salveti <ricardo@foundries.io> | 2018-08-01 00:06:13 -0300 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2018-08-02 11:23:03 -0700 |
| commit | 2585bc07eecb6617fd3abe6c9b8cf913074a2847 (patch) | |
| tree | e53d0066562ba2b8a91b48a54e78d4eeab67a9d5 | |
| parent | 2694423f1c82a59df4e3f462e5cfee63b0d19c1e (diff) | |
| download | meta-openembedded-2585bc07eecb6617fd3abe6c9b8cf913074a2847.tar.gz | |
mozjs: add support for RISC-V
Based on pending patch that was already submitted at
https://bugzilla.mozilla.org/show_bug.cgi?id=1318905.
Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs/add-riscv-support.patch | 70 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb | 1 |
2 files changed, 71 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/mozjs/mozjs/add-riscv-support.patch b/meta-oe/recipes-extended/mozjs/mozjs/add-riscv-support.patch new file mode 100644 index 0000000000..4354a9dee6 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/add-riscv-support.patch | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | Add RISC-V support | ||
| 2 | |||
| 3 | Upstream-Status: Submitted [https://bugzilla.mozilla.org/show_bug.cgi?id=1318905] | ||
| 4 | |||
| 5 | Signed-off-by: Ricardo Salveti <ricardo@foundries.io> | ||
| 6 | |||
| 7 | diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess | ||
| 8 | index d5d667d..1277a86 100755 | ||
| 9 | --- a/build/autoconf/config.guess | ||
| 10 | +++ b/build/autoconf/config.guess | ||
| 11 | @@ -1029,6 +1029,9 @@ EOF | ||
| 12 | ppcle:Linux:*:*) | ||
| 13 | echo powerpcle-unknown-linux-${LIBC} | ||
| 14 | exit ;; | ||
| 15 | + riscv32:Linux:*:* | riscv64:Linux:*:*) | ||
| 16 | + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} | ||
| 17 | + exit ;; | ||
| 18 | s390:Linux:*:* | s390x:Linux:*:*) | ||
| 19 | echo ${UNAME_MACHINE}-ibm-linux-${LIBC} | ||
| 20 | exit ;; | ||
| 21 | diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure | ||
| 22 | index 6fe6591..56e6730 100644 | ||
| 23 | --- a/build/moz.configure/init.configure | ||
| 24 | +++ b/build/moz.configure/init.configure | ||
| 25 | @@ -362,6 +362,9 @@ def split_triplet(triplet): | ||
| 26 | elif cpu.startswith('aarch64'): | ||
| 27 | canonical_cpu = 'aarch64' | ||
| 28 | endianness = 'little' | ||
| 29 | + elif cpu in ('riscv32', 'riscv64'): | ||
| 30 | + canonical_cpu = cpu | ||
| 31 | + endianness = 'little' | ||
| 32 | else: | ||
| 33 | die('Unknown CPU type: %s' % cpu) | ||
| 34 | |||
| 35 | diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h | ||
| 36 | index 15dd4bf..4f37218 100644 | ||
| 37 | --- a/mfbt/double-conversion/utils.h | ||
| 38 | +++ b/mfbt/double-conversion/utils.h | ||
| 39 | @@ -60,7 +60,8 @@ | ||
| 40 | defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ | ||
| 41 | defined(__SH4__) || defined(__alpha__) || \ | ||
| 42 | defined(_MIPS_ARCH_MIPS32R2) || \ | ||
| 43 | - defined(__AARCH64EL__) || defined(__aarch64__) | ||
| 44 | + defined(__AARCH64EL__) || defined(__aarch64__) || \ | ||
| 45 | + defined(__riscv) | ||
| 46 | #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 | ||
| 47 | #elif defined(_M_IX86) || defined(__i386__) || defined(__i386) | ||
| 48 | #if defined(_WIN32) | ||
| 49 | diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py | ||
| 50 | index dfc7cf8..4f8d666 100644 | ||
| 51 | --- a/python/mozbuild/mozbuild/configure/constants.py | ||
| 52 | +++ b/python/mozbuild/mozbuild/configure/constants.py | ||
| 53 | @@ -48,6 +48,8 @@ CPU_bitness = { | ||
| 54 | 'mips64': 64, | ||
| 55 | 'ppc': 32, | ||
| 56 | 'ppc64': 64, | ||
| 57 | + 'riscv32': 32, | ||
| 58 | + 'riscv64': 64, | ||
| 59 | 's390': 32, | ||
| 60 | 's390x': 64, | ||
| 61 | 'sparc': 32, | ||
| 62 | @@ -79,6 +81,8 @@ CPU_preprocessor_checks = OrderedDict(( | ||
| 63 | ('s390', '__s390__'), | ||
| 64 | ('ppc64', '__powerpc64__'), | ||
| 65 | ('ppc', '__powerpc__'), | ||
| 66 | + ('riscv32', '__riscv && __SIZEOF_POINTER__ == 4'), | ||
| 67 | + ('riscv64', '__riscv && __SIZEOF_POINTER__ == 8'), | ||
| 68 | ('Alpha', '__alpha__'), | ||
| 69 | ('hppa', '__hppa__'), | ||
| 70 | ('sparc64', '__sparc__ && __arch64__'), | ||
diff --git a/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb b/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb index da80b63c5f..2891771823 100644 --- a/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb +++ b/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb | |||
| @@ -12,6 +12,7 @@ SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.8.1.o | |||
| 12 | file://0004-do-not-use-autoconf-2.13-to-refresh-old.configure.patch \ | 12 | file://0004-do-not-use-autoconf-2.13-to-refresh-old.configure.patch \ |
| 13 | file://0005-fix-do_compile-failed-on-mips.patch \ | 13 | file://0005-fix-do_compile-failed-on-mips.patch \ |
| 14 | file://disable-mozglue-in-stand-alone-builds.patch \ | 14 | file://disable-mozglue-in-stand-alone-builds.patch \ |
| 15 | file://add-riscv-support.patch \ | ||
| 15 | " | 16 | " |
| 16 | SRC_URI_append_libc-musl = " \ | 17 | SRC_URI_append_libc-musl = " \ |
| 17 | file://0006-support-musl.patch \ | 18 | file://0006-support-musl.patch \ |
