This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: 3.0.2 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel (version 2)
- To: "'Rainer Orth'" <ro at TechFak dot Uni-Bielefeld dot DE>, java-patches at gcc dot gnu dot org
- Subject: RE: 3.0.2 PATCH: Avoid non-PIC code in boehm-gc for Solaris 2/Intel (version 2)
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- Date: Tue, 25 Sep 2001 15:04:03 -0700
- Cc: "Boehm, Hans" <hans_boehm at hp dot com>, Richard Henderson <rth at redhat dot com>
I'd marginally prefer to see it conditioned on __GNUC__, although I agree
that it doesn't make much difference. In general, I think everyone has
tried to avoid specializing the code in gcc/boehm-gc to that context. I
haven't tried it, but I believe it has been possible to build the general
general collector library from the code in the gcc tree with some simple
Makefile renaming. That's probably not a very important property here, but
it seems worth 8 or 9 lines of code to preserve it.
Otherwise it looks OK to me. Richard: Do you believe this is a reasonably
reliable use of gcc's register declaration mechanism? I never entirely
understood its semantics on an architecture on which nearly every register
has some preassigned use.
Hans
> -----Original Message-----
> From: Rainer Orth [mailto:ro@TechFak.Uni-Bielefeld.DE]
> Sent: Tuesday, September 25, 2001 8:43 AM
> To: gcc-patches@gcc.gnu.org; java-patches@gcc.gnu.org
> Cc: Hans Boehm; Richard Henderson
> Subject: 3.0.2 PATCH: Avoid non-PIC code in boehm-gc for
> Solaris 2/Intel
> (version 2)
>
>
> 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
>