OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [config/] [sparc/] [freebsd.h] - Diff between revs 282 and 384

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 282 Rev 384
/* Definitions for Sun SPARC64 running FreeBSD using the ELF format
/* Definitions for Sun SPARC64 running FreeBSD using the ELF format
   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
   Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
   Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
   Contributed by David E. O'Brien <obrien@FreeBSD.org> and BSDi.
 
 
This file is part of GCC.
This file is part of GCC.
 
 
GCC is free software; you can redistribute it and/or modify
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
the Free Software Foundation; either version 3, or (at your option)
any later version.
any later version.
 
 
GCC is distributed in the hope that it will be useful,
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.  */
<http://www.gnu.org/licenses/>.  */
 
 
#undef  SUBTARGET_EXTRA_SPECS
#undef  SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
#define SUBTARGET_EXTRA_SPECS \
  { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
  { "fbsd_dynamic_linker", FBSD_DYNAMIC_LINKER }
 
 
/* FreeBSD needs the platform name (sparc64) defined.
/* FreeBSD needs the platform name (sparc64) defined.
   Emacs needs to know if the arch is 64 or 32-bits.  */
   Emacs needs to know if the arch is 64 or 32-bits.  */
 
 
#undef  CPP_CPU64_DEFAULT_SPEC
#undef  CPP_CPU64_DEFAULT_SPEC
#define CPP_CPU64_DEFAULT_SPEC \
#define CPP_CPU64_DEFAULT_SPEC \
  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
  "-D__sparc64__ -D__sparc_v9__ -D__sparcv9 -D__arch64__"
 
 
#define LINK_SPEC "%(link_arch)                                         \
#define LINK_SPEC "%(link_arch)                                         \
  %{!mno-relax:%{!r:-relax}}                                            \
  %{!mno-relax:%{!r:-relax}}                                            \
  %{p:%nconsider using `-pg' instead of `-p' with gprof(1)}             \
  %{p:%nconsider using `-pg' instead of `-p' with gprof(1)}             \
  %{assert*} %{R*} %{rpath*} %{defsym*}                                 \
  %{assert*} %{R*} %{rpath*} %{defsym*}                                 \
  %{shared:-Bshareable %{h*} %{soname*}}                                \
  %{shared:-Bshareable %{h*} %{soname*}}                                \
  %{symbolic:-Bsymbolic}                                                \
  %{symbolic:-Bsymbolic}                                                \
  %{!shared:                                                            \
  %{!shared:                                                            \
    %{!static:                                                          \
    %{!static:                                                          \
      %{rdynamic:-export-dynamic}                                       \
      %{rdynamic:-export-dynamic}                                       \
      %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }}       \
      %{!dynamic-linker:-dynamic-linker %(fbsd_dynamic_linker) }}       \
    %{static:-Bstatic}}"
    %{static:-Bstatic}}"
 
 
 
 
/************************[  Target stuff  ]***********************************/
/************************[  Target stuff  ]***********************************/
 
 
/* Define the actual types of some ANSI-mandated types.
/* Define the actual types of some ANSI-mandated types.
   Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
   Needs to agree with <machine/ansi.h>.  GCC defaults come from c-decl.c,
   c-common.c, and config/<arch>/<arch>.h.  */
   c-common.c, and config/<arch>/<arch>.h.  */
 
 
/* Earlier headers may get this wrong for FreeBSD.
/* Earlier headers may get this wrong for FreeBSD.
   We use the GCC defaults instead.  */
   We use the GCC defaults instead.  */
#undef WCHAR_TYPE
#undef WCHAR_TYPE
 
 
#undef  WCHAR_TYPE_SIZE
#undef  WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 32
#define WCHAR_TYPE_SIZE 32
 
 
/* Define for support of TFmode long double.
/* Define for support of TFmode long double.
   SPARC ABI says that long double is 4 words.  */
   SPARC ABI says that long double is 4 words.  */
#undef  LONG_DOUBLE_TYPE_SIZE
#undef  LONG_DOUBLE_TYPE_SIZE
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
#define LONG_DOUBLE_TYPE_SIZE (TARGET_LONG_DOUBLE_128 ? 128 : 64)
 
 
/* Define this to set long double type size to use in libgcc2.c, which can
/* Define this to set long double type size to use in libgcc2.c, which can
   not depend on target_flags.  */
   not depend on target_flags.  */
#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
#if defined(__arch64__) || defined(__LONG_DOUBLE_128__)
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
#else
#else
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 64
#endif
#endif
 
 
/* Definitions for 64-bit SPARC running systems with ELF. */
/* Definitions for 64-bit SPARC running systems with ELF. */
 
 
#undef  TARGET_VERSION
#undef  TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)");
#define TARGET_VERSION fprintf (stderr, " (FreeBSD/sparc64 ELF)");
 
 
#define TARGET_ELF              1
#define TARGET_ELF              1
 
 
/* XXX */
/* XXX */
/* A 64 bit v9 compiler with stack-bias,
/* A 64 bit v9 compiler with stack-bias,
   in a Medium/mid code model environment.  */
   in a Medium/mid code model environment.  */
 
 
#undef  TARGET_DEFAULT
#undef  TARGET_DEFAULT
#define TARGET_DEFAULT \
#define TARGET_DEFAULT \
  (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \
  (MASK_V9 + MASK_64BIT + MASK_PTR64 /* + MASK_FASTER_STRUCTS */ \
   + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU \
   + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU \
   + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */)
   + MASK_LONG_DOUBLE_128 /* + MASK_HARD_QUAD */)
 
 
/* The default code model.  */
/* The default code model.  */
#undef  SPARC_DEFAULT_CMODEL
#undef  SPARC_DEFAULT_CMODEL
#define SPARC_DEFAULT_CMODEL    CM_MEDLOW
#define SPARC_DEFAULT_CMODEL    CM_MEDLOW
 
 
#define ENABLE_EXECUTE_STACK                                            \
#define ENABLE_EXECUTE_STACK                                            \
  static int need_enable_exec_stack;                                    \
  static int need_enable_exec_stack;                                    \
  static void check_enabling(void) __attribute__ ((constructor));       \
  static void check_enabling(void) __attribute__ ((constructor));       \
  static void check_enabling(void)                                      \
  static void check_enabling(void)                                      \
  {                                                                     \
  {                                                                     \
    extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
    extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
    int prot = 0;                                                       \
    int prot = 0;                                                       \
    size_t len = sizeof(prot);                                          \
    size_t len = sizeof(prot);                                          \
                                                                        \
                                                                        \
    sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0);              \
    sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0);              \
    if (prot != 7)                                                      \
    if (prot != 7)                                                      \
      need_enable_exec_stack = 1;                                       \
      need_enable_exec_stack = 1;                                       \
  }                                                                     \
  }                                                                     \
  extern void __enable_execute_stack (void *);                          \
  extern void __enable_execute_stack (void *);                          \
  void __enable_execute_stack (void *addr)                              \
  void __enable_execute_stack (void *addr)                              \
  {                                                                     \
  {                                                                     \
    if (!need_enable_exec_stack)                                        \
    if (!need_enable_exec_stack)                                        \
      return;                                                           \
      return;                                                           \
    else {                                                              \
    else {                                                              \
      /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */                     \
      /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */                     \
      if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0)                      \
      if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0)                      \
        perror ("mprotect of trampoline code");                         \
        perror ("mprotect of trampoline code");                         \
    }                                                                   \
    }                                                                   \
  }
  }
 
 
 
 
/************************[  Assembler stuff  ]********************************/
/************************[  Assembler stuff  ]********************************/
 
 
#undef  LOCAL_LABEL_PREFIX
#undef  LOCAL_LABEL_PREFIX
#define LOCAL_LABEL_PREFIX  "."
#define LOCAL_LABEL_PREFIX  "."
 
 
/* XXX2 */
/* XXX2 */
/* This is how to store into the string LABEL
/* This is how to store into the string LABEL
   the symbol_ref name of an internal numbered label where
   the symbol_ref name of an internal numbered label where
   PREFIX is the class of label and NUM is the number within the class.
   PREFIX is the class of label and NUM is the number within the class.
   This is suitable for output with `assemble_name'.  */
   This is suitable for output with `assemble_name'.  */
 
 
#undef  ASM_GENERATE_INTERNAL_LABEL
#undef  ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                   \
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM)                   \
  sprintf (LABEL, "*.L%s%lu", PREFIX, (unsigned long)(NUM))
  sprintf (LABEL, "*.L%s%lu", PREFIX, (unsigned long)(NUM))
 
 
 
 
/************************[  Debugger stuff  ]*********************************/
/************************[  Debugger stuff  ]*********************************/
 
 
/* This is the char to use for continuation (in case we need to turn
/* This is the char to use for continuation (in case we need to turn
   continuation back on).  */
   continuation back on).  */
 
 
#undef  DBX_CONTIN_CHAR
#undef  DBX_CONTIN_CHAR
#define DBX_CONTIN_CHAR '?'
#define DBX_CONTIN_CHAR '?'
 
 
/* DWARF bits.  */
/* DWARF bits.  */
 
 
/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets.
/* Follow Irix 6 and not the Dwarf2 draft in using 64-bit offsets.
   Obviously the Dwarf2 folks havn't tried to actually build systems
   Obviously the Dwarf2 folks havn't tried to actually build systems
   with their spec.  On a 64-bit system, only 64-bit relocs become
   with their spec.  On a 64-bit system, only 64-bit relocs become
   RELATIVE relocations.  */
   RELATIVE relocations.  */
 
 
/* #define DWARF_OFFSET_SIZE PTR_SIZE */
/* #define DWARF_OFFSET_SIZE PTR_SIZE */
 
 
#undef ENDFILE_SPEC
#undef ENDFILE_SPEC
#define ENDFILE_SPEC                                            \
#define ENDFILE_SPEC                                            \
  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "   \
  "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s} "   \
  FBSD_ENDFILE_SPEC
  FBSD_ENDFILE_SPEC
 
 
/* We use GNU ld so undefine this so that attribute((init_priority)) works.  */
/* We use GNU ld so undefine this so that attribute((init_priority)) works.  */
#undef CTORS_SECTION_ASM_OP
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.