OSDN Git Service

38df1b4bcbf85463b61bc271b669f2bc4257b8db
[pf3gnuchains/gcc-fork.git] / gcc / config / s390 / tpf.h
1 /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
2    Copyright (C) 2003, 2004 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, 59 Temple Place - Suite 330, Boston, MA
22 02111-1307, 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_HAS_F_SETLKW
36 #undef MD_EXEC_PREFIX
37 #undef MD_STARTFILE_PREFIX
38
39 #undef  SIZE_TYPE
40 #define SIZE_TYPE ("long unsigned int")
41 #undef  PTRDIFF_TYPE
42 #define PTRDIFF_TYPE ("long int")
43 #undef  WCHAR_TYPE
44 #define WCHAR_TYPE "int"
45 #undef  WCHAR_TYPE_SIZE
46 #define WCHAR_TYPE_SIZE 32
47
48
49 /* Basic record keeping for the TPF OS name.  */
50 #undef  TARGET_VERSION
51 #define TARGET_VERSION fprintf (stderr, " (TPF: zSeries)");
52
53 /* TPF OS specific stack-pointer offset.  */
54 #undef STACK_POINTER_OFFSET
55 #define STACK_POINTER_OFFSET            448
56
57 /* When building for TPF, set a generic default target that is 64 bits.
58    Also, enable TPF profiling support and the standard backchain by default.  */
59 #undef TARGET_DEFAULT
60 #define TARGET_DEFAULT          (MASK_64BIT | MASK_ZARCH | MASK_HARD_FLOAT \
61                                  | MASK_TPF_PROFILING | MASK_BACKCHAIN)
62 /* Exception handling.  */
63
64 /* Select a format to encode pointers in exception handling data.  */
65 #undef ASM_PREFERRED_EH_DATA_FORMAT
66 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
67
68 /* TPF OS specific compiler settings.  */
69 #undef TARGET_OS_CPP_BUILTINS
70 #define TARGET_OS_CPP_BUILTINS()                \
71   do                                            \
72     {                                           \
73       builtin_define_std ("tpf");               \
74       builtin_assert ("system=tpf");            \
75       builtin_define ("__ELF__");               \
76       if (flag_pic)                             \
77         {                                       \
78           builtin_define ("__PIC__");           \
79           builtin_define ("__pic__");           \
80         }                                       \
81     }                                           \
82   while (0)
83
84
85 /* Make TPF specific spec file settings here.  */
86
87 #undef  STARTFILE_SPEC
88 #define STARTFILE_SPEC \
89   "%{!shared: \
90      %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
91                        %{!p:%{profile:gcrt1.o%s} \
92                          %{!profile:crt1.o%s}}}} \
93    crti.o%s %{static:crtbeginT.o%s} \
94    %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
95
96 #undef  ENDFILE_SPEC
97 #define ENDFILE_SPEC \
98   "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
99
100 /* The GNU C++ standard library requires that these macros be defined.  */
101 #undef CPLUSPLUS_CPP_SPEC
102 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
103
104 #undef  ASM_SPEC
105 #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}"
106
107 #undef  LIB_SPEC
108 #define LIB_SPEC "%{pthread:-lpthread} -lc"
109
110 #undef TARGET_C99_FUNCTIONS
111 #define TARGET_C99_FUNCTIONS 1
112
113 #undef LINK_SPEC
114 #define LINK_SPEC \
115   "-m elf64_s390 \
116    %{shared:-shared} \
117    %{!shared: \
118       %{static:-static} \
119       %{!static: \
120         %{rdynamic:-export-dynamic} \
121         %{!dynamic-linker:-dynamic-linker /lib/ld64.so}}}"
122
123 #define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h"
124
125 #endif /* ! _TPF_H */
126