1/* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
2   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
3   Contributed by P.J. Darcy (darcypj@us.ibm.com),
4                  Hartmut Penner (hpenner@de.ibm.com), and
5                  Ulrich Weigand (uweigand@de.ibm.com).
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 2, or (at your option) any later
12version.
13
14GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17for more details.
18
19You should have received a copy of the GNU General Public License
20along with GCC; see the file COPYING.  If not, write to the Free
21Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
2202110-1301, USA.  */
23
24#ifndef _TPF_H
25#define _TPF_H
26
27/* TPF wants the following macros defined/undefined as follows.  */
28#undef TARGET_TPF
29#define TARGET_TPF 1
30#undef ASM_APP_ON
31#define ASM_APP_ON "#APP\n"
32#undef ASM_APP_OFF
33#define ASM_APP_OFF "#NO_APP\n"
34#define NO_IMPLICIT_EXTERN_C
35#define TARGET_POSIX_IO
36
37#undef  SIZE_TYPE
38#define SIZE_TYPE ("long unsigned int")
39#undef  PTRDIFF_TYPE
40#define PTRDIFF_TYPE ("long int")
41#undef  WCHAR_TYPE
42#define WCHAR_TYPE "int"
43#undef  WCHAR_TYPE_SIZE
44#define WCHAR_TYPE_SIZE 32
45
46
47/* Basic record keeping for the TPF OS name.  */
48#undef  TARGET_VERSION
49#define TARGET_VERSION fprintf (stderr, " (TPF: zSeries)");
50
51/* TPF OS specific stack-pointer offset.  */
52#undef STACK_POINTER_OFFSET
53#define STACK_POINTER_OFFSET 		448
54
55/* When building for TPF, set a generic default target that is 64 bits. Also
56   enable TPF profiling support and the standard backchain by default.  */
57#undef TARGET_DEFAULT
58#define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
59			| MASK_HARD_FLOAT | MASK_BACKCHAIN)
60
61/* Exception handling.  */
62
63/* Select a format to encode pointers in exception handling data.  */
64#undef ASM_PREFERRED_EH_DATA_FORMAT
65#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
66
67/* TPF OS specific compiler settings.  */
68#undef TARGET_OS_CPP_BUILTINS
69#define TARGET_OS_CPP_BUILTINS()                \
70  do                                            \
71    {                                           \
72      builtin_define_std ("tpf");               \
73      builtin_assert ("system=tpf");            \
74      builtin_define ("__ELF__");               \
75    }                                           \
76  while (0)
77
78
79#define EXTRA_SPECS                             \
80  { "entry_spec", ENTRY_SPEC }
81
82/* Make TPF specific spec file settings here.  */
83
84#undef STARTFILE_SPEC
85#define STARTFILE_SPEC \
86  "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
87
88#undef ENDFILE_SPEC
89#define ENDFILE_SPEC "crtendS%O%s"
90
91#undef CC1_SPEC
92#define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
93
94/* The GNU C++ standard library requires that these macros be defined.  */
95#undef CPLUSPLUS_CPP_SPEC
96#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
97
98#undef ASM_SPEC
99#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \
100                  -alshd=%b.lst"
101
102/* It would be nice to get the system linker script define the ones that it
103   needed.  */
104#undef LIB_SPEC
105#define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \
106                  -lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB"
107
108#undef TARGET_C99_FUNCTIONS
109#define TARGET_C99_FUNCTIONS 1
110
111#define ENTRY_SPEC "%{mmain:-entry=_start} \
112                    %{!mmain:-entry=0}"
113
114/* All linking is done shared on TPF-OS.  */
115/* FIXME: When binutils patch for new emulation is committed
116   then change emulation to elf64_s390_tpf.  */
117#undef LINK_SPEC
118#define LINK_SPEC \
119  "-m elf64_s390 \
120   %{static:%estatic is not supported on TPF-OS} \
121   %{shared: -shared} \
122   %{!shared:-shared} \
123   %(entry_spec)"
124
125#define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h"
126
127/* IBM copies these libraries over with these names.  */
128#define MATH_LIBRARY "-lCLBM"
129#define LIBSTDCXX "-lCPP1"
130#endif /* ! _TPF_H */
131