Package: icedove / 1:52.3.0-4~deb8u2

porting-sparc64/Add-sparc64-support-to-Thunderbird.patch Patch series | download
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Date: Fri, 2 Jun 2017 21:21:44 -0400
Subject: Add sparc64 support to Thunderbird

Bug-Debian: https://bugs.debian.org/859151

This is a squashed commit of the following patches cherry-picked from Firefox
upstream to add sparc64 support:
 - a73e3b7ea901f648ae7e1c4b41d77c45786bff0b
   Bug 1275204 - protobuf: Sync sparc64 pre-processor defines from upstream. r=fitzgen
 - 9fd9034ad9de26cc0cb0c70f9307d501823a79d9
   Bug 1275204 - media:webrtc: Use better pre-processor defines for sparc64. r=jesup
 - 87f559a4d89164c402d0f22b1ff7b8a686ececfd
   Bug 1275204 - js: Use the arm64 allocator on Linux/sparc64. r=ehoogeveen
 - ef8c81a9852551bb4428850687b41f7fb6137a45
   Bug 1275204 - js: Use better pre-processor defines for sparc64. r=glandium
 - 120b9c868b2155c29eb5d18603a04f21620328af
   Bug 1275204 - ipc:chromium: Use better pre-processor defines for sparc64. r=froydnj
 - fde7f4bca8db23193ba04459aef21875f4602aa9
   Bug 1275204 - Use OpenBSD/sparc64 xptcall stubs on Linux/sparc64. r=froydnj
---
 mozilla/ipc/chromium/src/build/build_config.h               |  2 +-
 mozilla/js/src/gc/Memory.cpp                                |  8 +++++---
 mozilla/js/src/jsapi-tests/testGCAllocator.cpp              |  8 +++++---
 mozilla/media/webrtc/trunk/build/build_config.h             |  2 +-
 mozilla/media/webrtc/trunk/webrtc/typedefs.h                |  2 +-
 mozilla/toolkit/components/protobuf/m-c-changes.patch       | 13 +++++++++++++
 .../protobuf/src/google/protobuf/stubs/platform_macros.h    |  2 +-
 mozilla/xpcom/reflect/xptcall/md/unix/moz.build             |  4 ++--
 8 files changed, 29 insertions(+), 12 deletions(-)

diff --git a/mozilla/ipc/chromium/src/build/build_config.h b/mozilla/ipc/chromium/src/build/build_config.h
index 53ad98e..42e8c41 100644
--- a/mozilla/ipc/chromium/src/build/build_config.h
+++ b/mozilla/ipc/chromium/src/build/build_config.h
@@ -87,7 +87,7 @@
 #elif defined(__ppc__) || defined(__powerpc__)
 #define ARCH_CPU_PPC 1
 #define ARCH_CPU_32_BITS 1
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
 #define ARCH_CPU_SPARC 1
 #define ARCH_CPU_64_BITS 1
 #elif defined(__sparc__)
diff --git a/mozilla/js/src/gc/Memory.cpp b/mozilla/js/src/gc/Memory.cpp
index 26da754..4d8bcc7 100644
--- a/mozilla/js/src/gc/Memory.cpp
+++ b/mozilla/js/src/gc/Memory.cpp
@@ -501,7 +501,9 @@ static inline void*
 MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE,
             int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
 {
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
+
+#if defined(__ia64__) || defined(__aarch64__) || \
+    (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
     MOZ_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0);
 #endif
     void* region = mmap(desired, length, prot, flags, fd, offset);
@@ -524,7 +526,7 @@ static inline void*
 MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE,
           int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
 {
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__))
     /*
      * The JS engine assumes that all allocated pointers have their high 17 bits clear,
      * which ia64's mmap doesn't support directly. However, we can emulate it by passing
@@ -551,7 +553,7 @@ MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE,
         return nullptr;
     }
     return region;
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
    /*
     * There might be similar virtual address issue on arm64 which depends on
     * hardware and kernel configurations. But the work around is slightly
diff --git a/mozilla/js/src/jsapi-tests/testGCAllocator.cpp b/mozilla/js/src/jsapi-tests/testGCAllocator.cpp
index 2c5c58a..229e564 100644
--- a/mozilla/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/mozilla/js/src/jsapi-tests/testGCAllocator.cpp
@@ -312,7 +312,9 @@ void unmapPages(void* p, size_t size) { }
 void*
 mapMemoryAt(void* desired, size_t length)
 {
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
+
+#if defined(__ia64__) || defined(__aarch64__) || \
+    (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
     MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
 #endif
     void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
@@ -334,7 +336,7 @@ mapMemory(size_t length)
     int fd = -1;
     off_t offset = 0;
     // The test code must be aligned with the implementation in gc/Memory.cpp.
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__))
     void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
     if (region == MAP_FAILED)
         return nullptr;
@@ -344,7 +346,7 @@ mapMemory(size_t length)
         return nullptr;
     }
     return region;
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
     const uintptr_t start = UINT64_C(0x0000070000000000);
     const uintptr_t end   = UINT64_C(0x0000800000000000);
     const uintptr_t step  = js::gc::ChunkSize;
diff --git a/mozilla/media/webrtc/trunk/build/build_config.h b/mozilla/media/webrtc/trunk/build/build_config.h
index e10707d..a81c701 100644
--- a/mozilla/media/webrtc/trunk/build/build_config.h
+++ b/mozilla/media/webrtc/trunk/build/build_config.h
@@ -138,7 +138,7 @@
 #define ARCH_CPU_PPC 1
 #define ARCH_CPU_32_BITS 1
 #define ARCH_CPU_BIG_ENDIAN 1
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
 #define ARCH_CPU_SPARC_FAMILY 1
 #define ARCH_CPU_SPARC 1
 #define ARCH_CPU_64_BITS 1
diff --git a/mozilla/media/webrtc/trunk/webrtc/typedefs.h b/mozilla/media/webrtc/trunk/webrtc/typedefs.h
index 99ea82a..fa669b8 100644
--- a/mozilla/media/webrtc/trunk/webrtc/typedefs.h
+++ b/mozilla/media/webrtc/trunk/webrtc/typedefs.h
@@ -61,7 +61,7 @@
 #define WEBRTC_ARCH_BIG_ENDIAN
 #define WEBRTC_BIG_ENDIAN
 #endif
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
 #define WEBRTC_ARCH_SPARC 1
 #define WEBRTC_ARCH_64_BITS 1
 #define WEBRTC_ARCH_BIG_ENDIAN
diff --git a/mozilla/toolkit/components/protobuf/m-c-changes.patch b/mozilla/toolkit/components/protobuf/m-c-changes.patch
index d09e7c5..bb91d94 100644
--- a/mozilla/toolkit/components/protobuf/m-c-changes.patch
+++ b/mozilla/toolkit/components/protobuf/m-c-changes.patch
@@ -408,3 +408,16 @@ diff --git a/toolkit/components/protobuf/src/google/protobuf/stubs/atomicops.h b
  //      return result;
  //
  // I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value".
+diff --git a/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h b/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
+index 7956d076dcd5..1bd67d436331 100644
+--- a/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
++++ b/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
+@@ -67,7 +67,7 @@
+ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
+ #elif defined(sparc)
+ #define GOOGLE_PROTOBUF_ARCH_SPARC 1
+-#ifdef SOLARIS_64BIT_ENABLED
++#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
+ #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
+ #else
+ #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
diff --git a/mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h b/mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
index 7956d07..1bd67d4 100644
--- a/mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
+++ b/mozilla/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
@@ -67,7 +67,7 @@
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
 #elif defined(sparc)
 #define GOOGLE_PROTOBUF_ARCH_SPARC 1
-#ifdef SOLARIS_64BIT_ENABLED
+#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
 #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
 #else
 #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
diff --git a/mozilla/xpcom/reflect/xptcall/md/unix/moz.build b/mozilla/xpcom/reflect/xptcall/md/unix/moz.build
index 067a6ad..90cf8e1 100644
--- a/mozilla/xpcom/reflect/xptcall/md/unix/moz.build
+++ b/mozilla/xpcom/reflect/xptcall/md/unix/moz.build
@@ -232,7 +232,7 @@ if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'powerpc':
         'xptcstubs_ppc_openbsd.cpp',
     ]
 
-if CONFIG['OS_ARCH'] == 'Linux' and 'sparc' in CONFIG['OS_TEST']:
+if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TEST'] == 'sparc':
     SOURCES += [
         'xptcinvoke_asm_sparc_linux_GCC3.s',
         'xptcinvoke_sparc_solaris.cpp',
@@ -256,7 +256,7 @@ if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'sparc':
         'xptcstubs_sparc_openbsd.cpp',
     ]
 
-if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64':
+if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD', 'Linux') and CONFIG['OS_TEST'] == 'sparc64':
     SOURCES += [
         'xptcinvoke_asm_sparc64_openbsd.s',
         'xptcinvoke_sparc64_openbsd.cpp',