home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / GNUSRC.Z / next-pdo-sol2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-25  |  5.9 KB  |  172 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.     { LOCAL_INCLUDE_DIR, 0, 1},                \
  54.     { "/usr/NextDeveloper/Headers", 0, 0},            \
  55.     { "/usr/NextDeveloper/Headers/ansi", 0, 0},        \
  56.     { "/usr/LocalDeveloper/Headers", 0, 0},        \
  57.     { "/usr/LocalDeveloper/Headers/ansi", 0, 0},        \
  58.     { STANDARD_INCLUDE_DIR, 0, 0},                \
  59.     { 0, 0, 0}                        \
  60.   }
  61.  
  62. /* Report errors to make application. */
  63.  
  64. #define REPORT_EVENT(TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3)    \
  65.   make_support (TYPE, NAME, FILE, LINE, MSG, ARG1, ARG2, ARG3)
  66. #define V_REPORT_EVENT(TYPE, NAME, FILE, LINE, MSG, AP)            \
  67.   v_make_support (TYPE, NAME, FILE, LINE, MSG, AP)
  68.  
  69. /* Give methods pretty symbol names on NeXT. */
  70.  
  71. #undef    OBJC_GEN_METHOD_LABEL
  72. #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \
  73.   do { if (CAT_NAME)                            \
  74.      sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+',        \
  75.           (CLASS_NAME), (CAT_NAME), (SEL_NAME));        \
  76.        else                                \
  77.      sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+',        \
  78.           (CLASS_NAME), (SEL_NAME));                \
  79.      } while (0)
  80.  
  81. /* Wrap new method names in quotes so the assembler doesn't gag.
  82.    Make Objective-C internal symbols local.  */
  83.  
  84. /* work around the gnu'ism of the @ at the begining of the symbol name */
  85.  
  86. #undef    ASM_OUTPUT_LABELREF
  87. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  88.   do {  \
  89.     if (NAME[1] == '+' || NAME[1] == '-') \
  90.         fprintf (FILE, "\"%s\"", NAME+1); \
  91.     else if (NAME[0] == '+' || NAME[0] == '-') \
  92.         fprintf (FILE, "\"%s\"", NAME); \
  93.     else if (!strncmp (NAME, "_OBJC_", 6)) \
  94.         fprintf (FILE, "L%s", NAME);   \
  95.     else if (!strncmp (NAME, ".objc_class_name_", 17))        \
  96.         fprintf (FILE, "%s", NAME);                \
  97.     else fprintf ((FILE), "%s", NAME); } while (0)
  98.  
  99. /* Prevent error on `-sun4' and `-target sun4' options.  */
  100. /* This used to translate -dalign to -malign, but that is no good
  101.    because it can't turn off the usual meaning of making debugging dumps.  */
  102.  
  103. #define CC1_SPEC "%{sun4:} %{target:}"
  104.  
  105. #define PTRDIFF_TYPE "int"
  106. /* In 2.4 it should work to delete this.
  107.    #define SIZE_TYPE "int"  */
  108.  
  109. /* Omit frame pointer at high optimization levels.  */
  110.   
  111. #define OPTIMIZATION_OPTIONS(OPTIMIZE) \
  112. {                                  \
  113.   if (OPTIMIZE >= 2)                         \
  114.     {                                \
  115.       flag_omit_frame_pointer = 1;                \
  116.     }                                \
  117. }
  118.  
  119. #undef WORD_SWITCH_TAKES_ARG
  120. #define WORD_SWITCH_TAKES_ARG(STR)                \
  121.   (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                \
  122.    || !strcmp (STR, "target")                     \
  123.    || !strcmp (STR, "assert")                    \
  124.    || !strcmp (STR, "arch")                    \
  125.    || !strcmp (STR, "filelist")                    \
  126.    || !strcmp (STR, "framework"))
  127.  
  128. #undef WORD_SWITCH
  129. #define WORD_SWITCH(STR) \
  130.   (WORD_SWITCH_TAKES_ARG (STR) \
  131.    || !strcmp (STR, "bsd") \
  132.    || !strcmp (STR, "object") \
  133.    || !strcmp (STR, "ObjC") \
  134.    || !strcmp (STR, "all_load"))
  135.  
  136. #define OBJC_FORWARDING_REG_OFFSET(ISREG, OFF, REGNO) \
  137.   do { OFF =  (4 * ((REGNO) - 24));                   \
  138.        ISREG = 0; } while (0)
  139.  
  140. /* Names to predefine in the preprocessor for this target machine.  */
  141.  
  142. /* The GCC_NEW_VARARGS macro is so that old versions of gcc can compile
  143.    new versions, which have an incompatible va-sparc.h file.  This matters
  144.    because gcc does "gvarargs.h" instead of <varargs.h>, and thus gets the
  145.    wrong varargs file when it is compiled with a different version of gcc.  */
  146.  
  147. #undef CPP_PREDEFINES
  148. #define CPP_PREDEFINES \
  149.   "-Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -D__svr4__ -D__SVR4 \
  150.    -DNeXT_PDO -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"sparc\" \
  151.    -Asystem(unix) -Asystem(svr4) -Acpu(sparc) -Amachine(sparc)"
  152.  
  153. #undef TARGET_VERSION
  154. #define TARGET_VERSION fprintf (stderr, " (sparc-nextpdo-sunos5.3)");
  155.  
  156. /* FIXME: This is a workaound for bug in objc-act.c, static strings need
  157.    to be in the writable data section, so now we make everything writable.
  158.  */
  159. #undef CONST_SECTION_ASM_OP
  160. #define CONST_SECTION_ASM_OP    ".section\t.data"
  161.  
  162. #undef LIB_SPEC
  163. #define LIB_SPEC \
  164.   "%{compat-bsd:-lucb -lsocket -lnsl -lelf -laio} %{!shared:%{!symbolic:-L/usr/NextDeveloper/lib %{!nopdolib:-lobjc -lpdo}  -lnsl -lthread -lsocket -lc -lm}} %{!shared:%{!symbolic:-lc}}"
  165.  
  166. #define NEXT_FRAMEWORKS_DEFAULT            \
  167.     {"/usr/LocalLibrary/Frameworks", 0},    \
  168.     {"/usr/NextLibrary/Frameworks", 0}, 
  169.  
  170. #undef TARGET_DEFAULT
  171. #define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_HARD_QUAD)
  172.