Fix for bug 272369

`firefox -register` results in SIGSEGV on s390(x)

Patch by Dr. Ulrich Weigand <uweigand@de.ibm.com> r=shaver sr=dougt

The patch reverts the problematic parts of the earlier fix attempt, and uses compiler options to make GCC 3.4 behave as the assembly stubs expect:
-fno-strict-aliasing
  (several of the routines violate C aliasing rules)
-fno-inline
  (so that the InvokeByIndex function allocates a stack frame)
-fomit-frame-pointer
  (so that %r11 is available for allocation, otherwise we might not be able to satisfy 6 inputs + 6 clobbers in GPRs)
-mbackchain
  (so that xptcstubs has the backchain available)


git-svn-id: svn://10.0.0.236/trunk@167692 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
caillon%redhat.com 2005-01-13 23:13:49 +00:00
parent 31ac9b1d94
commit 30cd2d061d
5 changed files with 7 additions and 16 deletions

View File

@ -358,10 +358,12 @@ endif
#
ifeq ($(OS_ARCH)$(OS_TEST),Linuxs390)
CPPSRCS := xptcinvoke_linux_s390.cpp xptcstubs_linux_s390.cpp
CXXFLAGS += -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain
endif
ifeq ($(OS_ARCH)$(OS_TEST),Linuxs390x)
CPPSRCS := xptcinvoke_linux_s390x.cpp xptcstubs_linux_s390x.cpp
CXXFLAGS += -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain
endif

View File

@ -200,8 +200,6 @@ invoke_copy_to_stack(PRUint32 paramCount, nsXPTCVariant* s, PRUint32* d_ov, PRUi
}
}
volatile register void* r14 asm("r14");
XPTC_PUBLIC_API(nsresult)
XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
@ -215,8 +213,6 @@ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 overflow = invoke_count_words (paramCount, params);
PRUint32 result;
volatile void* sav_r14 = r14;
__asm__ __volatile__
(
"lr 7,15\n\t"
@ -251,10 +247,8 @@ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
"a" (invoke_copy_to_stack),
"a" (that),
"a" (method)
: "2", "3", "4", "5", "6", "7", "memory"
: "2", "3", "4", "5", "6", "7", "14", "cc", "memory", "%f0", "%f2"
);
r14 = sav_r14;
return result;
}

View File

@ -194,8 +194,6 @@ invoke_copy_to_stack(PRUint32 paramCount, nsXPTCVariant* s, PRUint64* d_ov, PRUi
}
}
volatile register void* r14 asm("r14");
XPTC_PUBLIC_API(nsresult)
XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
@ -209,8 +207,6 @@ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint64 overflow = invoke_count_words (paramCount, params);
PRUint64 result;
volatile void* sav_r14 = r14;
__asm__ __volatile__
(
"lgr 7,15\n\t"
@ -247,10 +243,9 @@ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
"a" (invoke_copy_to_stack),
"a" (that),
"a" (method)
: "2", "3", "4", "5", "6", "7", "memory"
: "2", "3", "4", "5", "6", "7", "14", "cc", "memory",
"%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"
);
r14 = sav_r14;
return result;
}

View File

@ -193,7 +193,7 @@ nsresult nsXPTCStubBase::Stub##n() \
\
__asm__ __volatile__ \
( \
"lr %0,15\n\t" \
"l %0,0(15)\n\t" \
"ahi %0,96\n\t" \
"stm 3,6,0(%3)\n\t" \
"std 0,%1\n\t" \

View File

@ -193,7 +193,7 @@ nsresult nsXPTCStubBase::Stub##n() \
\
__asm__ __volatile__ \
( \
"lgr %0,15\n\t" \
"lg %0,0(15)\n\t" \
"aghi %0,160\n\t" \
"stmg 3,6,0(%5)\n\t"\
"std 0,%1\n\t" \