home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / config / sparc / next-pdo-sol2.h < prev    next >
C/C++ Source or Header  |  1997-01-22  |  6KB  |  173 lines

  1. /* Definitions of target machine for GNU compiler, for Sun SPARC.
  2.    Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc.
  3.    Contributed by Michael Tiemann (tiemann@cygnus.com).
  4.  
  5. This file is part of GNU CC.
  6.  
  7. GNU CC is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2, or (at your option)
  10. any later version.
  11.  
  12. GNU CC is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with GNU CC; see the file COPYING.  If not, write to
  19. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  20.  
  21. /* Note that some other tm.h files include this one and then override
  22.    many of the definitions that relate to assembler syntax.  */
  23.  
  24. #include "sparc/sol2.h"
  25.  
  26. #define USE_GAS
  27.  
  28. #define NEXT_OBJC_RUNTIME
  29.  
  30. #define NEXT_PDO
  31.  
  32. #undef INIT_SECTION_ASM_OP
  33. #undef CTORS_SECTION_ASM_OP
  34. #undef DTORS_SECTION_ASM_OP
  35.  
  36. #define INIT_SECTION_ASM_OP     ".section\t\".init\",#alloc"
  37. #define CTORS_SECTION_ASM_OP     "\t.section\t\".ctors\",#alloc,#execinstr\n"
  38. #define DTORS_SECTION_ASM_OP     "\t.section\t\".dtors\",#alloc,#execinstr\n"
  39.  
  40. #define INIT_SECTION_PREAMBLE   asm ("restore")
  41.  
  42. /* 
  43.  * overrides for the funky places we put stuff
  44.  *    there was a bug in the beta where the /usr was not prefixed
  45.  */
  46. #undef  GPLUSPLUS_INCLUDE_DIR
  47. #define GPLUSPLUS_INCLUDE_DIR "/usr/NextDeveloper/Headers/g++"
  48. #undef    INCLUDE_DEFAULTS
  49. #define INCLUDE_DEFAULTS                \
  50.   {                            \
  51.     { GPLUSPLUS_INCLUDE_DIR, 1, 1},            \
  52.     { GCC_INCLUDE_DIR, 0, 0},                \
  53.     { TOOL_INCLUDE_DIR, 0, 0},                \
  54.     { LOCAL_INCLUDE_DIR, 0, 1},                \
  55.     { "/usr/NextDeveloper/Headers", 0, 0},        \
  56.     { "/usr/NextDeveloper/Headers/ansi", 0, 0},        \
  57.     { "/usr/LocalDeveloper/Headers", 0, 0},        \
  58.     { "/usr/LocalDeveloper/Headers/ansi", 0, 0},    \
  59.     { STANDARD_INCLUDE_DIR, 0, 0},            \
  60.     { 0, 0, 0}                        \
  61.   }
  62.  
  63. /* Report errors to make application. */
  64.  
  65. #define REPORT_EVENT(TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3)    \
  66.   make_support (TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3)
  67. #define V_REPORT_EVENT(TYPE, NAME, FILE, LINE, MSG, AP)            \
  68.   v_make_support (TYPE, NAME, FILE, LINE, MSG, AP)
  69.  
  70. /* Give methods pretty symbol names on NeXT. */
  71.  
  72. #undef    OBJC_GEN_METHOD_LABEL
  73. #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \
  74.   do { if (CAT_NAME)                            \
  75.      sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+',        \
  76.           (CLASS_NAME), (CAT_NAME), (SEL_NAME));        \
  77.        else                                \
  78.      sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+',        \
  79.           (CLASS_NAME), (SEL_NAME));                \
  80.      } while (0)
  81.  
  82. /* Wrap new method names in quotes so the assembler doesn't gag.
  83.    Make Objective-C internal symbols local.  */
  84.  
  85. /* work around the gnu'ism of the @ at the begining of the symbol name */
  86.  
  87. #undef    ASM_OUTPUT_LABELREF
  88. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  89.   do {  \
  90.     if (NAME[1] == '+' || NAME[1] == '-') \
  91.         fprintf (FILE, "\"%s\"", NAME+1); \
  92.     else if (NAME[0] == '+' || NAME[0] == '-') \
  93.         fprintf (FILE, "\"%s\"", NAME); \
  94.     else if (!strncmp (NAME, "_OBJC_", 6)) \
  95.         fprintf (FILE, "L%s", NAME);   \
  96.     else if (!strncmp (NAME, ".objc_class_name_", 17))        \
  97.         fprintf (FILE, "%s", NAME);                \
  98.     else fprintf ((FILE), "%s", NAME); } while (0)
  99.  
  100. /* Prevent error on `-sun4' and `-target sun4' options.  */
  101. /* This used to translate -dalign to -malign, but that is no good
  102.    because it can't turn off the usual meaning of making debugging dumps.  */
  103.  
  104. #define CC1_SPEC "%{sun4:} %{target:}"
  105.  
  106. #define PTRDIFF_TYPE "int"
  107. /* In 2.4 it should work to delete this.
  108.    #define SIZE_TYPE "int"  */
  109.  
  110. /* Omit frame pointer at high optimization levels.  */
  111.   
  112. #define OPTIMIZATION_OPTIONS(OPTIMIZE) \
  113. {                                  \
  114.   if (OPTIMIZE >= 2)                         \
  115.     {                                \
  116.       flag_omit_frame_pointer = 1;                \
  117.     }                                \
  118. }
  119.  
  120. #undef WORD_SWITCH_TAKES_ARG
  121. #define WORD_SWITCH_TAKES_ARG(STR)                \
  122.   (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                \
  123.    || !strcmp (STR, "target")                     \
  124.    || !strcmp (STR, "assert")                    \
  125.    || !strcmp (STR, "arch")                    \
  126.    || !strcmp (STR, "filelist")                    \
  127.    || !strcmp (STR, "framework"))
  128.  
  129. #undef WORD_SWITCH
  130. #define WORD_SWITCH(STR) \
  131.   (WORD_SWITCH_TAKES_ARG (STR) \
  132.    || !strcmp (STR, "bsd") \
  133.    || !strcmp (STR, "object") \
  134.    || !strcmp (STR, "ObjC") \
  135.    || !strcmp (STR, "all_load"))
  136.  
  137. #define OBJC_FORWARDING_REG_OFFSET(ISREG, OFF, REGNO) \
  138.   do { OFF =  (4 * ((REGNO) - 24));                   \
  139.        ISREG = 0; } while (0)
  140.  
  141. /* Names to predefine in the preprocessor for this target machine.  */
  142.  
  143. /* The GCC_NEW_VARARGS macro is so that old versions of gcc can compile
  144.    new versions, which have an incompatible va-sparc.h file.  This matters
  145.    because gcc does "gvarargs.h" instead of <varargs.h>, and thus gets the
  146.    wrong varargs file when it is compiled with a different version of gcc.  */
  147.  
  148. #undef CPP_PREDEFINES
  149. #define CPP_PREDEFINES \
  150.   "-Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -D__svr4__ -D__SVR4 \
  151.    -DNeXT_PDO -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"sparc\" \
  152.    -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc)"
  153.  
  154. #undef TARGET_VERSION
  155. #define TARGET_VERSION fprintf (stderr, " (sparc-nextpdo-sunos5.3)");
  156.  
  157. /* FIXME: This is a workaound for bug in objc-act.c, static strings need
  158.    to be in the writable data section, so now we make everything writable.
  159.  */
  160. #undef CONST_SECTION_ASM_OP
  161. #define CONST_SECTION_ASM_OP    ".section\t.data"
  162.  
  163. #undef LIB_SPEC
  164. #define LIB_SPEC \
  165.   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-L/usr/NextDeveloper/lib %{!nopdolib:-lpdo}  -lnsl -lthread -lsocket -lc -lm}} %{!shared:%{!symbolic:-lc}}"
  166.  
  167. #define NEXT_FRAMEWORKS_DEFAULT            \
  168.     {"/usr/LocalLibrary/Frameworks", 0},    \
  169.     {"/usr/NextLibrary/Frameworks", 0}, 
  170.  
  171. #undef TARGET_DEFAULT
  172. #define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_HARD_QUAD)
  173.