summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-07-20 22:14:37 +0800
committerKhem Raj <raj.khem@gmail.com>2018-07-20 16:14:22 -0700
commit0aff7abedc1c7727c88029a123107f4faf5ba4f1 (patch)
tree57973f350de6b5699a32f723bbc66005c1637c5d /meta-oe
parentda59f864945681521ea313de8b483f7593018948 (diff)
downloadmeta-openembedded-0aff7abedc1c7727c88029a123107f4faf5ba4f1.tar.gz
mozjs: add support for mips64-n32
- Tweak configure for mips64-n32 - Disable gold linker which not supported by mips64-n32 - Since n32 and n64 use the same registers, add n32 to n64's register definition. Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch79
-rw-r--r--meta-oe/recipes-extended/mozjs/mozjs_52.8.1.bb7
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 000000000..bc1af3c70
--- /dev/null
+++ b/meta-oe/recipes-extended/mozjs/mozjs/0001-fix-compiling-failure-on-mips64-n32-bsp.patch
@@ -0,0 +1,79 @@
1From 5ad700c92224193bfc789f7d53af38fc6f8b8904 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 19 Jul 2018 17:31:35 +0800
4Subject: [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
16Upstream-Status: Inappropriate [oe specific]
17
18Signed-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
25diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
26index 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'
41diff --git a/js/src/jit/mips-shared/Architecture-mips-shared.h b/js/src/jit/mips-shared/Architecture-mips-shared.h
42index 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,
63diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
64index 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--
782.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 790960282..599681215 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
15SRC_URI_append_libc-musl = " \ 15SRC_URI_append_libc-musl = " \
16 file://0006-support-musl.patch \ 16 file://0006-support-musl.patch \
17 " 17 "
18SRC_URI_append_mipsarchn32 = " \
19 file://0001-fix-compiling-failure-on-mips64-n32-bsp.patch \
20 "
18 21
19SRC_URI[md5sum] = "3a44c2fd3d7b5a370ed9184163c74bc4" 22SRC_URI[md5sum] = "3a44c2fd3d7b5a370ed9184163c74bc4"
20SRC_URI[sha256sum] = "fb5e11b7f31a33be820d5c947c5fa114751b0d5033778c1cd8e0cf2dad91e8fa" 23SRC_URI[sha256sum] = "fb5e11b7f31a33be820d5c947c5fa114751b0d5033778c1cd8e0cf2dad91e8fa"
21 24
22inherit autotools pkgconfig perlnative pythonnative 25inherit autotools pkgconfig perlnative pythonnative
23 26
27inherit distro_features_check
28CONFLICT_DISTRO_FEATURES_mipsarchn32 = "ld-is-gold"
29
24DEPENDS += "nspr zlib" 30DEPENDS += "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
36PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" 43PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}"