This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] adds powerpc-*-freebsd? to mainline


On Tue, Nov 13, 2001 at 08:39:46PM -0800, Geoff Keating wrote:
> Wouldn't it be easier, and more useful, to split config/freebsd.h into
> two pieces, one of which just defines the FBSD_* macros, and another
> piece?

Here is the patch that does that.  It also moves TARGET_VERSION out of
rs6000.h into the OS headers.  Look ready to commit?


2001-11-08  David O'Brien  <obrien@FreeBSD.org>

	* config.gcc: Add FreeBSD/PowerPC target.
	(powerpc64-*-linux*, powerpc-*-sysv*, powerpc-*-netbsd*,
	powerpc-*-chorusos*, powerpc-*-eabiaix*, powerpc-*-eabisim*,
	powerpc-*-elf*, powerpc-*-eabi*, powerpc-*-rtems*,
	powerpc-*-linux*libc1, powerpc-*-linux*, powerpc-wrs-vxworks*,
	powerpcle-wrs-vxworks*, powerpcle-*-sysv*, powerpcle-*-elf*,
	powerpcle-*-eabisim*, powerpcle-*-eabi*, powerpcle-*-solaris2*): Add
	freebsd-spec.h to tm_file.
	(rs6000-*-lynxos*): Add lynx.h to tm_file.
	* config/freebsd.h: Tidy up.
	(USING_CONFIG_FREEBSD): Define.
	(FBSD_SWITCH_TAKES_ARG, FBSD_WORD_SWITCH_TAKES_ARG,
	FBSD_CPP_PREDEFINES, FBSD_CPP_SPEC, FBSD_STARTFILE_SPEC,
	FBSD_ENDFILE_SPEC, FBSD_LIB_SPEC): Remove (moved to freebsd-spec.h).
	(TARGET_HAS_F_SETLKW): Define.
	(ASM_OUTPUT_IDENT): Delete, the elfos.h definition is fine.
	* config/freebsd-spec.h: New file.
	* config/rs6000/freebsd.h: New file.
	* config/rs6000/rs6000.h (TARGET_VERSION): Do not define.
	* config/rs6000/rs6000.c: Test for USING_ELFOS_H rather than
	USING_SVR4_H to know when to turn on ELF support.
	* config/rs6000/sysv4.h (TARGET_VERSION, CPP_PREDEFINES): Don't undef,
	define only if not already defined.
	Add FreeBSD support.
	* config/rs6000/aix.h (TARGET_VERSION): Define.
	* config/rs6000/beos.h: Likewise.
	* config/rs6000/dwarin.h: Likewise.
	* config/rs6000/mach.h: Likewise.
	* config/rs6000/lynx.h (TARGET_VERSION): Likewise.
	Don't include lynx.h directly.


Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.114
diff -u -r1.114 config.gcc
--- config.gcc	2001/11/17 05:46:25	1.114
+++ config.gcc	2001/11/17 07:08:06
@@ -320,7 +320,7 @@
 	# entries of tm_file with the minor exception that components
 	# of the tm_file set here will always be of the form:
 	#
-	# freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd.h
+	# freebsd<version_number>.h [freebsd-<conf_option>.h ...] freebsd-spec.h freebsd.h
 	#
 	# The machine-specific section should not tamper with this
 	# ordering but may order all other entries of tm_file as it
@@ -346,7 +346,7 @@
 		;;
 	*) echo 'Unknown thread configuration for FreeBSD'; exit 1;;
 	esac
-	fbsd_tm_file="${fbsd_tm_file} freebsd.h"
+	fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h"
 	if test x${thread_file} = xposix; then
 	  if test x${enable_libgcj} = xyes; then
 	    echo 'FreeBSD does not currently handle --enable-threads (now'
@@ -2610,7 +2610,7 @@
 	tmake_file="${tmake_file} rs6000/t-rs6000 rs6000/t-openbsd"
 	;;
 powerpc64-*-linux*)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux64.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux64.h"
 	out_file=rs6000/rs6000.c
 	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
@@ -2636,21 +2636,28 @@
 	# Darwin linker does collect2 functionality
 	use_collect2=no
 	;;
+powerpc*-*-freebsd*)
+	tm_file="${tm_file} elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
+	xm_file=rs6000/xm-sysv4.h
+	out_file=rs6000/rs6000.c
+	tmake_file="rs6000/t-ppcos t-freebsd rs6000/t-ppccomm"
+	extra_headers=ppc-asm.h
+	;;
 powerpc-*-sysv*)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
 	xm_defines=POSIX
 	extra_headers=ppc-asm.h
 	tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
 	;;
 powerpc-*-netbsd*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/netbsd.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
 	tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpc-*-chorusos*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h chorus.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h chorus.h"
 	tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	case x${enable_threads} in
@@ -2661,31 +2668,31 @@
 	;;
 powerpc-*-eabiaix*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabiaix.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabiaix.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpc-*-eabisim*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/eabisim.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpc-*-elf*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpc-*-eabi*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpc-*-rtems*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/eabi.h rtems.h rs6000/rtems.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rtems.h rs6000/rtems.h"
 	tmake_file="rs6000/t-ppcgas t-rtems rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	if test x$enable_threads = xyes; then
@@ -2693,7 +2700,7 @@
 	fi
 	;;
 powerpc-*-linux*libc1)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
 	out_file=rs6000/rs6000.c
 	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux t-linux-gnulibc1 rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
@@ -2702,7 +2709,7 @@
 	fi
 	;;
 powerpc-*-linux*)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/linux.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/linux.h"
 	out_file=rs6000/rs6000.c
 	tmake_file="rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
@@ -2712,44 +2719,44 @@
 	;;
 powerpc-wrs-vxworks*)
 	xm_defines=POSIX
-        tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/vxppc.h"
+        tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/vxppc.h"
         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	thread_file='vxworks'
         ;;
 powerpcle-wrs-vxworks*)
 	xm_defines=POSIX
-        tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/vxppc.h"
+        tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/vxppc.h"
         tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	thread_file='vxworks'
         ;;
 powerpcle-*-sysv*)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
 	xm_defines=POSIX
 	tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpcle-*-elf*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpcle-*-eabisim*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h rs6000/eabisim.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpcle-*-eabi*)
 	xm_defines=POSIX
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/eabi.h"
 	tmake_file="rs6000/t-ppcgas rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
 	;;
 powerpcle-*-solaris2*)
-	tm_file="${tm_file} elfos.h svr4.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/sol2.h"
+	tm_file="${tm_file} elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/sysv4le.h rs6000/sol2.h"
 	xm_defines=POSIX
 	tmake_file="rs6000/t-ppcos rs6000/t-ppccomm"
 	extra_headers=ppc-asm.h
@@ -2808,7 +2815,7 @@
 	use_collect2=yes
 	;;
 rs6000-*-lynxos*)
-	tm_file=rs6000/lynx.h
+	tm_file="lynx.h rs6000/lynx.h"
 	tmake_file=rs6000/t-rs6000
 	use_collect2=yes
 	;;
Index: config/freebsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/freebsd.h,v
retrieving revision 1.10
diff -u -r1.10 freebsd.h
--- freebsd.h	2001/11/10 01:07:16	1.10
+++ freebsd.h	2001/11/17 07:08:07
@@ -27,139 +27,31 @@
    Loren J. Rittle <ljrittle@acm.org>.  */
 
 
-/* To help with rs6000/sysv4.h carnal knowledge problem.  */
-#define _USING_CONFIG_FREEBSD 1
+/* In case we need to know.  */
+#define USING_CONFIG_FREEBSD 1
 
 /* This defines which switch letters take arguments.  On FreeBSD, most of
    the normal cases (defined in gcc.c) apply, and we also have -h* and
    -z* options (for the linker) (coming from SVR4).
    We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */
 
-#define FBSD_SWITCH_TAKES_ARG(CHAR)					\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)					\
-    || (CHAR) == 'h'							\
-    || (CHAR) == 'z' /* ignored by ld */				\
-    || (CHAR) == 'R')
-
 #undef  SWITCH_TAKES_ARG
 #define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
 
-/* This defines which multi-letter switches take arguments.  */
-
-#define FBSD_WORD_SWITCH_TAKES_ARG(STR)					\
-  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
-   || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link")		\
-   || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") 		\
-   || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
-
 #undef  WORD_SWITCH_TAKES_ARG
 #define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
 
-#if FBSD_MAJOR == 6
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=6 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 5
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=5 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 4
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=4 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#if FBSD_MAJOR == 3
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__=3 -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
-#ifndef FBSD_CPP_PREDEFINES
-#define FBSD_CPP_PREDEFINES \
-  "-D__FreeBSD__   -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
-#endif
-
 #undef  CPP_PREDEFINES
 #define CPP_PREDEFINES FBSD_CPP_PREDEFINES
 
-/* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC 
-   option `-posix', and PIC issues.  */
-
-#define FBSD_CPP_SPEC "							\
-  %(cpp_cpu)								\
-  %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__}		\
-  %{posix:-D_POSIX_SOURCE}"
-
 #undef  CPP_SPEC
 #define CPP_SPEC FBSD_CPP_SPEC
+
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
 
-/* Provide a STARTFILE_SPEC appropriate for FreeBSD.  Here we add
-   the magical crtbegin.o file (see crtstuff.c) which provides part 
-	of the support for getting C++ file-scope static object constructed 
-	before entering `main'. */
-   
-#define FBSD_STARTFILE_SPEC \
-  "%{!shared: \
-     %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
-		       %{!p:%{profile:gcrt1.o%s} \
-			 %{!profile:crt1.o%s}}}} \
-   crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for FreeBSD.  Here we tack on
-   the magical crtend.o file (see crtstuff.c) which provides part of 
-	the support for getting C++ file-scope static object constructed 
-	before entering `main', followed by a normal "finalizer" file, 
-	`crtn.o'.  */
-
-#define FBSD_ENDFILE_SPEC \
-  "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
-
-/* Provide a LIB_SPEC appropriate for FreeBSD as configured and as
-   required by the user-land thread model.  Before __FreeBSD_version
-   500016, select the appropriate libc, depending on whether we're
-   doing profiling or need threads support.  At __FreeBSD_version
-   500016 and later, when threads support is requested include both
-   -lc and -lc_r instead of only -lc_r.  To make matters interesting,
-   we can't actually use __FreeBSD_version provided by <osreldate.h>
-   directly since it breaks cross-compiling.  As a final twist, make
-   it a hard error if -pthread is provided on the command line and gcc
-   was configured with --disable-threads (this will help avoid bug
-   reports from users complaining about threading when they
-   misconfigured the gcc bootstrap but are later consulting FreeBSD
-   manual pages that refer to the mythical -pthread option).  */
-
-/* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
-   libc, depending on whether we're doing profiling or need threads support.
-   (simular to the default, except no -lg, and no -p).  */
-
-#ifdef FBSD_NO_THREADS
-#define FBSD_LIB_SPEC "							\
-  %{pthread: %eThe -pthread option is only supported on FreeBSD when gcc \
-is built with the --enable-threads configure-time option.}		\
-  %{!shared:								\
-    %{!pg: -lc}								\
-    %{pg:  -lc_p}							\
-  }"
-#else
-#if FBSD_MAJOR >= 5
-#define FBSD_LIB_SPEC "							\
-  %{!shared:								\
-    %{!pg: %{pthread:-lc_r} -lc}					\
-    %{pg:  %{pthread:-lc_r_p} -lc_p}					\
-  }"
-#else
-#define FBSD_LIB_SPEC "							\
-  %{!shared:								\
-    %{!pg:								\
-      %{!pthread:-lc}							\
-      %{pthread:-lc_r}}							\
-    %{pg:								\
-      %{!pthread:-lc_p}							\
-      %{pthread:-lc_r_p}}						\
-  }"
-#endif
-#endif
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
 
 #undef  LIB_SPEC
 #define LIB_SPEC FBSD_LIB_SPEC
@@ -197,6 +89,11 @@
    with libraries compiled with the native cc.  */
 #undef NO_DOLLAR_IN_LABEL
 
+/* Used by libgcc2.c.  We support file locking with fcntl / F_SETLKW.
+   This enables the test coverage code to use file locking when exiting a
+   program, which avoids race conditions if the program has forked.  */
+#define TARGET_HAS_F_SETLKW
+
 /* The prefix to add to user-visible assembler symbols.
    For System V Release 4 & ELF the convention is *not* to prepend a leading
    underscore onto user-level symbol names. Some CPU files such as
@@ -217,12 +114,6 @@
 
 #undef  IDENT_ASM_OP
 #define IDENT_ASM_OP "\t.ident\t"
-
-/* Output #ident as a .ident.  */
-
-#undef  ASM_OUTPUT_IDENT
-#define ASM_OUTPUT_IDENT(FILE, NAME)					\
-  fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
 
 /************************[  Debugger stuff  ]*********************************/
 
Index: config/rs6000/aix.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix.h,v
retrieving revision 1.26
diff -u -r1.26 aix.h
--- aix.h	2001/11/07 20:49:41	1.26
+++ aix.h	2001/11/17 07:08:07
@@ -189,3 +189,6 @@
 #define SETUP_FRAME_ADDRESSES() rs6000_aix_emit_builtin_unwind_init ()
 
 #define PROFILE_HOOK(LABEL)   output_profile_hook (LABEL)
+
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION ;
Index: config/rs6000/beos.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/beos.h,v
retrieving revision 1.7
diff -u -r1.7 beos.h
--- beos.h	2001/11/15 05:21:06	1.7
+++ beos.h	2001/11/17 07:08:07
@@ -20,6 +20,8 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (BeOS/PowerPC)");
 
 /* Enable AIX XL compiler calling convention breakage compatibility.  */
 #define MASK_XL_CALL		0x40000000
Index: config/rs6000/darwin.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/darwin.h,v
retrieving revision 1.12
diff -u -r1.12 darwin.h
--- darwin.h	2001/11/15 05:21:06	1.12
+++ darwin.h	2001/11/17 07:08:07
@@ -19,6 +19,9 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC)");
+
 /* The "Darwin ABI" is mostly like AIX, but with some key differences.  */
 
 #define DEFAULT_ABI ABI_DARWIN
Index: config/rs6000/freebsd.h
===================================================================
RCS file: freebsd.h
diff -N freebsd.h
--- /dev/null	Tue May  5 13:32:27 1998
+++ freebsd.h	Fri Nov 16 23:08:07 2001
@@ -0,0 +1,66 @@
+/* Definitions for PowerPC running FreeBSD using the ELF format
+   Copyright (C) 2001 Free Software Foundation, Inc.
+   Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING.  If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+
+/* Override the defaults, which exist to force the proper definition. */
+
+#undef	CPP_OS_DEFAULT_SPEC
+#define CPP_OS_DEFAULT_SPEC "%(cpp_os_freebsd)"
+
+#undef	STARTFILE_DEFAULT_SPEC
+#define STARTFILE_DEFAULT_SPEC "%(startfile_freebsd)"
+
+#undef	ENDFILE_DEFAULT_SPEC
+#define ENDFILE_DEFAULT_SPEC "%(endfile_freebsd)"
+
+#undef	LIB_DEFAULT_SPEC
+#define LIB_DEFAULT_SPEC "%(lib_freebsd)"
+
+#undef	LINK_START_DEFAULT_SPEC
+#define LINK_START_DEFAULT_SPEC "%(link_start_freebsd)"
+
+#undef	LINK_OS_DEFAULT_SPEC
+#define	LINK_OS_DEFAULT_SPEC "%(link_os_freebsd)"
+
+
+/************************[  Target stuff  ]***********************************/
+
+/* Define the actual types of some ANSI-mandated types.  
+   Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
+   c-common.c, and config/<arch>/<arch>.h.  */
+
+/* rs6000.h gets this wrong for FreeBSD.  We use the GCC defaults instead.  */
+#undef WCHAR_TYPE
+
+#undef  WCHAR_UNSIGNED
+#define WCHAR_UNSIGNED 0
+
+#undef  WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE 32
+
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/PowerPC ELF)");
+
+/* Override rs6000.h definition.  */
+#undef  ASM_APP_ON
+#define ASM_APP_ON "#APP\n"
+
+/* Override rs6000.h definition.  */
+#undef  ASM_APP_OFF
+#define ASM_APP_OFF "#NO_APP\n"
Index: config/rs6000/lynx.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/lynx.h,v
retrieving revision 1.6
diff -u -r1.6 lynx.h
--- lynx.h	2001/11/15 05:21:06	1.6
+++ lynx.h	2001/11/17 07:08:07
@@ -19,8 +19,6 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-#include <lynx.h>
-
 /* Definitions we want to override with those from rs6000.h: */
 #undef LIB_SPEC
 #undef PTRDIFF_TYPE
@@ -46,6 +44,9 @@
 #undef FUNCTION_PROFILER
 
 #include <rs6000/rs6000.h>
+
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION fprintf (stderr, " (LynxOS-RS/6000)");
 
 /* LynxOS has signed chars, regardless of what most R/S 6000 systems do */
 #undef DEFAULT_SIGNED_CHAR
Index: config/rs6000/mach.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/mach.h,v
retrieving revision 1.5
diff -u -r1.5 mach.h
--- mach.h	2001/05/03 07:56:42	1.5
+++ mach.h	2001/11/17 07:08:07
@@ -22,6 +22,9 @@
 
 #define TARGET_AIX 0
 
+/* Print subsidiary information on the compiler version in use.  */
+#define TARGET_VERSION fprintf (stderr, " (Mach-RS/6000)");
+
 /* We don't define AIX under MACH; instead we define `unix'.  */
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "-Drios -D_IBMR2 -Dunix -Asystem=unix -Asystem=mach -Acpu=rs6000 -Amachine=rs6000"
Index: config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.236
diff -u -r1.236 rs6000.c
--- rs6000.c	2001/11/16 01:06:37	1.236
+++ rs6000.c	2001/11/17 07:08:10
@@ -80,7 +80,7 @@
    get the address of the GOT section */
 int rs6000_pic_labelno;
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
 /* Which abi to adhere to */
 const char *rs6000_abi_name = RS6000_ABI_NAME;
 
@@ -540,7 +540,7 @@
 	    }
 	}
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
       switch (rs6000_sdata)
 	{
 	case SDATA_NONE: fprintf (file, "%s -msdata=none", start); start = ""; break;
@@ -8848,7 +8848,7 @@
    Do not define this macro if you put all constants in the read-only
    data section.  */
 
-#ifdef USING_SVR4_H
+#ifdef USING_ELFOS_H
 
 void
 rs6000_select_rtx_section (mode, x)
@@ -9054,7 +9054,7 @@
     }
 }
 
-#endif /* USING_SVR4_H */
+#endif /* USING_ELFOS_H */
 
 
 /* Return a REG that occurs in ADDR with coefficient 1.
Index: config/rs6000/rs6000.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.h,v
retrieving revision 1.137
diff -u -r1.137 rs6000.h
--- rs6000.h	2001/11/15 21:06:51	1.137
+++ rs6000.h	2001/11/17 07:08:10
@@ -41,9 +41,6 @@
 #define TARGET_AIX 0
 #endif
 
-/* Print subsidiary information on the compiler version in use.  */
-#define TARGET_VERSION ;
-
 /* Default string to use for cpu if not specified.  */
 #ifndef TARGET_CPU_DEFAULT
 #define TARGET_CPU_DEFAULT ((char *)0)
Index: config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.69
diff -u -r1.69 sysv4.h
--- sysv4.h	2001/11/07 20:49:41	1.69
+++ sysv4.h	2001/11/17 07:08:11
@@ -200,6 +200,8 @@
     }									\
   else if (!strcmp (rs6000_abi_name, "aixdesc"))			\
     rs6000_current_abi = ABI_AIX;					\
+  else if (!strcmp (rs6000_abi_name, "freebsd"))			\
+    rs6000_current_abi = ABI_V4;					\
   else if (!strcmp (rs6000_abi_name, "linux"))				\
     rs6000_current_abi = ABI_V4;					\
   else if (!strcmp (rs6000_abi_name, "netbsd"))				\
@@ -939,12 +941,14 @@
 
 /* This is the end of what might become sysv4dbx.h.  */
 
-/* Override rs6000.h definition.  */
-#undef	TARGET_VERSION
+#ifndef	TARGET_VERSION
 #define	TARGET_VERSION fprintf (stderr, " (PowerPC System V.4)");
+#endif
 
+#ifndef	CPP_PREDEFINES
 #define	CPP_PREDEFINES \
   "-DPPC -Dunix -D__svr4__ -Asystem=unix -Asystem=svr4 -Acpu=powerpc -Amachine=powerpc"
+#endif
 
 /* Pass various options to the assembler.  */
 /* Override svr4.h definition.  */
@@ -957,9 +961,11 @@
 %{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-solaris: -mlittle -msolaris} \
+    %{mcall-freebsd: -mbig} \
     %{mcall-i960-old: -mlittle} \
     %{mcall-linux: -mbig} \
-    %{mcall-netbsd: -mbig} }}}}"
+    %{mcall-netbsd: -mbig} \
+}}}}"
 
 #define	CC1_ENDIAN_BIG_SPEC ""
 
@@ -978,13 +984,14 @@
 %{mbig: %(cc1_endian_big)} %{!mbig: %{mbig-endian: %(cc1_endian_big)}} \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-aixdesc: -mbig %(cc1_endian_big) } \
+    %{mcall-freebsd: -mbig %(cc1_endian_big) } \
     %{mcall-solaris: -mlittle %(cc1_endian_little) } \
     %{mcall-i960-old: -mlittle %(cc1_endian_little) } \
     %{mcall-linux: -mbig %(cc1_endian_big) } \
     %{mcall-netbsd: -mbig %(cc1_endian_big) } \
-    %{!mcall-aixdesc: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
+    %{!mcall-aixdesc: %{!mcall-freebsd: %{!mcall-solaris: %{!mcall-i960-old: %{!mcall-linux: %{!mcall-netbsd: \
 	    %(cc1_endian_default) \
-    }}}}} \
+    }}}}}} \
 }}}} \
 %{mcall-solaris: -mregnames } \
 %{mno-sdata: -msdata=none } \
@@ -992,6 +999,7 @@
 %{!meabi: %{!mno-eabi: \
     %{mrelocatable: -meabi } \
     %{mcall-solaris: -mno-eabi } \
+    %{mcall-freebsd: -mno-eabi } \
     %{mcall-i960-old: -meabi } \
     %{mcall-linux: -mno-eabi } \
     %{mcall-netbsd: -mno-eabi }}} \
@@ -1022,10 +1030,11 @@
 %{myellowknife: %(link_start_yellowknife) } \
 %{mmvme: %(link_start_mvme) } \
 %{msim: %(link_start_sim) } \
+%{mcall-freebsd: %(link_start_freebsd) } \
 %{mcall-linux: %(link_start_linux) } \
 %{mcall-netbsd: %(link_start_netbsd) } \
 %{mcall-solaris: %(link_start_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_start_default) }}}}}}}}"
 
 #define LINK_START_DEFAULT_SPEC ""
 
@@ -1078,10 +1087,11 @@
 %{myellowknife: %(link_os_yellowknife) } \
 %{mmvme: %(link_os_mvme) } \
 %{msim: %(link_os_sim) } \
+%{mcall-freebsd: %(link_os_freebsd) } \
 %{mcall-linux: %(link_os_linux) } \
 %{mcall-netbsd: %(link_os_netbsd) } \
 %{mcall-solaris: %(link_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(link_os_default) }}}}}}}}"
 
 #define LINK_OS_DEFAULT_SPEC ""
 
@@ -1127,11 +1137,12 @@
 %{mbig-endian: %(cpp_endian_big) } \
 %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
     %{mcall-solaris: %(cpp_endian_solaris) } \
+    %{mcall-freebsd: %(cpp_endian_big) } \
     %{mcall-linux: %(cpp_endian_big) } \
     %{mcall-netbsd: %(cpp_endian_big) } \
     %{mcall-i960-old: %(cpp_endian_little) } \
     %{mcall-aixdesc:  %(cpp_endian_big) } \
-    %{!mcall-solaris: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}"
+    %{!mcall-solaris: %{!mcall-linux: %{!mcall-freebsd: %{!mcall-netbsd: %{!mcall-aixdesc: %(cpp_endian_default) }}}}}}}}}"
 
 #define	CPP_ENDIAN_DEFAULT_SPEC "%(cpp_endian_big)"
 
@@ -1142,10 +1153,11 @@
 %{myellowknife: %(cpp_os_yellowknife) } \
 %{mmvme: %(cpp_os_mvme) } \
 %{msim: %(cpp_os_sim) } \
+%{mcall-freebsd: %(cpp_os_freebsd) } \
 %{mcall-linux: %(cpp_os_linux) } \
 %{mcall-netbsd: %(cpp_os_netbsd) } \
 %{mcall-solaris: %(cpp_os_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(cpp_os_default) }}}}}}}}"
 
 #define	CPP_OS_DEFAULT_SPEC ""
 
@@ -1156,10 +1168,11 @@
 %{myellowknife: %(startfile_yellowknife) } \
 %{mmvme: %(startfile_mvme) } \
 %{msim: %(startfile_sim) } \
+%{mcall-freebsd: %(startfile_freebsd) } \
 %{mcall-linux: %(startfile_linux) } \
 %{mcall-netbsd: %(startfile_netbsd) } \
 %{mcall-solaris: %(startfile_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(startfile_default) }}}}}}}}"
 
 #define	STARTFILE_DEFAULT_SPEC ""
 
@@ -1170,10 +1183,11 @@
 %{myellowknife: %(lib_yellowknife) } \
 %{mmvme: %(lib_mvme) } \
 %{msim: %(lib_sim) } \
+%{mcall-freebsd: %(lib_freebsd) } \
 %{mcall-linux: %(lib_linux) } \
 %{mcall-netbsd: %(lib_netbsd) } \
 %{mcall-solaris: %(lib_solaris) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %%{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %(lib_default) }}}}}}}}"
 
 #define LIB_DEFAULT_SPEC ""
 
@@ -1184,11 +1198,12 @@
 %{myellowknife: %(endfile_yellowknife)} \
 %{mmvme: %(endfile_mvme)} \
 %{msim: %(endfile_sim)} \
+%{mcall-freebsd: %(endfile_freebsd) } \
 %{mcall-linux: %(endfile_linux) } \
 %{mcall-netbsd: %(endfile_netbsd) } \
 %{mcall-solaris: %(endfile_solaris)} \
 %{mvxworks: %(endfile_vxworks) } \
-%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}"
+%{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-freebsd: %{!mcall-linux: %{!mcall-netbsd: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}}}"
 
 #define	ENDFILE_DEFAULT_SPEC ""
 
@@ -1244,6 +1259,20 @@
 
 #define CPP_OS_SIM_SPEC ""
 
+/* FreeBSD support.  */
+
+#define CPP_OS_FREEBSD_SPEC	"\
+  -D__PPC__ -D__ppc__ -D__PowerPC__ -D__powerpc__ \
+  -Acpu=powerpc -Amachine=powerpc"
+
+#define	STARTFILE_FREEBSD_SPEC	FBSD_STARTFILE_SPEC
+#define ENDFILE_FREEBSD_SPEC	FBSD_ENDFILE_SPEC
+#define LIB_FREEBSD_SPEC	FBSD_LIB_SPEC
+#define LINK_START_FREEBSD_SPEC	""
+
+#define LINK_OS_FREEBSD_SPEC "\
+  %{symbolic:-Bsymbolic}"
+
 /* GNU/Linux support.  */
 #ifdef USE_GNULIBC_1
 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } \
@@ -1401,6 +1430,7 @@
   { "lib_yellowknife",		LIB_YELLOWKNIFE_SPEC },			\
   { "lib_mvme",			LIB_MVME_SPEC },			\
   { "lib_sim",			LIB_SIM_SPEC },				\
+  { "lib_freebsd",		LIB_FREEBSD_SPEC },			\
   { "lib_linux",		LIB_LINUX_SPEC },			\
   { "lib_netbsd",		LIB_NETBSD_SPEC },			\
   { "lib_solaris",		LIB_SOLARIS_SPEC },			\
@@ -1410,6 +1440,7 @@
   { "startfile_yellowknife",	STARTFILE_YELLOWKNIFE_SPEC },		\
   { "startfile_mvme",		STARTFILE_MVME_SPEC },			\
   { "startfile_sim",		STARTFILE_SIM_SPEC },			\
+  { "startfile_freebsd",	STARTFILE_FREEBSD_SPEC },		\
   { "startfile_linux",		STARTFILE_LINUX_SPEC },			\
   { "startfile_netbsd",		STARTFILE_NETBSD_SPEC },		\
   { "startfile_solaris",	STARTFILE_SOLARIS_SPEC },		\
@@ -1419,6 +1450,7 @@
   { "endfile_yellowknife",	ENDFILE_YELLOWKNIFE_SPEC },		\
   { "endfile_mvme",		ENDFILE_MVME_SPEC },			\
   { "endfile_sim",		ENDFILE_SIM_SPEC },			\
+  { "endfile_freebsd",		ENDFILE_FREEBSD_SPEC },			\
   { "endfile_linux",		ENDFILE_LINUX_SPEC },			\
   { "endfile_netbsd",		ENDFILE_NETBSD_SPEC },			\
   { "endfile_solaris",		ENDFILE_SOLARIS_SPEC },			\
@@ -1432,6 +1464,7 @@
   { "link_start_yellowknife",	LINK_START_YELLOWKNIFE_SPEC },		\
   { "link_start_mvme",		LINK_START_MVME_SPEC },			\
   { "link_start_sim",		LINK_START_SIM_SPEC },			\
+  { "link_start_freebsd",	LINK_START_FREEBSD_SPEC },		\
   { "link_start_linux",		LINK_START_LINUX_SPEC },		\
   { "link_start_netbsd",	LINK_START_NETBSD_SPEC },		\
   { "link_start_solaris",	LINK_START_SOLARIS_SPEC },		\
@@ -1442,6 +1475,7 @@
   { "link_os_yellowknife",	LINK_OS_YELLOWKNIFE_SPEC },		\
   { "link_os_mvme",		LINK_OS_MVME_SPEC },			\
   { "link_os_sim",		LINK_OS_SIM_SPEC },			\
+  { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
   { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
   { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
   { "link_os_solaris",		LINK_OS_SOLARIS_SPEC },			\
@@ -1459,6 +1493,7 @@
   { "cpp_os_yellowknife",	CPP_OS_YELLOWKNIFE_SPEC },		\
   { "cpp_os_mvme",		CPP_OS_MVME_SPEC },			\
   { "cpp_os_sim",		CPP_OS_SIM_SPEC },			\
+  { "cpp_os_freebsd",		CPP_OS_FREEBSD_SPEC },			\
   { "cpp_os_linux",		CPP_OS_LINUX_SPEC },			\
   { "cpp_os_netbsd",		CPP_OS_NETBSD_SPEC },			\
   { "cpp_os_solaris",		CPP_OS_SOLARIS_SPEC },			\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]