home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / gcc / config / sparc / next-pdo.h < prev    next >
C/C++ Source or Header  |  1997-01-22  |  7KB  |  191 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/sparc.h"
  25.  
  26. #define USE_GAS
  27.  
  28. #define NEXT_OBJC_RUNTIME
  29.  
  30. #define NEXT_PDO
  31.  
  32.  
  33. /* 
  34.  * overrides for the funky places we put stuff
  35.  *    there was a bug in the beta where the /usr was not prefixed
  36.  */
  37. #undef  GPLUSPLUS_INCLUDE_DIR
  38. #define GPLUSPLUS_INCLUDE_DIR "/usr/NextDeveloper/Headers/g++"
  39. #undef    INCLUDE_DEFAULTS
  40. #define INCLUDE_DEFAULTS                \
  41.   {                            \
  42.     { GPLUSPLUS_INCLUDE_DIR, 1},            \
  43.     { GCC_INCLUDE_DIR, 0},                \
  44.     { TOOL_INCLUDE_DIR, 0},                \
  45.     { LOCAL_INCLUDE_DIR, 0},                \
  46.     { "/usr/NextDeveloper/Headers", 0},            \
  47.     { "/usr/NextDeveloper/Headers/ansi", 0},        \
  48.     { "/usr/LocalDeveloper/Headers", 0},        \
  49.     { "/usr/LocalDeveloper/Headers/ansi", 0},        \
  50.     { STANDARD_INCLUDE_DIR, 0},                \
  51.     { 0, 0}                        \
  52.   }
  53.  
  54. /* RIPPED OFF FROM nextstep.h */
  55.  
  56. /* Give methods pretty symbol names on NeXT. */
  57.  
  58. #undef    OBJC_GEN_METHOD_LABEL
  59. #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \
  60.   do { if (CAT_NAME)                            \
  61.      sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+',        \
  62.           (CLASS_NAME), (CAT_NAME), (SEL_NAME));        \
  63.        else                                \
  64.      sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+',        \
  65.           (CLASS_NAME), (SEL_NAME));                \
  66.      } while (0)
  67.  
  68. /* Wrap new method names in quotes so the assembler doesn't gag.
  69.    Make Objective-C internal symbols local.  */
  70.  
  71. /* work around the gnu'ism of the @ at the begining of the symbol name */
  72.  
  73. #undef    ASM_OUTPUT_LABELREF
  74. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  75.   do {  \
  76.     if (NAME[1] == '+' || NAME[1] == '-') \
  77.         fprintf (FILE, "\"%s\"", NAME+1); \
  78.     else if (NAME[0] == '+' || NAME[0] == '-') \
  79.         fprintf (FILE, "\"%s\"", NAME); \
  80.     else if (!strncmp (NAME, "_OBJC_MODULES", 13)) \
  81.         fprintf (FILE, "%s", NAME);   \
  82.     else if (!strncmp (NAME, "_OBJC_", 6)) \
  83.         fprintf (FILE, "L%s", NAME);   \
  84.     else if (!strncmp (NAME, ".objc_class_name_", 17))        \
  85.         fprintf (FILE, "%s", NAME);                \
  86.     else fprintf ((FILE), "_%s", NAME); } while (0)
  87.  
  88.  
  89. #undef LIB_SPEC
  90. #define LIB_SPEC "%{!p:%{!pg:-L/usr/NextDeveloper/lib %{!nopdo:-lpdo} -lc -lm}}%{p:-L/usr/NextDeveloper/lib %{!nopdo:-lpdo} -lc_p -lm_p}%{pg:-L/usr/NextDeveloper/lib %{!nopdo:-lpdo} -lc_p -lm_p}"
  91.  
  92. /* Provide required defaults for linker -e and -d switches.  */
  93.  
  94. #undef LINK_SPEC
  95. #define LINK_SPEC \
  96.  "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static|pg|p:-Bstatic} %{assert*}"
  97.  
  98. #undef WORD_SWITCH
  99. #define WORD_SWITCH(STR) \
  100.   (WORD_SWITCH_TAKES_ARG (STR) \
  101.    || !strcmp (STR, "bsd") \
  102.    || !strcmp (STR, "object") \
  103.    || !strcmp (STR, "ObjC") \
  104.    || !strcmp (STR, "all_load"))
  105.  
  106. #undef WORD_SWITCH_TAKES_ARG
  107. #define WORD_SWITCH_TAKES_ARG(STR)                \
  108.   (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)                \
  109.    || !strcmp (STR, "target")                     \
  110.    || !strcmp (STR, "assert")                    \
  111.    || !strcmp (STR, "arch")                    \
  112.    || !strcmp (STR, "filelist")                    \
  113.    || !strcmp (STR, "framework"))
  114.  
  115.  
  116. #define OBJC_FORWARDING_REG_OFFSET(ISREG, OFF, REGNO) \
  117.   do { OFF =  (4 * ((REGNO) - 24));                   \
  118.        ISREG = 0; } while (0)
  119.  
  120. /* Names to predefine in the preprocessor for this target machine.  */
  121.  
  122. /* The GCC_NEW_VARARGS macro is so that old versions of gcc can compile
  123.    new versions, which have an incompatible va-sparc.h file.  This matters
  124.    because gcc does "gvarargs.h" instead of <varargs.h>, and thus gets the
  125.    wrong varargs file when it is compiled with a different version of gcc.  */
  126.  
  127. #undef CPP_PREDEFINES
  128. #define CPP_PREDEFINES \
  129.   "-Dsparc -Dsun -Dunix -D__GCC_NEW_VARARGS__ -DNeXT_PDO -D__BIG_ENDIAN__ -D__ARCHITECTURE__=\"sparc\" \
  130.    -Asystem(unix) -Asystem(bsd) -Acpu(sparc) -Amachine(sparc)"
  131.  
  132. #undef TARGET_VERSION
  133. #define TARGET_VERSION fprintf (stderr, " (sparc-nextpdo-sunos4.1.3)");
  134.  
  135. #undef SELECT_SECTION
  136. #define SELECT_SECTION(T,RELOC)                        \
  137. {                                    \
  138.   if (TREE_CODE (T) == VAR_DECL)                    \
  139.     {                                    \
  140.       if (TREE_READONLY (T) && ! TREE_SIDE_EFFECTS (T)            \
  141.       && DECL_ALIGN (T) <= MAX_TEXT_ALIGN                \
  142.       && ! (flag_pic && (RELOC))                                    \
  143.           && strncmp(IDENTIFIER_POINTER (DECL_NAME (T)), "_OBJC_", 6))    \
  144.     text_section ();                        \
  145.       else                                \
  146.     data_section ();                        \
  147.     }                                    \
  148.   else if (TREE_CODE (T) == CONSTRUCTOR                        \
  149.        && TREE_TYPE (T)                            \
  150.        && TREE_CODE (TREE_TYPE (T)) == RECORD_TYPE                \
  151.        && TYPE_NAME (TREE_TYPE (T))                        \
  152.        && TREE_CODE (TYPE_NAME (TREE_TYPE (T))) == IDENTIFIER_NODE  \
  153.        && IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (T))))           \
  154.      {                                                                  \
  155.        if ((!strcmp (IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (T))),    \
  156.             "NSConstantString")) ||                \
  157.        (!strcmp (IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (T))),    \
  158.             "NXConstantString")) ||                \
  159.        (!strcmp (IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (T))),    \
  160.              "_objc_protocol")))                                \
  161.       data_section ();                                \
  162.        else if ((TREE_READONLY (T) || TREE_CONSTANT (T))        \
  163.         && !TREE_SIDE_EFFECTS (T))                \
  164.       text_section ();                            \
  165.        else                                \
  166.       data_section ();                        \
  167.       }                                    \
  168.   else if (TREE_CODE (T) == CONSTRUCTOR)                \
  169.     {                                    \
  170.       if (flag_pic != 0 && (RELOC) != 0)                \
  171.     data_section ();                        \
  172.     }                                    \
  173.   else if (*tree_code_type[(int) TREE_CODE (T)] == 'c')            \
  174.     {                                    \
  175.       if ((TREE_CODE (T) == STRING_CST && flag_writable_strings)    \
  176.       || TYPE_ALIGN (TREE_TYPE (T)) > MAX_TEXT_ALIGN)        \
  177.     data_section ();                        \
  178.       else                                \
  179.     text_section ();                        \
  180.     }                                    \
  181. }
  182.  
  183. #define NEXT_FRAMEWORKS_DEFAULT            \
  184.     {"/usr/LocalLibrary/Frameworks", 0},    \
  185.     {"/usr/NextLibrary/Frameworks", 0}, 
  186.  
  187.  
  188. #undef TARGET_DEFAULT
  189. #define TARGET_DEFAULT (MASK_APP_REGS + MASK_EPILOGUE + MASK_FPU + MASK_HARD_QUAD)
  190.  
  191.