Subject: Re: getting gcc-2.95.2 working
To: Brad Chapman <chapmanb@arches.uga.edu>
From: Andrew Cagney <ac131313@cygnus.com>
List: port-macppc
Date: 07/05/2001 00:20:51
This is a multi-part message in MIME format.
--------------030209060708010605020100
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I don't think your GCC should even be generating .toc sections.

From memory, the TOC was part of the PowerOpen (AIX) ABI and was

omitted from the SVR4 ABI.


> [work/gcc-2.95.2/gcc]$ diff -c configure.orig configure
> *** configure.orig      Sat Jun 30 07:02:16 2001
> --- configure   Sat Jun 30 09:37:35 2001
> ***************
> *** 5068,5073 ****
> --- 5068,5075 ----
>         powerpc-*-openbsd*)
>                 tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
>                 ;;
> +       powerpc-*-netbsd*)
> +               ;;
>         powerpc-*-beos*)
>                 cpu_type=rs6000
>                 tm_file=rs6000/beos.h
> 


The attatched (against GCC current) is probably relevant.  It tweeks 
things to build an SVR4 GCC/PPC (NetBSD/PPC uses the SVR4 ABI).

Using this patch, current GCC can at least configure and build 
(.../configure ; gmake all-gdb).  It barfs while trying to cross compile 
some of the libraries vis:


/home/scratch/EGCS/native/gcc/xgcc -B/home/scratch/EGCS/native/gcc/ 
-B/home/scratch/cygnus/H-powerpc-apple-netbsd1.5W/T-powerpc-apple-netbsd1.5W/B-EGCS/powerpc-apple-netbsd1.5W/bin/ 
-B/home/scratch/cygnus/H-powerpc-apple-netbsd1.5W/T-powerpc-apple-netbsd1.5W/B-EGCS/powerpc-apple-netbsd1.5W/lib/ 
-isystem 
/home/scratch/cygnus/H-powerpc-apple-netbsd1.5W/T-powerpc-apple-netbsd1.5W/B-EGCS/powerpc-apple-netbsd1.5W/include 
-c -DHAVE_CONFIG_H -g -O -I. 
-I/home/scratch/EGCS/gcc/libiberty/../include  -W -Wall -Wtraditional 
-pedantic /home/scratch/EGCS/gcc/libiberty/strerror.c
/home/scratch/EGCS/gcc/libiberty/strerror.c:465: conflicting types for 
`sys_nerr'
/usr/include/errno.h:56: previous declaration of `sys_nerr'
/home/scratch/EGCS/gcc/libiberty/strerror.c:466: conflicting types for 
`sys_errlist'
/usr/include/errno.h:57: previous declaration of `sys_errlist'
gmake[1]: *** [strerror.o] Error 1
gmake[1]: Leaving directory 
`/home/scratch/EGCS/native/powerpc-apple-netbsd1.5W/libiberty'
gmake: *** [all-target-libiberty] Error 2

but that sounds like a lot more progress than you were making.

	Andrew

--------------030209060708010605020100
Content-Type: text/plain;
 name="diffs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diffs"

2001-07-04  Andrew Cagney  <ac131313@redhat.com>
+ 
+ 	* config.gcc: Recognize powerpc-*-netbsd*.
+ 
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.70
diff -p -r1.70 config.gcc
*** config.gcc	2001/06/28 19:55:51	1.70
--- config.gcc	2001/07/05 04:03:36
*************** powerpc-*-linux*)
*** 2644,2649 ****
--- 2644,2655 ----
  		thread_file='posix'
  	fi
  	;;
+ powerpc-*-netbsd*)
+ 	xm_defines=POSIX
+ 	tm_file="${tm_file} svr4.h rs6000/sysv4.h"
+ 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
+ 	extra_headers=ppc-asm.h
+ 	;;
  powerpc-wrs-vxworks*)
          cpu_type=rs6000
  	xm_defines=POSIX

--------------030209060708010605020100--