1 |
12 |
jlechner |
/* 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 |
|
|
|
7 |
|
|
This file is part of GCC.
|
8 |
|
|
|
9 |
|
|
GCC is free software; you can redistribute it and/or modify it under
|
10 |
|
|
the terms of the GNU General Public License as published by the Free
|
11 |
|
|
Software Foundation; either version 2, or (at your option) any later
|
12 |
|
|
version.
|
13 |
|
|
|
14 |
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
15 |
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
16 |
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
17 |
|
|
for more details.
|
18 |
|
|
|
19 |
|
|
You should have received a copy of the GNU General Public License
|
20 |
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
21 |
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
22 |
|
|
02110-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 |
|
|
if (flag_pic) \
|
76 |
|
|
{ \
|
77 |
|
|
builtin_define ("__PIC__"); \
|
78 |
|
|
builtin_define ("__pic__"); \
|
79 |
|
|
} \
|
80 |
|
|
} \
|
81 |
|
|
while (0)
|
82 |
|
|
|
83 |
|
|
|
84 |
|
|
#define EXTRA_SPECS \
|
85 |
|
|
{ "entry_spec", ENTRY_SPEC }
|
86 |
|
|
|
87 |
|
|
/* Make TPF specific spec file settings here. */
|
88 |
|
|
|
89 |
|
|
#undef STARTFILE_SPEC
|
90 |
|
|
#define STARTFILE_SPEC \
|
91 |
|
|
"%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
|
92 |
|
|
|
93 |
|
|
#undef ENDFILE_SPEC
|
94 |
|
|
#define ENDFILE_SPEC "crtendS%O%s"
|
95 |
|
|
|
96 |
|
|
#undef CC1_SPEC
|
97 |
|
|
#define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
|
98 |
|
|
|
99 |
|
|
/* The GNU C++ standard library requires that these macros be defined. */
|
100 |
|
|
#undef CPLUSPLUS_CPP_SPEC
|
101 |
|
|
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
|
102 |
|
|
|
103 |
|
|
#undef ASM_SPEC
|
104 |
|
|
#define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \
|
105 |
|
|
-alshd=%b.lst"
|
106 |
|
|
|
107 |
|
|
/* It would be nice to get the system linker script define the ones that it
|
108 |
|
|
needed. */
|
109 |
|
|
#undef LIB_SPEC
|
110 |
|
|
#define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \
|
111 |
|
|
-lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB"
|
112 |
|
|
|
113 |
|
|
#undef TARGET_C99_FUNCTIONS
|
114 |
|
|
#define TARGET_C99_FUNCTIONS 1
|
115 |
|
|
|
116 |
|
|
#define ENTRY_SPEC "%{mmain:-entry=_start} \
|
117 |
|
|
%{!mmain:-entry=0}"
|
118 |
|
|
|
119 |
|
|
/* All linking is done shared on TPF-OS. */
|
120 |
|
|
/* FIXME: When binutils patch for new emulation is committed
|
121 |
|
|
then change emulation to elf64_s390_tpf. */
|
122 |
|
|
#undef LINK_SPEC
|
123 |
|
|
#define LINK_SPEC \
|
124 |
|
|
"-m elf64_s390 \
|
125 |
|
|
%{static:%estatic is not supported on TPF-OS} \
|
126 |
|
|
%{shared: -shared} \
|
127 |
|
|
%{!shared:-shared} \
|
128 |
|
|
%(entry_spec)"
|
129 |
|
|
|
130 |
|
|
#define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h"
|
131 |
|
|
|
132 |
|
|
/* IBM copies these libraries over with these names. */
|
133 |
|
|
#define MATH_LIBRARY "-lCLBM"
|
134 |
|
|
#define LIBSTDCXX "-lCPP1"
|
135 |
|
|
#endif /* ! _TPF_H */
|