Patches to make firefox work on OpenBSD/macppc

This commit is contained in:
drahn 2004-03-01 23:52:32 +00:00
parent 604b10a9c6
commit 2b42fd088e
5 changed files with 29 additions and 36 deletions

View File

@ -1,6 +1,6 @@
# $OpenBSD: Makefile,v 1.5 2004/03/01 09:12:13 wilfried Exp $
# $OpenBSD: Makefile,v 1.6 2004/03/01 23:52:32 drahn Exp $
ONLY_FOR_ARCHS= alpha i386 sparc sparc64 amd64
ONLY_FOR_ARCHS= alpha i386 sparc sparc64 amd64 powerpc
COMMENT= "redesign of Mozilla's browser component"
@ -23,7 +23,7 @@ MASTER_SITES= http://ftp.eu.mozilla.org/pub/mozilla.org/firefox/releases/${VER}/
DISTFILES= firefox-source-${VER}.tar.bz2
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.2 2004/03/01 07:14:48 pvalchev Exp $
--- nsprpub/pr/include/md/_openbsd.h.orig 2000-06-20 15:23:18.000000000 -0600
+++ nsprpub/pr/include/md/_openbsd.h 2004-02-29 19:51:25.000000000 -0700
$OpenBSD: patch-nsprpub_pr_include_md__openbsd_h,v 1.3 2004/03/01 23:52:32 drahn Exp $
--- nsprpub/pr/include/md/_openbsd.h.orig 2004-03-01 16:15:11.000000000 -0500
+++ nsprpub/pr/include/md/_openbsd.h 2004-03-01 16:16:17.000000000 -0500
@@ -43,6 +43,8 @@
#define _PR_SI_ARCHITECTURE "x86"
#elif defined(__alpha__)
@ -23,8 +23,15 @@ $OpenBSD: patch-nsprpub_pr_include_md__openbsd_h,v 1.2 2004/03/01 07:14:48 pvalc
#define USE_SETJMP
#ifndef _PR_PTHREADS
@@ -84,6 +92,8 @@
@@ -80,10 +88,14 @@
#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(__amd64__)