From 3c0c83176102700daccbd554604e5b5efd759a38 Mon Sep 17 00:00:00 2001 From: obrien Date: Tue, 7 May 2002 23:28:45 +0000 Subject: [PATCH] Alpha MD bits for Gcc 3.1. --- contrib/gcc/config/alpha/freebsd.h | 152 +++++++---------------------- 1 file changed, 37 insertions(+), 115 deletions(-) diff --git a/contrib/gcc/config/alpha/freebsd.h b/contrib/gcc/config/alpha/freebsd.h index 1584f42ed0a..d8f71f0ca6c 100644 --- a/contrib/gcc/config/alpha/freebsd.h +++ b/contrib/gcc/config/alpha/freebsd.h @@ -1,6 +1,6 @@ -/* Definitions for DEC AXP Alpha running FreeBSD using the ELF format - Copyright (C) 2000 Free Software Foundation, Inc. - Contributed by David O'Brien +/* Definitions for DEC Alpha/AXP running FreeBSD using the ELF format + Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Contributed by David E. O'Brien and BSDi. This file is part of GNU CC. @@ -16,26 +16,26 @@ 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. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -/* This is used on Alpha platforms that use the ELF format. - This was taken from the NetBSD configuration, and modified - for FreeBSD/Alpha by Hidetoshi Shimokawa */ /* $FreeBSD$ */ -/* Names to predefine in the preprocessor for this target machine. - XXX FreeBSD, by convention, shouldn't do __alpha, but lots of applications - expect it because that's what OSF/1 does. */ +/* Provide a CPP_SPEC appropriate for FreeBSD/alpha. Besides the dealing with + the GCC option `-posix', and PIC issues as on all FreeBSD platforms, we must + deal with the Alpha's FP issues. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-D__alpha__ -D__alpha -Acpu(alpha) -Amachine(alpha)" \ - FBSD_CPP_PREDEFINES +#undef CPP_SPEC +#define CPP_SPEC "%(cpp_cpu) %(cpp_subtarget) -D__ELF__ \ + %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ + %{posix:-D_POSIX_SOURCE} \ + %{mieee:-D_IEEE_FP} \ + %{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT}" -#undef LINK_SPEC -#define LINK_SPEC "-m elf64alpha \ +#undef LINK_SPEC +#define LINK_SPEC "%{G*} %{relax:-relax} \ %{p:%e`-p' not supported; use `-pg' and gprof(1)} \ %{Wl,*:%*} \ %{assert*} %{R*} %{rpath*} %{defsym*} \ @@ -47,31 +47,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \ %{static:-Bstatic}}" -/* Provide an ASM_SPEC appropriate for a FreeBSD/Alpha target. This differs - from the generic FreeBSD ASM_SPEC in that no special handling of PIC is - necessary on the Alpha. */ +/* We now have to provide a STARTFILE_SPEC because of a moronic pigheaded + Linuxism(glibc'ism) that was added to alpha/elf.h. */ -#undef ASM_SPEC -#define ASM_SPEC " %| %{mcpu=*:-m%*}" - -#undef ASM_FINAL_SPEC - -/* Provide a STARTFILE_SPEC for FreeBSD that is compatible with the - non-aout version used on i386. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ - crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" - -/* Provide a ENDFILE_SPEC appropriate for ELF. Here we tack on the - magical crtend.o file which provides part of the support for - getting C++ file-scope static object constructed before entering - `main', followed by a normal ELF "finalizer" file, `crtn.o'. */ - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ + "%{!shared: \ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}}\ + crti.o%s %{shared:crtbeginS.o%s}%{!shared:crtbegin.o%s}" /************************[ Target stuff ]***********************************/ @@ -83,6 +66,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* 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 + /* Handle cross-compilation on 32-bits machines (such as i386) for 64-bits machines (Alpha in this case). */ @@ -98,14 +87,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* This is the pseudo-op used to generate a 64-bit word of data with a specific value in some section. */ -#undef INT_ASM_OP -#define INT_ASM_OP ".quad" - #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (FreeBSD/Alpha ELF)"); +#define TARGET_ELF 1 #define TARGET_AOUT (0) -#define TARGET_ELF (1) #define TARGET_UNDERSCORES (0) #undef OBJECT_FORMAT_COFF @@ -118,7 +104,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Show that we need a GP when profiling. */ #undef TARGET_PROFILING_NEEDS_GP -#define TARGET_PROFILING_NEEDS_GP +#define TARGET_PROFILING_NEEDS_GP 1 /* We always use gas here, so we don't worry about ECOFF assembler problems. */ #undef TARGET_GAS @@ -127,76 +113,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ /************************[ Assembler stuff ]********************************/ -/* This is how to begin an assembly language file. - ELF also needs a .version. */ - -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - { \ - alpha_write_verstamp (FILE); \ - output_file_directive ((FILE), main_input_filename); \ - fprintf ((FILE), "\t.version\t\"01.01\"\n"); \ - fprintf ((FILE), "\t.set noat\n"); \ - } - -extern void output_file_directive (); -extern void alpha_output_lineno (); - -#undef ASM_OUTPUT_SOURCE_LINE -#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \ - alpha_output_lineno ((STREAM), (LINE)) - -/* Switch into a generic section. - This is currently only used to support section attributes. - - We make the section read-only and executable for a function decl, - read-only for a const data decl, and writable for a non-const data decl. */ -#undef ASM_OUTPUT_SECTION_NAME -#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC) \ - fprintf ((FILE), ".section\t%s,\"%s\",@progbits\n", (NAME), \ - (DECL) && TREE_CODE (DECL) == FUNCTION_DECL ? "ax" : \ - (DECL) && DECL_READONLY_SECTION ((DECL), (RELOC)) ? "a" : "aw") - -/* A C statement or statements to switch to the appropriate - section for output of DECL. DECL is either a `VAR_DECL' node - or a constant of some sort. RELOC indicates whether forming - the initial value of DECL requires link-time relocations. */ - -#undef SELECT_SECTION -#define SELECT_SECTION(DECL, RELOC) \ - { \ - if (TREE_CODE (DECL) == STRING_CST) \ - { \ - if (! flag_writable_strings) \ - const_section (); \ - else \ - data_section (); \ - } \ - else if (TREE_CODE (DECL) == VAR_DECL) \ - { \ - if ((flag_pic && (RELOC)) \ - || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ - || !DECL_INITIAL (DECL) \ - || (DECL_INITIAL (DECL) != error_mark_node \ - && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ - data_section (); \ - else \ - const_section (); \ - } \ - else \ - const_section (); \ - } - -/* This is how we tell the assembler that two symbols have the same value. */ - -#undef ASM_OUTPUT_DEF -#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \ - do { \ - assemble_name((FILE), (NAME1)); \ - fputs(" = ", (FILE)); \ - assemble_name((FILE), (NAME2)); \ - fputc('\n', (FILE)); \ - } while (0) /************************[ Debugger stuff ]*********************************/ @@ -206,3 +122,9 @@ extern void alpha_output_lineno (); #undef DBX_CONTIN_CHAR #define DBX_CONTIN_CHAR '?' + +/* Don't default to pcc-struct-return, we want to retain compatibility with + older FreeBSD releases AND pcc-struct-return may not be reentrant. */ + +#undef DEFAULT_PCC_STRUCT_RETURN +#define DEFAULT_PCC_STRUCT_RETURN 0 -- 2.45.0