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

David O'Brien obrien@FreeBSD.org
Tue Nov 13 15:03:00 GMT 2001


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

	* config.gcc: Add FreeBSD/PowerPC target.
	* config/freebsd.h: Tidy up.
	(_USING_CONFIG_FREEBSD): Define.
	(FBSD_CPP_PREDEFINES): Add __KPRINTF_ATTRIBUTE__.
	(FBSD_CPP_SPEC): Define generic FreeBSD spec.
	(FBSD_STARTFILE_SPEC): Likewise.
	(FBSD_ENDFILE_SPEC): Likewise.
	(FBSD_LIB_SPEC): Likewise.
	(WCHAR_UNSIGNED): Undefine, FreeBSD's wchars are signed.
	(USER_LABEL_PREFIX): Define to ELF compatible value as some CPU headers
	set an ELF-improper one.
	* config/rs6000/freebsd.h: New file.
	* 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:  Add FreeBSD support.


Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.103
diff -u -r1.103 config.gcc
--- config.gcc	2001/11/04 22:37:40	1.103
+++ config.gcc	2001/11/08 02:00:58
@@ -337,6 +337,7 @@
 	*) echo 'Please update *-*-freebsd* in gcc/config.gcc'; exit 1;;
 	esac
 	tmake_file=t-freebsd
+	xmake_file=none
 	xm_defines=POSIX
 	case x${enable_threads} in
 	xno) fbsd_tm_file="${fbsd_tm_file} freebsd-nthr.h";;
@@ -2667,6 +2674,13 @@
 	cxx_target_objs="darwin-c.o"
 	# 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"
Index: config/freebsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/freebsd.h,v
retrieving revision 1.9
diff -u -r1.9 freebsd.h
--- freebsd.h	2001/07/21 09:42:19	1.9
+++ freebsd.h	2001/11/08 02:00:58
@@ -27,6 +27,9 @@
    Loren J. Rittle <ljrittle@acm.org>.  */
 
 
+/* To help with rs6000/sysv4.h carnal knowledge problem.  */
+#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).
@@ -38,41 +41,43 @@
     || (CHAR) == 'z' /* ignored by ld */				\
     || (CHAR) == 'R')
 
-#undef SWITCH_TAKES_ARG
+#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
+#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__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+  "-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__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+  "-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__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+  "-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__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+  "-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__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
+  "-D__FreeBSD__   -Dunix -D__ELF__ -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD"
 #endif
 
 #undef  CPP_PREDEFINES
@@ -81,11 +86,35 @@
 /* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC 
    option `-posix', and PIC issues.  */
 
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu)						\
+#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
+
+/* 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
@@ -100,9 +129,12 @@
    misconfigured the gcc bootstrap but are later consulting FreeBSD
    manual pages that refer to the mythical -pthread option).  */
 
-#undef  LIB_SPEC
+/* 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 LIB_SPEC "							\
+#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:								\
@@ -111,13 +143,13 @@
   }"
 #else
 #if FBSD_MAJOR >= 5
-#define LIB_SPEC "							\
+#define FBSD_LIB_SPEC "							\
   %{!shared:								\
     %{!pg: %{pthread:-lc_r} -lc}					\
     %{pg:  %{pthread:-lc_r_p} -lc_p}					\
   }"
 #else
-#define LIB_SPEC "							\
+#define FBSD_LIB_SPEC "							\
   %{!shared:								\
     %{!pg:								\
       %{!pthread:-lc}							\
@@ -129,49 +161,81 @@
 #endif
 #endif
 
-/* Code generation parameters.  */
+#undef  LIB_SPEC
+#define LIB_SPEC FBSD_LIB_SPEC
 
-/* Make gcc agree with <machine/ansi.h>.  */
 
-#undef WCHAR_TYPE
+/************************[  Target stuff  ]***********************************/
+
+/* Don't assume anything about the header files.  */
+#undef  NO_IMPLICIT_EXTERN_C
+#define NO_IMPLICIT_EXTERN_C
+
+/* Allow #sccs in preprocessor.  */
+#undef  SCCS_DIRECTIVE
+#define SCCS_DIRECTIVE
+
+/* Make gcc agree with FreeBSD's standard headers (<machine/ansi.h>, etc...)  */
+
+#undef  WCHAR_TYPE
 #define WCHAR_TYPE "int"
 
-#undef WCHAR_UNSIGNED
+#undef  WCHAR_UNSIGNED
 #define WCHAR_UNSIGNED 0
 
+/* Code generation parameters.  */
+
 /* Don't default to pcc-struct-return, because gcc is the only compiler, and
    we want to retain compatibility with older gcc versions
    (even though the SVR4 ABI for the i386 says that records and unions are
    returned in memory).  */
-#undef DEFAULT_PCC_STRUCT_RETURN
+#undef  DEFAULT_PCC_STRUCT_RETURN
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
-/* Ensure we the configuration knows our system correctly so we can link with
-   libraries compiled with the native cc.  */
+/* Use periods rather than dollar signs in special g++ assembler names.
+   This ensures the configuration knows our system correctly so we can link
+   with libraries compiled with the native cc.  */
 #undef NO_DOLLAR_IN_LABEL
 
-/* The GNU tools operate better with dwarf2 than stabs.  Since we
-   don't have any native tools to be compatible with, default to
-   dwarf2.  */
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+/* 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
+   config/sparc/sparc.h set this wrong for ELF.  */
+
+#undef  USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX ""
 
-#undef IDENT_ASM_OP
+/* Handle #pragma weak and #pragma pack.  */
+#undef  HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA
+
+/* Use more efficient ``thunks'' to implement C++ vtables.  */
+#undef DEFAULT_VTABLE_THUNKS
+#define DEFAULT_VTABLE_THUNKS 1
+
+/************************[  Assembler stuff  ]********************************/
+
+#undef  IDENT_ASM_OP
 #define IDENT_ASM_OP "\t.ident\t"
 
 /* Output #ident as a .ident.  */
-#undef ASM_OUTPUT_IDENT
+
+#undef  ASM_OUTPUT_IDENT
 #define ASM_OUTPUT_IDENT(FILE, NAME)					\
   fprintf ((FILE), "%s\"%s\"\n", IDENT_ASM_OP, (NAME));
 
-/* Miscellaneous parameters.  */
+/************************[  Debugger stuff  ]*********************************/
 
-/* Don't assume anything about the header files.  */
-#undef NO_IMPLICIT_EXTERN_C
-#define NO_IMPLICIT_EXTERN_C
-
-/* Allow #sccs in preprocessor.  */
-#define SCCS_DIRECTIVE
-
-/* Handle #pragma weak and #pragma pack.  */
-#define HANDLE_SYSV_PRAGMA
+/* All ELF targets can support DWARF-2.  */
+#undef  DWARF2_DEBUGGING_INFO
+#define DWARF2_DEBUGGING_INFO
+
+/* This is BSD, so we want the DBX format.  */
+#undef  DBX_DEBUGGING_INFO
+#define DBX_DEBUGGING_INFO
+
+/* Even though this is BSD, ELF and the GNU tools operates better with dwarf2
+   than stabs.  Since we don't have any native tools to be compatible with,
+   defaulting to dwarf2 is OK.  */
+#undef  PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG

Index: config/rs6000/freebsd.h
===================================================================
RCS file: freebsd.h
diff -N freebsd.h
--- /dev/null	Tue May  5 13:32:27 1998
+++ freebsd.h	Wed Nov  7 18:00:59 2001
@@ -0,0 +1,73 @@
+/* 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.  */
+
+
+/* config/rs6000/sysv4.h undoes the work we did in config/freebsd.h.  */
+#define CPP_OS_FREEBSD_SPEC	FBSD_CPP_PREDEFINES
+#define	STARTFILE_FREEBSD_SPEC	FBSD_STARTFILE_SPEC
+#define ENDFILE_FREEBSD_SPEC	FBSD_ENDFILE_SPEC
+#define LIB_FREEBSD_SPEC	FBSD_LIB_SPEC
+
+/* 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/rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.230
diff -u -r1.230 rs6000.c
--- rs6000.c	2001/11/07 20:49:41	1.230
+++ rs6000.c	2001/11/08 02:01:01
@@ -79,7 +79,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;
 
@@ -539,7 +539,7 @@
 	    }
 	}
 
-#ifdef USING_SVR4_H
+#ifdef _USING_ELFOS_H
       switch (rs6000_sdata)
 	{
 	case SDATA_NONE: fprintf (file, "%s -msdata=none", start); start = ""; break;
@@ -8846,7 +8846,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)
@@ -9052,7 +9052,7 @@
     }
 }
 
-#endif /* USING_SVR4_H */
+#endif /* _USING_ELFOS_H */
 
 
 /* Return a REG that occurs in ADDR with coefficient 1.

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/08 02:04:30
@@ -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"))				\
@@ -957,9 +959,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 +982,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 +997,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 +1028,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 +1085,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 +1135,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 +1151,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 +1166,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 +1181,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 +1196,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 ""
 
@@ -1231,6 +1244,9 @@
 
 #define CPP_OS_MVME_SPEC ""
 
+/* PowerPC simulator based on FreeBSD system calls support.  */
+#define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
+
 /* PowerPC simulator based on netbsd system calls support.  */
 #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group"
 
@@ -1244,6 +1260,20 @@
 
 #define CPP_OS_SIM_SPEC ""
 
+/* Faked out FreeBSD support.
+   The real information comes from config/freebsd.h  */
+#ifndef _USING_CONFIG_FREEBSD
+#define CPP_OS_FREEBSD_SPEC	""
+#define	STARTFILE_FREEBSD_SPEC	""
+#define ENDFILE_FREEBSD_SPEC	""
+#define LIB_FREEBSD_SPEC	""
+#endif /* _USING_CONFIG_FREEBSD */
+
+#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 +1431,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 +1441,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 +1451,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 +1465,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 +1476,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 +1494,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 },			\



More information about the Gcc-patches mailing list