2012-07-27 Segher Boessenkool <segher@kernel.crashing.org>
[official-gcc.git] / gcc / config / s390 / tpf.h
blob4727a295938b905788404b8d2712328145e16691
1 /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
2 Copyright (C) 2003, 2004, 2005, 2007, 2009,
3 2010, 2011, 2012 Free Software Foundation, Inc.
4 Contributed by P.J. Darcy (darcypj@us.ibm.com),
5 Hartmut Penner (hpenner@de.ibm.com), and
6 Ulrich Weigand (uweigand@de.ibm.com).
8 This file is part of GCC.
10 GCC is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation; either version 3, or (at your option) any later
13 version.
15 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
16 WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 for more details.
20 You should have received a copy of the GNU General Public License
21 along with GCC; see the file COPYING3. If not see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _TPF_H
25 #define _TPF_H
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
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
47 /* TPF OS specific stack-pointer offset. */
48 #undef STACK_POINTER_OFFSET
49 #define STACK_POINTER_OFFSET 448
51 /* When building for TPF, set a generic default target that is 64 bits. Also
52 enable TPF profiling support and the standard backchain by default. */
53 #undef TARGET_DEFAULT
54 #define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
55 | MASK_HARD_DFP | MASK_BACKCHAIN)
57 /* Exception handling. */
59 /* Select a format to encode pointers in exception handling data. */
60 #undef ASM_PREFERRED_EH_DATA_FORMAT
61 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
63 /* TPF OS specific compiler settings. */
64 #undef TARGET_OS_CPP_BUILTINS
65 #define TARGET_OS_CPP_BUILTINS() \
66 do \
67 { \
68 builtin_define_std ("tpf"); \
69 builtin_assert ("system=tpf"); \
70 builtin_define ("__ELF__"); \
71 } \
72 while (0)
75 #define EXTRA_SPECS \
76 { "entry_spec", ENTRY_SPEC }
78 /* Make TPF specific spec file settings here. */
80 #undef STARTFILE_SPEC
81 #define STARTFILE_SPEC \
82 "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
84 #undef ENDFILE_SPEC
85 #define ENDFILE_SPEC "crtendS%O%s"
87 #undef CC1_SPEC
88 #define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
90 /* The GNU C++ standard library requires that these macros be defined. */
91 #undef CPLUSPLUS_CPP_SPEC
92 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
94 #undef ASM_SPEC
95 #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \
96 -alshd=%b.lst"
98 #undef TARGET_C99_FUNCTIONS
99 #define TARGET_C99_FUNCTIONS 1
101 #define ENTRY_SPEC "%{mmain:-entry=_start} \
102 %{!mmain:-entry=0}"
104 /* All linking is done shared on TPF-OS. */
105 /* FIXME: When binutils patch for new emulation is committed
106 then change emulation to elf64_s390_tpf. */
107 #undef LINK_SPEC
108 #define LINK_SPEC \
109 "-m elf64_s390 \
110 %{static:%estatic is not supported on TPF-OS} \
111 %{shared: -shared} \
112 %{!shared:-shared} \
113 %(entry_spec)"
115 /* IBM copies these libraries over with these names. */
116 #define MATH_LIBRARY "CLBM"
117 #define LIBSTDCXX "CPP2"
118 #endif /* ! _TPF_H */