3.0.2 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Int el (version 2)

Rainer Orth ro@TechFak.Uni-Bielefeld.DE
Wed Sep 26 09:25:00 GMT 2001


Hans Boehm writes:

> I personally would be happy to very have you go ahead and check it in with
> the ifdef __GNUC__ , assuming you check that the result still builds.  I
> believe I'm generally allowed to approve check-ins to this part of the code.
> But I haven't been following the current 3.0.2 procedures, since my only
> recent work has been on the trunk.  If it's otherwise consistent with the
> 3.0.2 procedures, please check it in.

ok, I've checked in the patch below.  It leaves the original (non-GCC) code
as is.  I've reconfigured, rebuilt and tested boehm-gc on the branch before
to make sure I didn't introduce any typos.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

Email: ro@TechFak.Uni-Bielefeld.DE


2001-09-26  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* mach_dep.c (GC_push_regs) [I386 && (SVR4 || SCO || SCO_ELF)
	&& __GNUC__ ]: 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/26 16:20:39
@@ -281,6 +281,18 @@ 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 */
+#	 ifdef __GNUC__
+	  /* This is necessary to support PIC code.  */
+#	 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)
+#	 else /* !__GNUC__ */
 	  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");
@@ -288,6 +300,7 @@ void GC_push_regs()
 	  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");
+#	 endif /* !__GNUC__ */
 #       endif
 
 #       ifdef NS32K



More information about the Java-patches mailing list