This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
3.0.2 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel (version 2)
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Subject: 3.0.2 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel (version 2)
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Tue, 25 Sep 2001 17:43:04 +0200 (MEST)
- Cc: Hans Boehm <hans_boehm at hp dot com>, Richard Henderson <rth at redhat dot com>
This is an updated version of
http://gcc.gnu.org/ml/gcc-patches/2001-06/msg01613.html
incorporating Richards suggestion to handle the problem portably. I've
made the change only in the section used by Solaris 2/Intel, and could even
restrict it to a I386/SUNOS5 only section if that were desired to make
absolutely sure it doesn't affect other platforms. I didn't protect the
code by #ifdef __GNUC__, since this won't get into a general-purpose
boehm-gc release: the problem doesn't exist in boehm-gc 6.0/on the trunk,
but has been solved there by using __builtin_unwind_init ().
This patch allows a shared libgcjgc.so to be built on i386-pc-solaris2.9,
which failed before as described in the original patch submission and PR
bootstrap/4162.
Another patch to fix Solaris 2/Intel support will follow shortly, which
makes gctest work and allows the libjava testsuite to succeed.
Ok for the branch?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Tue Sep 25 15:09:03 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* mach_dep.c (GC_push_regs) [I386 && SVR4 || SCO || SCO_ELF]: Call
GC_push_one in C to allow for PIC code.
Fixes PR bootstrap/4162.
Index: mach_dep.c
===================================================================
RCS file: /cvs/gcc/gcc/boehm-gc/mach_dep.c,v
retrieving revision 1.7
diff -u -p -r1.7 mach_dep.c
--- mach_dep.c 2000/04/27 00:43:33 1.7
+++ mach_dep.c 2001/09/25 13:42:25
@@ -281,13 +281,15 @@ void GC_push_regs()
# if defined(I386) && (defined(SVR4) || defined(SCO) || defined(SCO_ELF))
/* I386 code, SVR4 variant, generic code does not appear to work */
- asm("pushl %eax"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %ebx"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %ecx"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %edx"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %ebp"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %esi"); asm("call GC_push_one"); asm("addl $4,%esp");
- asm("pushl %edi"); asm("call GC_push_one"); asm("addl $4,%esp");
+#define call_push(REGNAME) \
+ { register word reg __asm__( #REGNAME ); GC_push_one (reg); }
+
+#ifndef PIC
+ call_push(ebx)
+#endif
+ call_push(ebp)
+ call_push(esi)
+ call_push(edi)
# endif
# ifdef NS32K