Subject: Re: pkgsrc gcc3 vs. sparc64?
To: Todd Vierling <tv@pobox.com>
From: Andrey Petrov <petrov@netbsd.org>
List: port-sparc64
Date: 07/02/2003 00:09:02
On Mon, Jun 30, 2003 at 11:20:47PM -0400, Todd Vierling wrote:
> On Tue, 1 Jul 2003, matthew green wrote:
> 
> :    I don't know how to fix it properly so workarounds:
> :    	configure with --disable-shared so there will be no libgcc_s.so,
> :    or
> :    	set TARGET_LIBGCC2_CFLAGS to usual -fPIC -DPIC in gcc/Makefile (after configure),
> :    	(there will be PIC penalty for libgcc_s.a).
> :
> : aren't there a set of flags espcially for libgcc_s?  these should
> : contain -fPIC -DPIC and it probably should go in gcc/config/netbsd.h.
> 
> Right.  libgcc_s should always be PIC, and there is zero reason for it not
> to be.
> 

I mean libgcc.a, sorry if that became a source for confusion. PIC penalty
probably is too small to bother, especially for embed-any model we use.
I need to look at ABI and generated code to check though.

It seems to me that currently the most reliable gcc version for sparc64 is
gcc 3.2.3. I saw several miscompilation reports for gcc3.3, and 3.3.x fixes
most of them, but if built on -current netbsd system it ICEs during 
regress/lib/libc/convfp/convfp.c compilation. Interestingly the same gcc version
compiles that file without problem on solaris.

I also made a complete built with gcc3.3 and installed and run it. And a major
problem is that in-tree compiler doesn't work, due to crt[in].o which became necessary
for proper build. I havn't tried to rebuild intree gcc to correct spec, we have it
builtin inside compiler. So I tried gcc3.2.3 and very interestingly that even with
corrected spec (to include mentioned crt* files) it can not generate executable
which works. I might screw something during build so I'm going to repeat this
procedure again...

	Andrey