Patches to make Mozilla work on OpenBSD/macppc.

This commit is contained in:
drahn 2004-03-01 23:51:58 +00:00
parent 8ef0fd503a
commit 604b10a9c6
5 changed files with 33 additions and 35 deletions

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.67 2004/02/25 02:35:17 naddy Exp $
# $OpenBSD: Makefile,v 1.68 2004/03/01 23:51:58 drahn Exp $
ONLY_FOR_ARCHS= alpha i386 sparc sparc64
ONLY_FOR_ARCHS= alpha i386 sparc sparc64 powerpc
COMMENT= "open source version of the Netscape browser"
COMMENT-devel= "devel files for Gecko"
@ -37,7 +37,7 @@ SUBPACKAGE?=
RUN_DEPENDS= ::www/mozilla
.else
MODULES= gcc3
MODGCC3_ARCHES= alpha
MODGCC3_ARCHES= alpha powerpc
MODGCC3_LANGS= C++
BUILD_DEPENDS= :zip->=2.3:archivers/zip \
:pkgconfig-*:devel/pkgconfig

View File

@ -22,6 +22,7 @@
# beard@netscape.com (Patrick Beard)
# waterson@netscape.com (Chris Waterson)
#
.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
@ -62,8 +63,8 @@ XPTC_InvokeByIndex:
addi r0,r10,96 # reserve stack for GPR and FPR register save area r0 = r10 + 96
lwz r9,0(sp) # r9 = backchain
neg r0,r0
stwux r9,sp,r0 # reserve stack sapce and save SP backchain
stwux r9,sp,r0 # reserve stack space and save SP backchain
addi r3,sp,8 # r3 <= args
mr r4,r5 # r4 <= paramCount
mr r5,r6 # r5 <= params
@ -85,13 +86,14 @@ XPTC_InvokeByIndex:
lwz r3,8(r31) # r3 <= that
lwz r4,12(r31) # r4 <= methodIndex
lwz r5,0(r3) # r5 <= vtable ( == *that )
slwi r4,r4,3 # convert to offset ( *= 8 )
addi r4,r4,8 # skip first two vtable entries
add r4,r4,r5
lhz r0,0(r4) # virtual base offset
extsh r0,r0
add r3,r3,r0
lwz r0,4(r4) # r0 <= methodpointer ( == vtable + offset )
#if 0
#if !((__GNUC__ == 3 && __GNUC_MINOR__ < 2) || __GXX_ABI_VERSION >= 100) # G++ pre-V3 ABI
addi r4,r4,2 # skip first two vtable entries
#endif
#endif
subi r4,r4,2 # skip first two vtable entries
slwi r4,r4,2 # convert to offset ( *= 4 )
lwzx r0,r5,r4 # r0 <= methodpointer ( == vtable + offset )
lwz r4,4(r30) # load GP regs with method parameters
lwz r5,8(r30)

View File

@ -104,23 +104,13 @@ invoke_copy_to_stack(PRUint32* d,
if ((PRUint32) d & 4) d++; // doubles are 8-byte aligned on stack
*((double*) d) = s->val.d;
d += 2;
#if 0
if (gpr < GPR_COUNT)
gpr += 2;
#endif
}
}
else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
if (fpr < FPR_COUNT)
fpregs[fpr++] = s->val.f; // if passed in registers, floats are promoted to doubles
else {
*((float*) d) = s->val.f;
d += 1;
#if 0
if (gpr < GPR_COUNT)
gpr += 1;
#endif
}
else
*((float*) d++) = s->val.f;
}
else if (!s->IsPtrData() && (s->type == nsXPTType::T_I64
|| s->type == nsXPTType::T_U64)) {

View File

@ -119,20 +119,14 @@ PrepareAndDispatch(nsXPTCStubBase* self,
if ((PRUint32) ap & 4) ap++; // doubles are 8-byte aligned on stack
dp->val.d = *(double*) ap;
ap += 2;
if (gpr < GPR_COUNT)
gpr += 2;
}
continue;
}
else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
if (fpr < FPR_COUNT)
dp->val.f = (float) fprData[fpr++]; // in registers floats are passed as doubles
else {
dp->val.f = *(float*) ap;
ap += 1;
if (gpr < GPR_COUNT)
gpr += 1;
}
else
dp->val.f = *(float*) ap++;
continue;
}
else if (!param.IsOut() && (type == nsXPTType::T_I64

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-nsprpub_pr_include_md__openbsd_h,v 1.1 2004/02/29 22:27:49 wilfried Exp $
--- nsprpub/pr/include/md/_openbsd.h.orig 2000-06-20 23:23:18.000000000 +0200
+++ nsprpub/pr/include/md/_openbsd.h 2004-02-22 11:12:33.000000000 +0100
$OpenBSD: patch-nsprpub_pr_include_md__openbsd_h,v 1.2 2004/03/01 23:51:58 drahn Exp $
--- nsprpub/pr/include/md/_openbsd.h.orig 2004-03-01 17:54:03.000000000 -0500
+++ nsprpub/pr/include/md/_openbsd.h 2004-03-01 17:50:51.000000000 -0500
@@ -71,6 +71,12 @@
#define _PR_HAVE_SYSV_SEMAPHORES
#define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
@ -14,3 +14,15 @@ $OpenBSD: patch-nsprpub_pr_include_md__openbsd_h,v 1.1 2004/02/29 22:27:49 wilfr
#define USE_SETJMP
#ifndef _PR_PTHREADS
@@ -80,8 +86,10 @@
#define CONTEXT(_th) ((_th)->md.context)
-#if defined(__i386__) || defined(__sparc__) || defined(__m68k__) || defined(__powerpc__)
+#if defined(__i386__) || defined(__sparc__) || defined(__m68k__)
#define JB_SP_INDEX 2
+#elif defined(__powerpc__)
+#define JB_SP_INDEX 1
#elif defined(__alpha__)
#define JB_SP_INDEX 34
#elif defined(__arm32__)