PERFORCE change 150058 for review

Warner Losh imp at FreeBSD.org
Thu Sep 18 23:49:48 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150058

Change 150058 by imp at imp_paco-paco on 2008/09/18 23:48:53

	Revert branch-only changes and go with what's in svn.  With this 
	change, buildworld finishes in this branch.
	
	Reviewed by:	gonzo@

Affected files ...

.. //depot/projects/mips2/src/contrib/gcc/config/elfos.h#4 edit
.. //depot/projects/mips2/src/contrib/gcc/config/mips/elf.h#5 edit
.. //depot/projects/mips2/src/contrib/gcc/config/mips/freebsd.h#10 edit

Differences ...

==== //depot/projects/mips2/src/contrib/gcc/config/elfos.h#4 (text+ko) ====

@@ -79,14 +79,11 @@
 
 
 /* Output #ident as a .ident.  */
-#ifndef ASM_OUTPUT_IDENT
+
 #define ASM_OUTPUT_IDENT(FILE, NAME) \
   fprintf (FILE, "%s\"%s\"\n", IDENT_ASM_OP, NAME);
-#endif
 
-#ifndef IDENT_ASM_OP
 #define IDENT_ASM_OP "\t.ident\t"
-#endif
 
 #undef  SET_ASM_OP
 #define SET_ASM_OP	"\t.set\t"
@@ -197,9 +194,8 @@
 #define ASCII_DATA_ASM_OP	"\t.ascii\t"
 
 /* Support a read-only data section.  */
-#ifndef READONLY_DATA_SECTION_ASM_OP
 #define READONLY_DATA_SECTION_ASM_OP	"\t.section\t.rodata"
-#endif
+
 /* On svr4, we *do* have support for the .init and .fini sections, and we
    can put stuff in there to be executed before and after `main'.  We let
    crtstuff.c and other files know this by defining the following symbols.
@@ -285,7 +281,7 @@
 #endif
 
 /* Write the extra assembler code needed to declare an object properly.  */
-#ifndef ASM_DECLARE_OBJECT_NAME
+
 #define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)		\
   do								\
     {								\
@@ -305,7 +301,7 @@
       ASM_OUTPUT_LABEL (FILE, NAME);				\
     }								\
   while (0)
-#endif
+
 /* Output the size directive for a decl in rest_of_decl_compilation
    in the case where we did not do so before the initializer.
    Once we find the error_mark_node, we know that the value of

==== //depot/projects/mips2/src/contrib/gcc/config/mips/elf.h#5 (text+ko) ====

@@ -51,7 +51,4 @@
 
 #define NO_IMPLICIT_EXTERN_C 1
 
-#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
-#undef HANDLE_PRAGMA_PACK_PUSH_POP
-#endif
 #define HANDLE_PRAGMA_PACK_PUSH_POP 1

==== //depot/projects/mips2/src/contrib/gcc/config/mips/freebsd.h#10 (text+ko) ====

@@ -1,6 +1,6 @@
-/* Definitions of target machine for GNU compiler, for MIPS FreeBSD systems.
-   Copyright (C) 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004
-   Free Software Foundation, Inc.
+/* Definitions for MIPS varients running FreeBSD with ELF format
+   Copyright (C) 2008 Free Software Foundation, Inc.
+   Continued by David O'Brien <obrien at freebsd.org>
 
 This file is part of GCC.
 
@@ -16,53 +16,108 @@
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* $FreeBSD$ */
+
+/* This defines which switch letters take arguments.  -G is a MIPS
+   special.  */
+
+#undef  SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR)		\
+  (FBSD_SWITCH_TAKES_ARG (CHAR)		\
+   || (CHAR) == 'R'			\
+   || (CHAR) == 'G')
+
+#undef  SUBTARGET_EXTRA_SPECS	/* mips.h bogusly defines it.  */
+#define SUBTARGET_EXTRA_SPECS \
+  { "fbsd_dynamic_linker",	FBSD_DYNAMIC_LINKER}, \
+  { "fbsd_link_spec",		FBSD_LINK_SPEC }
+
+/* config/mips/mips.h defines CC1_SPEC,
+   but gives us an "out" with SUBTARGET_CC1_SPEC.  */
+#undef  SUBTARGET_CC1_SPEC
+#define SUBTARGET_CC1_SPEC "%{profile:-p}"
+
+/* Provide a LINK_SPEC appropriate for FreeBSD.  Here we provide support
+   for the special GCC options -static and -shared, which allow us to
+   link things in one of these three modes by applying the appropriate
+   combinations of options at link-time. We like to support here for
+   as many of the other GNU linker options as possible. But I don't
+   have the time to search for those flags. I am sure how to add
+   support for -soname shared_object_name. H.J.
 
-/* $FreeBSD: src/contrib/gcc/config/mips/freebsd.h,v 1.2 2008/09/01 23:09:45 obrien Exp $ */
+   When the -shared link option is used a final link is not being
+   done.  */
 
-/* Define default target values.  */
+#define FBSD_LINK_SPEC "\
+    %{p:%nconsider using `-pg' instead of `-p' with gprof(1) } \
+    %{v:-V} \
+    %{assert*} %{R*} %{rpath*} %{defsym*} \
+    %{shared:-Bshareable %{h*} %{soname*}} \
+    %{!shared: \
+      %{!static: \
+	%{rdynamic: -export-dynamic} \
+	%{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }} \
+      %{static:-Bstatic}} \
+    %{symbolic:-Bsymbolic} "
 
-#undef MACHINE_TYPE
-#if TARGET_ENDIAN_DEFAULT != 0
-#define MACHINE_TYPE "FreeBSD/mipseb ELF"
-#else
-#define MACHINE_TYPE "FreeBSD/mipsel ELF"
+#undef	LINK_SPEC
+#define LINK_SPEC "\
+    %{G*} %{mips1} %{mips2} %{mips3} %{mips4} %{mips32} %{mips32r2} %{mips64} \
+    %{bestGnum} %{call_shared} %{no_archive} %{exact_version} \
+    %(fbsd_link_spec) "
+#if 0
+    %(endian_spec)
 #endif
+    
+/* Reset our STARTFILE_SPEC which was properly set in config/freebsd.h
+   but trashed by config/mips/elf.h.  */
+#undef  STARTFILE_SPEC
+#define STARTFILE_SPEC	FBSD_STARTFILE_SPEC
 
-#define MIPS_ABI_DEFAUL ABI_32
+/* Provide an ENDFILE_SPEC appropriate for FreeBSD/i386.  */
+#undef  ENDFILE_SPEC
+#define ENDFILE_SPEC	FBSD_ENDFILE_SPEC
 
-#ifdef LIB_SPEC
-#undef LIB_SPEC
+/* Reset our LIB_SPEC which was properly set in config/freebsd.h
+   but trashed by config/mips/elf.h.  */
+#undef  LIB_SPEC
 #define LIB_SPEC	FBSD_LIB_SPEC
-#endif /* LIB_SPEC */
+
+/* config/mips/mips.h defines CPP_SPEC, and it expects SUBTARGET_CPP_SPEC.  */
+#undef  SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC
+
+
+/************************[  Target stuff  ]***********************************/
 
-#undef  STARTFILE_SPEC
-#define STARTFILE_SPEC FBSD_STARTFILE_SPEC
+/* 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.  */
 
-#undef  ENDFILE_SPEC
-#define ENDFILE_SPEC FBSD_ENDFILE_SPEC
+#if TARGET_ENDIAN_DEFAULT != 0
+#define TARGET_VERSION	fprintf (stderr, " (FreeBSD/mips)");
+#else
+#define TARGET_VERSION	fprintf (stderr, " (FreeBSD/mipsel)");
+#endif
 
-/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD.
+/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for FreeBSD.
    Specifically, they define too many namespace-invasive macros.  Override
    them here.  Note this is structured for easy comparison to the version
-   in mips.h.
+   in mips.h.  */
 
-   FIXME: This probably isn't the best solution.  But in the absence
-   of something better, it will have to do, for now.  */
-/* XXX cognet: need to find out which one we need for FreeBSD. */
-
-#undef TARGET_CPU_CPP_BUILTINS
+#undef  TARGET_CPU_CPP_BUILTINS
 #define TARGET_CPU_CPP_BUILTINS()				\
   do								\
     {								\
+      builtin_assert ("machine=mips");				\
       builtin_assert ("cpu=mips");				\
       builtin_define ("__mips__");				\
-      builtin_define ("_mips");					\
 								\
-      /* No _R3000 or _R4000.  */				\
       if (TARGET_64BIT)						\
-	builtin_define ("__mips64");				\
+	builtin_define ("__mips64__");				\
 								\
       if (TARGET_FLOAT64)					\
 	builtin_define ("__mips_fpr=64");			\
@@ -75,11 +130,7 @@
       MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info);	\
       MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info);	\
 								\
-      if (ISA_MIPS1)						\
-	builtin_define ("__mips=1");				\
-      else if (ISA_MIPS2)					\
-	builtin_define ("__mips=2");				\
-      else if (ISA_MIPS3)					\
+      if (ISA_MIPS3)						\
 	builtin_define ("__mips=3");				\
       else if (ISA_MIPS4)					\
 	builtin_define ("__mips=4");				\
@@ -112,12 +163,21 @@
       else							\
 	builtin_define ("__MIPSEL__");				\
 								\
+      /* No language dialect defines.  */			\
+								\
+      if (mips_abi == ABI_EABI)					\
+	builtin_define ("__mips_eabi");				\
+      else if (mips_abi == ABI_N32)				\
+	builtin_define ("__mips_n32");				\
+      else if (mips_abi == ABI_64)				\
+	builtin_define ("__mips_n64");				\
+      else if (mips_abi == ABI_O64)				\
+	builtin_define ("__mips_o64");				\
+      else							\
+	builtin_define ("__mips_o32");				\
+								\
       if (TARGET_ABICALLS)					\
 	builtin_define ("__ABICALLS__");			\
-								\
-      /* No language dialect defines.  */			\
-								\
-      /* ABIs handled in TARGET_OS_CPP_BUILTINS.  */		\
     }								\
   while (0)
 
@@ -129,66 +189,55 @@
   "%{!EB:%{!EL:%(endian_spec)}}", 
 #endif
 
-/* Provide a SUBTARGET_CPP_SPEC appropriate for FreeBSD.  */
+#if 0
+/* Don't default to pcc-struct-return, we want to retain compatibility with
+   older gcc versions AND pcc-struct-return is nonreentrant.
+   (even though the SVR4 ABI for the i386 says that records and unions are
+   returned in memory).  */
 
-#undef SUBTARGET_CPP_SPEC
-#define SUBTARGET_CPP_SPEC FBSD_CPP_SPEC
+#undef  DEFAULT_PCC_STRUCT_RETURN
+#define DEFAULT_PCC_STRUCT_RETURN 0
+#endif
 
-/* Provide a LINK_SPEC appropriate for a NetBSD/mips target.
-   This is a copy of LINK_SPEC from <netbsd-elf.h> tweaked for
-   the MIPS target.  */
 
-#undef	LINK_SPEC
-#define LINK_SPEC "							\
-  %{p:%nconsider using `-pg' instead of `-p' with gprof(1) }		\
-  %{Wl,*:%*}								\
-  %{v:-V}								\
-  %{assert*} %{R*} %{rpath*} %{defsym*}					\
-  %{shared:-Bshareable %{h*} %{soname*}}				\
-  %{!shared:								\
-    %{!static:								\
-      %{rdynamic:-export-dynamic}					\
-      %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }}	\
-    %{static:-Bstatic}}							\
-  %{symbolic:-Bsymbolic}"
+/************************[  Assembler stuff  ]********************************/
 
-#undef SUBTARGET_ASM_SPEC
+#undef  SUBTARGET_ASM_SPEC
 #define SUBTARGET_ASM_SPEC \
-  "%{!mno-abicalls: \
-     %{!fno-PIC:%{!fno-pic:-KPIC}}}"
-
+  "%{!mno-abicalls: %{!fno-PIC:%{!fno-pic:-KPIC}}}"
 
 /* -G is incompatible with -KPIC which is the default, so only allow objects
    in the small data section if the user explicitly asks for it.  */
 
-#undef MIPS_DEFAULT_GVALUE
+#undef  MIPS_DEFAULT_GVALUE
 #define MIPS_DEFAULT_GVALUE 0
 
+/* If defined, a C expression whose value is a string containing the
+   assembler operation to identify the following data as
+   uninitialized global data.  If not defined, and neither
+   `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
+   uninitialized global data will be output in the data section if
+   `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
+   used.  */
+#undef  BSS_SECTION_ASM_OP
+#define BSS_SECTION_ASM_OP "\t.section\t.bss"
 
-/* This defines which switch letters take arguments.  -G is a MIPS
-   special.  */
+/* Like `ASM_OUTPUT_BSS' except takes the required alignment as a
+   separate, explicit argument.  If you define this macro, it is used
+   in place of `ASM_OUTPUT_BSS', and gives you more flexibility in
+   handling the required alignment of the variable.  The alignment is
+   specified as the number of bits.
 
-#undef SWITCH_TAKES_ARG
-#define SWITCH_TAKES_ARG(CHAR)						\
-  (DEFAULT_SWITCH_TAKES_ARG (CHAR)					\
-   || (CHAR) == 'R'							\
-   || (CHAR) == 'G')
+   Try to use function `asm_output_aligned_bss' defined in file
+   `varasm.c' when defining this macro.  */
+#undef  ASM_OUTPUT_ALIGNED_BSS
+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
+  asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
 
+/* Standard AT&T UNIX 'as' local label spelling.  */
+#undef  LOCAL_LABEL_PREFIX
+#define LOCAL_LABEL_PREFIX "."
 
-#undef ASM_FINAL_SPEC
-#undef SET_ASM_OP
 
-/* Make gcc agree with <machine/ansi.h> */
-
-#undef WCHAR_TYPE
-#define WCHAR_TYPE "int"
-
-#undef WCHAR_TYPE_SIZE
-#define WCHAR_TYPE_SIZE 32
+/************************[  Debugger stuff  ]*********************************/
 
-#undef WINT_TYPE
-#define WINT_TYPE "int"
-
-/* Needed for ELF (inspired by netbsd-elf).  */
-#undef LOCAL_LABEL_PREFIX
-#define LOCAL_LABEL_PREFIX	"."


More information about the p4-projects mailing list