diff options
| -rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch | 79 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb | 7 |
2 files changed, 86 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch b/meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch new file mode 100644 index 0000000000..bc1af3c702 --- /dev/null +++ b/meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch | |||
| @@ -0,0 +1,79 @@ | |||
| 1 | From 5ad700c92224193bfc789f7d53af38fc6f8b8904 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Thu, 19 Jul 2018 17:31:35 +0800 | ||
| 4 | Subject: [PATCH] fix compiling failure on mips64-n32 bsp | ||
| 5 | |||
| 6 | - Tweak mips64-n32 with mips32 | ||
| 7 | |||
| 8 | - The toolchain of mips64-n32 supports both of macro | ||
| 9 | `__mips64' and `__mips__', but 32bit is required here. | ||
| 10 | |||
| 11 | - N32 uses 64-bit registers but restricts addresses to 32 bits. | ||
| 12 | https://www.linux-mips.org/pub/linux/mips/doc/ABI/MIPS-N32-ABI-Handbook.pdf | ||
| 13 | Table 2-1 specifies the use of registers in n32 and native 64-bit mode. | ||
| 14 | From the table, N32 and N64 have the same registers | ||
| 15 | |||
| 16 | Upstream-Status: Inappropriate [oe specific] | ||
| 17 | |||
| 18 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 19 | --- | ||
| 20 | build/moz.configure/init.configure | 5 ++++- | ||
| 21 | js/src/jit/mips-shared/Architecture-mips-shared.h | 4 +++- | ||
| 22 | python/mozbuild/mozbuild/configure/constants.py | 2 +- | ||
| 23 | 3 files changed, 8 insertions(+), 3 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure | ||
| 26 | index 6fe6591..a77b46c 100644 | ||
| 27 | --- a/build/moz.configure/init.configure | ||
| 28 | +++ b/build/moz.configure/init.configure | ||
| 29 | @@ -357,7 +357,10 @@ def split_triplet(triplet): | ||
| 30 | canonical_cpu = 'mips32' | ||
| 31 | endianness = 'little' if 'el' in cpu else 'big' | ||
| 32 | elif cpu in ('mips64', 'mips64el'): | ||
| 33 | - canonical_cpu = 'mips64' | ||
| 34 | + if 'n32' in triplet: | ||
| 35 | + canonical_cpu = 'mips32' | ||
| 36 | + else: | ||
| 37 | + canonical_cpu = 'mips64' | ||
| 38 | endianness = 'little' if 'el' in cpu else 'big' | ||
| 39 | elif cpu.startswith('aarch64'): | ||
| 40 | canonical_cpu = 'aarch64' | ||
| 41 | diff --git a/js/src/jit/mips-shared/Architecture-mips-shared.h b/js/src/jit/mips-shared/Architecture-mips-shared.h | ||
| 42 | index 7afe305..c6e29dc 100644 | ||
| 43 | --- a/js/src/jit/mips-shared/Architecture-mips-shared.h | ||
| 44 | +++ b/js/src/jit/mips-shared/Architecture-mips-shared.h | ||
| 45 | @@ -24,6 +24,8 @@ | ||
| 46 | #define USES_O32_ABI | ||
| 47 | #elif (defined(_MIPS_SIM) && (_MIPS_SIM == _ABI64)) || defined(JS_SIMULATOR_MIPS64) | ||
| 48 | #define USES_N64_ABI | ||
| 49 | +#elif (defined(_MIPS_SIM) && (_MIPS_SIM == _ABIN32)) | ||
| 50 | +#define USES_N32_ABI | ||
| 51 | #else | ||
| 52 | #error "Unsupported ABI" | ||
| 53 | #endif | ||
| 54 | @@ -91,7 +93,7 @@ class Registers | ||
| 55 | ta1 = t5, | ||
| 56 | ta2 = t6, | ||
| 57 | ta3 = t7, | ||
| 58 | -#elif defined(USES_N64_ABI) | ||
| 59 | +#elif defined(USES_N64_ABI) || defined(USES_N32_ABI) | ||
| 60 | a4 = r8, | ||
| 61 | a5 = r9, | ||
| 62 | a6 = r10, | ||
| 63 | diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py | ||
| 64 | index dfc7cf8..27f83ab 100644 | ||
| 65 | --- a/python/mozbuild/mozbuild/configure/constants.py | ||
| 66 | +++ b/python/mozbuild/mozbuild/configure/constants.py | ||
| 67 | @@ -83,8 +83,8 @@ CPU_preprocessor_checks = OrderedDict(( | ||
| 68 | ('hppa', '__hppa__'), | ||
| 69 | ('sparc64', '__sparc__ && __arch64__'), | ||
| 70 | ('sparc', '__sparc__'), | ||
| 71 | - ('mips64', '__mips64'), | ||
| 72 | ('mips32', '__mips__'), | ||
| 73 | + ('mips64', '__mips64'), | ||
| 74 | )) | ||
| 75 | |||
| 76 | assert sorted(CPU_preprocessor_checks.keys()) == sorted(CPU.POSSIBLE_VALUES) | ||
| 77 | -- | ||
| 78 | 2.7.4 | ||
| 79 | |||
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 7909602825..599681215b 100644 --- a/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb +++ b/meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb | |||
| @@ -15,12 +15,18 @@ SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/m/mozjs52/mozjs52_52.8.1.o | |||
| 15 | SRC_URI_append_libc-musl = " \ | 15 | SRC_URI_append_libc-musl = " \ |
| 16 | file://0006-support-musl.patch \ | 16 | file://0006-support-musl.patch \ |
| 17 | " | 17 | " |
| 18 | SRC_URI_append_mipsarchn32 = " \ | ||
| 19 | file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \ | ||
| 20 | " | ||
| 18 | 21 | ||
| 19 | SRC_URI[md5sum] = "3a44c2fd3d7b5a370ed9184163c74bc4" | 22 | SRC_URI[md5sum] = "3a44c2fd3d7b5a370ed9184163c74bc4" |
| 20 | SRC_URI[sha256sum] = "fb5e11b7f31a33be820d5c947c5fa114751b0d5033778c1cd8e0cf2dad91e8fa" | 23 | SRC_URI[sha256sum] = "fb5e11b7f31a33be820d5c947c5fa114751b0d5033778c1cd8e0cf2dad91e8fa" |
| 21 | 24 | ||
| 22 | inherit autotools pkgconfig perlnative pythonnative | 25 | inherit autotools pkgconfig perlnative pythonnative |
| 23 | 26 | ||
| 27 | inherit distro_features_check | ||
| 28 | CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold" | ||
| 29 | |||
| 24 | DEPENDS += "nspr zlib" | 30 | DEPENDS += "nspr zlib" |
| 25 | 31 | ||
| 26 | # nspr's package-config is ignored so set libs manually | 32 | # nspr's package-config is ignored so set libs manually |
| @@ -31,6 +37,7 @@ EXTRA_OECONF = " \ | |||
| 31 | --libdir=${libdir} \ | 37 | --libdir=${libdir} \ |
| 32 | --disable-tests \ | 38 | --disable-tests \ |
| 33 | --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \ | 39 | --with-nspr-libs='-lplds4 -lplc4 -lnspr4' \ |
| 40 | ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', "--enable-gold", '--disable-gold', d)} \ | ||
| 34 | " | 41 | " |
| 35 | 42 | ||
| 36 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" | 43 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" |
