summaryrefslogtreecommitdiffstats
path: root/bsp/meta-synopsys/recipes-extended/mozjs/mozjs/0001-Add-ARC-CPU-support.patch
blob: e0ccee2a086210824eed31daad3d6f843ae8e23e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
From e1a1c4b3daa5fdddae579405f32989156ff9db92 Mon Sep 17 00:00:00 2001
From: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
Date: Tue, 26 Mar 2019 10:24:17 +0300
Subject: [PATCH] Add ARC support

Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>
---
 build/autoconf/config.guess                     | 3 +++
 build/moz.configure/init.configure              | 3 +++
 mfbt/double-conversion/utils.h                  | 2 +-
 python/mozbuild/mozbuild/configure/constants.py | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess
index 1277a862..e3c40ec7 100755
--- a/build/autoconf/config.guess
+++ b/build/autoconf/config.guess
@@ -1032,6 +1032,9 @@ EOF
     riscv32:Linux:*:* | riscv64:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
+    arc:Linux:*:*)
+        echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
index 56e6730f..85a944c9 100644
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -365,6 +365,9 @@ def split_triplet(triplet):
     elif cpu in ('riscv32', 'riscv64'):
         canonical_cpu = cpu
         endianness = 'little'
+    elif cpu in ('arc'):
+        canonical_cpu = 'arc'
+        endianness = 'little'
     else:
         die('Unknown CPU type: %s' % cpu)
 
diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
index 4f372180..c0680791 100644
--- a/mfbt/double-conversion/utils.h
+++ b/mfbt/double-conversion/utils.h
@@ -61,7 +61,7 @@
     defined(__SH4__) || defined(__alpha__) || \
     defined(_MIPS_ARCH_MIPS32R2) || \
     defined(__AARCH64EL__) || defined(__aarch64__) || \
-    defined(__riscv)
+    defined(__riscv) || defined(__arc__)
 #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #if defined(_WIN32)
diff --git a/python/mozbuild/mozbuild/configure/constants.py b/python/mozbuild/mozbuild/configure/constants.py
index 4f8d6666..3cef1f50 100644
--- a/python/mozbuild/mozbuild/configure/constants.py
+++ b/python/mozbuild/mozbuild/configure/constants.py
@@ -50,6 +50,7 @@ CPU_bitness = {
     'ppc64': 64,
     'riscv32': 32,
     'riscv64': 64,
+    'arc': 32,
     's390': 32,
     's390x': 64,
     'sparc': 32,
@@ -83,6 +84,7 @@ CPU_preprocessor_checks = OrderedDict((
     ('ppc', '__powerpc__'),
     ('riscv32', '__riscv && __SIZEOF_POINTER__ == 4'),
     ('riscv64', '__riscv && __SIZEOF_POINTER__ == 8'),
+    ('arc', '__arc__'),
     ('Alpha', '__alpha__'),
     ('hppa', '__hppa__'),
     ('sparc64', '__sparc__ && __arch64__'),
-- 
2.16.2