summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-support/nspr/files/fix-build-on-aarch64.patch101
-rw-r--r--meta/recipes-support/nspr/nspr_4.9.4.bb1
2 files changed, 102 insertions, 0 deletions
diff --git a/meta/recipes-support/nspr/files/fix-build-on-aarch64.patch b/meta/recipes-support/nspr/files/fix-build-on-aarch64.patch
new file mode 100644
index 0000000000..ccad0a1a14
--- /dev/null
+++ b/meta/recipes-support/nspr/files/fix-build-on-aarch64.patch
@@ -0,0 +1,101 @@
1Add Aarch64 support
2
3Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
4
5Upstream-Status: Submitted https://bugzilla.mozilla.org/show_bug.cgi?id=827271
6---
7 configure.in | 12 ++++++------
8 1 files changed, 6 insertions(+), 6 deletions(-)
9--- a/pr/include/md/_linux.cfg
10+++ b/pr/include/md/_linux.cfg
11@@ -861,6 +861,59 @@
12 #define PR_BYTES_PER_WORD_LOG2 2
13 #define PR_BYTES_PER_DWORD_LOG2 3
14
15+#elif defined(__aarch64__)
16+
17+#ifdef __AARCH64EB__
18+#undef IS_LITTLE_ENDIAN
19+#define IS_BIG_ENDIAN 1
20+#elif defined(__AARCH64EL__)
21+#define IS_LITTLE_ENDIAN 1
22+#undef IS_BIG_ENDIAN
23+#else
24+#error "Unknown Aarch64 endianness."
25+#endif
26+#define IS_64
27+
28+#define PR_BYTES_PER_BYTE 1
29+#define PR_BYTES_PER_SHORT 2
30+#define PR_BYTES_PER_INT 4
31+#define PR_BYTES_PER_INT64 8
32+#define PR_BYTES_PER_LONG 8
33+#define PR_BYTES_PER_FLOAT 4
34+#define PR_BYTES_PER_DOUBLE 8
35+#define PR_BYTES_PER_WORD 8
36+#define PR_BYTES_PER_DWORD 8
37+
38+#define PR_BITS_PER_BYTE 8
39+#define PR_BITS_PER_SHORT 16
40+#define PR_BITS_PER_INT 32
41+#define PR_BITS_PER_INT64 64
42+#define PR_BITS_PER_LONG 64
43+#define PR_BITS_PER_FLOAT 32
44+#define PR_BITS_PER_DOUBLE 64
45+#define PR_BITS_PER_WORD 64
46+
47+#define PR_BITS_PER_BYTE_LOG2 3
48+#define PR_BITS_PER_SHORT_LOG2 4
49+#define PR_BITS_PER_INT_LOG2 5
50+#define PR_BITS_PER_INT64_LOG2 6
51+#define PR_BITS_PER_LONG_LOG2 6
52+#define PR_BITS_PER_FLOAT_LOG2 5
53+#define PR_BITS_PER_DOUBLE_LOG2 6
54+#define PR_BITS_PER_WORD_LOG2 6
55+
56+#define PR_ALIGN_OF_SHORT 2
57+#define PR_ALIGN_OF_INT 4
58+#define PR_ALIGN_OF_LONG 8
59+#define PR_ALIGN_OF_INT64 8
60+#define PR_ALIGN_OF_FLOAT 4
61+#define PR_ALIGN_OF_DOUBLE 8
62+#define PR_ALIGN_OF_POINTER 8
63+#define PR_ALIGN_OF_WORD 8
64+
65+#define PR_BYTES_PER_WORD_LOG2 3
66+#define PR_BYTES_PER_DWORD_LOG2 3
67+
68 #else
69
70 #error "Unknown CPU architecture"
71--- a/pr/include/md/_linux.h
72+++ b/pr/include/md/_linux.h
73@@ -53,6 +53,8 @@
74 #define _PR_SI_ARCHITECTURE "avr32"
75 #elif defined(__m32r__)
76 #define _PR_SI_ARCHITECTURE "m32r"
77+#elif defined(__aarch64__)
78+#define _PR_SI_ARCHITECTURE "aarch64"
79 #else
80 #error "Unknown CPU architecture"
81 #endif
82@@ -186,7 +188,7 @@
83 })
84 #endif
85
86-#if defined(__arm__)
87+#if defined(__arm__) || defined(__aarch64__)
88 #if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
89 /* Use GCC built-in functions */
90 #define _PR_HAVE_ATOMIC_OPS
91@@ -242,6 +244,10 @@
92 #endif
93 #endif /* __arm__ */
94
95+#if defined(__aarch64__)
96+#define _MD_MINIMUM_STACK_SIZE 0x20000
97+#endif
98+
99 #define USE_SETJMP
100 #if (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(ANDROID)
101 #define _PR_POLL_AVAILABLE
diff --git a/meta/recipes-support/nspr/nspr_4.9.4.bb b/meta/recipes-support/nspr/nspr_4.9.4.bb
index 36f93e0d9f..accfda7004 100644
--- a/meta/recipes-support/nspr/nspr_4.9.4.bb
+++ b/meta/recipes-support/nspr/nspr_4.9.4.bb
@@ -11,6 +11,7 @@ SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-$
11 file://remove-rpath-from-tests.patch \ 11 file://remove-rpath-from-tests.patch \
12 file://fix-build-on-x86_64.patch \ 12 file://fix-build-on-x86_64.patch \
13 file://trickly-fix-build-on-x86_64.patch \ 13 file://trickly-fix-build-on-x86_64.patch \
14 file://fix-build-on-aarch64.patch \
14 " 15 "
15 16
16SRC_URI += "file://nspr.pc.in" 17SRC_URI += "file://nspr.pc.in"