View | Details | Raw Unified | Return to bug 251417 | Differences between
and this patch

Collapse All | Expand All

(-)editors/openoffice-4/files/patch-bridges_prj_build.lst (+12 lines)
Line 0 Link Here
1
--- bridges/prj/build.lst.orig
2
+++ bridges/prj/build.lst
3
@@ -9,6 +9,8 @@
4
 br	bridges\source\cpp_uno\gcc3_freebsd_intel	nmake	-	u	br_gcc3fi br_cppuno_shared br_unotypes br_inc NULL
5
 br	bridges\source\cpp_uno\gcc3_linux_x86-64	nmake	-	u	br_gcc3lx br_cppuno_shared br_unotypes br_inc NULL
6
 br	bridges\source\cpp_uno\gcc3_freebsd_x86-64	nmake	-	u	br_gcc3fx br_cppuno_shared br_unotypes br_inc NULL
7
+br	bridges\source\cpp_uno\gcc3_freebsd_powerpc	nmake	-	u	br_gcc3fp br_cppuno_shared br_unotypes br_inc NULL
8
+br	bridges\source\cpp_uno\gcc3_freebsd_powerpc64	nmake	-	u	br_gcc3fp_64 br_cppuno_shared br_unotypes br_inc NULL
9
 br	bridges\source\cpp_uno\gcc3_linux_powerpc	nmake	-	u	br_gcc3lp br_cppuno_shared br_unotypes br_inc NULL
10
 br	bridges\source\cpp_uno\gcc3_linux_powerpc64	nmake	-	u	br_gcc3lp_64 br_cppuno_shared br_unotypes br_inc NULL
11
 br	bridges\source\cpp_uno\gcc3_linux_mips		nmake	-	u	br_gcc3lmips br_cppuno_shared br_unotypes br_inc NULL
12
(-)editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_call.s (+482 lines)
Line 0 Link Here
1
--- /dev/null
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/call.s
3
@@ -0,0 +1,478 @@
4
+	.file	"uno_ppc64_asm.cc"
5
+	.machine power4
6
+	.abiversion 2
7
+	.section	".text"
8
+	.align 2
9
+	.globl callVirtualMethod
10
+	.type	callVirtualMethod, @function
11
+callVirtualMethod:
12
+.LFB0:
13
+	.cfi_startproc
14
+.LCF0:
15
+0:	addis 2,12,.TOC.-.LCF0@ha
16
+	addi 2,2,.TOC.-.LCF0@l
17
+	.localentry	callVirtualMethod,.-callVirtualMethod
18
+	mflr 0
19
+	std 0,16(1)
20
+	std 31,-8(1)
21
+	stdu 1,-208(1)
22
+	.cfi_def_cfa_offset 208
23
+	.cfi_offset 65, 16
24
+	.cfi_offset 31, -8
25
+	mr 31,1
26
+	.cfi_def_cfa_register 31
27
+	std 3,136(31)
28
+	std 5,128(31)
29
+	std 6,120(31)
30
+	std 7,112(31)
31
+	std 9,104(31)
32
+	mr 9,4
33
+	stw 9,248(31)
34
+	mr 9,8
35
+	stw 9,280(31)
36
+	mr 9,10
37
+	stw 9,296(31)
38
+	ld 9,304(31)
39
+	std 9,96(31)
40
+	ld 9,-28688(13)
41
+	std 9,184(31)
42
+	li 9,0
43
+	lwz 9,280(31)
44
+	cmpwi 0,9,0
45
+	beq 0,.L2
46
+	lwz 9,280(31)
47
+	addi 9,9,1
48
+	rldicl 9,9,0,32
49
+	rlwinm 9,9,0,0,30
50
+	stw 9,280(31)
51
+.L2:
52
+#ifdef __LITTLE_ENDIAN__
53
+	lwz 9,312(31)
54
+#else
55
+	lwz 9,316(31)
56
+#endif
57
+	cmplwi 0,9,13
58
+	ble 0,.L3
59
+	li 9,13
60
+#ifdef __LITTLE_ENDIAN__
61
+	stw 9,312(31)
62
+#else
63
+	stw 9,316(31)
64
+#endif
65
+.L3:
66
+	lwz 9,296(31)
67
+	cmplwi 0,9,8
68
+	ble 0,.L4
69
+	li 9,8
70
+	stw 9,296(31)
71
+.L4:
72
+	lwz 9,280(31)
73
+	slwi 9,9,3
74
+	rldicl 9,9,0,32
75
+	addi 9,9,15
76
+	srdi 9,9,4
77
+	sldi 9,9,4
78
+	ld 10,0(1)
79
+	neg 9,9
80
+	stdux 10,1,9
81
+	addi 9,1,96
82
+	addi 9,9,15
83
+	srdi 9,9,4
84
+	sldi 9,9,4
85
+	std 9,160(31)
86
+	lwz 9,280(31)
87
+	slwi 9,9,3
88
+	rldicl 9,9,0,32
89
+	mr 8,9
90
+	ld 10,160(31)
91
+	ld 9,112(31)
92
+	mr 5,8
93
+	mr 4,9
94
+	mr 3,10
95
+	bl memcpy
96
+	nop
97
+	ld 9,136(31)
98
+	ld 9,0(9)
99
+	std 9,168(31)
100
+	lwz 9,248(31)
101
+	slwi 9,9,3
102
+	rldicl 9,9,0,32
103
+	mr 10,9
104
+	ld 9,168(31)
105
+	add 9,9,10
106
+	std 9,168(31)
107
+	ld 9,168(31)
108
+	ld 9,0(9)
109
+	std 9,168(31)
110
+	ld 9,168(31)
111
+	std 9,176(31)
112
+	ld 9,96(31)
113
+#APP
114
+ # 123 "uno_ppc64_asm.cc" 1
115
+	lfd  1,  0(9)
116
+	lfd  2,  8(9)
117
+	lfd  3, 16(9)
118
+	lfd  4, 24(9)
119
+	lfd  5, 32(9)
120
+	lfd  6, 40(9)
121
+	lfd  7, 48(9)
122
+	lfd  8, 56(9)
123
+	lfd  9, 64(9)
124
+	lfd 10, 72(9)
125
+	lfd 11, 80(9)
126
+	lfd 12, 88(9)
127
+	lfd 13, 96(9)
128
+	
129
+ # 0 "" 2
130
+#NO_APP
131
+	ld 9,104(31)
132
+	ld 3,0(9)
133
+	ld 9,104(31)
134
+	addi 9,9,8
135
+	ld 4,0(9)
136
+	ld 9,104(31)
137
+	addi 9,9,16
138
+	ld 5,0(9)
139
+	ld 9,104(31)
140
+	addi 9,9,24
141
+	ld 6,0(9)
142
+	ld 9,104(31)
143
+	addi 9,9,32
144
+	ld 7,0(9)
145
+	ld 9,104(31)
146
+	addi 9,9,40
147
+	ld 8,0(9)
148
+	ld 9,104(31)
149
+	addi 9,9,48
150
+	ld 0,0(9)
151
+	ld 9,104(31)
152
+	addi 9,9,56
153
+	ld 9,0(9)
154
+	ld 11,176(31)
155
+	mr 10,9
156
+	mr 9,0
157
+	std 2,24(1)
158
+	mr 12,11
159
+	mtctr 12
160
+	bctrl
161
+	ld 2,24(1)
162
+#APP
163
+ # 149 "uno_ppc64_asm.cc" 1
164
+	mr     3,     3
165
+	mr     4,     4
166
+	fmr    0,     1
167
+	
168
+ # 0 "" 2
169
+#NO_APP
170
+	stfd 0,152(31)
171
+	mr 9,3
172
+	mr 10,4
173
+	lfd 0,152(31)
174
+	ld 7,128(31)
175
+	ld 6,120(31)
176
+	fmr 1,0
177
+	mr 4,10
178
+	mr 3,9
179
+	bl MapReturn
180
+	nop
181
+	nop
182
+	ld 9,184(31)
183
+	ld 10,-28688(13)
184
+	xor. 9,9,10
185
+	li 10,0
186
+	beq 0,.L5
187
+	bl __stack_chk_fail
188
+	nop
189
+.L5:
190
+	addi 1,31,208
191
+	.cfi_def_cfa 1, 0
192
+	ld 0,16(1)
193
+	mtlr 0
194
+	ld 31,-8(1)
195
+	blr
196
+	.long 0
197
+	.byte 0,9,0,1,128,1,0,1
198
+	.cfi_endproc
199
+.LFE0:
200
+	.size	callVirtualMethod,.-callVirtualMethod
201
+	.section	".toc","aw"
202
+	.align 3
203
+.LC0:
204
+	.quad	.L9
205
+	.section	".text"
206
+	.align 2
207
+	.globl privateSnippetExecutor
208
+	.type	privateSnippetExecutor, @function
209
+privateSnippetExecutor:
210
+.LFB1:
211
+	.cfi_startproc
212
+.LCF1:
213
+0:	addis 2,12,.TOC.-.LCF1@ha
214
+	addi 2,2,.TOC.-.LCF1@l
215
+	.localentry	privateSnippetExecutor,.-privateSnippetExecutor
216
+	mflr 0
217
+	std 0,16(1)
218
+	std 31,-8(1)
219
+	stdu 1,-272(1)
220
+	.cfi_def_cfa_offset 272
221
+	.cfi_offset 65, 16
222
+	.cfi_offset 31, -8
223
+	mr 31,1
224
+	.cfi_def_cfa_register 31
225
+	ld 0,-28688(13)
226
+	std 0,248(31)
227
+	li 0,0
228
+	std 3,80(31)
229
+	std 4,88(31)
230
+	std 5,96(31)
231
+	std 6,104(31)
232
+	std 7,112(31)
233
+	std 8,120(31)
234
+	std 9,128(31)
235
+	mr 9,10
236
+	std 9,136(31)
237
+	addi 9,31,144
238
+#APP
239
+ # 173 "uno_ppc64_asm.cc" 1
240
+	stfd 1,   0(9)	
241
+stfd 2,   8(9)	
242
+stfd 3,  16(9)	
243
+stfd 4,  24(9)	
244
+stfd 5,  32(9)	
245
+stfd 6,  40(9)	
246
+stfd 7,  48(9)	
247
+stfd 8,  56(9)	
248
+stfd 9,  64(9)	
249
+stfd 10, 72(9)	
250
+stfd 11, 80(9)	
251
+stfd 12, 88(9)	
252
+stfd 13, 96(9)	
253
+
254
+ # 0 "" 2
255
+#NO_APP
256
+	std 11,48(31)
257
+	std 1,56(31)
258
+	ld 9,48(31)
259
+	addi 7,31,64
260
+	addi 8,31,144
261
+	addi 10,31,80
262
+	ld 6,56(31)
263
+	mr 5,8
264
+	mr 4,10
265
+	mr 3,9
266
+	bl cpp_mediate
267
+	nop
268
+	mr 9,3
269
+	stw 9,44(31)
270
+	lwa 9,44(31)
271
+	cmplwi 0,9,15
272
+	bgt 0,.L7
273
+	sldi 10,9,2
274
+	addis 8,2,.LC0@toc@ha
275
+	ld 9,.LC0@toc@l(8)
276
+	add 9,10,9
277
+	lwz 10,0(9)
278
+	ld 9,.LC0@toc@l(8)
279
+	extsw 10,10
280
+	add 9,10,9
281
+	mtctr 9
282
+	bctr
283
+	.p2align 2
284
+	.align 2
285
+.L9:
286
+	.long .L19-.L9
287
+	.long .L13-.L9
288
+	.long .L15-.L9
289
+	.long .L15-.L9
290
+	.long .L14-.L9
291
+	.long .L13-.L9
292
+	.long .L12-.L9
293
+	.long .L8-.L9
294
+	.long .L7-.L9
295
+	.long .L7-.L9
296
+	.long .L11-.L9
297
+	.long .L10-.L9
298
+	.long .L7-.L9
299
+	.long .L7-.L9
300
+	.long .L7-.L9
301
+	.long .L8-.L9
302
+.L15:
303
+#APP
304
+ # 209 "uno_ppc64_asm.cc" 1
305
+	lbz 3,64(31)
306
+	
307
+ # 0 "" 2
308
+#NO_APP
309
+	b .L17
310
+.L13:
311
+#APP
312
+ # 214 "uno_ppc64_asm.cc" 1
313
+	lhz 3,64(31)
314
+	
315
+ # 0 "" 2
316
+#NO_APP
317
+	b .L17
318
+.L14:
319
+#APP
320
+ # 218 "uno_ppc64_asm.cc" 1
321
+	lha 3,64(31)
322
+	
323
+ # 0 "" 2
324
+#NO_APP
325
+	b .L17
326
+.L8:
327
+#APP
328
+ # 223 "uno_ppc64_asm.cc" 1
329
+	lwz 3,64(31)
330
+	
331
+ # 0 "" 2
332
+#NO_APP
333
+	b .L17
334
+.L12:
335
+#APP
336
+ # 227 "uno_ppc64_asm.cc" 1
337
+	lwa 3,64(31)
338
+	
339
+ # 0 "" 2
340
+#NO_APP
341
+	b .L17
342
+.L11:
343
+	addi 9,31,64
344
+#APP
345
+ # 231 "uno_ppc64_asm.cc" 1
346
+	lfs 1,0(9)
347
+	
348
+ # 0 "" 2
349
+#NO_APP
350
+	b .L17
351
+.L10:
352
+	addi 9,31,64
353
+#APP
354
+ # 235 "uno_ppc64_asm.cc" 1
355
+	lfd 1,0(9)
356
+	
357
+ # 0 "" 2
358
+#NO_APP
359
+	b .L17
360
+.L7:
361
+#APP
362
+ # 239 "uno_ppc64_asm.cc" 1
363
+	ld 3,64(31)
364
+	
365
+ # 0 "" 2
366
+ # 241 "uno_ppc64_asm.cc" 1
367
+	ld 4,72(31)
368
+	
369
+ # 0 "" 2
370
+#NO_APP
371
+	b .L17
372
+.L19:
373
+	nop
374
+.L17:
375
+	nop
376
+	ld 9,248(31)
377
+	ld 10,-28688(13)
378
+	xor. 9,9,10
379
+	li 10,0
380
+	beq 0,.L18
381
+	bl __stack_chk_fail
382
+	nop
383
+.L18:
384
+	addi 1,31,272
385
+	.cfi_def_cfa 1, 0
386
+	ld 0,16(1)
387
+	mtlr 0
388
+	ld 31,-8(1)
389
+	blr
390
+	.long 0
391
+	.byte 0,9,0,1,128,1,0,1
392
+	.cfi_endproc
393
+.LFE1:
394
+	.size	privateSnippetExecutor,.-privateSnippetExecutor
395
+	.section	.rodata
396
+	.align 2
397
+	.type	_ZL15codeSnippetSize, @object
398
+	.size	_ZL15codeSnippetSize, 4
399
+_ZL15codeSnippetSize:
400
+	.long	32
401
+	.section	".text"
402
+	.align 2
403
+	.globl codeSnippet
404
+	.type	codeSnippet, @function
405
+codeSnippet:
406
+.LFB2:
407
+	.cfi_startproc
408
+.LCF2:
409
+0:	addis 2,12,.TOC.-.LCF2@ha
410
+	addi 2,2,.TOC.-.LCF2@l
411
+	.localentry	codeSnippet,.-codeSnippet
412
+	std 31,-8(1)
413
+	stdu 1,-96(1)
414
+	.cfi_def_cfa_offset 96
415
+	.cfi_offset 31, -8
416
+	mr 31,1
417
+	.cfi_def_cfa_register 31
418
+	std 3,56(31)
419
+	mr 9,4
420
+	mr 8,5
421
+	mr 10,6
422
+	stw 9,52(31)
423
+	mr 9,8
424
+	stw 9,48(31)
425
+	mr 9,10
426
+	stb 9,47(31)
427
+	lwa 9,48(31)
428
+	sldi 10,9,32
429
+	lwa 9,52(31)
430
+	or 9,10,9
431
+	std 9,64(31)
432
+	lbz 9,47(31)
433
+	cmpwi 0,9,0
434
+	beq 0,.L21
435
+	ld 9,64(31)
436
+	oris 9,9,0x8000
437
+	std 9,64(31)
438
+.L21:
439
+	ld 9,56(31)
440
+	std 9,72(31)
441
+	ld 9,72(31)
442
+	lis 10,0xe96c
443
+	ori 10,10,0x18
444
+	stw 10,0(9)
445
+	ld 9,72(31)
446
+	addi 9,9,4
447
+	lis 10,0xe98c
448
+	ori 10,10,0x10
449
+	stw 10,0(9)
450
+	ld 9,72(31)
451
+	addi 9,9,8
452
+	lis 10,0x7d89
453
+	ori 10,10,0x3a6
454
+	stw 10,0(9)
455
+	ld 9,72(31)
456
+	addi 9,9,12
457
+	lis 10,0x4e80
458
+	ori 10,10,0x420
459
+	stw 10,0(9)
460
+	ld 9,72(31)
461
+	addi 9,9,16
462
+	addis 10,2,privateSnippetExecutor@toc@ha
463
+	addi 10,10,privateSnippetExecutor@toc@l
464
+	std 10,0(9)
465
+	ld 9,72(31)
466
+	addi 9,9,24
467
+	ld 10,64(31)
468
+	std 10,0(9)
469
+	ld 9,56(31)
470
+	addi 9,9,32
471
+	mr 3,9
472
+	addi 1,31,96
473
+	.cfi_def_cfa 1, 0
474
+	ld 31,-8(1)
475
+	blr
476
+	.long 0
477
+	.byte 0,9,0,0,128,1,0,1
478
+	.cfi_endproc
479
+.LFE2:
480
+	.size	codeSnippet,.-codeSnippet
481
+	.section	.note.GNU-stack,"",@progbits
482
(-)editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_cpp2uno.cxx (+257 lines)
Line 0 Link Here
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx.orig
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/cpp2uno.cxx
3
@@ -28,6 +28,7 @@
4
 #include <uno/data.h>
5
 #include <typelib/typedescription.hxx>
6
 
7
+#include <osl/endian.h>
8
 #include "bridges/cpp_uno/shared/bridge.hxx"
9
 #include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
10
 #include "bridges/cpp_uno/shared/types.hxx"
11
@@ -37,6 +38,11 @@
12
 #include <stdio.h>
13
 #include <string.h>
14
 
15
+#ifdef OSL_BIGENDIAN
16
+#define IS_BIG_ENDIAN 1
17
+#else
18
+#define IS_BIG_ENDIAN 0
19
+#endif
20
 
21
 using namespace ::com::sun::star::uno;
22
 
23
@@ -144,14 +150,14 @@
24
                 case typelib_TypeClass_BYTE:
25
                 case typelib_TypeClass_BOOLEAN:
26
                     if (ng < ppc64::MAX_GPR_REGS)
27
-					{
28
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-1));
29
+                    {
30
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 7*IS_BIG_ENDIAN);
31
                         ng++;
32
                         gpreg++;
33
                     }
34
                     else
35
-					{
36
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-1));
37
+                    {
38
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 7*IS_BIG_ENDIAN);
39
                         bOverFlowUsed = true;
40
                     }
41
                     if (bOverFlowUsed) ovrflw++;
42
@@ -160,14 +166,14 @@
43
                 case typelib_TypeClass_SHORT:
44
                 case typelib_TypeClass_UNSIGNED_SHORT:
45
                     if (ng < ppc64::MAX_GPR_REGS)
46
-					{
47
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-2));
48
+                    {
49
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 6*IS_BIG_ENDIAN);
50
                         ng++;
51
                         gpreg++;
52
                     }
53
                     else
54
-					{
55
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-2));
56
+                    {
57
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 6*IS_BIG_ENDIAN);
58
                         bOverFlowUsed = true;
59
                     }
60
                     if (bOverFlowUsed) ovrflw++;
61
@@ -176,14 +182,14 @@
62
                 case typelib_TypeClass_LONG:
63
                 case typelib_TypeClass_UNSIGNED_LONG:
64
                     if (ng < ppc64::MAX_GPR_REGS)
65
-					{
66
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + (sizeof(void*)-4));
67
+                    {
68
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)gpreg) + 4*IS_BIG_ENDIAN);
69
                         ng++;
70
                         gpreg++;
71
                     }
72
                     else
73
-					{
74
-                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + (sizeof(void*)-4));
75
+                    {
76
+                        pCppArgs[nPos] = pUnoArgs[nPos] = (((char *)ovrflw) + 4*IS_BIG_ENDIAN);
77
                         bOverFlowUsed = true;
78
                     }
79
                     if (bOverFlowUsed) ovrflw++;
80
@@ -327,21 +333,25 @@
81
 	}
82
 }
83
 
84
-
85
-//==================================================================================================
86
-static typelib_TypeClass cpp_mediate(
87
-	sal_uInt64 nOffsetAndIndex,
88
+#if defined(_CALL_ELF) && _CALL_ELF == 2
89
+#  define PARAMSAVE 32
90
+#else
91
+#  define PARAMSAVE 48
92
+#endif
93
+
94
+extern "C" typelib_TypeClass cpp_mediate(
95
+    sal_uInt64 nOffsetAndIndex,
96
         void ** gpreg, void ** fpreg, long sp,
97
-	sal_Int64 * pRegisterReturn /* space for register return */ )
98
-{
99
-    OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" );
100
+    sal_Int64 * pRegisterReturn /* space for register return */ )
101
+{
102
+    static_assert(sizeof(sal_Int64)==sizeof(void *), "### unexpected!");
103
 
104
     sal_Int32 nVtableOffset = (nOffsetAndIndex >> 32);
105
     sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF);
106
 
107
     long sf = *(long*)sp;
108
-    void ** ovrflw = (void**)(sf + 112);
109
-	
110
+    void ** ovrflw = (void**)(sf + PARAMSAVE + 64);
111
+
112
     // gpreg:  [ret *], this, [other gpr params]
113
     // fpreg:  [fpr params]
114
     // ovrflw: [gpr or fpr params (properly aligned)]
115
@@ -501,54 +511,52 @@
116
 	return eRet;
117
 }
118
 
119
-extern "C" void privateSnippetExecutor( ... )
120
-{
121
-    volatile long nOffsetAndIndex;
122
-
123
-    //mr %r3, %r11            # move into arg1 the 64bit value passed from OOo
124
+extern "C" void privateSnippetExecutor( ... );
125
+#if 0
126
+{
127
+    sal_uInt64 gpreg[ppc64::MAX_GPR_REGS];
128
+
129
+    register long r3 asm("r3"); gpreg[0] = r3;
130
+    register long r4 asm("r4"); gpreg[1] = r4;
131
+    register long r5 asm("r5"); gpreg[2] = r5;
132
+    register long r6 asm("r6"); gpreg[3] = r6;
133
+    register long r7 asm("r7"); gpreg[4] = r7;
134
+    register long r8 asm("r8"); gpreg[5] = r8;
135
+    register long r9 asm("r9"); gpreg[6] = r9;
136
+    register long r10 asm("r10"); gpreg[7] = r10;
137
+
138
+    double fpreg[ppc64::MAX_SSE_REGS];
139
+
140
     __asm__ __volatile__ (
141
-                "mr     %0,    11\n\t"
142
-                : "=r" (nOffsetAndIndex) : );
143
-
144
-    sal_uInt64 gpreg[ppc64::MAX_GPR_REGS];
145
-    double fpreg[ppc64::MAX_SSE_REGS];
146
-
147
-    __asm__ __volatile__ (
148
-        "std 3,   0(%0)\t\n"
149
-        "std 4,   8(%0)\t\n"
150
-        "std 5,  16(%0)\t\n"
151
-        "std 6,  24(%0)\t\n"
152
-        "std 7,  32(%0)\t\n"
153
-        "std 8,  40(%0)\t\n"
154
-        "std 9,  48(%0)\t\n"
155
-        "std 10, 56(%0)\t\n"
156
-        "stfd 1,   0(%1)\t\n"
157
-        "stfd 2,   8(%1)\t\n"
158
-        "stfd 3,  16(%1)\t\n"
159
-        "stfd 4,  24(%1)\t\n"
160
-        "stfd 5,  32(%1)\t\n"
161
-        "stfd 6,  40(%1)\t\n"
162
-        "stfd 7,  48(%1)\t\n"
163
-        "stfd 8,  56(%1)\t\n"
164
-        "stfd 9,  64(%1)\t\n"
165
-        "stfd 10, 72(%1)\t\n"
166
-        "stfd 11, 80(%1)\t\n"
167
-        "stfd 12, 88(%1)\t\n"
168
-        "stfd 13, 96(%1)\t\n"
169
-	: : "r" (gpreg), "r" (fpreg) 
170
-        : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
171
-          "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9",
172
+        "stfd 1,   0(%0)\t\n"
173
+        "stfd 2,   8(%0)\t\n"
174
+        "stfd 3,  16(%0)\t\n"
175
+        "stfd 4,  24(%0)\t\n"
176
+        "stfd 5,  32(%0)\t\n"
177
+        "stfd 6,  40(%0)\t\n"
178
+        "stfd 7,  48(%0)\t\n"
179
+        "stfd 8,  56(%0)\t\n"
180
+        "stfd 9,  64(%0)\t\n"
181
+        "stfd 10, 72(%0)\t\n"
182
+        "stfd 11, 80(%0)\t\n"
183
+        "stfd 12, 88(%0)\t\n"
184
+        "stfd 13, 96(%0)\t\n"
185
+    : : "r" (fpreg)
186
+        : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9",
187
           "fr10", "fr11", "fr12", "fr13"
188
     );
189
 
190
-    volatile long sp;
191
-
192
-    //stack pointer
193
-    __asm__ __volatile__ (
194
-                "mr     %0,    1\n\t"
195
-                : "=r" (sp) : );
196
-
197
+    register long r11 asm("r11");
198
+    const long nOffsetAndIndex = r11;
199
+
200
+    register long r1 asm("r1");
201
+    const long sp = r1;
202
+
203
+#if defined(_CALL_ELF) && _CALL_ELF == 2
204
+    volatile long nRegReturn[2];
205
+#else
206
     volatile long nRegReturn[1];
207
+#endif
208
 
209
     typelib_TypeClass aType =
210
         cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, sp, (sal_Int64*)nRegReturn);
211
@@ -591,11 +599,20 @@
212
         default:
213
             __asm__( "ld 3,%0\n\t" 
214
                 : : "m" (nRegReturn[0]) );
215
+#if defined(_CALL_ELF) && _CALL_ELF == 2
216
+            __asm__( "ld 4,%0\n\t"
217
+                : : "m" (nRegReturn[1]) );
218
+#endif
219
             break;
220
     }
221
 }
222
-
223
+#endif
224
+
225
+#if defined(_CALL_ELF) && _CALL_ELF == 2
226
+const int codeSnippetSize = 32;
227
+#else
228
 const int codeSnippetSize = 24;
229
+#endif
230
 
231
 unsigned char *  codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, 
232
                               bool simpleRetType)
233
@@ -609,10 +626,22 @@
234
 
235
     if ( !simpleRetType )
236
         nOffsetAndIndex |= 0x80000000;
237
-
238
+#if defined(_CALL_ELF) && _CALL_ELF == 2
239
+    unsigned int *raw = (unsigned int *)&code[0];
240
+
241
+    raw[0] = 0xe96c0018;        /* 0:   ld      11,2f-0b(12)    */
242
+    raw[1] = 0xe98c0010;        /*      ld      12,1f-0b(12)    */
243
+    raw[2] = 0x7d8903a6;        /*      mtctr   12              */
244
+    raw[3] = 0x4e800420;        /*      bctr                    */
245
+                                /* 1:   .quad   function_addr   */
246
+                                /* 2:   .quad   context         */
247
+    *(void **)&raw[4] = (void *)privateSnippetExecutor;
248
+    *(void **)&raw[6] = (void*)nOffsetAndIndex;
249
+#else
250
     void ** raw = (void **)&code[0];
251
     memcpy(raw, (char*) privateSnippetExecutor, 16);
252
     raw[2] = (void*) nOffsetAndIndex;
253
+#endif
254
 #ifdef CMC_DEBUG
255
     fprintf(stderr, "in: offset/index is %x %x %d, %lx\n", 
256
 	nFunctionIndex, nVtableOffset, !simpleRetType, raw[2]);
257
(-)editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_makefile.mk (+21 lines)
Line 0 Link Here
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/makefile.mk
3
@@ -53,7 +53,8 @@
4
 SLOFILES= \
5
 	$(SLO)$/except.obj		\
6
 	$(SLO)$/cpp2uno.obj		\
7
-	$(SLO)$/uno2cpp.obj
8
+	$(SLO)$/uno2cpp.obj		\
9
+	$(SLO)$/call.obj
10
 
11
 SHL1TARGET= $(TARGET)
12
 
13
@@ -73,3 +74,7 @@
14
 # --- Targets ------------------------------------------------------
15
 
16
 .INCLUDE :  target.mk
17
+
18
+$(SLO)$/%.obj: %.s
19
+    $(CC) -c -o $(SLO)$/$(@:b).o $<
20
+    touch $@
21
(-)editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_share.hxx (-6 / +72 lines)
Lines 1-22 Link Here
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig	2020-10-06 14:16:16 UTC
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx.orig
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/share.hxx
3
@@ -35,6 +35,7 @@ namespace CPPU_CURRENT_NAMESPACE
3
@@ -25,16 +25,64 @@
4
 
4
 
5
 #include <typeinfo>
6
 #include <exception>
7
+
8
+#include <cxxabi.h>
9
+#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
10
+#define _GLIBCXX_CDTOR_CALLABI
11
+#endif
12
 #include <cstddef>
13
+
14
+#ifndef CONFIG_CXXABI_H
15
+#define CONFIG_CXXABI_H
16
+
17
+#define HAVE_CXXABI_H_BASE_CLASS_TYPE_INFO 0
18
+#define HAVE_CXXABI_H_CLASS_TYPE_INFO 0
19
+#define HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION 0
20
+#define HAVE_CXXABI_H_CXA_EH_GLOBALS 1
21
+#define HAVE_CXXABI_H_CXA_EXCEPTION 1
22
+#define HAVE_CXXABI_H_CXA_GET_GLOBALS 1
23
+#define HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE 1
24
+#define HAVE_CXXABI_H_CXA_THROW 0
25
+#define HAVE_CXXABI_H_SI_CLASS_TYPE_INFO 0
26
+#define HAVE_CXXABI_H_VMI_CLASS_TYPE_INFO 0
27
+
28
+#endif
29
+
30
+#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
31
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
32
+// libstdc++-v3/libsupc++/cxxabi.h:
33
+namespace __cxxabiv1 {
34
+class __class_type_info: public std::type_info {
35
+public:
36
+    explicit __class_type_info(char const * n): type_info(n) {}
37
+    ~__class_type_info();
38
+};
39
+}
40
+#endif
41
+
42
+#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
43
+// <https://mentorembedded.github.io/cxx-abi/abi.html>,
44
+// libstdc++-v3/libsupc++/cxxabi.h:
45
+namespace __cxxabiv1 {
46
+class __si_class_type_info: public __class_type_info {
47
+public:
48
+    __class_type_info const * __base_type;
49
+    explicit __si_class_type_info(
50
+        char const * n, __class_type_info const *base):
51
+        __class_type_info(n), __base_type(base) {}
52
+    ~__si_class_type_info();
53
+};
54
+}
55
+#endif
56
 
57
 namespace CPPU_CURRENT_NAMESPACE
58
 {
59
 
60
-  void dummy_can_throw_anything( char const * );
61
-
62
+void dummy_can_throw_anything( char const * );
63
 
5
 // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
64
 // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
6
 
65
 
7
+#ifdef __GLIBCXX__
66
+#ifdef __GLIBCXX__
8
 struct _Unwind_Exception
67
 struct _Unwind_Exception
9
 {
68
 {
10
     unsigned exception_class __attribute__((__mode__(__DI__)));
69
     unsigned exception_class __attribute__((__mode__(__DI__)));
11
@@ -63,18 +64,21 @@ struct __cxa_exception
70
@@ -63,18 +111,21 @@
12
     
71
     
13
     _Unwind_Exception unwindHeader;
72
     _Unwind_Exception unwindHeader;
14
 };    
73
 };    
15
+#endif /* __GLIBCXX__ */
74
+#endif /* __GLIBCXX__ */
16
 
75
 
17
 extern "C" void *__cxa_allocate_exception(
76
 extern "C" void *__cxa_allocate_exception(
18
-    std::size_t thrown_size ) throw();
77
     std::size_t thrown_size ) throw();
19
+    size_t thrown_size );
20
 extern "C" void __cxa_throw (
78
 extern "C" void __cxa_throw (
21
     void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
79
     void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
22
 
80
 
Lines 31-37 +#endif /* __GLIBCXX__ */ Link Here
31
 
89
 
32
 // -----
90
 // -----
33
 
91
 
34
@@ -82,6 +86,10 @@ void raiseException(
92
@@ -82,11 +133,16 @@
35
 void raiseException(
93
 void raiseException(
36
     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
94
     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
37
 //==================================================================================================
95
 //==================================================================================================
Lines 42-44 + Link Here
42
 void fillUnoException(
100
 void fillUnoException(
43
     __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
101
     __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
44
 }
102
 }
103
 
104
 namespace ppc64
105
 {
106
-	enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 };
107
+     enum ppclimits { MAX_GPR_REGS = 8, MAX_SSE_REGS = 13 };
108
+    bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
109
 }
110
(-)editors/openoffice-4/files/patch-bridges_source_cpp__uno_gcc3__freebsd__powerpc64_uno2cpp.cxx (-5 / +376 lines)
Lines 1-9 Link Here
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig	2019-09-17 22:55:10 UTC
1
--- bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx.orig
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx
2
+++ bridges/source/cpp_uno/gcc3_freebsd_powerpc64/uno2cpp.cxx
3
@@ -42,6 +42,14 @@ using namespace ::com::sun::star::uno;
3
@@ -26,6 +26,12 @@
4
 
4
 
5
 #include <stdlib.h>
6
 
7
+#include <exception>
8
+#include <malloc.h>
9
+#include <typeinfo>
10
+
11
+#include <com/sun/star/uno/Exception.hpp>
12
+#include <com/sun/star/uno/RuntimeException.hpp>
13
 #include <com/sun/star/uno/genfunc.hxx>
14
 #include <uno/data.h>
15
 
16
@@ -42,10 +48,68 @@
17
 
5
 using namespace ::rtl;
18
 using namespace ::rtl;
6
 using namespace ::com::sun::star::uno;
19
 using namespace ::com::sun::star::uno;
20
-
21
-void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn)
7
+#ifdef __GLIBCXX__
22
+#ifdef __GLIBCXX__
8
+using CPPU_CURRENT_NAMESPACE::__cxa_exception;
23
+using CPPU_CURRENT_NAMESPACE::__cxa_exception;
9
+using CPPU_CURRENT_NAMESPACE::__cxa_get_globals;
24
+using CPPU_CURRENT_NAMESPACE::__cxa_get_globals;
Lines 12-21 +#endif Link Here
12
+using __cxxabiv1::__cxa_current_primary_exception;
27
+using __cxxabiv1::__cxa_current_primary_exception;
13
+using __cxxabiv1::__cxa_decrement_exception_refcount;
28
+using __cxxabiv1::__cxa_decrement_exception_refcount;
14
+#endif
29
+#endif
15
 
30
+
16
 void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegisterReturn)
31
+namespace ppc64
17
 {
32
 {
18
@@ -448,9 +456,18 @@ static void cpp_call(
33
-    switch (eTypeClass)
34
+#if defined(_CALL_ELF) && _CALL_ELF == 2
35
+    bool is_complex_struct(const typelib_TypeDescription * type)
36
+    {
37
+        const typelib_CompoundTypeDescription * p
38
+            = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
39
+        for (sal_Int32 i = 0; i < p->nMembers; ++i)
40
+        {
41
+            if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
42
+                p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
43
+            {
44
+                typelib_TypeDescription * t = 0;
45
+                TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
46
+                bool b = is_complex_struct(t);
47
+                TYPELIB_DANGER_RELEASE(t);
48
+                if (b) {
49
+                    return true;
50
+                }
51
+            }
52
+            else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
53
+                return true;
54
+        }
55
+        if (p->pBaseTypeDescription != 0)
56
+            return is_complex_struct(&p->pBaseTypeDescription->aBase);
57
+        return false;
58
+    }
59
+#endif
60
+
61
+    bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef )
62
+    {
63
+        if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
64
+            return false;
65
+#if defined(_CALL_ELF) && _CALL_ELF == 2
66
+        else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
67
+        {
68
+            typelib_TypeDescription * pTypeDescr = 0;
69
+            TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
70
+
71
+            //A Composite Type not larger than 16 bytes is returned in up to two GPRs
72
+            bool bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr);
73
+
74
+            TYPELIB_DANGER_RELEASE( pTypeDescr );
75
+            return bRet;
76
+        }
77
+#endif
78
+        return true;
79
+    }
80
+}
81
+
82
+extern "C" void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* pReturnType, void *pRegisterReturn)
83
+{
84
+    switch (pReturnType->eTypeClass)
85
     {
86
     case typelib_TypeClass_HYPER:
87
     case typelib_TypeClass_UNSIGNED_HYPER:
88
@@ -67,10 +131,23 @@
89
             break;
90
     case typelib_TypeClass_FLOAT:
91
             *reinterpret_cast<float *>( pRegisterReturn ) = dret;
92
-	    break;
93
+        break;
94
     case typelib_TypeClass_DOUBLE:
95
             *reinterpret_cast<double *>( pRegisterReturn ) = dret;
96
             break;
97
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98
+    case typelib_TypeClass_STRUCT:
99
+    case typelib_TypeClass_EXCEPTION:
100
+            if (!ppc64::return_in_hidden_param(pReturnType))
101
+            {
102
+                sal_uInt64 *pRegisters = reinterpret_cast<sal_uInt64*>(pRegisterReturn);
103
+                pRegisters[0] = r3;
104
+                if (pReturnType->pType->nSize > 8)
105
+                    pRegisters[1] = r4;
106
+            }
107
+#else
108
+    (void)r4;
109
+#endif
110
     default:
111
             break;
112
     }
113
@@ -79,11 +156,13 @@
114
 namespace
115
 {
116
 //==================================================================================================
117
-static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, 
118
-	void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, 
119
+extern "C" void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
120
+    void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr,
121
         sal_uInt64 *pStack, sal_uInt32 nStack,
122
         sal_uInt64 *pGPR, sal_uInt32 nGPR,
123
-        double *pFPR, sal_uInt32 nFPR)
124
+        double *pFPR, sal_uInt32 nFPR);
125
+
126
+#if 0
127
 {
128
     // Stack, if used, must be 16-bytes aligned
129
     if ( nStack )
130
@@ -99,13 +178,13 @@
131
         // Let's figure out what is really going on here
132
         {
133
                 fprintf( stderr, "= callVirtualMethod() =\nGPR's (%d): ", nGPR );
134
-                for ( int i = 0; i < nGPR; ++i )
135
+                for ( sal_uInt32 i = 0; i < nGPR; ++i )
136
                         fprintf( stderr, "0x%lx, ", pGPR[i] );
137
                 fprintf( stderr, "\nFPR's (%d): ", nFPR );
138
-                for ( int i = 0; i < nFPR; ++i ) 
139
-                        fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] );
140
+                for ( sal_uInt32 i = 0; i < nFPR; ++i )
141
+                        fprintf( stderr, "0x%lx (%lf), ", (sal_Int64)pFPR[i], pFPR[i] );
142
                 fprintf( stderr, "\nStack (%d): ", nStack );
143
-                for ( int i = 0; i < nStack; ++i )
144
+                for ( sal_uInt32 i = 0; i < nStack; ++i )
145
                         fprintf( stderr, "0x%lx, ", pStack[i] );
146
                 fprintf( stderr, "\n" );
147
         }
148
@@ -120,52 +199,40 @@
149
     pMethod += 8 * nVtableIndex;
150
     pMethod = *((sal_uInt64 *)pMethod);
151
 
152
+#if defined(_CALL_ELF) && _CALL_ELF == 2
153
+    typedef void (* FunctionCall )(...);
154
+#else
155
     typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 );
156
+#endif
157
     FunctionCall pFunc = (FunctionCall)pMethod;
158
 
159
     volatile double dret;
160
 
161
     //  fill registers
162
     __asm__ __volatile__ (
163
-                "ld   3,  0(%0)\n\t"
164
-                "ld   4,  8(%0)\n\t"
165
-                "ld   5, 16(%0)\n\t"
166
-                "ld   6, 24(%0)\n\t"
167
-                "ld   7, 32(%0)\n\t"
168
-                "ld   8, 40(%0)\n\t"
169
-                "ld   9, 48(%0)\n\t"
170
-                "ld  10, 56(%0)\n\t"
171
-                "lfd  1,  0(%1)\n\t"
172
-                "lfd  2,  8(%1)\n\t"
173
-                "lfd  3, 16(%1)\n\t"
174
-                "lfd  4, 24(%1)\n\t"
175
-                "lfd  5, 32(%1)\n\t"
176
-                "lfd  6, 40(%1)\n\t"
177
-                "lfd  7, 48(%1)\n\t"
178
-                "lfd  8, 56(%1)\n\t"
179
-                "lfd  9, 64(%1)\n\t"
180
-                "lfd 10, 72(%1)\n\t"
181
-                "lfd 11, 80(%1)\n\t"
182
-                "lfd 12, 88(%1)\n\t"
183
-                "lfd 13, 96(%1)\n\t"
184
-                : : "r" (pGPR), "r" (pFPR)
185
-          	: "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10",
186
-                  "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9",
187
-                  "fr10", "fr11", "fr12", "fr13"
188
+                "lfd  1,  0(%0)\n\t"
189
+                "lfd  2,  8(%0)\n\t"
190
+                "lfd  3, 16(%0)\n\t"
191
+                "lfd  4, 24(%0)\n\t"
192
+                "lfd  5, 32(%0)\n\t"
193
+                "lfd  6, 40(%0)\n\t"
194
+                "lfd  7, 48(%0)\n\t"
195
+                "lfd  8, 56(%0)\n\t"
196
+                "lfd  9, 64(%0)\n\t"
197
+                "lfd 10, 72(%0)\n\t"
198
+                "lfd 11, 80(%0)\n\t"
199
+                "lfd 12, 88(%0)\n\t"
200
+                "lfd 13, 96(%0)\n\t"
201
+                : : "r" (pFPR)
202
+              : "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9",
203
+                "fr10", "fr11", "fr12", "fr13"
204
     );
205
 
206
     // tell gcc that r3 to r11 are not available to it for doing the TOC and exception munge on the func call
207
     register sal_uInt64 r3 asm("r3");
208
     register sal_uInt64 r4 asm("r4");
209
-    register sal_uInt64 r5 asm("r5");
210
-    register sal_uInt64 r6 asm("r6");
211
-    register sal_uInt64 r7 asm("r7");
212
-    register sal_uInt64 r8 asm("r8");
213
-    register sal_uInt64 r9 asm("r9");
214
-    register sal_uInt64 r10 asm("r10");
215
-    register sal_uInt64 r11 asm("r11");
216
-
217
-    (*pFunc)(r3, r4, r5, r6, r7, r8, r9, r10);
218
+
219
+    (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]);
220
 
221
     // get return value
222
     __asm__ __volatile__ (
223
@@ -174,8 +241,9 @@
224
                 "fmr    %0,     1\n\t"
225
                 : "=f" (dret), "=r" (r3), "=r" (r4) : );
226
 
227
-    MapReturn(r3, dret, pReturnTypeDescr->eTypeClass, pRegisterReturn);
228
+    MapReturn(r3, r4, dret, reinterpret_cast<typelib_TypeDescriptionReference *>(pReturnTypeDescr), pRegisterReturn);
229
 }
230
+#endif
231
 
232
 // Macros for easier insertion of values to registers or stack
233
 // pSV - pointer to the source
234
@@ -185,23 +253,35 @@
235
 
236
 // The value in %xmm register is already prepared to be retrieved as a float,
237
 // thus we treat float and double the same
238
-#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverflow ) \
239
-        if ( nr < ppc64::MAX_SSE_REGS ) \
240
+#define INSERT_FLOAT( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \
241
+        if ( nGPR < ppc64::MAX_GPR_REGS ) \
242
+                ++nGPR;                   \
243
+        if ( nr < ppc64::MAX_SSE_REGS )   \
244
                 pFPR[nr++] = *reinterpret_cast<float *>( pSV ); \
245
         else \
246
-        	bOverFlow = true; \
247
+            bOverFlow = true; \
248
         if (bOverFlow) \
249
                 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
250
 
251
-#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, bOverflow ) \
252
-        if ( nr < ppc64::MAX_SSE_REGS ) \
253
+#define INSERT_DOUBLE( pSV, nr, pFPR, nGPR, pDS, bOverFlow ) \
254
+        if ( nGPR < ppc64::MAX_GPR_REGS ) \
255
+                ++nGPR;                   \
256
+        if ( nr < ppc64::MAX_SSE_REGS )   \
257
                 pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \
258
         else \
259
-        	bOverFlow = true; \
260
+            bOverFlow = true; \
261
         if (bOverFlow) \
262
                 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim!
263
 
264
-#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverflow ) \
265
+#define INSERT_INT64( pSV, nr, pGPR, pDS, bOverFlow ) \
266
+        if ( nr < ppc64::MAX_GPR_REGS ) \
267
+                pGPR[nr++] = *reinterpret_cast<sal_Int64 *>( pSV ); \
268
+        else \
269
+        bOverFlow = true; \
270
+    if (bOverFlow) \
271
+                *pDS++ = *reinterpret_cast<sal_Int64 *>( pSV );
272
+
273
+#define INSERT_UINT64( pSV, nr, pGPR, pDS, bOverFlow ) \
274
         if ( nr < ppc64::MAX_GPR_REGS ) \
275
                 pGPR[nr++] = *reinterpret_cast<sal_uInt64 *>( pSV ); \
276
         else \
277
@@ -209,7 +289,15 @@
278
 	if (bOverFlow) \
279
                 *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV );
280
 
281
-#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverflow ) \
282
+#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverFlow ) \
283
+        if ( nr < ppc64::MAX_GPR_REGS ) \
284
+                pGPR[nr++] = *reinterpret_cast<sal_Int32 *>( pSV ); \
285
+        else \
286
+                bOverFlow = true; \
287
+        if (bOverFlow) \
288
+                *pDS++ = *reinterpret_cast<sal_Int32 *>( pSV );
289
+
290
+#define INSERT_UINT32( pSV, nr, pGPR, pDS, bOverFlow ) \
291
         if ( nr < ppc64::MAX_GPR_REGS ) \
292
                 pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
293
         else \
294
@@ -217,7 +305,15 @@
295
         if (bOverFlow) \
296
                 *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
297
 
298
-#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverflow ) \
299
+#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverFlow ) \
300
+        if ( nr < ppc64::MAX_GPR_REGS ) \
301
+                pGPR[nr++] = *reinterpret_cast<sal_Int16 *>( pSV ); \
302
+        else \
303
+                bOverFlow = true; \
304
+        if (bOverFlow) \
305
+                *pDS++ = *reinterpret_cast<sal_Int16 *>( pSV );
306
+
307
+#define INSERT_UINT16( pSV, nr, pGPR, pDS, bOverFlow ) \
308
         if ( nr < ppc64::MAX_GPR_REGS ) \
309
                 pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
310
         else \
311
@@ -225,7 +321,15 @@
312
         if (bOverFlow) \
313
                 *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
314
 
315
-#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverflow ) \
316
+#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverFlow ) \
317
+        if ( nr < ppc64::MAX_GPR_REGS ) \
318
+                pGPR[nr++] = *reinterpret_cast<sal_Int8 *>( pSV ); \
319
+        else \
320
+                bOverFlow = true; \
321
+        if (bOverFlow) \
322
+                *pDS++ = *reinterpret_cast<sal_Int8 *>( pSV );
323
+
324
+#define INSERT_UINT8( pSV, nr, pGPR, pDS, bOverFlow ) \
325
         if ( nr < ppc64::MAX_GPR_REGS ) \
326
                 pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \
327
         else \
328
@@ -337,19 +441,23 @@
329
                                 INSERT_INT32( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
330
                                 break;
331
                         case typelib_TypeClass_SHORT:
332
+                                INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
333
+                                break;
334
                         case typelib_TypeClass_CHAR:
335
                         case typelib_TypeClass_UNSIGNED_SHORT:
336
                                 INSERT_INT16( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
337
                                 break;
338
                         case typelib_TypeClass_BOOLEAN:
339
+                                INSERT_UINT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
340
+                                break;
341
                         case typelib_TypeClass_BYTE:
342
                                 INSERT_INT8( pCppArgs[nPos], nGPR, pGPR, pStack, bOverFlow );
343
                                 break;
344
                         case typelib_TypeClass_FLOAT:
345
-                                INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow );
346
-				break;
347
+                                INSERT_FLOAT( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow );
348
+								break;
349
                         case typelib_TypeClass_DOUBLE:
350
-                                INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, pStack, bOverFlow );
351
+                                INSERT_DOUBLE( pCppArgs[nPos], nFPR, pFPR, nGPR, pStack, bOverFlow );
352
                                 break;
353
                         }
354
 
355
@@ -448,9 +556,18 @@
19
 	}
356
 	}
20
  	catch (...)
357
  	catch (...)
21
  	{
358
  	{
Lines 36-38 + CPPU_CURRENT_NAMESPACE::fillUnoException( header, * Link Here
36
         
373
         
37
 		// temporary params
374
 		// temporary params
38
 		for ( ; nTempIndizes--; )
375
 		for ( ; nTempIndizes--; )
376
@@ -475,8 +592,8 @@
377
 	void * pReturn, void * pArgs[], uno_Any ** ppException )
378
 {
379
 	// is my surrogate
380
-        bridges::cpp_uno::shared::UnoInterfaceProxy * pThis 
381
-            = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
382
+        ::bridges::cpp_uno::shared::UnoInterfaceProxy * pThis 
383
+            = static_cast< ::bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
384
 	typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
385
 	
386
 	switch (pMemberDescr->eTypeClass)
387
@@ -484,8 +601,8 @@
388
 	case typelib_TypeClass_INTERFACE_ATTRIBUTE:
389
 	{
390
 
391
-        VtableSlot aVtableSlot(
392
-            getVtableSlot(
393
+        ::bridges::cpp_uno::shared::VtableSlot aVtableSlot(
394
+            ::bridges::cpp_uno::shared::getVtableSlot(
395
                 reinterpret_cast<
396
                     typelib_InterfaceAttributeTypeDescription const * >(
397
                         pMemberDescr)));
398
@@ -529,8 +646,8 @@
399
 	case typelib_TypeClass_INTERFACE_METHOD:
400
 	{
401
 
402
-        VtableSlot aVtableSlot(
403
-            getVtableSlot(
404
+        ::bridges::cpp_uno::shared::VtableSlot aVtableSlot(
405
+            ::bridges::cpp_uno::shared::getVtableSlot(
406
                 reinterpret_cast<
407
                     typelib_InterfaceMethodTypeDescription const * >(
408
                         pMemberDescr)));
409
(-)editors/openoffice-4/files/patch-set_soenv.in (+67 lines)
Line 0 Link Here
1
--- set_soenv.in	2021-04-02 08:58:22.000000000 -0400
2
+++ set_soenv.in	2021-04-17 14:43:53.000000000 -0400
3
@@ -408,46 +403,26 @@
4
       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
5
       $EPM_FLAGS      = "-a arm";
6
    }
7
-   elsif ($platform =~ m/^powerpc/)
8
-   {
9
-      if (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) {
10
-         print "Setting FreeBSD PPC64 specific values... ";
11
-         $outfile = "FreeBSDPPC64Env.Set"; 
12
-         $OUTPATH = "unxfbsdppc64";
13
-         $CPUNAME = "POWERPC64";
14
-
15
-         if ( $JDK eq "gcj" ) {
16
-            $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64";
17
-            $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."client";
18
-            $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
19
-         }
20
-      }
21
-      else {
22
-         print "Setting FreeBSD PPC specific values... ";
23
-         $outfile = "FreeBSDPPCEnv.Set"; 
24
-         $OUTPATH = "unxlngppc";
25
-         $CPUNAME = "POWERPC";
26
-
27
-         if ( $JDK eq "gcj" ) {
28
-            $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
29
-            $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
30
-            $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; }
31
-         elsif ($JDK =~ m/^[Ii][Bb][Mm]/)
32
-         {  $JRELIBDIR     = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
33
-            $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
34
-            $JRETHREADDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
35
-         }
36
-	 # OpenJDK
37
-	 elsif ($JDK =~ m/sun/) {
38
-	    $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
39
-	    $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."server";
40
-	    $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
41
-	 }
42
-      }
43
-
44
+   elsif (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8'))
45
+   {  print "Setting FreeBSD PPC64 specific values... ";
46
+      $outfile        = "FreeBSDPPC64Env.Set"; 
47
       $CPU            = "P";
48
-
49
+      $CPUNAME        = "POWERPC64";
50
+      $OUTPATH        = "unxfbsdppc64";
51
+      $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64";
52
+      $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."server";
53
+      $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
54
    }
55
+   elsif ($platform =~ m/powerpc/)
56
+   {  print "Setting FreeBSD PPC specific values... ";
57
+      $outfile        = "FreeBSDPPCEnv.Set"; 
58
+      $CPU            = "P";
59
+      $CPUNAME        = "POWERPC";
60
+      $OUTPATH        = "unxfbsdppc";
61
+      $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
62
+      $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
63
+      $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
64
+   }
65
    else
66
    {  print "Unsupported FreeBSD architecture: $platform \n";
67
          exit 1;
(-)editors/openoffice-4/files/patch-solenv_inc_unxfbsdp.mk (+34 lines)
Line 0 Link Here
1
--- /dev/null
2
+++ solenv/inc/unxfbsdp.mk	2024-03-27 19:54:01.799314000 -0400
3
@@ -0,0 +1,31 @@
4
+#**************************************************************
5
+#  
6
+#  Licensed to the Apache Software Foundation (ASF) under one
7
+#  or more contributor license agreements.  See the NOTICE file
8
+#  distributed with this work for additional information
9
+#  regarding copyright ownership.  The ASF licenses this file
10
+#  to you under the Apache License, Version 2.0 (the
11
+#  "License"); you may not use this file except in compliance
12
+#  with the License.  You may obtain a copy of the License at
13
+#  
14
+#    http://www.apache.org/licenses/LICENSE-2.0
15
+#  
16
+#  Unless required by applicable law or agreed to in writing,
17
+#  software distributed under the License is distributed on an
18
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
+#  KIND, either express or implied.  See the License for the
20
+#  specific language governing permissions and limitations
21
+#  under the License.
22
+#  
23
+#**************************************************************
24
+
25
+
26
+
27
+# mk file for Unix FreeBSD 64Bit PowerPC using GCC, inherit from
28
+# ppc and add some flags
29
+
30
+.INCLUDE : unxfbsdppc.mk
31
+
32
+CDEFS+=-DPOWERPC64
33
+CFLAGSCXX+=-mminimal-toc
34
+BUILD64=1
(-)editors/openoffice-4/files/patch-testtools__source__bridgetest__makefile.mk (+12 lines)
Line 0 Link Here
1
--- testtools/source/bridgetest/makefile.mk.orig
2
+++ testtools/source/bridgetest/makefile.mk
3
@@ -134,7 +134,7 @@
4
 
5
 runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk \
6
         $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN)
7
-.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(COM)$(OS)$(CPU)"=="GCCFREEBSDP"
8
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS" || "$(OS)$(CPU)"=="FREEBSDP"
9
 	@echo "Mac OSX PPC GCC and Solaris fails this test! likely broken UNO bridge. Fix me."
10
 .ELSE
11
         cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \
12

Return to bug 251417