From 81b47219535814188c5f40f9efb448c1cad02b92 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 24 Jan 2005 22:31:52 +0100 Subject: [PATCH] re PR bootstrap/19364 (embedded sparc does not bootstrap) PR bootstrap/19364 * config.gcc (sparc-*-elf*): Remove sol2.h, sparc/sol2.h and sparc/elf.h, add sparc/sp-elf.h. (sparc-*-rtems*): Likewise. (sparclite-*-elf*): Remove sol2.h, sparc/sol2.h, sparc/elf.h and tm-dwarf2.h, add sparc/sp-elf.h. (sparc86x-*-elf): Likewise. (sparc64-*-elf*): Remove sol2.h, sparc/sol2.h and tm-dwarf2.h. * config/sparc/liteelf.h (TARGET_SUB_OS_CPP_BUILTINS): Rename into TARGET_OS_CPP_BUILTINS. * config/sparc/sp86x-elf (TARGET_SUB_OS_CPP_BUILTINS): Likewise. * config/sparc/rtemself.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise. Undefine it. * config/sparc/openbsd64.h (NO_IMPLICIT_EXTERN_C): Undefine. * config/sparc/sp64-elf.h (NO_IMPLICIT_EXTERN_C): New macro. (SWITCH_TAKES_ARG): Likewise. (LOCAL_LABEL_PREFIX): Likewise. (ASM_GENERATE_INTERNAL_LABEL): Likewise. (TARGET_N_FORMAT_TYPES): Delete. (TARGET_FORMAT_TYPES): Likewise. (ASM_DECLARE_FUNCTION_SIZE): Likewise. * config/sparc/elf.h: Delete. * config/sparc/sp-elf.h: New file. From-SVN: r94185 --- gcc/ChangeLog | 26 +++++++++++ gcc/config.gcc | 10 ++--- gcc/config/sparc/elf.h | 64 --------------------------- gcc/config/sparc/liteelf.h | 12 +++--- gcc/config/sparc/openbsd64.h | 5 ++- gcc/config/sparc/rtemself.h | 5 ++- gcc/config/sparc/sp-elf.h | 83 ++++++++++++++++++++++++++++++++++++ gcc/config/sparc/sp64-elf.h | 46 +++++++++++--------- gcc/config/sparc/sp86x-elf.h | 12 +++--- 9 files changed, 158 insertions(+), 105 deletions(-) delete mode 100644 gcc/config/sparc/elf.h create mode 100644 gcc/config/sparc/sp-elf.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b701448bb249..62ae65354a68 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,29 @@ +2005-01-24 Eric Botcazou + + PR bootstrap/19364 + * config.gcc (sparc-*-elf*): Remove sol2.h, sparc/sol2.h and + sparc/elf.h, add sparc/sp-elf.h. + (sparc-*-rtems*): Likewise. + (sparclite-*-elf*): Remove sol2.h, sparc/sol2.h, sparc/elf.h and + tm-dwarf2.h, add sparc/sp-elf.h. + (sparc86x-*-elf): Likewise. + (sparc64-*-elf*): Remove sol2.h, sparc/sol2.h and tm-dwarf2.h. + * config/sparc/liteelf.h (TARGET_SUB_OS_CPP_BUILTINS): Rename into + TARGET_OS_CPP_BUILTINS. + * config/sparc/sp86x-elf (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + * config/sparc/rtemself.h (TARGET_SUB_OS_CPP_BUILTINS): Likewise. + Undefine it. + * config/sparc/openbsd64.h (NO_IMPLICIT_EXTERN_C): Undefine. + * config/sparc/sp64-elf.h (NO_IMPLICIT_EXTERN_C): New macro. + (SWITCH_TAKES_ARG): Likewise. + (LOCAL_LABEL_PREFIX): Likewise. + (ASM_GENERATE_INTERNAL_LABEL): Likewise. + (TARGET_N_FORMAT_TYPES): Delete. + (TARGET_FORMAT_TYPES): Likewise. + (ASM_DECLARE_FUNCTION_SIZE): Likewise. + * config/sparc/elf.h: Delete. + * config/sparc/sp-elf.h: New file. + 2005-01-24 Kazu Hirata * tree-flow-inline.h (phi_arg_from_edge): Remove. diff --git a/gcc/config.gcc b/gcc/config.gcc index 462593a50cd9..c56b1da8a3ca 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1889,7 +1889,7 @@ sparc64-*-openbsd*) with_cpu=ultrasparc ;; sparc-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h" tmake_file="sparc/t-elf sparc/t-crtfm" extra_parts="crti.o crtn.o crtbegin.o crtend.o" use_fixproto=yes @@ -1899,7 +1899,7 @@ sparc-*-linux*) # SPARC's running GNU/Linux, libc6 tmake_file="${tmake_file} sparc/t-crtfm" ;; sparc-*-rtems*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h sparc/rtemself.h rtems.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/rtemself.h rtems.h" tmake_file="sparc/t-elf sparc/t-crtfm t-rtems" extra_parts="crti.o crtn.o crtbegin.o crtend.o" ;; @@ -1997,19 +1997,19 @@ sparclite-*-coff*) tmake_file=sparc/t-sparclite ;; sparclite-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h sparc/liteelf.h tm-dwarf2.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/liteelf.h" tmake_file="sparc/t-sparclite sparc/t-crtfm" extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; sparc86x-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/elf.h sparc/sp86x-elf.h tm-dwarf2.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp-elf.h sparc/sp86x-elf.h" tmake_file="sparc/t-sp86x sparc/t-crtfm" extra_parts="crtbegin.o crtend.o" use_fixproto=yes ;; sparc64-*-elf*) - tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sol2.h sparc/sol2.h sparc/sp64-elf.h tm-dwarf2.h" + tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sp64-elf.h" tmake_file="${tmake_file} sparc/t-crtfm" extra_parts="crtbegin.o crtend.o" use_fixproto=yes diff --git a/gcc/config/sparc/elf.h b/gcc/config/sparc/elf.h deleted file mode 100644 index 5d55c9cd9525..000000000000 --- a/gcc/config/sparc/elf.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Definitions of target machine for GCC, - for SPARC running in an embedded environment using the ELF file format. - Copyright (C) 1997, 2004 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC 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. - -GCC 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 GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ - crtend.o%s crtn.o%s" - -/* Use the default. */ -#undef LINK_SPEC - -/* Don't set the target flags, this is done by the linker script */ -#undef LIB_SPEC -#define LIB_SPEC "" - -/* FIXME: until fixed */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -/* This solaris2 define does not apply. */ -#undef STDC_0_IN_SYSTEM_HEADERS - -/* We don't want to use the Solaris2 specific long long int conversion - routines or 64-bit integer multiply and divide routines. */ -#undef SUN_CONVERSION_LIBFUNCS -#define SUN_CONVERSION_LIBFUNCS 0 - -#undef SUN_INTEGER_MULTIPLY_64 -#define SUN_INTEGER_MULTIPLY_64 0 - -/* Don't include Solaris-specific format checks. */ -#undef TARGET_N_FORMAT_TYPES -#undef TARGET_FORMAT_TYPES - -/* Don't include Solaris-specific .init / .fini support. */ -#undef ASM_DECLARE_FUNCTION_SIZE -#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ - do \ - { \ - if (!flag_inhibit_size_directive) \ - ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ - } \ - while (0) diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h index 00318576bad9..584816b4a1e1 100644 --- a/gcc/config/sparc/liteelf.h +++ b/gcc/config/sparc/liteelf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC, for SPARClite w/o FPU, ELF. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2005 Free Software Foundation, Inc. Contributed by Stan Cox (scox@cygnus.com). This file is part of GCC. @@ -19,17 +19,17 @@ 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. */ -#undef TARGET_SUB_OS_CPP_BUILTINS -#define TARGET_SUB_OS_CPP_BUILTINS() \ +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparclite)"); + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define ("__sparclite__"); \ } \ while (0) -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (sparclite)"); - /* Enable app-regs and epilogue options. Do not enable the fpu. */ #undef TARGET_DEFAULT diff --git a/gcc/config/sparc/openbsd64.h b/gcc/config/sparc/openbsd64.h index e13c8862554b..4801525a8bc1 100644 --- a/gcc/config/sparc/openbsd64.h +++ b/gcc/config/sparc/openbsd64.h @@ -1,5 +1,5 @@ /* Configuration file for sparc64 OpenBSD target. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -51,6 +51,9 @@ Boston, MA 02111-1307, USA. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX +/* Inherited from sp64-elf. */ +#undef NO_IMPLICIT_EXTERN_C + #undef ASM_SPEC #define ASM_SPEC "\ %{v:-V} -s %{fpic|fPIC|fpie|fPIE:-K PIC} \ diff --git a/gcc/config/sparc/rtemself.h b/gcc/config/sparc/rtemself.h index bd9eea45532d..b55680d7cf79 100644 --- a/gcc/config/sparc/rtemself.h +++ b/gcc/config/sparc/rtemself.h @@ -1,5 +1,5 @@ /* Definitions for rtems targeting a SPARC using ELF. - Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2002, 2005 Free Software Foundation, Inc. Contributed by Joel Sherrill (joel@OARcorp.com). This file is part of GCC. @@ -20,7 +20,8 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Target OS builtins. */ -#define TARGET_SUB_OS_CPP_BUILTINS() \ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define ("__rtems__"); \ diff --git a/gcc/config/sparc/sp-elf.h b/gcc/config/sparc/sp-elf.h new file mode 100644 index 000000000000..b261299058cb --- /dev/null +++ b/gcc/config/sparc/sp-elf.h @@ -0,0 +1,83 @@ +/* Definitions of target machine for GCC, + for SPARC running in an embedded environment using the ELF file format. + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC 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. + +GCC 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 GCC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparc-elf)") + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT MASK_FPU + +/* Don't assume anything about the header files. */ +#define NO_IMPLICIT_EXTERN_C + +/* The sun bundled assembler doesn't accept -Yd, (and neither does gas). + It's safe to pass -s always, even if -g is not used. */ +#undef ASM_SPEC +#define ASM_SPEC \ + "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s \ + %{fpic|fpie|fPIC|fPIE:-K PIC} %(asm_cpu)" + +/* Use the default. */ +#undef LINK_SPEC + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "crt0.o%s crti.o%s crtbegin.o%s" + +#undef ENDFILE_SPEC +#define ENDFILE_SPEC \ + "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \ + crtend.o%s crtn.o%s" + +/* Don't set the target flags, this is done by the linker script */ +#undef LIB_SPEC +#define LIB_SPEC "" + +/* This defines which switch letters take arguments. + It is as in svr4.h but with -R added. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ + || (CHAR) == 'R' \ + || (CHAR) == 'h' \ + || (CHAR) == 'z') + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM)) + +/* ??? Inherited from sol2.h. Probably wrong. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE "long int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE BITS_PER_WORD + +/* ??? until fixed. */ +#undef LONG_DOUBLE_TYPE_SIZE +#define LONG_DOUBLE_TYPE_SIZE 64 diff --git a/gcc/config/sparc/sp64-elf.h b/gcc/config/sparc/sp64-elf.h index bbee49df8c97..e75a5f53bf65 100644 --- a/gcc/config/sparc/sp64-elf.h +++ b/gcc/config/sparc/sp64-elf.h @@ -20,16 +20,10 @@ 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. */ -/* ??? We're taking the scheme of including another file and then overriding - the values we don't like a bit too far here. The alternative is to more or - less duplicate all of svr4.h, sparc/sysv4.h, and sparc/sol2.h here - (suitably cleaned up). */ - #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (sparc64-elf)") /* A 64 bit v9 compiler in a Medium/Anywhere code model environment. */ - #undef TARGET_DEFAULT #define TARGET_DEFAULT \ (MASK_V9 + MASK_PTR64 + MASK_64BIT + MASK_HARD_QUAD \ @@ -38,6 +32,9 @@ Boston, MA 02111-1307, USA. */ #undef SPARC_DEFAULT_CMODEL #define SPARC_DEFAULT_CMODEL CM_EMBMEDANY +/* Don't assume anything about the header files. */ +#define NO_IMPLICIT_EXTERN_C + /* __svr4__ is used by the C library (FIXME) */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC "-D__svr4__" @@ -75,6 +72,15 @@ crtbegin.o%s \ /* Use the default (for now). */ #undef LIB_SPEC +/* This defines which switch letters take arguments. + It is as in svr4.h but with -R added. */ +#undef SWITCH_TAKES_ARG +#define SWITCH_TAKES_ARG(CHAR) \ + (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ + || (CHAR) == 'R' \ + || (CHAR) == 'h' \ + || (CHAR) == 'z') + /* V9 chips can handle either endianness. */ #undef SUBTARGET_SWITCHES #define SUBTARGET_SWITCHES \ @@ -86,7 +92,19 @@ crtbegin.o%s \ #undef WORDS_BIG_ENDIAN #define WORDS_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN) - + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* This is how to store into the string LABEL + the symbol_ref name of an internal numbered label where + PREFIX is the class of label and NUM is the number within the class. + This is suitable for output with `assemble_name'. */ + +#undef ASM_GENERATE_INTERNAL_LABEL +#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ + sprintf ((LABEL), "*.L%s%ld", (PREFIX), (long)(NUM)) + /* ??? This should be 32 bits for v9 but what can we do? */ #undef WCHAR_TYPE #define WCHAR_TYPE "short unsigned int" @@ -104,17 +122,3 @@ crtbegin.o%s \ this 0 to not confuse the branch shortening code. */ #undef JUMP_TABLES_IN_TEXT_SECTION #define JUMP_TABLES_IN_TEXT_SECTION 0 - -/* Don't include Solaris-specific format checks. */ -#undef TARGET_N_FORMAT_TYPES -#undef TARGET_FORMAT_TYPES - -/* Don't include Solaris-specific .init / .fini support. */ -#undef ASM_DECLARE_FUNCTION_SIZE -#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ - do \ - { \ - if (!flag_inhibit_size_directive) \ - ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ - } \ - while (0) diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h index 8aa84301019f..971f3583b7fa 100644 --- a/gcc/config/sparc/sp86x-elf.h +++ b/gcc/config/sparc/sp86x-elf.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GCC, for sparclite 86x w/o FPU. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2005 Free Software Foundation, Inc. Contributed by Stan Cox (scox@cygnus.com). This file is part of GCC. @@ -19,17 +19,17 @@ 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. */ -#undef TARGET_SUB_OS_CPP_BUILTINS -#define TARGET_SUB_OS_CPP_BUILTINS() \ +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (sparclite 86x)"); + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define ("__sparclite86x__"); \ } \ while (0) -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (sparclite 86x)"); - /* Enable app-regs and epilogue options. Do not enable the fpu. */ #undef TARGET_DEFAULT -- 2.43.5