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]

[PATCH] Adds FreeBSD/IA-64 to mainline (and cleans up IA-64 config some)


Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.11745
diff -u -r1.11745 ChangeLog
--- ChangeLog	2001/11/03 16:38:50	1.11745
+++ ChangeLog	2001/11/03 21:54:17
@@ -1,3 +1,26 @@
+2001-11-03  David O'Brien  <obrien@FreeBSD.org>
+
+	* config.gcc: Add FreeBSD/IA-64 target.
+	* config/i64/ia64.h (TARGET_VERSION,ASM_SPEC,LINK_SPEC): Remove,
+	they are OS specific.  Use CPP_CPU_SPEC rather than CPP_PREDEFINES,
+	so OS specific files and use CPP_PREDEFINES for their needs.
+	* config/i64/elf.h (TARGET_VERSION): Add.  Also, move inclusion of
+	target headers to tm_file.
+	* config/i64/aix.h (TARGET_VERSION): Likewise.
+	* config/i64/linux.h (TARGET_VERSION): Likewise.
+	* config/i64/hpux.h (TARGET_VERSION): Likewise.
+	* config/i64/frebsd.h: New file.
+	* config/frebsd.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.
+
 2001-11-03  Kazu Hirata  <kazu@hxi.com>
 
 	* config/sparc/linux-aout.h: Fix comment formatting.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config.gcc,v
retrieving revision 1.101
diff -u -r1.101 config.gcc
--- config.gcc	2001/11/02 02:18:36	1.101
+++ config.gcc	2001/11/03 21:54:18
@@ -1537,7 +1538,7 @@
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	;;
 ia64*-*-elf*)
-	tm_file=ia64/elf.h
+	tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h"
 	tmake_file="ia64/t-ia64"
 	target_cpu_default="0"
 	if test x$gas = xyes
@@ -1550,6 +1551,12 @@
 	fi
 	float_format=i386
 	;;
+ia64*-*-freebsd*)
+	tm_file="${tm_file} ${fbsd_tm_file} elfos.h ia64/sysv4.h ia64/freebsd.h"
+	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
+	tmake_file="${tmake_file} ia64/t-ia64"
+	float_format=i386
+	;;
 ia64*-*-linux*)
 	tm_file="${tm_file} elfos.h svr4.h linux.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="t-slibgcc-elf-ver t-linux ia64/t-ia64 ia64/t-glibc"
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/03 21:54:18
@@ -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/ia64/aix.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/aix.h,v
retrieving revision 1.4
diff -u -r1.4 aix.h
--- aix.h	2001/09/12 17:17:54	1.4
+++ aix.h	2001/11/03 21:54:18
@@ -22,6 +22,11 @@
 /* AIX5 (aka Monterey): a mix of AIX and UnixWare.  
    This file is loosely based on ia64/linux.h. */
 
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) AIX");
+
 #undef ASM_APP_ON
 #define ASM_APP_ON "#APP\n"
 
Index: config/ia64/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/elf.h,v
retrieving revision 1.2
diff -u -r1.2 elf.h
--- elf.h	2001/10/19 22:27:29	1.2
+++ elf.h	2001/11/03 21:54:18
@@ -1,9 +1,44 @@
 /* Definitions for embedded ia64-elf target.  */
 
-/* TODO: convert includes to ${tm_file} list in config.gcc.  */
-#include "ia64/ia64.h"
-#include "elfos.h"
-#include "sysv4.h"
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) ELF");
+
+/* Define this to be a string constant containing `-D' options to define the
+   predefined macros that identify this machine and system.  These macros will
+   be predefined unless the `-ansi' option is specified.  */
+/* ??? This is undefed in svr4.h.  */
+#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+   the assembler.  It can also specify how to translate options you give to GNU
+   CC into options for GNU CC to pass to the assembler.  */
+
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
+/* GNU AS.  */
+#define ASM_SPEC \
+  "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
+#else
+/* Intel ias.  */
+#define ASM_SPEC \
+  "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
+   %{mauto-pic:-M no_plabel}"
+#endif
+
+/* A C string constant that tells the GNU CC driver program options to pass to
+   the linker.  It can also specify how to translate options you give to GNU CC
+   into options for GNU CC to pass to the linker.  */
+
+/* The Intel linker does not support dynamic linking, so we need -dn.
+   The Intel linker gives annoying messages unless -N so is used.  */
+#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
+/* GNU LD.  */
+#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
+#else
+/* Intel ild.  */
+#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
+#endif
 
 /* svr4.h links with crti.o/crtn.o, but elfos.h does not.  We override elfos.h
    so that we can use the standard ELF Unix method.  */
Index: config/ia64/freebsd.h
===================================================================
RCS file: freebsd.h
diff -N freebsd.h
--- /dev/null	Tue May  5 13:32:27 1998
+++ freebsd.h	Sat Nov  3 13:54:18 2001
@@ -0,0 +1,262 @@
+/* Definitions for Intel IA-64 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.  */
+
+
+#undef  LINK_SPEC
+#define LINK_SPEC							\
+ "%{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
+  %{Wl,*:%*}								\
+  %{assert*} %{R*} %{rpath*} %{defsym*}					\
+  %{shared:-Bshareable %{h*} %{soname*}}				\
+  %{symbolic:-Bsymbolic}						\
+  %{!shared:								\
+    %{!static:								\
+      %{rdynamic:-export-dynamic}					\
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}}	\
+    %{static:-Bstatic}}"
+
+#undef  ASM_SPEC
+#define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+
+
+/************************[  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.  */
+
+/* alpha.h gets this wrong for FreeBSD.  We use the GCC defaults instead.  */
+#undef  WCHAR_TYPE
+#define WCHAR_TYPE "int"
+
+#undef  WCHAR_TYPE_SIZE
+#define WCHAR_TYPE_SIZE (sizeof (int))
+
+#undef  TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (FreeBSD/IA-64 ELF)");
+
+#define TARGET_ELF		1
+
+#define DONT_USE_BUILTIN_SETJMP
+#define JMP_BUF_SIZE  76
+
+/* Output any profiling code before the prologue.  */
+
+#undef  PROFILE_BEFORE_PROLOGUE
+#define PROFILE_BEFORE_PROLOGUE 1
+
+/* A C statement or compound statement to output to FILE some assembler code to
+   call the profiling subroutine `mcount'.  */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO)		\
+do {							\
+  char buf[20];						\
+  ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO);	\
+  fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE);	\
+  if (TARGET_AUTO_PIC)					\
+    fputs ("\tmovl out3 = @gprel(", FILE);		\
+  else							\
+    fputs ("\taddl out3 = @ltoff(", FILE);		\
+  assemble_name (FILE, buf);				\
+  if (TARGET_AUTO_PIC)					\
+    fputs (");;\n", FILE);				\
+  else							\
+    fputs ("), r1;;\n", FILE);				\
+  fputs ("\tmov out1 = r1\n", FILE);			\
+  fputs ("\tmov out2 = b0\n", FILE);			\
+  fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE);	\
+} while (0)
+/* Definitions for Intel IA-64 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.  */
+
+
+#undef  LINK_SPEC
+#define LINK_SPEC							\
+ "%{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
+  %{Wl,*:%*}								\
+  %{assert*} %{R*} %{rpath*} %{defsym*}					\
+  %{shared:-Bshareable %{h*} %{soname*}}				\
+  %{symbolic:-Bsymbolic}						\
+  %{!shared:								\
+    %{!static:								\
+      %{rdynamic:-export-dynamic}					\
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}}	\
+    %{static:-Bstatic}}"
+
+#undef  ASM_SPEC
+#define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+
+
+/************************[  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.  */
+
+/* alpha.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/IA-64 ELF)");
+
+#define TARGET_ELF		1
+
+#define DONT_USE_BUILTIN_SETJMP
+#define JMP_BUF_SIZE  76
+
+/* Output any profiling code before the prologue.  */
+
+#undef  PROFILE_BEFORE_PROLOGUE
+#define PROFILE_BEFORE_PROLOGUE 1
+
+/* A C statement or compound statement to output to FILE some assembler code to
+   call the profiling subroutine `mcount'.  */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO)		\
+do {							\
+  char buf[20];						\
+  ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO);	\
+  fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE);	\
+  if (TARGET_AUTO_PIC)					\
+    fputs ("\tmovl out3 = @gprel(", FILE);		\
+  else							\
+    fputs ("\taddl out3 = @ltoff(", FILE);		\
+  assemble_name (FILE, buf);				\
+  if (TARGET_AUTO_PIC)					\
+    fputs (");;\n", FILE);				\
+  else							\
+    fputs ("), r1;;\n", FILE);				\
+  fputs ("\tmov out1 = r1\n", FILE);			\
+  fputs ("\tmov out2 = b0\n", FILE);			\
+  fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE);	\
+} while (0)
+/* Definitions for Intel IA-64 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.  */
+
+
+#undef  LINK_SPEC
+#define LINK_SPEC							\
+ "%{p:%e`-p' not supported; use `-pg' and gprof(1)}			\
+  %{Wl,*:%*}								\
+  %{assert*} %{R*} %{rpath*} %{defsym*}					\
+  %{shared:-Bshareable %{h*} %{soname*}}				\
+  %{symbolic:-Bsymbolic}						\
+  %{!shared:								\
+    %{!static:								\
+      %{rdynamic:-export-dynamic}					\
+      %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}}	\
+    %{static:-Bstatic}}"
+
+#undef  ASM_SPEC
+#define ASM_SPEC "-x %{mconstant-gp} %{mauto-pic}"
+
+
+/************************[  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.  */
+
+/* alpha.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/IA-64 ELF)");
+
+#define TARGET_ELF		1
+
+#define DONT_USE_BUILTIN_SETJMP
+#define JMP_BUF_SIZE  76
+
+/* Output any profiling code before the prologue.  */
+
+#undef  PROFILE_BEFORE_PROLOGUE
+#define PROFILE_BEFORE_PROLOGUE 1
+
+/* A C statement or compound statement to output to FILE some assembler code to
+   call the profiling subroutine `mcount'.  */
+
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO)		\
+do {							\
+  char buf[20];						\
+  ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO);	\
+  fputs ("\talloc out0 = ar.pfs, 8, 0, 4, 0\n", FILE);	\
+  if (TARGET_AUTO_PIC)					\
+    fputs ("\tmovl out3 = @gprel(", FILE);		\
+  else							\
+    fputs ("\taddl out3 = @ltoff(", FILE);		\
+  assemble_name (FILE, buf);				\
+  if (TARGET_AUTO_PIC)					\
+    fputs (");;\n", FILE);				\
+  else							\
+    fputs ("), r1;;\n", FILE);				\
+  fputs ("\tmov out1 = r1\n", FILE);			\
+  fputs ("\tmov out2 = b0\n", FILE);			\
+  fputs ("\tbr.call.sptk.many b0 = _mcount;;\n", FILE);	\
+} while (0)
Index: config/ia64/hpux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/hpux.h,v
retrieving revision 1.3
diff -u -r1.3 hpux.h
--- hpux.h	2001/07/19 23:26:50	1.3
+++ hpux.h	2001/11/03 21:54:18
@@ -20,6 +20,11 @@
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) HP-UX");
+
 #undef CPP_PREDEFINES
 #define CPP_PREDEFINES "\
   -D__IA64__ -D__ia64 -D__ia64__ -D__hpux -D__hpux__ -Dhpux -Dunix \
Index: config/ia64/ia64.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/ia64.h,v
retrieving revision 1.88
diff -u -r1.88 ia64.h
--- ia64.h	2001/09/21 16:58:19	1.88
+++ ia64.h	2001/11/03 21:54:19
@@ -31,12 +31,12 @@
 
 /* Run-time target specifications */
 
-/* Define this to be a string constant containing `-D' options to define the
-   predefined macros that identify this machine and system.  These macros will
-   be predefined unless the `-ansi' option is specified.  */
-/* ??? This is undefed in svr4.h.  */
-#define CPP_PREDEFINES "-Dia64 -Amachine=ia64"
+#define CPP_CPU_SPEC "\
+  -Acpu=ia64 -Amachine=ia64 \
+  %{!ansi:%{!std=c*:%{!std=i*:-Dia64}}} -D__ia64 -D__ia64__"
 
+#define CC1_SPEC "%(cc1_cpu) "
+
 /* This declaration should be present.  */
 extern int target_flags;
 
@@ -176,11 +176,6 @@
       N_("Specify range of registers to make fixed.")},			\
 }
 
-/* This macro is a C statement to print on `stderr' a string describing the
-   particular machine description choice.  */
-
-#define TARGET_VERSION fprintf (stderr, " (IA-64)");
-
 /* Sometimes certain combinations of command options do not make sense on a
    particular target machine.  You can define a macro `OVERRIDE_OPTIONS' to
    take account of this.  This macro, if defined, is executed once just after
@@ -242,36 +237,6 @@
    into options for GNU CC to pass to the `cc1plus'.  */
 
 /* #define CC1PLUS_SPEC "" */
-
-/* A C string constant that tells the GNU CC driver program options to pass to
-   the assembler.  It can also specify how to translate options you give to GNU
-   CC into options for GNU CC to pass to the assembler.  */
-
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_AS) != 0
-/* GNU AS.  */
-#define ASM_SPEC \
-  "%{mno-gnu-as:-N so} %{!mno-gnu-as:-x} %{mconstant-gp} %{mauto-pic}"
-#else
-/* Intel ias.  */
-#define ASM_SPEC \
-  "%{!mgnu-as:-N so} %{mgnu-as:-x} %{mconstant-gp:-M const_gp}\
-   %{mauto-pic:-M no_plabel}"
-#endif
-
-/* A C string constant that tells the GNU CC driver program options to pass to
-   the linker.  It can also specify how to translate options you give to GNU CC
-   into options for GNU CC to pass to the linker.  */
-
-/* The Intel linker does not support dynamic linking, so we need -dn.
-   The Intel linker gives annoying messages unless -N so is used.  */
-#if ((TARGET_CPU_DEFAULT | TARGET_DEFAULT) & MASK_GNU_LD) != 0
-/* GNU LD.  */
-#define LINK_SPEC "%{mno-gnu-ld:-dn -N so}"
-#else
-/* Intel ild.  */
-#define LINK_SPEC "%{!mgnu-ld:-dn -N so}"
-#endif
-
 
 /* Storage Layout */
 
Index: config/ia64/linux.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/ia64/linux.h,v
retrieving revision 1.11
diff -u -r1.11 linux.h
--- linux.h	2001/10/19 22:27:29	1.11
+++ linux.h	2001/11/03 21:54:19
@@ -1,5 +1,10 @@
 /* Definitions for ia64-linux target.  */
 
+/* This macro is a C statement to print on `stderr' a string describing the
+   particular machine description choice.  */
+
+#define TARGET_VERSION fprintf (stderr, " (IA-64) Linux");
+
 /* This is for -profile to use -lc_p instead of -lc. */
 #undef CC1_SPEC
 #define CC1_SPEC "%{profile:-p} %{G*}"


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