1132718Skan/* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
2169689Skan   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3132718Skan   Contributed by P.J. Darcy (darcypj@us.ibm.com),
4132718Skan                  Hartmut Penner (hpenner@de.ibm.com), and
5132718Skan                  Ulrich Weigand (uweigand@de.ibm.com).
6132718Skan
7132718SkanThis file is part of GCC.
8132718Skan
9132718SkanGCC is free software; you can redistribute it and/or modify it under
10132718Skanthe terms of the GNU General Public License as published by the Free
11132718SkanSoftware Foundation; either version 2, or (at your option) any later
12132718Skanversion.
13132718Skan
14132718SkanGCC is distributed in the hope that it will be useful, but WITHOUT ANY
15132718SkanWARRANTY; without even the implied warranty of MERCHANTABILITY or
16132718SkanFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17132718Skanfor more details.
18132718Skan
19132718SkanYou should have received a copy of the GNU General Public License
20132718Skanalong with GCC; see the file COPYING.  If not, write to the Free
21169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
22169689Skan02110-1301, USA.  */
23132718Skan
24132718Skan#ifndef _TPF_H
25132718Skan#define _TPF_H
26132718Skan
27132718Skan/* TPF wants the following macros defined/undefined as follows.  */
28169689Skan#undef TARGET_TPF
29169689Skan#define TARGET_TPF 1
30132718Skan#undef ASM_APP_ON
31132718Skan#define ASM_APP_ON "#APP\n"
32132718Skan#undef ASM_APP_OFF
33132718Skan#define ASM_APP_OFF "#NO_APP\n"
34132718Skan#define NO_IMPLICIT_EXTERN_C
35169689Skan#define TARGET_POSIX_IO
36132718Skan
37132718Skan#undef  SIZE_TYPE
38132718Skan#define SIZE_TYPE ("long unsigned int")
39132718Skan#undef  PTRDIFF_TYPE
40132718Skan#define PTRDIFF_TYPE ("long int")
41132718Skan#undef  WCHAR_TYPE
42132718Skan#define WCHAR_TYPE "int"
43132718Skan#undef  WCHAR_TYPE_SIZE
44132718Skan#define WCHAR_TYPE_SIZE 32
45132718Skan
46132718Skan
47132718Skan/* Basic record keeping for the TPF OS name.  */
48132718Skan#undef  TARGET_VERSION
49132718Skan#define TARGET_VERSION fprintf (stderr, " (TPF: zSeries)");
50132718Skan
51132718Skan/* TPF OS specific stack-pointer offset.  */
52132718Skan#undef STACK_POINTER_OFFSET
53169689Skan#define STACK_POINTER_OFFSET 		448
54132718Skan
55169689Skan/* When building for TPF, set a generic default target that is 64 bits. Also
56169689Skan   enable TPF profiling support and the standard backchain by default.  */
57132718Skan#undef TARGET_DEFAULT
58169689Skan#define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
59169689Skan			| MASK_HARD_FLOAT | MASK_BACKCHAIN)
60132718Skan
61169689Skan/* Exception handling.  */
62169689Skan
63169689Skan/* Select a format to encode pointers in exception handling data.  */
64169689Skan#undef ASM_PREFERRED_EH_DATA_FORMAT
65169689Skan#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
66169689Skan
67132718Skan/* TPF OS specific compiler settings.  */
68132718Skan#undef TARGET_OS_CPP_BUILTINS
69132718Skan#define TARGET_OS_CPP_BUILTINS()                \
70132718Skan  do                                            \
71132718Skan    {                                           \
72132718Skan      builtin_define_std ("tpf");               \
73132718Skan      builtin_assert ("system=tpf");            \
74132718Skan      builtin_define ("__ELF__");               \
75132718Skan    }                                           \
76132718Skan  while (0)
77132718Skan
78132718Skan
79169689Skan#define EXTRA_SPECS                             \
80169689Skan  { "entry_spec", ENTRY_SPEC }
81169689Skan
82132718Skan/* Make TPF specific spec file settings here.  */
83132718Skan
84169689Skan#undef STARTFILE_SPEC
85132718Skan#define STARTFILE_SPEC \
86169689Skan  "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
87132718Skan
88169689Skan#undef ENDFILE_SPEC
89169689Skan#define ENDFILE_SPEC "crtendS%O%s"
90132718Skan
91169689Skan#undef CC1_SPEC
92169689Skan#define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
93169689Skan
94132718Skan/* The GNU C++ standard library requires that these macros be defined.  */
95132718Skan#undef CPLUSPLUS_CPP_SPEC
96132718Skan#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
97132718Skan
98169689Skan#undef ASM_SPEC
99169689Skan#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \
100169689Skan                  -alshd=%b.lst"
101146895Skan
102169689Skan/* It would be nice to get the system linker script define the ones that it
103169689Skan   needed.  */
104169689Skan#undef LIB_SPEC
105169689Skan#define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \
106169689Skan                  -lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB"
107132718Skan
108132718Skan#undef TARGET_C99_FUNCTIONS
109132718Skan#define TARGET_C99_FUNCTIONS 1
110132718Skan
111169689Skan#define ENTRY_SPEC "%{mmain:-entry=_start} \
112169689Skan                    %{!mmain:-entry=0}"
113169689Skan
114169689Skan/* All linking is done shared on TPF-OS.  */
115169689Skan/* FIXME: When binutils patch for new emulation is committed
116169689Skan   then change emulation to elf64_s390_tpf.  */
117132718Skan#undef LINK_SPEC
118132718Skan#define LINK_SPEC \
119132718Skan  "-m elf64_s390 \
120169689Skan   %{static:%estatic is not supported on TPF-OS} \
121169689Skan   %{shared: -shared} \
122169689Skan   %{!shared:-shared} \
123169689Skan   %(entry_spec)"
124132718Skan
125169689Skan#define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h"
126169689Skan
127169689Skan/* IBM copies these libraries over with these names.  */
128169689Skan#define MATH_LIBRARY "-lCLBM"
129169689Skan#define LIBSTDCXX "-lCPP1"
130132718Skan#endif /* ! _TPF_H */
131