aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/ia64
diff options
context:
space:
mode:
authorDavid O'Brien <obrien@FreeBSD.org>2001-11-10 01:07:17 +0000
committerDavid O'Brien <obrien@gcc.gnu.org>2001-11-10 01:07:17 +0000
commit243a707078d20d78057fe4660a9388028db83489 (patch)
tree577a7f314d943cdee4114f2e22033a938b8b2ced /gcc/config/ia64
parentb8e42321fb18771c9b259b8c21d683cd9acafa21 (diff)
downloadgcc-243a707078d20d78057fe4660a9388028db83489.zip
gcc-243a707078d20d78057fe4660a9388028db83489.tar.gz
gcc-243a707078d20d78057fe4660a9388028db83489.tar.bz2
config.gcc: Add FreeBSD/IA-64 target.
2001-11-07 David O'Brien <obrien@FreeBSD.org> * config.gcc: Add FreeBSD/IA-64 target. Expand config/i64/elf.h headers. * 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/ia64/aix.h (TARGET_VERSION): Likewise. * config/ia64/hpux.h (TARGET_VERSION): Likewise. * config/ia64/linux.h (TARGET_VERSION): Likewise. (FUNCTION_PROFILER): Remove. * config/ia64/ia64.h (FUNCTION_PROFILER): Update defintion using the version in config/ia64/linux.h. * config/ia64/freebsd.h: New file. * 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. Approved by: Richard Henderson <rth@redhat.com> Message-ID: <20011109100352.A6186@redhat.com> From-SVN: r46909
Diffstat (limited to 'gcc/config/ia64')
-rw-r--r--gcc/config/ia64/aix.h5
-rw-r--r--gcc/config/ia64/elf.h43
-rw-r--r--gcc/config/ia64/freebsd.h66
-rw-r--r--gcc/config/ia64/hpux.h5
-rw-r--r--gcc/config/ia64/ia64.h70
-rw-r--r--gcc/config/ia64/linux.h28
6 files changed, 139 insertions, 78 deletions
diff --git a/gcc/config/ia64/aix.h b/gcc/config/ia64/aix.h
index 8366824..7b93683 100644
--- a/gcc/config/ia64/aix.h
+++ b/gcc/config/ia64/aix.h
@@ -22,6 +22,11 @@ Boston, MA 02111-1307, USA. */
/* 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"
diff --git a/gcc/config/ia64/elf.h b/gcc/config/ia64/elf.h
index a3b851c..af8c7a6 100644
--- a/gcc/config/ia64/elf.h
+++ b/gcc/config/ia64/elf.h
@@ -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. */
diff --git a/gcc/config/ia64/freebsd.h b/gcc/config/ia64/freebsd.h
new file mode 100644
index 0000000..75cfc04
--- /dev/null
+++ b/gcc/config/ia64/freebsd.h
@@ -0,0 +1,66 @@
+/* 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. */
+
+/* Earilier headers may get 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
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
index c9df25b..6fb8f87 100644
--- a/gcc/config/ia64/hpux.h
+++ b/gcc/config/ia64/hpux.h
@@ -20,6 +20,11 @@ along with GNU CC; see the file COPYING. If not, write to
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 \
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 361cf0a..baca932 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -31,11 +31,11 @@ Boston, MA 02111-1307, USA. */
/* 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 @@ extern const char *ia64_fixed_range_string;
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 @@ extern const char *ia64_fixed_range_string;
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 */
@@ -1570,21 +1535,24 @@ do { \
/* A C statement or compound statement to output to FILE some assembler code to
call the profiling subroutine `mcount'. */
-/* ??? Unclear if this will actually work. No way to test this currently. */
-
-#define FUNCTION_PROFILER(FILE, LABELNO) \
+#undef FUNCTION_PROFILER
+#define FUNCTION_PROFILER(FILE, LABELNO) \
do { \
char buf[20]; \
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", LABELNO); \
- fputs ("\taddl r16 = @ltoff(", FILE); \
+ 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); \
- fputs ("), gp\n", FILE); \
- fputs ("\tmov r17 = r1;;\n", FILE); \
- fputs ("\tld8 out0 = [r16]\n", FILE); \
- fputs ("\tmov r18 = b0\n", FILE); \
- fputs ("\tbr.call.sptk.many rp = mcount;;\n", FILE); \
- fputs ("\tmov b0 = r18\n", FILE); \
- fputs ("\tmov r1 = r17;;\n", FILE); \
+ 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)
/* A C statement or compound statement to output to FILE some assembler code to
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index a78130a..a25844f 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -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*}"
@@ -40,27 +45,4 @@
#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)
-
/* End of linux.h */