OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [config/] [openbsd.h] - Diff between revs 38 and 154

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

Rev 38 Rev 154
/* Base configuration file for all OpenBSD targets.
/* Base configuration file for all OpenBSD targets.
   Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc.
   Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc.
 
 
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/>.  */
 
 
/* Common OpenBSD configuration.
/* Common OpenBSD configuration.
   All OpenBSD architectures include this file, which is intended as
   All OpenBSD architectures include this file, which is intended as
   a repository for common defines.
   a repository for common defines.
 
 
   Some defines are common to all architectures, a few of them are
   Some defines are common to all architectures, a few of them are
   triggered by OBSD_* guards, so that we won't override architecture
   triggered by OBSD_* guards, so that we won't override architecture
   defaults by mistakes.
   defaults by mistakes.
 
 
   OBSD_HAS_CORRECT_SPECS:
   OBSD_HAS_CORRECT_SPECS:
      another mechanism provides correct specs already.
      another mechanism provides correct specs already.
   OBSD_NO_DYNAMIC_LIBRARIES:
   OBSD_NO_DYNAMIC_LIBRARIES:
      no implementation of dynamic libraries.
      no implementation of dynamic libraries.
   OBSD_OLD_GAS:
   OBSD_OLD_GAS:
      older flavor of gas which needs help for PIC.
      older flavor of gas which needs help for PIC.
   OBSD_HAS_DECLARE_FUNCTION_NAME, OBSD_HAS_DECLARE_FUNCTION_SIZE,
   OBSD_HAS_DECLARE_FUNCTION_NAME, OBSD_HAS_DECLARE_FUNCTION_SIZE,
   OBSD_HAS_DECLARE_OBJECT:
   OBSD_HAS_DECLARE_OBJECT:
      PIC support, FUNCTION_NAME/FUNCTION_SIZE are independent, whereas
      PIC support, FUNCTION_NAME/FUNCTION_SIZE are independent, whereas
      the corresponding logic for OBJECTS is necessarily coupled.
      the corresponding logic for OBJECTS is necessarily coupled.
 
 
   There are also a few `default' defines such as ASM_WEAKEN_LABEL,
   There are also a few `default' defines such as ASM_WEAKEN_LABEL,
   intended as common ground for arch that don't provide
   intended as common ground for arch that don't provide
   anything suitable.  */
   anything suitable.  */
 
 
/* OPENBSD_NATIVE is defined only when gcc is configured as part of
/* OPENBSD_NATIVE is defined only when gcc is configured as part of
   the OpenBSD source tree, specifically through Makefile.bsd-wrapper.
   the OpenBSD source tree, specifically through Makefile.bsd-wrapper.
 
 
   In such a case the include path can be trimmed as there is no
   In such a case the include path can be trimmed as there is no
   distinction between system includes and gcc includes.  */
   distinction between system includes and gcc includes.  */
 
 
/* This configuration method, namely Makefile.bsd-wrapper and
/* This configuration method, namely Makefile.bsd-wrapper and
   OPENBSD_NATIVE is NOT recommended for building cross-compilers.  */
   OPENBSD_NATIVE is NOT recommended for building cross-compilers.  */
 
 
#ifdef OPENBSD_NATIVE
#ifdef OPENBSD_NATIVE
 
 
/* The compiler is configured with ONLY the gcc/g++ standard headers.  */
/* The compiler is configured with ONLY the gcc/g++ standard headers.  */
#undef INCLUDE_DEFAULTS
#undef INCLUDE_DEFAULTS
#define INCLUDE_DEFAULTS                        \
#define INCLUDE_DEFAULTS                        \
  {                                             \
  {                                             \
    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },     \
    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },     \
    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 }, \
    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1 }, \
    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1 }, \
    { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \
    { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 }, \
    { 0, 0, 0, 0 }                          \
    { 0, 0, 0, 0 }                          \
  }
  }
 
 
/* Under OpenBSD, the normal location of the various *crt*.o files is the
/* Under OpenBSD, the normal location of the various *crt*.o files is the
   /usr/lib directory.  */
   /usr/lib directory.  */
#undef STANDARD_STARTFILE_PREFIX
#undef STANDARD_STARTFILE_PREFIX
#define STANDARD_STARTFILE_PREFIX       "/usr/local/lib/"
#define STANDARD_STARTFILE_PREFIX       "/usr/local/lib/"
 
 
#endif
#endif
 
 


/* Controlling the compilation driver.  */
/* Controlling the compilation driver.  */
/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets.  */
/* TARGET_OS_CPP_BUILTINS() common to all OpenBSD targets.  */
#define OPENBSD_OS_CPP_BUILTINS()               \
#define OPENBSD_OS_CPP_BUILTINS()               \
  do                                            \
  do                                            \
    {                                           \
    {                                           \
      builtin_define ("__OpenBSD__");           \
      builtin_define ("__OpenBSD__");           \
      builtin_define ("__unix__");              \
      builtin_define ("__unix__");              \
      builtin_define ("__ANSI_COMPAT");         \
      builtin_define ("__ANSI_COMPAT");         \
      builtin_assert ("system=unix");           \
      builtin_assert ("system=unix");           \
      builtin_assert ("system=bsd");            \
      builtin_assert ("system=bsd");            \
      builtin_assert ("system=OpenBSD");        \
      builtin_assert ("system=OpenBSD");        \
    }                                           \
    }                                           \
  while (0)
  while (0)
 
 
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
/* CPP_SPEC appropriate for OpenBSD. We deal with -posix and -pthread.
   XXX the way threads are handled currently is not very satisfying,
   XXX the way threads are handled currently is not very satisfying,
   since all code must be compiled with -pthread to work.
   since all code must be compiled with -pthread to work.
   This two-stage defines makes it easy to pick that for targets that
   This two-stage defines makes it easy to pick that for targets that
   have subspecs.  */
   have subspecs.  */
#ifdef CPP_CPU_SPEC
#ifdef CPP_CPU_SPEC
#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#define OBSD_CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#else
#else
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#define OBSD_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
#endif
#endif
 
 
/* LIB_SPEC appropriate for OpenBSD.  */
/* LIB_SPEC appropriate for OpenBSD.  */
#ifdef HAS_LIBC_R
#ifdef HAS_LIBC_R
/*   -lc(_r)?(_p)?, select _r for threads, and _p for p or pg.  */
/*   -lc(_r)?(_p)?, select _r for threads, and _p for p or pg.  */
# define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
# define OBSD_LIB_SPEC "%{!shared:-lc%{pthread:_r}%{p:_p}%{!p:%{pg:_p}}}"
#else
#else
/* Include -lpthread if -pthread is specified on the command line. */
/* Include -lpthread if -pthread is specified on the command line. */
# define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
# define OBSD_LIB_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
#endif
#endif
 
 
 
 
#ifndef OBSD_HAS_CORRECT_SPECS
#ifndef OBSD_HAS_CORRECT_SPECS
 
 
#ifndef OBSD_NO_DYNAMIC_LIBRARIES
#ifndef OBSD_NO_DYNAMIC_LIBRARIES
#undef SWITCH_TAKES_ARG
#undef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) \
#define SWITCH_TAKES_ARG(CHAR) \
  (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
  (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
   || (CHAR) == 'R')
   || (CHAR) == 'R')
#endif
#endif
 
 
#undef CPP_SPEC
#undef CPP_SPEC
#define CPP_SPEC OBSD_CPP_SPEC
#define CPP_SPEC OBSD_CPP_SPEC
 
 
#ifdef OBSD_OLD_GAS
#ifdef OBSD_OLD_GAS
/* ASM_SPEC appropriate for OpenBSD.  For some architectures, OpenBSD
/* ASM_SPEC appropriate for OpenBSD.  For some architectures, OpenBSD
   still uses a special flavor of gas that needs to be told when generating
   still uses a special flavor of gas that needs to be told when generating
   pic code.  */
   pic code.  */
#undef ASM_SPEC
#undef ASM_SPEC
#define ASM_SPEC "%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
#define ASM_SPEC "%{fpic|fpie:-k} %{fPIC|fPIE:-k -K}"
#endif
#endif
 
 
/* Since we use gas, stdin -> - is a good idea.  */
/* Since we use gas, stdin -> - is a good idea.  */
#define AS_NEEDS_DASH_FOR_PIPED_INPUT
#define AS_NEEDS_DASH_FOR_PIPED_INPUT
 
 
/* LINK_SPEC appropriate for OpenBSD.  Support for GCC options
/* LINK_SPEC appropriate for OpenBSD.  Support for GCC options
   -static, -assert, and -nostdlib.  */
   -static, -assert, and -nostdlib.  */
#undef LINK_SPEC
#undef LINK_SPEC
#ifdef OBSD_NO_DYNAMIC_LIBRARIES
#ifdef OBSD_NO_DYNAMIC_LIBRARIES
#define LINK_SPEC \
#define LINK_SPEC \
  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{assert*}"
#else
#else
#define LINK_SPEC \
#define LINK_SPEC \
  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
  "%{g:%{!nostdlib:-L/usr/lib/debug}} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}}} %{shared:-Bshareable -x} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
#endif
#endif
 
 
#undef LIB_SPEC
#undef LIB_SPEC
#define LIB_SPEC OBSD_LIB_SPEC
#define LIB_SPEC OBSD_LIB_SPEC
#endif
#endif
 
 


/* Runtime target specification.  */
/* Runtime target specification.  */
 
 
/* Miscellaneous parameters.  */
/* Miscellaneous parameters.  */
 
 
/* Controlling debugging info: dbx options.  */
/* Controlling debugging info: dbx options.  */
 
 
/* Don't use the `xsTAG;' construct in DBX output; OpenBSD systems that
/* Don't use the `xsTAG;' construct in DBX output; OpenBSD systems that
   use DBX don't support it.  */
   use DBX don't support it.  */
#define DBX_NO_XREFS
#define DBX_NO_XREFS
 
 


/* Support of shared libraries, mostly imported from svr4.h through netbsd.  */
/* Support of shared libraries, mostly imported from svr4.h through netbsd.  */
/* Two differences from svr4.h:
/* Two differences from svr4.h:
   - we use . - _func instead of a local label,
   - we use . - _func instead of a local label,
   - we put extra spaces in expressions such as
   - we put extra spaces in expressions such as
     .type _func , @function
     .type _func , @function
     This is more readable for a human being and confuses c++filt less.  */
     This is more readable for a human being and confuses c++filt less.  */
 
 
/* Assembler format: output and generation of labels.  */
/* Assembler format: output and generation of labels.  */
 
 
/* Define the strings used for the .type and .size directives.
/* Define the strings used for the .type and .size directives.
   These strings generally do not vary from one system running OpenBSD
   These strings generally do not vary from one system running OpenBSD
   to another, but if a given system needs to use different pseudo-op
   to another, but if a given system needs to use different pseudo-op
   names for these, they may be overridden in the arch specific file.  */
   names for these, they may be overridden in the arch specific file.  */
 
 
/* OpenBSD assembler is hacked to have .type & .size support even in a.out
/* OpenBSD assembler is hacked to have .type & .size support even in a.out
   format object files.  Functions size are supported but not activated
   format object files.  Functions size are supported but not activated
   yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).
   yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c).
   SET_ASM_OP is needed for attribute alias to work.  */
   SET_ASM_OP is needed for attribute alias to work.  */
 
 
#undef TYPE_ASM_OP
#undef TYPE_ASM_OP
#undef SIZE_ASM_OP
#undef SIZE_ASM_OP
#undef SET_ASM_OP
#undef SET_ASM_OP
#undef GLOBAL_ASM_OP
#undef GLOBAL_ASM_OP
 
 
#define TYPE_ASM_OP     "\t.type\t"
#define TYPE_ASM_OP     "\t.type\t"
#define SIZE_ASM_OP     "\t.size\t"
#define SIZE_ASM_OP     "\t.size\t"
#define SET_ASM_OP      "\t.set\t"
#define SET_ASM_OP      "\t.set\t"
#define GLOBAL_ASM_OP   "\t.globl\t"
#define GLOBAL_ASM_OP   "\t.globl\t"
 
 
/* The following macro defines the format used to output the second
/* The following macro defines the format used to output the second
   operand of the .type assembler directive.  */
   operand of the .type assembler directive.  */
#undef TYPE_OPERAND_FMT
#undef TYPE_OPERAND_FMT
#define TYPE_OPERAND_FMT        "@%s"
#define TYPE_OPERAND_FMT        "@%s"
 
 
/* Provision if extra assembler code is needed to declare a function's result
/* Provision if extra assembler code is needed to declare a function's result
   (taken from svr4, not needed yet actually).  */
   (taken from svr4, not needed yet actually).  */
#ifndef ASM_DECLARE_RESULT
#ifndef ASM_DECLARE_RESULT
#define ASM_DECLARE_RESULT(FILE, RESULT)
#define ASM_DECLARE_RESULT(FILE, RESULT)
#endif
#endif
 
 
/* These macros generate the special .type and .size directives which
/* These macros generate the special .type and .size directives which
   are used to set the corresponding fields of the linker symbol table
   are used to set the corresponding fields of the linker symbol table
   entries under OpenBSD.  These macros also have to output the starting
   entries under OpenBSD.  These macros also have to output the starting
   labels for the relevant functions/objects.  */
   labels for the relevant functions/objects.  */
 
 
#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME
#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME
/* Extra assembler code needed to declare a function properly.
/* Extra assembler code needed to declare a function properly.
   Some assemblers may also need to also have something extra said
   Some assemblers may also need to also have something extra said
   about the function's return value.  We allow for that here.  */
   about the function's return value.  We allow for that here.  */
#undef ASM_DECLARE_FUNCTION_NAME
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)                     \
  do {                                                                  \
  do {                                                                  \
    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");                 \
    ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function");                 \
    ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
    ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL));                      \
    ASM_OUTPUT_LABEL(FILE, NAME);                                       \
    ASM_OUTPUT_LABEL(FILE, NAME);                                       \
  } while (0)
  } while (0)
#endif
#endif
 
 
#ifndef OBSD_HAS_DECLARE_FUNCTION_SIZE
#ifndef OBSD_HAS_DECLARE_FUNCTION_SIZE
/* Declare the size of a function.  */
/* Declare the size of a function.  */
#undef ASM_DECLARE_FUNCTION_SIZE
#undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)            \
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL)            \
  do {                                                          \
  do {                                                          \
    if (!flag_inhibit_size_directive)                           \
    if (!flag_inhibit_size_directive)                           \
      ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                   \
      ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME);                   \
  } while (0)
  } while (0)
#endif
#endif
 
 
#ifndef OBSD_HAS_DECLARE_OBJECT
#ifndef OBSD_HAS_DECLARE_OBJECT
/* Extra assembler code needed to declare an object properly.  */
/* Extra assembler code needed to declare an object properly.  */
#undef ASM_DECLARE_OBJECT_NAME
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)               \
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL)               \
  do {                                                          \
  do {                                                          \
      HOST_WIDE_INT size;                                       \
      HOST_WIDE_INT size;                                       \
      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");         \
      ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object");         \
      size_directive_output = 0;                         \
      size_directive_output = 0;                         \
      if (!flag_inhibit_size_directive                          \
      if (!flag_inhibit_size_directive                          \
          && (DECL) && DECL_SIZE (DECL))                        \
          && (DECL) && DECL_SIZE (DECL))                        \
        {                                                       \
        {                                                       \
          size_directive_output = 1;                            \
          size_directive_output = 1;                            \
          size = int_size_in_bytes (TREE_TYPE (DECL));          \
          size = int_size_in_bytes (TREE_TYPE (DECL));          \
          ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);         \
          ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size);         \
        }                                                       \
        }                                                       \
      ASM_OUTPUT_LABEL (FILE, NAME);                            \
      ASM_OUTPUT_LABEL (FILE, NAME);                            \
  } while (0)
  } while (0)
 
 
/* Output the size directive for a decl in rest_of_decl_compilation
/* Output the size directive for a decl in rest_of_decl_compilation
   in the case where we did not do so before the initializer.
   in the case where we did not do so before the initializer.
   Once we find the error_mark_node, we know that the value of
   Once we find the error_mark_node, we know that the value of
   size_directive_output was set by ASM_DECLARE_OBJECT_NAME
   size_directive_output was set by ASM_DECLARE_OBJECT_NAME
   when it was run for the same decl.  */
   when it was run for the same decl.  */
#undef ASM_FINISH_DECLARE_OBJECT
#undef ASM_FINISH_DECLARE_OBJECT
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)         \
do {                                                                     \
do {                                                                     \
     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);               \
     const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0);               \
     HOST_WIDE_INT size;                                                 \
     HOST_WIDE_INT size;                                                 \
     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
     if (!flag_inhibit_size_directive && DECL_SIZE (DECL)                \
         && ! AT_END && TOP_LEVEL                                        \
         && ! AT_END && TOP_LEVEL                                        \
         && DECL_INITIAL (DECL) == error_mark_node                       \
         && DECL_INITIAL (DECL) == error_mark_node                       \
         && !size_directive_output)                                      \
         && !size_directive_output)                                      \
       {                                                                 \
       {                                                                 \
         size_directive_output = 1;                                      \
         size_directive_output = 1;                                      \
         size = int_size_in_bytes (TREE_TYPE (DECL));                    \
         size = int_size_in_bytes (TREE_TYPE (DECL));                    \
         ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
         ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size);                   \
       }                                                                 \
       }                                                                 \
   } while (0)
   } while (0)
#endif
#endif
 
 


/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
/* Those are `generic' ways to weaken/globalize a label. We shouldn't need
   to override a processor specific definition. Hence, #ifndef ASM_*
   to override a processor specific definition. Hence, #ifndef ASM_*
   In case overriding turns out to be needed, one can always #undef ASM_*
   In case overriding turns out to be needed, one can always #undef ASM_*
   before including this file.  */
   before including this file.  */
 
 
/* Tell the assembler that a symbol is weak.  */
/* Tell the assembler that a symbol is weak.  */
/* Note: netbsd arm32 assembler needs a .globl here. An override may
/* Note: netbsd arm32 assembler needs a .globl here. An override may
   be needed when/if we go for arm32 support.  */
   be needed when/if we go for arm32 support.  */
#ifndef ASM_WEAKEN_LABEL
#ifndef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
#define ASM_WEAKEN_LABEL(FILE,NAME) \
  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
  do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
       fputc ('\n', FILE); } while (0)
       fputc ('\n', FILE); } while (0)
#endif
#endif


/* Storage layout.  */
/* Storage layout.  */
 
 


/* Otherwise, since we support weak, gthr.h erroneously tries to use
/* Otherwise, since we support weak, gthr.h erroneously tries to use
   #pragma weak.  */
   #pragma weak.  */
#define GTHREAD_USE_WEAK 0
#define GTHREAD_USE_WEAK 0
 
 
/* bug work around: we don't want to support #pragma weak, but the current
/* bug work around: we don't want to support #pragma weak, but the current
   code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to
   code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to
   work.  On the other hand, we don't define HANDLE_PRAGMA_WEAK directly,
   work.  On the other hand, we don't define HANDLE_PRAGMA_WEAK directly,
   as this depends on a few other details as well...  */
   as this depends on a few other details as well...  */
#define HANDLE_SYSV_PRAGMA 1
#define HANDLE_SYSV_PRAGMA 1
 
 
/* Stack is explicitly denied execution rights on OpenBSD platforms.  */
/* Stack is explicitly denied execution rights on OpenBSD platforms.  */
#define ENABLE_EXECUTE_STACK                                            \
#define ENABLE_EXECUTE_STACK                                            \
extern void __enable_execute_stack (void *);                            \
extern void __enable_execute_stack (void *);                            \
void                                                                    \
void                                                                    \
__enable_execute_stack (void *addr)                                     \
__enable_execute_stack (void *addr)                                     \
{                                                                       \
{                                                                       \
  long size = getpagesize ();                                           \
  long size = getpagesize ();                                           \
  long mask = ~(size-1);                                                \
  long mask = ~(size-1);                                                \
  char *page = (char *) (((long) addr) & mask);                         \
  char *page = (char *) (((long) addr) & mask);                         \
  char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
  char *end  = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
                                                                      \
                                                                      \
  if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
  if (mprotect (page, end - page, PROT_READ | PROT_WRITE | PROT_EXEC) < 0) \
    perror ("mprotect of trampoline code");                             \
    perror ("mprotect of trampoline code");                             \
}
}
 
 
#include <sys/types.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/mman.h>
 
 

powered by: WebSVN 2.1.0

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