home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / gcc-2.6.0-src.lha / GNU / src / amiga / gcc-2.6.0 / config / m88k / dgux.h next >
Encoding:
C/C++ Source or Header  |  1994-07-13  |  9.0 KB  |  246 lines

  1. /* Definitions of target machine for GNU compiler.
  2.    Motorola m88100 running DG/UX.
  3.    Copyright (C) 1988, 1989, 1990, 1991 Free Software Foundation, Inc.
  4.    Contributed by Michael Tiemann (tiemann@mcc.com)
  5.    Enhanced by Michael Meissner (meissner@osf.org)
  6.    Version 2 port by Tom Wood (twood@pets.sps.mot.com)
  7.    Currently maintained by (gcc@dg-rtp.dg.com)
  8.  
  9. This file is part of GNU CC.
  10.  
  11. GNU CC is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2, or (at your option)
  14. any later version.
  15.  
  16. GNU CC is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. GNU General Public License for more details.
  20.  
  21. You should have received a copy of the GNU General Public License
  22. along with GNU CC; see the file COPYING.  If not, write to
  23. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  24.  
  25. /* You're not seeing double!  To transition to dwarf debugging, both are
  26.    supported.  The option -msvr4 specifies elf.  With these combinations, 
  27.    -g means dwarf.  */
  28. /* DWARF_DEBUGGING_INFO defined in svr4.h.  */
  29. #define SDB_DEBUGGING_INFO
  30. #define PREFERRED_DEBUGGING_TYPE \
  31.   (TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
  32.  
  33. #ifndef VERSION_INFO2
  34. #define VERSION_INFO2   "$Revision: 1.14 $"
  35. #endif
  36. #ifndef NO_BUGS
  37. #define AS_BUG_IMMEDIATE_LABEL
  38. /* The DG/UX 4.30 assembler doesn't accept the symbol `fcr63'.  */
  39. #define AS_BUG_FLDCR
  40. #endif
  41.  
  42. #include "svr4.h"
  43. #include "m88k/m88k.h"
  44.  
  45. /* Augment TARGET_SWITCHES with the MXDB options.  */
  46. #define MASK_STANDARD        0x40000000 /* Retain standard information */
  47. #define MASK_LEGEND        0x20000000 /* Retain legend information */
  48. #define MASK_EXTERNAL_LEGEND    0x10000000 /* Make external legends */
  49.  
  50. #define TARGET_STANDARD          (target_flags & MASK_STANDARD)
  51. #define TARGET_LEGEND          (target_flags & MASK_LEGEND)
  52. #define TARGET_EXTERNAL_LEGEND      (target_flags & MASK_EXTERNAL_LEGEND)
  53.  
  54. #undef  SUBTARGET_SWITCHES
  55. #define SUBTARGET_SWITCHES \
  56.     { "standard",             MASK_STANDARD }, \
  57.     { "legend",                 MASK_LEGEND }, \
  58.     { "external-legend",         MASK_EXTERNAL_LEGEND }, \
  59.     /* the following is used only in the *_SPEC's */ \
  60.     { "keep-coff",             0 },
  61.  
  62. /* Default switches */
  63. #undef    TARGET_DEFAULT
  64. #define TARGET_DEFAULT    (MASK_CHECK_ZERO_DIV     | \
  65.              MASK_OCS_DEBUG_INFO     | \
  66.              MASK_OCS_FRAME_POSITION | \
  67.              MASK_STANDARD         | \
  68.              MASK_SVR4)
  69. #undef    CPU_DEFAULT
  70. #define CPU_DEFAULT MASK_88000
  71.  
  72. /* Macros to be automatically defined.  __svr4__ is our extension.
  73.    __CLASSIFY_TYPE__ is used in the <varargs.h> and <stdarg.h> header
  74.    files with DG/UX revision 5.40 and later.  This allows GNU CC to
  75.    operate without installing the header files.  */
  76.  
  77. #undef    CPP_PREDEFINES
  78. #define CPP_PREDEFINES "-Dm88000 -Dm88k -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
  79.    -D__svr4__ -Asystem(unix) -Acpu(m88k) -Amachine(m88k)"
  80.  
  81. /* If -m88100 is in effect, add -Dm88100; similarly for -m88110.
  82.    Here, the CPU_DEFAULT is assumed to be -m88000.  If not -ansi,
  83.    -traditional, or restricting include files to one specific source
  84.    target, specify full DG/UX features.  */
  85. #undef    CPP_SPEC
  86. #define    CPP_SPEC "%{!m88000:%{!m88100:%{m88110:-D__m88110__}}} \
  87.           %{!m88000:%{!m88110:%{m88100:-D__m88100__}}} \
  88.           %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}"
  89.  
  90. /* Assembler support (-V, silicon filter, legends for mxdb).  */
  91. #undef    ASM_SPEC
  92. #define ASM_SPEC "\
  93. %{V} %{v:%{!V:-V}} %{pipe:%{!.s: - }\
  94. %{!msvr3:%{mversion-03.00:-KV3}%{!mversion-03.00:%{mversion-*:-KV%*}}}}\
  95. %{!mlegend:%{mstandard:-Wc,off}}\
  96. %{mlegend:-Wc,-fix-bb,-h\"gcc-" VERSION_INFO2 "\",-s\"%i\"\
  97. %{traditional:,-lc}%{!traditional:,-lansi-c}\
  98. %{mstandard:,-keep-std}\
  99. %{mkeep-coff:,-keep-coff}\
  100. %{mexternal-legend:,-external}\
  101. %{mocs-frame-position:,-ocs}}"
  102.  
  103. /* Override svr4.h.  */
  104. #undef    ASM_FINAL_SPEC
  105. #undef    STARTFILE_SPEC
  106.  
  107. /* Linker and library spec's.
  108.    -msvr4 is the default if -msvr3 is not specified.
  109.    -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options.
  110.    -svr4 instructs gcc to place /usr/lib/values-X[cat].o on the link line.
  111.    -msvr3 indicates linking done in a COFF environment and the link
  112.    script is added to the link line.  In all environments, the first
  113.    and last objects are crtbegin.o (or bcscrtbegin.o) and crtend.o.
  114.    When the -G link option is used (-shared and -symbolic) a final
  115.    link is not being done.  */
  116. #undef    LIB_SPEC
  117. #define LIB_SPEC "%{!msvr3:%{!shared:-lstaticdgc}} %{!shared:%{!symbolic:-lc}} crtend.o%s"
  118. #undef    LINK_SPEC
  119. #define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \
  120.            %{static:-dn -Bstatic} \
  121.            %{shared:-G -dy} \
  122.            %{symbolic:-Bsymbolic -G -dy} \
  123.            %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
  124. #undef    STARTFILE_SPEC
  125. #define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \
  126.              %{!pg:%{p:/lib/mcrt0.o}%{!p:/lib/crt0.o}} \
  127.              %{msvr3:m88kdgux.ld%s bcscrtbegin.o%s} \
  128.              %{!msvr3:crtbegin.o%s} \
  129.              %{svr4:%{ansi:/lib/values-Xc.o} \
  130.               %{!ansi:%{traditional:/lib/values-Xt.o} \
  131.                %{!traditional:/usr/lib/values-Xa.o}}}}}"
  132.  
  133. #undef    GPLUSPLUS_INCLUDE_DIR
  134. #define GPLUSPLUS_INCLUDE_DIR "/usr/opt/g++/lib/g++-include"
  135.  
  136. /* Fast DG/UX version of profiler that does not require lots of
  137.    registers to be stored.  */
  138. #undef    FUNCTION_PROFILER
  139. #define FUNCTION_PROFILER(FILE, LABELNO) \
  140.   output_function_profiler (FILE, LABELNO, "gcc.mcount", 0)
  141.  
  142. /* Output the legend info for mxdb when debugging except if standard
  143.    debugging information only is explicitly requested.  */
  144. #undef  ASM_FIRST_LINE
  145. #define ASM_FIRST_LINE(FILE)                        \
  146.   do {                                    \
  147.     if (TARGET_SVR4)                            \
  148.       {                                    \
  149.     if (TARGET_88110)                        \
  150.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "04.00");   \
  151.     else                                \
  152.       fprintf (FILE, "\t%s\t \"%s\"\n", VERSION_ASM_OP, "03.00");   \
  153.       }                                    \
  154.     if (write_symbols != NO_DEBUG                    \
  155.     && ! (TARGET_STANDARD && ! TARGET_LEGEND))            \
  156.       {                                    \
  157.     fprintf (FILE, ";legend_info -fix-bb -h\"gcc-%s\" -s\"%s\"",    \
  158.          VERSION_STRING, main_input_filename);            \
  159.     fputs (flag_traditional ? " -lc" : " -lansi-c", FILE);        \
  160.     if (TARGET_STANDARD)                        \
  161.       fputs (" -keep-std", FILE);                    \
  162.     if (TARGET_EXTERNAL_LEGEND)                    \
  163.       fputs (" -external", FILE);                    \
  164.     if (TARGET_OCS_FRAME_POSITION)                    \
  165.       fputs (" -ocs", FILE);                    \
  166.     fputc ('\n', FILE);                        \
  167.       }                                    \
  168.   } while (0)
  169.  
  170. /* Override svr4.h.  */
  171. #undef PTRDIFF_TYPE
  172. #undef WCHAR_TYPE
  173. #undef WCHAR_TYPE_SIZE
  174.  
  175. /* Override svr4.h and m88k.h except when compiling crtstuff.c.  These must
  176.    be constant strings when compiling crtstuff.c.  Otherwise, respect the
  177.    -mversion-STRING option used.  */
  178. #undef INIT_SECTION_PREAMBLE
  179. #undef INIT_SECTION_ASM_OP
  180. #undef FINI_SECTION_ASM_OP
  181. #undef CTORS_SECTION_ASM_OP
  182. #undef DTORS_SECTION_ASM_OP
  183.  
  184. #if !defined (CRT_BEGIN) && !defined (CRT_END)
  185. #undef    INIT_SECTION_ASM_OP
  186. #define INIT_SECTION_ASM_OP (TARGET_SVR4            \
  187.                  ? "section\t .init,\"xa\""        \
  188.                  : "section\t .init,\"x\"")
  189. #undef    CTORS_SECTION_ASM_OP
  190. #define CTORS_SECTION_ASM_OP (TARGET_SVR4            \
  191.                   ? "section\t .ctors,\"aw\""    \
  192.                   : "section\t .ctors,\"d\"")
  193. #undef    DTORS_SECTION_ASM_OP
  194. #define DTORS_SECTION_ASM_OP (TARGET_SVR4            \
  195.                   ? "section\t .dtors,\"aw\""    \
  196.                   : "section\t .dtors,\"d\"")
  197. #else
  198. /* These must be constant strings for crtstuff.c.  
  199.    An elf and bcs crtbegin.o are needed since bcs does not  
  200.    increment the stack pointer in the init section as elf does */
  201. #ifndef BCS
  202. #define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20")  
  203. #endif
  204. #define INIT_SECTION_ASM_OP    "section\t .init,\"x\""
  205. #define FINI_SECTION_ASM_OP    "section\t .fini,\"x\""
  206. #define CTORS_SECTION_ASM_OP    "section\t .ctors,\"d\""
  207. #define DTORS_SECTION_ASM_OP    "section\t .dtors,\"d\""
  208. #endif /* crtstuff.c */
  209.  
  210. /* The lists of global object constructors and global destructors are always
  211.    placed in the .ctors/.dtors sections.  This requires the use of a link
  212.    script if the COFF linker is used, but otherwise COFF and ELF objects
  213.    can be intermixed.  A COFF object will pad the section to 16 bytes with
  214.    zeros; and ELF object will not contain padding.  We deal with this by
  215.    putting a -1 marker at the begin and end of the list and ignoring zero
  216.    entries.  */
  217.  
  218. /* Mark the end of the .ctors/.dtors sections with a -1.  */
  219. #define CTOR_LIST_END            \
  220. asm (CTORS_SECTION_ASM_OP);        \
  221. func_ptr __CTOR_END__[1] = { (func_ptr) (-1) }
  222.  
  223. #define DTOR_LIST_END            \
  224. asm (DTORS_SECTION_ASM_OP);        \
  225. func_ptr __DTOR_END__[1] = { (func_ptr) (-1) }
  226.  
  227. /* Walk the list ignoring NULL entries till we hit the terminating -1.  */
  228. #define DO_GLOBAL_CTORS_BODY                \
  229.   do {                            \
  230.     int i;                        \
  231.     for (i=1;(int)(__CTOR_LIST__[i]) != -1; i++)    \
  232.       if (((int *)__CTOR_LIST__)[i] != 0)        \
  233.     __CTOR_LIST__[i] ();                \
  234.   } while (0)                    
  235.  
  236. /* Walk the list looking for the terminating -1 that marks the end.
  237.    Go backward and ignore any NULL entries.  */
  238. #define DO_GLOBAL_DTORS_BODY                \
  239.   do {                            \
  240.     int i;                        \
  241.     for (i=1;(int)(__DTOR_LIST__[i]) != -1; i++);    \
  242.     for (i-=1;(int)(__DTOR_LIST__[i]) != -1; i--)    \
  243.       if (((int *)__DTOR_LIST__)[i] != 0)        \
  244.     __DTOR_LIST__[i] ();                \
  245.   } while (0)                    
  246.