[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: powerpc-elf-netbsd patch for gcc-2.8.0



<199802200516.OAA06253@ruri.iri.co.jp>の記事において
1998年02月20日14時16分頃、tsubai@iri.co.jpさんは書きました。

 > でもやっぱり self でも使えるパッチになるとうれしいな…。

toolchainのalphaのところに綺麗に書かれたのがあったので持ってきました。

PREFIX/powerpc-elf-netbsd
			 /include
			 /lib
を、DESTDIRのusr/include, usr/libとシンボリックリンクにでも
しておけば、powerpc-elf-netbsd-gcc hoge.cで、NetBSD/powerpcバイナリが
手に入ります。


# target=host=powerpc-elf-netbsd host=i386-netbsdで作ろうとしたら失敗...

sakamoto@cec.co.jp

*** configure.orig	Fri Feb 20 11:58:05 1998
--- configure	Fri Feb 20 11:58:05 1998
***************
*** 4517,4522 ****
--- 4517,4530 ----
  		fi
  		xmake_file=rs6000/x-sysv4
  		;;
+ 	powerpc-elf-netbsd*)
+ 		tm_file=rs6000/netbsd.h
+ 		xm_file=rs6000/xm-netbsd.h
+ 		fixincludes=Makefile.in
+ 		extra_headers=ppc-asm.h
+ 		tmake_file=t-libc-ok
+ 		xmake_file=x-netbsd
+ 		;;
  	powerpc-*-eabiaix*)
  		tm_file=rs6000/eabiaix.h
  		tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
*** /dev/null	Fri Feb 20 18:16:41 1998
--- config/rs6000/netbsd.h	Fri Feb 20 18:17:19 1998
***************
*** 0 ****
--- 1,61 ----
+ #include <rs6000/sysv4.h>
+ 
+ /* Get generic NetBSD definitions.  */
+ 
+ #include <netbsd.h>
+ 
+ /* Use bcopy etc. instead of memcpy etc. */
+ #undef	TARGET_MEM_FUNCTIONS
+ 
+ /* Names to predefine in the preprocessor for this target machine.  */
+ #undef	CPP_PREDEFINES
+ #define CPP_PREDEFINES "-D__powerpc__ -D__PPC__ -D__NetBSD__ -Asystem(unix) -Asystem(NetBSD) -Acpu(powerpc) -Amachine(powerpc)"
+ 
+ /* Make gcc agree with <machine/ansi.h> */
+ 
+ #undef SIZE_TYPE
+ #define SIZE_TYPE "unsigned int"
+ 
+ #undef PTRDIFF_TYPE
+ #define PTRDIFF_TYPE "int"
+ 
+ #undef WCHAR_TYPE
+ #define WCHAR_TYPE "int"
+ 
+ #undef WCHAR_TYPE_SIZE
+ #define WCHAR_TYPE_SIZE 32
+ 
+ /* Don't default to pcc-struct-return, because gcc is the only compiler, and
+    we want to retain compatibility with older gcc versions.  */
+ #define DEFAULT_PCC_STRUCT_RETURN 0
+ 
+ /* Until gcc uses fixed functions on procedure entry, -mmultiple is probably
+    more efficient due to smaller code and less cache thrashing.  */
+ #undef	CC1_SPEC
+ #define	CC1_SPEC	"-mmultiple"
+ 
+ /* We want a implemetation reserved symbol for the entry point! */
+ #undef	LINK_SPEC
+ #define	LINK_SPEC	"%{!nostdlib:%{!r*:%{!e*:-e _start}}} -dc -dp %{static:-Bstatic} %{assert*}"
+ 
+ /* Provide a STARTFILE_SPEC appropriate for NetBSD.  Here we add
+    the crtbegin.o file (see crtstuff.c) which provides part of the
+    support for getting C++ file-scope static object constructed
+    before entering `main'. */
+    
+ #undef	STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+  "%{!shared: \
+      %{pg:gcrt0.o%s} \
+      %{!pg: \
+ 	%{p:gcrt0.o%s} \
+ 	%{!p:crt0.o%s}}} \
+    %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+ 
+ /* Provide a ENDFILE_SPEC appropriate for NetBSD.  Here we tack on
+    the file which provides part of the support for getting C++
+    file-scope static object deconstructed after exiting `main' */
+ 
+ #undef	ENDFILE_SPEC
+ #define ENDFILE_SPEC \
+   "%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
*** /dev/null	Fri Feb 20 18:16:41 1998
--- config/rs6000/xm-netbsd.h	Fri Feb 20 11:58:05 1998
***************
*** 0 ****
--- 1,9 ----
+ /* Configuration for GCC for PowerPC running NetBSD as host.  */
+ 
+ #include <rs6000/xm-rs6000.h>
+ 
+ /* NetBSD isn't SysV */
+ #undef	USG
+ 
+ /* Not needed on NetBSD (really?) */
+ #undef	COLLECT_EXPORT_LIST