1 |
redhatter 08/09/01 11:11:48 |
2 |
|
3 |
Added: 006_mips-asm.patch 008_mips-fpic.patch |
4 |
Log: |
5 |
These patches get Firefox 3.0.1 working on MIPS (tested on mipsel)... Some stability issues (http://acid3.acidtests.org will crash the browser at around 53/100) but the ACID2 test is mostly okay. Needs to be tested on mips (big-endian). |
6 |
|
7 |
Revision Changes Path |
8 |
1.1 src/patchsets/mozilla-firefox/3.0.1/006_mips-asm.patch |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/006_mips-asm.patch?rev=1.1&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/006_mips-asm.patch?rev=1.1&content-type=text/plain |
12 |
|
13 |
Index: 006_mips-asm.patch |
14 |
=================================================================== |
15 |
Upstream Bug: http://bugzilla.mozilla.org/show_bug.cgi?id=258429 |
16 |
|
17 |
This patch is required to fix build issues with Mozilla on MIPS architectures. |
18 |
The out-of-the-box code is coded to build on a PlayStation 2 game console, which |
19 |
is a highly specialised MIPS machine based around the Toshiba TX5900. This CPU |
20 |
is very non-standard, causing problems with generic MIPS machines like Silicon |
21 |
Graphics workstations. |
22 |
|
23 |
The following patch fixes the assembly language routines for generic MIPS |
24 |
machines. In the case where it is being compiled for a PlayStation 2, the older |
25 |
PS2-specific implementation is used instead. |
26 |
|
27 |
Patch $Revision: 1.1 $ |
28 |
diff --git a/configure.in b/configure.in |
29 |
index f49bf6c..2423b6c 100644 |
30 |
--- a/configure.in |
31 |
+++ b/configure.in |
32 |
@@ -1806,8 +1806,7 @@ case "$target" in |
33 |
MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1 |
34 |
;; |
35 |
mips*) |
36 |
- CFLAGS="$CFLAGS -Wa,-xgot" |
37 |
- CXXFLAGS="$CXXFLAGS -Wa,-xgot" |
38 |
+ MOZ_DEBUG_FLAGS="-g" # We want inlining |
39 |
;; |
40 |
esac |
41 |
;; |
42 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
43 |
index 559fd96..6181699 100644 |
44 |
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
45 |
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in |
46 |
@@ -276,11 +276,7 @@ ifeq ($(OS_ARCH),Linux) |
47 |
ifneq (,$(findstring mips, $(OS_TEST))) |
48 |
CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp |
49 |
ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s |
50 |
-#xptcstubs_mips.cpp |
51 |
-# xptcstubs_asm_mips.s |
52 |
-ifdef GNU_CC |
53 |
-ASFLAGS += $(INCLUDES) -x assembler-with-cpp -D__GNUC__ |
54 |
-endif |
55 |
+ASFLAGS += -I$(PUBLIC) -x assembler-with-cpp |
56 |
endif |
57 |
endif |
58 |
|
59 |
@@ -466,10 +462,7 @@ LOCAL_INCLUDES += \ |
60 |
|
61 |
ifeq ($(OS_ARCH),Linux) |
62 |
ifneq (,$(findstring mips, $(OS_TEST))) |
63 |
-xptcstubs_asm_mips.o: xptcstubs_asm_mips.s.m4 $(PUBLIC)/xptcstubsdef.inc |
64 |
- m4 $(INCLUDES) $< > ./xptcstubs_asm_mips.s && \ |
65 |
- $(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) ./xptcstubs_asm_mips.s |
66 |
- $(RM) -f ./xptcstubs_asm_mips.s |
67 |
+xptcstubs_asm_mips.o: $(PUBLIC)/xptcstubsdef.inc |
68 |
endif |
69 |
endif |
70 |
|
71 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
72 |
index 8704247..6cf9deb 100644 |
73 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
74 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips.s |
75 |
@@ -24,6 +24,7 @@ |
76 |
* Contributor(s): |
77 |
* Brendan Eich <brendan@×××××××.org> |
78 |
* Stuart Parmenter <pavlov@××××××××.com> |
79 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
80 |
* |
81 |
* Alternatively, the contents of this file may be used under the terms of |
82 |
* either the GNU General Public License Version 2 or later (the "GPL"), or |
83 |
@@ -44,139 +45,123 @@ |
84 |
#include <sys/regdef.h> |
85 |
#include <sys/asm.h> |
86 |
|
87 |
-.text |
88 |
-.globl invoke_count_words |
89 |
-.globl invoke_copy_to_stack |
90 |
- |
91 |
-# We need a variable number of words allocated from the stack for copies of |
92 |
-# the params, and this space must come between the high frame (where ra, gp, |
93 |
-# and s0 are saved) and the low frame (where a0-a3 are saved by the callee |
94 |
-# functions we invoke). |
95 |
- |
96 |
-LOCALSZ=4 # s0, s1, ra, gp |
97 |
-NARGSAVE=4 # a0, a1, a2, a3 |
98 |
-HIFRAMESZ=(LOCALSZ*SZREG) |
99 |
-LOFRAMESZ=(NARGSAVE*SZREG) |
100 |
-FRAMESZ=(HIFRAMESZ+LOFRAMESZ+ALSZ)&ALMASK |
101 |
- |
102 |
-# XXX these 2*SZREG, etc. are very magic -- we *know* that ALSZ&ALMASK cause |
103 |
-# FRAMESZ to be 0 mod 8, in this case to be 16 and not 12. |
104 |
-RAOFF=FRAMESZ - (2*SZREG) |
105 |
-GPOFF=FRAMESZ - (3*SZREG) |
106 |
-S0OFF=FRAMESZ - (4*SZREG) |
107 |
-S1OFF=FRAMESZ - (5*SZREG) |
108 |
- |
109 |
-# These are not magic -- they are just our argsave slots in the caller frame. |
110 |
-A0OFF=FRAMESZ |
111 |
-A1OFF=FRAMESZ + (1*SZREG) |
112 |
-A2OFF=FRAMESZ + (2*SZREG) |
113 |
-A3OFF=FRAMESZ + (3*SZREG) |
114 |
- |
115 |
- # |
116 |
- # _XPTC_InvokeByIndex(that, methodIndex, paramCount, params) |
117 |
- # a0 a1 a2 a3 |
118 |
- |
119 |
-NESTED(_XPTC_InvokeByIndex, FRAMESZ, ra) |
120 |
- |
121 |
- .set noreorder |
122 |
- .cpload t9 |
123 |
- .set reorder |
124 |
- |
125 |
+# NARGSAVE is the argument space in the callers frame, including extra |
126 |
+# 'shadowed' space for the argument registers. The minimum of 4 |
127 |
+# argument slots is sometimes predefined in the header files. |
128 |
+#ifndef NARGSAVE |
129 |
+#define NARGSAVE 4 |
130 |
+#endif |
131 |
+ |
132 |
+#define LOCALSZ 3 /* gp, fp, ra */ |
133 |
+#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) |
134 |
+ |
135 |
+#define RAOFF (FRAMESZ - (1*SZREG)) |
136 |
+#define FPOFF (FRAMESZ - (2*SZREG)) |
137 |
+#define GPOFF (FRAMESZ - (3*SZREG)) |
138 |
+ |
139 |
+#define A0OFF (FRAMESZ + (0*SZREG)) |
140 |
+#define A1OFF (FRAMESZ + (1*SZREG)) |
141 |
+#define A2OFF (FRAMESZ + (2*SZREG)) |
142 |
+#define A3OFF (FRAMESZ + (3*SZREG)) |
143 |
+ |
144 |
+ .text |
145 |
+ |
146 |
+# |
147 |
+# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params) |
148 |
+# a0 a1 a2 a3 |
149 |
+ |
150 |
+ .globl _NS_InvokeByIndex_P |
151 |
+ .align 2 |
152 |
+ .type _NS_InvokeByIndex_P,@function |
153 |
+ .ent _NS_InvokeByIndex_P,0 |
154 |
+ .frame fp, FRAMESZ, ra |
155 |
+_NS_InvokeByIndex_P: |
156 |
+ SETUP_GP |
157 |
subu sp, FRAMESZ |
158 |
|
159 |
- # specify the save register mask -- XXX do we want the a0-a3 here, given |
160 |
- # our "split" frame where the args are saved below a dynamicly allocated |
161 |
- # region under the high frame? |
162 |
- # |
163 |
- # 10010000000000010000000011110000 |
164 |
- .mask 0x900100F0, -((NARGSAVE+LOCALSZ)*SZREG) |
165 |
+ # specify the save register mask for gp, fp, ra, a3 - a0 |
166 |
+ .mask 0xD00000F0, RAOFF-FRAMESZ |
167 |
|
168 |
- # thou shalt not use .cprestore if yer frame has variable size... |
169 |
- # .cprestore GPOFF |
170 |
+ sw ra, RAOFF(sp) |
171 |
+ sw fp, FPOFF(sp) |
172 |
|
173 |
- REG_S ra, RAOFF(sp) |
174 |
+ # we can't use .cprestore in a variable stack frame |
175 |
+ sw gp, GPOFF(sp) |
176 |
|
177 |
- # this happens automatically with .cprestore, but we cannot use that op... |
178 |
- REG_S gp, GPOFF(sp) |
179 |
- REG_S s0, S0OFF(sp) |
180 |
- REG_S s1, S1OFF(sp) |
181 |
+ sw a0, A0OFF(sp) |
182 |
+ sw a1, A1OFF(sp) |
183 |
+ sw a2, A2OFF(sp) |
184 |
+ sw a3, A3OFF(sp) |
185 |
|
186 |
- REG_S a0, A0OFF(sp) |
187 |
- REG_S a1, A1OFF(sp) |
188 |
- REG_S a2, A2OFF(sp) |
189 |
- REG_S a3, A3OFF(sp) |
190 |
+ # save bottom of fixed frame |
191 |
+ move fp, sp |
192 |
|
193 |
- # invoke_count_words(paramCount, params) |
194 |
+ # extern "C" uint32 |
195 |
+ # invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s); |
196 |
+ la t9, invoke_count_words |
197 |
move a0, a2 |
198 |
move a1, a3 |
199 |
- |
200 |
- jal invoke_count_words |
201 |
- lw gp, GPOFF(sp) |
202 |
- |
203 |
- # save the old sp so we can pop the param area and any "low frame" |
204 |
- # needed as an argsave area below the param block for callees that |
205 |
- # we invoke. |
206 |
- move s0, sp |
207 |
- |
208 |
- REG_L a1, A2OFF(sp) # a1 = paramCount |
209 |
- REG_L a2, A3OFF(sp) # a2 = params |
210 |
- |
211 |
- # we define a word as 4 bytes, period end of story! |
212 |
- sll v0, 2 # 4 bytes * result of invoke_copy_words |
213 |
- subu v0, LOFRAMESZ # but we take back the argsave area built into |
214 |
- # our stack frame -- SWEET! |
215 |
- subu sp, sp, v0 # make room |
216 |
- move a0, sp # a0 = param stack address |
217 |
- move s1, a0 # save it for later -- it should be safe here |
218 |
- |
219 |
- # the old sp is still saved in s0, but we now need another argsave |
220 |
- # area ("low frame") for the invoke_copy_to_stack call. |
221 |
- subu sp, sp, LOFRAMESZ |
222 |
- |
223 |
- # copy the param into the stack areas |
224 |
+ jalr t9 |
225 |
+ lw gp, GPOFF(fp) |
226 |
+ |
227 |
+ # allocate variable stack, with a size of: |
228 |
+ # wordsize (of 4 bytes) * result (already aligned to dword) |
229 |
+ # but a minimum of 16 byte |
230 |
+ sll v0, 2 |
231 |
+ slt t0, v0, 16 |
232 |
+ beqz t0, 1f |
233 |
+ li v0, 16 |
234 |
+1: subu sp, v0 |
235 |
+ |
236 |
+ # let a0 point to the bottom of the variable stack, allocate |
237 |
+ # another fixed stack for: |
238 |
+ # extern "C" void |
239 |
# invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
240 |
- # nsXPTCVariant* s) |
241 |
- jal invoke_copy_to_stack |
242 |
- lw gp, GPOFF(s0) |
243 |
- |
244 |
- move sp, s0 # get orig sp back, popping params and argsave |
245 |
- |
246 |
- REG_L a0, A0OFF(sp) # a0 = set "that" to be "this" |
247 |
- REG_L a1, A1OFF(sp) # a1 = methodIndex |
248 |
- |
249 |
- # t1 = methodIndex * 4 |
250 |
- # (use shift instead of mult) |
251 |
- sll t1, a1, 2 |
252 |
- |
253 |
- # calculate the function we need to jump to, |
254 |
- # which must then be saved in t9 |
255 |
+ # nsXPTCVariant* s); |
256 |
+ la t9, invoke_copy_to_stack |
257 |
+ move a0, sp |
258 |
+ lw a1, A2OFF(fp) |
259 |
+ lw a2, A3OFF(fp) |
260 |
+ subu sp, 16 |
261 |
+ jalr t9 |
262 |
+ lw gp, GPOFF(fp) |
263 |
+ |
264 |
+ # back to the variable stack frame |
265 |
+ addu sp, 16 |
266 |
+ |
267 |
+ # calculate the function we need to jump to, which must then be |
268 |
+ # stored in t9 |
269 |
+ lw a0, A0OFF(fp) # a0 = set "that" to be "this" |
270 |
+ lw t0, A1OFF(fp) # a1 = methodIndex |
271 |
lw t9, 0(a0) |
272 |
- addu t9, t9, t1 |
273 |
- lw t9, 8(t9) |
274 |
- |
275 |
- # a1..a3 and f13..f14 should now be set to what |
276 |
- # invoke_copy_to_stack told us. skip a0 and f12 |
277 |
- # because that is the "this" pointer |
278 |
- |
279 |
- REG_L a1, 1*SZREG(s1) |
280 |
- REG_L a2, 2*SZREG(s1) |
281 |
- REG_L a3, 3*SZREG(s1) |
282 |
- |
283 |
- l.d $f13, 8(s1) |
284 |
- l.d $f14, 16(s1) |
285 |
- |
286 |
- # Create the stack pointer for the function, which must have 4 words |
287 |
- # of space for callee-saved args. invoke_count_words allocated space |
288 |
- # for a0 starting at s1, so we just move s1 into sp. |
289 |
- move sp, s1 |
290 |
- |
291 |
- jalr ra, t9 |
292 |
- lw gp, GPOFF(s0) |
293 |
- |
294 |
- move sp, s0 |
295 |
- |
296 |
- REG_L ra, RAOFF(sp) |
297 |
- REG_L s0, S0OFF(sp) |
298 |
- addu sp, FRAMESZ |
299 |
+ # t0 = methodIndex << PTRLOG |
300 |
+ sll t0, t0, PTRLOG |
301 |
+ addu t9, t0 |
302 |
+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ |
303 |
+ lw t9, (t9) |
304 |
+#else /* not G++ V3 ABI */ |
305 |
+ lw t9, 2*PTRSIZE(t9) |
306 |
+#endif /* G++ V3 ABI */ |
307 |
+ |
308 |
+ # Set a1-a3 to what invoke_copy_to_stack told us. a0 is already |
309 |
+ # the "this" pointer. We don't have to care about floating |
310 |
+ # point arguments, the non-FP "this" pointer as first argument |
311 |
+ # means they'll never be used. |
312 |
+ lw a1, 1*SZREG(sp) |
313 |
+ lw a2, 2*SZREG(sp) |
314 |
+ lw a3, 3*SZREG(sp) |
315 |
+ |
316 |
+ jalr t9 |
317 |
+ # Micro-optimization: There's no gp usage below this point, so |
318 |
+ # we don't reload. |
319 |
+ # lw gp, GPOFF(fp) |
320 |
+ |
321 |
+ # leave variable stack frame |
322 |
+ move sp, fp |
323 |
+ |
324 |
+ lw ra, RAOFF(sp) |
325 |
+ lw fp, FPOFF(sp) |
326 |
+ |
327 |
+ addiu sp, FRAMESZ |
328 |
j ra |
329 |
-.end _XPTC_InvokeByIndex |
330 |
+END(_NS_InvokeByIndex_P) |
331 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
332 |
index a73e432..2c27a26 100644 |
333 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
334 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips.cpp |
335 |
@@ -24,6 +24,7 @@ |
336 |
* Contributor(s): |
337 |
* Stuart Parmenter <pavlov@××××××××.com> |
338 |
* Brendan Eich <brendan@×××××××.org> |
339 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
340 |
* |
341 |
* Alternatively, the contents of this file may be used under the terms of |
342 |
* either of the GNU General Public License Version 2 or later (the "GPL"), |
343 |
@@ -52,10 +53,8 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) |
344 |
// Count a word for a0 even though it's never stored or loaded |
345 |
// We do this only for alignment of register pairs. |
346 |
PRUint32 result = 1; |
347 |
- for (PRUint32 i = 0; i < paramCount; i++, s++) |
348 |
+ for (PRUint32 i = 0; i < paramCount; i++, result++, s++) |
349 |
{ |
350 |
- result++; |
351 |
- |
352 |
if (s->IsPtrData()) |
353 |
continue; |
354 |
|
355 |
@@ -68,6 +67,9 @@ invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s) |
356 |
result++; |
357 |
result++; |
358 |
break; |
359 |
+ |
360 |
+ default: |
361 |
+ break; |
362 |
} |
363 |
} |
364 |
return (result + 1) & ~(PRUint32)1; |
365 |
@@ -88,8 +90,6 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
366 |
continue; |
367 |
} |
368 |
|
369 |
- *((void**)d) = s->val.p; |
370 |
- |
371 |
switch(s->type) |
372 |
{ |
373 |
case nsXPTType::T_I64 : |
374 |
@@ -104,19 +104,20 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, |
375 |
if ((PRWord)d & 4) d++; |
376 |
*((double*) d) = s->val.d; d++; |
377 |
break; |
378 |
+ default: |
379 |
+ *((void**)d) = s->val.p; |
380 |
+ break; |
381 |
} |
382 |
} |
383 |
} |
384 |
|
385 |
-extern "C" nsresult _XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, |
386 |
+extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, |
387 |
PRUint32 paramCount, |
388 |
nsXPTCVariant* params); |
389 |
|
390 |
-extern "C" |
391 |
-XPTC_PUBLIC_API(nsresult) |
392 |
-XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, |
393 |
+EXPORT_XPCOM_API(nsresult) |
394 |
+NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex, |
395 |
PRUint32 paramCount, nsXPTCVariant* params) |
396 |
{ |
397 |
- return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params); |
398 |
-} |
399 |
- |
400 |
+ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params); |
401 |
+} |
402 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s |
403 |
new file mode 100644 |
404 |
index 0000000..c2dc0c7 |
405 |
--- /dev/null |
406 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips.s |
407 |
@@ -0,0 +1,142 @@ |
408 |
+/* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
409 |
+ * Version: MPL 1.1 |
410 |
+ * |
411 |
+ * The contents of this file are subject to the Mozilla Public License Version |
412 |
+ * 1.1 (the "License"); you may not use this file except in compliance with |
413 |
+ * the License. You may obtain a copy of the License at |
414 |
+ * http://www.mozilla.org/MPL/ |
415 |
+ * |
416 |
+ * Software distributed under the License is distributed on an "AS IS" basis, |
417 |
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
418 |
+ * for the specific language governing rights and limitations under the |
419 |
+ * License. |
420 |
+ * |
421 |
+ * The Original Code is mozilla.org code. |
422 |
+ * |
423 |
+ * The Initial Developer of the Original Code is |
424 |
+ * Netscape Communications Corp, Inc. |
425 |
+ * Portions created by the Initial Developer are Copyright (C) 2001 |
426 |
+ * the Initial Developer. All Rights Reserved. |
427 |
+ * |
428 |
+ * Contributor(s): |
429 |
+ * Stuart Parmenter <pavlov@××××××××.com> |
430 |
+ * Chris Waterson <waterson@××××××××.com> |
431 |
+ * Thiemo Seufer <seufer@×××××××××××××××××××××.de> |
432 |
+ */ |
433 |
+ |
434 |
+/* This code is for MIPS using the O32 ABI. */ |
435 |
+ |
436 |
+#include <sys/regdef.h> |
437 |
+#include <sys/asm.h> |
438 |
+ |
439 |
+# NARGSAVE is the argument space in the callers frame, including extra |
440 |
+# 'shadowed' space for the argument registers. The minimum of 4 |
441 |
+# argument slots is sometimes predefined in the header files. |
442 |
+#ifndef NARGSAVE |
443 |
+#define NARGSAVE 4 |
444 |
+#endif |
445 |
+ |
446 |
+#define LOCALSZ 2 /* gp, ra */ |
447 |
+#define FRAMESZ ((((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK) |
448 |
+ |
449 |
+#define RAOFF (FRAMESZ - (1*SZREG)) |
450 |
+#define GPOFF (FRAMESZ - (2*SZREG)) |
451 |
+ |
452 |
+#define A0OFF (FRAMESZ + (0*SZREG)) |
453 |
+#define A1OFF (FRAMESZ + (1*SZREG)) |
454 |
+#define A2OFF (FRAMESZ + (2*SZREG)) |
455 |
+#define A3OFF (FRAMESZ + (3*SZREG)) |
456 |
+ |
457 |
+ .text |
458 |
+ |
459 |
+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ |
460 |
+#define STUB_ENTRY(x) \ |
461 |
+ .if x < 10; \ |
462 |
+ .globl _ZN14nsXPTCStubBase5Stub ##x ##Ev; \ |
463 |
+ .type _ZN14nsXPTCStubBase5Stub ##x ##Ev,@function; \ |
464 |
+ .aent _ZN14nsXPTCStubBase5Stub ##x ##Ev,0; \ |
465 |
+_ZN14nsXPTCStubBase5Stub ##x ##Ev:; \ |
466 |
+ SETUP_GP; \ |
467 |
+ li t0,x; \ |
468 |
+ b sharedstub; \ |
469 |
+ .elseif x < 100; \ |
470 |
+ .globl _ZN14nsXPTCStubBase6Stub ##x ##Ev; \ |
471 |
+ .type _ZN14nsXPTCStubBase6Stub ##x ##Ev,@function; \ |
472 |
+ .aent _ZN14nsXPTCStubBase6Stub ##x ##Ev,0; \ |
473 |
+_ZN14nsXPTCStubBase6Stub ##x ##Ev:; \ |
474 |
+ SETUP_GP; \ |
475 |
+ li t0,x; \ |
476 |
+ b sharedstub; \ |
477 |
+ .elseif x < 1000; \ |
478 |
+ .globl _ZN14nsXPTCStubBase7Stub ##x ##Ev; \ |
479 |
+ .type _ZN14nsXPTCStubBase7Stub ##x ##Ev,@function; \ |
480 |
+ .aent _ZN14nsXPTCStubBase7Stub ##x ##Ev,0; \ |
481 |
+_ZN14nsXPTCStubBase7Stub ##x ##Ev:; \ |
482 |
+ SETUP_GP; \ |
483 |
+ li t0,x; \ |
484 |
+ b sharedstub; \ |
485 |
+ .else; \ |
486 |
+ .err; \ |
487 |
+ .endif |
488 |
+#else /* not G++ V3 ABI */ |
489 |
+#define STUB_ENTRY(x) \ |
490 |
+ .globl Stub ##x ##__14nsXPTCStubBase; \ |
491 |
+ .type Stub ##x ##__14nsXPTCStubBase,@function; \ |
492 |
+ .aent Stub ##x ##__14nsXPTCStubBase,0; \ |
493 |
+Stub ##x ##__14nsXPTCStubBase:; \ |
494 |
+ SETUP_GP; \ |
495 |
+ li t0,x; \ |
496 |
+ b sharedstub |
497 |
+#endif /* G++ V3 ABI */ |
498 |
+ |
499 |
+# SENTINEL_ENTRY is handled in the cpp file. |
500 |
+#define SENTINEL_ENTRY(x) |
501 |
+ |
502 |
+# |
503 |
+# open a dummy frame for the function entries |
504 |
+# |
505 |
+ .align 2 |
506 |
+ .type dummy,@function |
507 |
+ .ent dummy, 0 |
508 |
+ .frame sp, FRAMESZ, ra |
509 |
+dummy: |
510 |
+ SETUP_GP |
511 |
+ |
512 |
+#include "xptcstubsdef.inc" |
513 |
+ |
514 |
+sharedstub: |
515 |
+ subu sp, FRAMESZ |
516 |
+ |
517 |
+ # specify the save register mask for gp, ra, a0-a3 |
518 |
+ .mask 0x900000F0, RAOFF-FRAMESZ |
519 |
+ |
520 |
+ sw ra, RAOFF(sp) |
521 |
+ SAVE_GP(GPOFF) |
522 |
+ |
523 |
+ # Micro-optimization: a0 is already loaded, and its slot gets |
524 |
+ # ignored by PrepareAndDispatch, so no need to save it here. |
525 |
+ # sw a0, A0OFF(sp) |
526 |
+ sw a1, A1OFF(sp) |
527 |
+ sw a2, A2OFF(sp) |
528 |
+ sw a3, A3OFF(sp) |
529 |
+ |
530 |
+ la t9, PrepareAndDispatch |
531 |
+ |
532 |
+ # t0 is methodIndex |
533 |
+ move a1, t0 |
534 |
+ # have a2 point to the begin of the argument space on stack |
535 |
+ addiu a2, sp, FRAMESZ |
536 |
+ |
537 |
+ # PrepareAndDispatch(that, methodIndex, args) |
538 |
+ jalr t9 |
539 |
+ |
540 |
+ # Micro-optimization: Using jalr explicitly has the side-effect |
541 |
+ # of not triggering .cprestore. This is ok because we have no |
542 |
+ # gp reference below this point. It also allows better |
543 |
+ # instruction sscheduling. |
544 |
+ # lw gp, GPOFF(fp) |
545 |
+ |
546 |
+ lw ra, RAOFF(sp) |
547 |
+ addiu sp, FRAMESZ |
548 |
+ j ra |
549 |
+ END(dummy) |
550 |
diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
551 |
index 4d60f7b..bdce59c 100644 |
552 |
--- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
553 |
+++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips.cpp |
554 |
@@ -39,6 +39,7 @@ |
555 |
* ***** END LICENSE BLOCK ***** */ |
556 |
|
557 |
#include "xptcprivate.h" |
558 |
+#include "xptiprivate.h" |
559 |
|
560 |
/* |
561 |
* This is for MIPS O32 ABI |
562 |
@@ -54,7 +55,6 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
563 |
|
564 |
nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; |
565 |
nsXPTCMiniVariant* dispatchParams = NULL; |
566 |
- nsIInterfaceInfo* iface_info = NULL; |
567 |
const nsXPTMethodInfo* info; |
568 |
PRUint8 paramCount; |
569 |
PRUint8 i; |
570 |
@@ -62,11 +62,8 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
571 |
|
572 |
NS_ASSERTION(self,"no self"); |
573 |
|
574 |
- self->GetInterfaceInfo(&iface_info); |
575 |
- NS_ASSERTION(iface_info,"no interface info"); |
576 |
- |
577 |
- iface_info->GetMethodInfo(PRUint16(methodIndex), &info); |
578 |
- NS_ASSERTION(info,"no interface info"); |
579 |
+ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info); |
580 |
+ NS_ASSERTION(info,"no method info"); |
581 |
|
582 |
paramCount = info->GetParamCount(); |
583 |
|
584 |
@@ -109,9 +106,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint32* args) |
585 |
} |
586 |
} |
587 |
|
588 |
- result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); |
589 |
- |
590 |
- NS_RELEASE(iface_info); |
591 |
+ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams); |
592 |
|
593 |
if(dispatchParams != paramBuffer) |
594 |
delete [] dispatchParams; |
595 |
|
596 |
|
597 |
|
598 |
1.1 src/patchsets/mozilla-firefox/3.0.1/008_mips-fpic.patch |
599 |
|
600 |
file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/008_mips-fpic.patch?rev=1.1&view=markup |
601 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/mozilla-firefox/3.0.1/008_mips-fpic.patch?rev=1.1&content-type=text/plain |
602 |
|
603 |
Index: 008_mips-fpic.patch |
604 |
=================================================================== |
605 |
Upstream bug: https://bugzilla.mozilla.org/attachment.cgi?id=321598 |
606 |
|
607 |
We've had an issue on debian with the mips xpcom stubs because gcc 4.3 changed |
608 |
its default from PIC to non-PIC. While the whole c++ code is built as PIC code, |
609 |
the xptc stubs assembly ends up built as non-PIC. |
610 |
|
611 |
It would be safer to build the assembly with -fPIC when C++ is built with -fPIC, |
612 |
to avoid future possible problems with gcc changing its default again on |
613 |
some random architecture. The attached patch does it for linux, but it might be |
614 |
necessary to do the same on other architectures. |
615 |
|
616 |
Patch $Revision: 1.1 $ |
617 |
diff --git a/configure.in b/configure.in |
618 |
index 3730f0e..516da66 100644 |
619 |
--- a/configure.in |
620 |
+++ b/configure.in |
621 |
@@ -1279,6 +1279,7 @@ if test "$GNU_CC"; then |
622 |
WARNINGS_AS_ERRORS='-Werror' |
623 |
DSO_CFLAGS='' |
624 |
DSO_PIC_CFLAGS='-fPIC' |
625 |
+ ASFLAGS="$ASFLAGS -fPIC" |
626 |
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti |
627 |
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti |
628 |
_MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions' |