|
1 # HG changeset patch |
|
2 # Parent cad86882605788345b2791275efc6e1fa7500dbd |
|
3 # User Ulrich Weigand <uweigand@de.ibm.com> |
|
4 General PPC64 LE support |
|
5 |
|
6 diff --git a/configure.in b/configure.in |
|
7 --- a/configure.in |
|
8 +++ b/configure.in |
|
9 @@ -1079,17 +1079,17 @@ esac |
|
10 |
|
11 # Only set CPU_ARCH if we recognize the value of OS_TEST |
|
12 |
|
13 case "$OS_TEST" in |
|
14 *86 | i86pc) |
|
15 CPU_ARCH=x86 |
|
16 ;; |
|
17 |
|
18 -powerpc64 | ppc64) |
|
19 +powerpc64 | ppc64 | powerpc64le | ppc64le) |
|
20 CPU_ARCH=ppc64 |
|
21 ;; |
|
22 |
|
23 powerpc | ppc | rs6000) |
|
24 CPU_ARCH=ppc |
|
25 ;; |
|
26 |
|
27 Alpha | alpha | ALPHA) |
|
28 diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h |
|
29 --- a/js/src/assembler/wtf/Platform.h |
|
30 +++ b/js/src/assembler/wtf/Platform.h |
|
31 @@ -160,26 +160,32 @@ |
|
32 /* WTF_CPU_PPC - PowerPC 32-bit */ |
|
33 #if defined(__ppc__) \ |
|
34 || defined(__PPC__) \ |
|
35 || defined(__powerpc__) \ |
|
36 || defined(__powerpc) \ |
|
37 || defined(__POWERPC__) \ |
|
38 || defined(_M_PPC) \ |
|
39 || defined(__PPC) |
|
40 +#if !defined(__ppc64__) && !defined(__PPC64__) |
|
41 #define WTF_CPU_PPC 1 |
|
42 +#endif |
|
43 +#if !defined(__LITTLE_ENDIAN__) |
|
44 #define WTF_CPU_BIG_ENDIAN 1 |
|
45 #endif |
|
46 +#endif |
|
47 |
|
48 /* WTF_CPU_PPC64 - PowerPC 64-bit */ |
|
49 #if defined(__ppc64__) \ |
|
50 || defined(__PPC64__) |
|
51 #define WTF_CPU_PPC64 1 |
|
52 +#if !defined(__LITTLE_ENDIAN__) |
|
53 #define WTF_CPU_BIG_ENDIAN 1 |
|
54 #endif |
|
55 +#endif |
|
56 |
|
57 /* WTF_CPU_SH4 - SuperH SH-4 */ |
|
58 #if defined(__SH4__) |
|
59 #define WTF_CPU_SH4 1 |
|
60 #endif |
|
61 |
|
62 /* WTF_CPU_SPARC32 - SPARC 32-bit */ |
|
63 #if defined(__sparc) && !defined(__arch64__) || defined(__sparcv8) |
|
64 diff --git a/js/src/configure.in b/js/src/configure.in |
|
65 --- a/js/src/configure.in |
|
66 +++ b/js/src/configure.in |
|
67 @@ -910,17 +910,17 @@ esac |
|
68 |
|
69 # Only set CPU_ARCH if we recognize the value of OS_TEST |
|
70 |
|
71 case "$OS_TEST" in |
|
72 *86 | i86pc) |
|
73 CPU_ARCH=x86 |
|
74 ;; |
|
75 |
|
76 -powerpc64 | ppc64) |
|
77 +powerpc64 | ppc64 | powerpc64le | ppc64le) |
|
78 CPU_ARCH=ppc64 |
|
79 ;; |
|
80 |
|
81 powerpc | ppc | rs6000) |
|
82 CPU_ARCH=ppc |
|
83 ;; |
|
84 |
|
85 Alpha | alpha | ALPHA) |
|
86 diff --git a/js/src/jscpucfg.h b/js/src/jscpucfg.h |
|
87 --- a/js/src/jscpucfg.h |
|
88 +++ b/js/src/jscpucfg.h |
|
89 @@ -26,17 +26,17 @@ |
|
90 # define HAVE_VA_LIST_AS_ARRAY 1 |
|
91 # endif |
|
92 |
|
93 # define IS_LITTLE_ENDIAN 1 |
|
94 # undef IS_BIG_ENDIAN |
|
95 # define JS_BYTES_PER_WORD 4 |
|
96 # define JS_BITS_PER_WORD_LOG2 5 |
|
97 |
|
98 -#elif defined(__APPLE__) |
|
99 +#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__) |
|
100 # if __LITTLE_ENDIAN__ |
|
101 # define IS_LITTLE_ENDIAN 1 |
|
102 # undef IS_BIG_ENDIAN |
|
103 # elif __BIG_ENDIAN__ |
|
104 # undef IS_LITTLE_ENDIAN |
|
105 # define IS_BIG_ENDIAN 1 |
|
106 # endif |
|
107 |
|
108 @@ -88,18 +88,17 @@ |
|
109 # if defined(_STACK_GROWS_UPWARD) |
|
110 # define JS_STACK_GROWTH_DIRECTION (1) |
|
111 # elif defined(_STACK_GROWS_DOWNWARD) |
|
112 # define JS_STACK_GROWTH_DIRECTION (-1) |
|
113 # endif |
|
114 # endif |
|
115 |
|
116 #elif defined(__sparc) || defined(__sparc__) || \ |
|
117 - defined(_POWER) || defined(__powerpc__) || \ |
|
118 - defined(__ppc__) || defined(__hppa) || \ |
|
119 + defined(_POWER) || defined(__hppa) || \ |
|
120 defined(_MIPSEB) || defined(_BIG_ENDIAN) |
|
121 /* IA64 running HP-UX will have _BIG_ENDIAN defined. |
|
122 * IA64 running Linux will have endian.h and be handled above. |
|
123 */ |
|
124 # undef IS_LITTLE_ENDIAN |
|
125 # define IS_BIG_ENDIAN 1 |
|
126 |
|
127 #else /* !defined(__sparc) && !defined(__sparc__) && ... */ |
|
128 diff --git a/media/webrtc/trunk/webrtc/typedefs.h b/media/webrtc/trunk/webrtc/typedefs.h |
|
129 --- a/media/webrtc/trunk/webrtc/typedefs.h |
|
130 +++ b/media/webrtc/trunk/webrtc/typedefs.h |
|
131 @@ -47,23 +47,33 @@ |
|
132 //#define WEBRTC_ARCH_ARM_FAMILY |
|
133 //#define WEBRTC_ARCH_ARMEL |
|
134 #define WEBRTC_ARCH_32_BITS |
|
135 #define WEBRTC_ARCH_LITTLE_ENDIAN |
|
136 #define WEBRTC_LITTLE_ENDIAN |
|
137 #elif defined(__powerpc64__) |
|
138 #define WEBRTC_ARCH_PPC64 1 |
|
139 #define WEBRTC_ARCH_64_BITS 1 |
|
140 +#ifdef __LITTLE_ENDIAN__ |
|
141 +#define WEBRTC_ARCH_LITTLE_ENDIAN |
|
142 +#define WEBRTC_LITTLE_ENDIAN |
|
143 +#else |
|
144 #define WEBRTC_ARCH_BIG_ENDIAN |
|
145 #define WEBRTC_BIG_ENDIAN |
|
146 +#endif |
|
147 #elif defined(__ppc__) || defined(__powerpc__) |
|
148 #define WEBRTC_ARCH_PPC 1 |
|
149 #define WEBRTC_ARCH_32_BITS 1 |
|
150 +#ifdef __LITTLE_ENDIAN__ |
|
151 +#define WEBRTC_ARCH_LITTLE_ENDIAN |
|
152 +#define WEBRTC_LITTLE_ENDIAN |
|
153 +#else |
|
154 #define WEBRTC_ARCH_BIG_ENDIAN |
|
155 #define WEBRTC_BIG_ENDIAN |
|
156 +#endif |
|
157 #elif defined(__sparc64__) |
|
158 #define WEBRTC_ARCH_SPARC 1 |
|
159 #define WEBRTC_ARCH_64_BITS 1 |
|
160 #define WEBRTC_ARCH_BIG_ENDIAN |
|
161 #define WEBRTC_BIG_ENDIAN |
|
162 #elif defined(__sparc__) |
|
163 #define WEBRTC_ARCH_SPARC 1 |
|
164 #define WEBRTC_ARCH_32_BITS 1 |
|
165 diff --git a/mfbt/Endian.h b/mfbt/Endian.h |
|
166 --- a/mfbt/Endian.h |
|
167 +++ b/mfbt/Endian.h |
|
168 @@ -86,17 +86,17 @@ |
|
169 # error "CPU type is unknown" |
|
170 # endif |
|
171 #elif defined(_WIN32) |
|
172 # if defined(_M_IX86) |
|
173 # define MOZ_LITTLE_ENDIAN 1 |
|
174 # else |
|
175 # error "CPU type is unknown" |
|
176 # endif |
|
177 -#elif defined(__APPLE__) |
|
178 +#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__) |
|
179 # if __LITTLE_ENDIAN__ |
|
180 # define MOZ_LITTLE_ENDIAN 1 |
|
181 # elif __BIG_ENDIAN__ |
|
182 # define MOZ_BIG_ENDIAN 1 |
|
183 # endif |
|
184 #elif defined(__GNUC__) && \ |
|
185 defined(__BYTE_ORDER__) && \ |
|
186 defined(__ORDER_LITTLE_ENDIAN__) && \ |
|
187 @@ -114,18 +114,17 @@ |
|
188 # endif |
|
189 /* |
|
190 * We can't include useful headers like <endian.h> or <sys/isa_defs.h> |
|
191 * here because they're not present on all platforms. Instead we have |
|
192 * this big conditional that ideally will catch all the interesting |
|
193 * cases. |
|
194 */ |
|
195 #elif defined(__sparc) || defined(__sparc__) || \ |
|
196 - defined(_POWER) || defined(__powerpc__) || \ |
|
197 - defined(__ppc__) || defined(__hppa) || \ |
|
198 + defined(_POWER) || defined(__hppa) || \ |
|
199 defined(_MIPSEB) || defined(__ARMEB__) || \ |
|
200 defined(__s390__) || \ |
|
201 (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ |
|
202 (defined(__ia64) && defined(__BIG_ENDIAN__)) |
|
203 # define MOZ_BIG_ENDIAN 1 |
|
204 #elif defined(__i386) || defined(__i386__) || \ |
|
205 defined(__x86_64) || defined(__x86_64__) || \ |
|
206 defined(_MIPSEL) || defined(__ARMEL__) || \ |
|
207 diff --git a/nsprpub/pr/include/md/_linux.cfg b/nsprpub/pr/include/md/_linux.cfg |
|
208 --- a/nsprpub/pr/include/md/_linux.cfg |
|
209 +++ b/nsprpub/pr/include/md/_linux.cfg |
|
210 @@ -24,18 +24,23 @@ |
|
211 #elif defined(__GNU__) |
|
212 #define PR_AF_INET6 26 /* same as AF_INET6 */ |
|
213 #else |
|
214 #define PR_AF_INET6 10 /* same as AF_INET6 */ |
|
215 #endif |
|
216 |
|
217 #ifdef __powerpc64__ |
|
218 |
|
219 +#ifdef __LITTLE_ENDIAN__ |
|
220 +#define IS_LITTLE_ENDIAN 1 |
|
221 +#undef IS_BIG_ENDIAN |
|
222 +#else |
|
223 #undef IS_LITTLE_ENDIAN |
|
224 #define IS_BIG_ENDIAN 1 |
|
225 +#endif |
|
226 #define IS_64 |
|
227 |
|
228 #define PR_BYTES_PER_BYTE 1 |
|
229 #define PR_BYTES_PER_SHORT 2 |
|
230 #define PR_BYTES_PER_INT 4 |
|
231 #define PR_BYTES_PER_INT64 8 |
|
232 #define PR_BYTES_PER_LONG 8 |
|
233 #define PR_BYTES_PER_FLOAT 4 |
|
234 @@ -70,18 +75,23 @@ |
|
235 #define PR_ALIGN_OF_POINTER 8 |
|
236 #define PR_ALIGN_OF_WORD 8 |
|
237 |
|
238 #define PR_BYTES_PER_WORD_LOG2 3 |
|
239 #define PR_BYTES_PER_DWORD_LOG2 3 |
|
240 |
|
241 #elif defined(__powerpc__) |
|
242 |
|
243 +#ifdef __LITTLE_ENDIAN__ |
|
244 +#define IS_LITTLE_ENDIAN 1 |
|
245 +#undef IS_BIG_ENDIAN |
|
246 +#else |
|
247 #undef IS_LITTLE_ENDIAN |
|
248 #define IS_BIG_ENDIAN 1 |
|
249 +#endif |
|
250 |
|
251 #define PR_BYTES_PER_BYTE 1 |
|
252 #define PR_BYTES_PER_SHORT 2 |
|
253 #define PR_BYTES_PER_INT 4 |
|
254 #define PR_BYTES_PER_INT64 8 |
|
255 #define PR_BYTES_PER_LONG 4 |
|
256 #define PR_BYTES_PER_FLOAT 4 |
|
257 #define PR_BYTES_PER_DOUBLE 8 |