1 /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware 2 Copyright (C) 2003, 2004, 2005, 2007 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 3, 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 COPYING3. If not see 21 <http://www.gnu.org/licenses/>. */ 22 23 #ifndef _TPF_H 24 #define _TPF_H 25 26 /* TPF wants the following macros defined/undefined as follows. */ 27 #undef TARGET_TPF 28 #define TARGET_TPF 1 29 #undef ASM_APP_ON 30 #define ASM_APP_ON "#APP\n" 31 #undef ASM_APP_OFF 32 #define ASM_APP_OFF "#NO_APP\n" 33 #define NO_IMPLICIT_EXTERN_C 34 #define TARGET_POSIX_IO 35 36 #undef SIZE_TYPE 37 #define SIZE_TYPE ("long unsigned int") 38 #undef PTRDIFF_TYPE 39 #define PTRDIFF_TYPE ("long int") 40 #undef WCHAR_TYPE 41 #define WCHAR_TYPE "int" 42 #undef WCHAR_TYPE_SIZE 43 #define WCHAR_TYPE_SIZE 32 44 45 46 /* Basic record keeping for the TPF OS name. */ 47 #undef TARGET_VERSION 48 #define TARGET_VERSION fprintf (stderr, " (TPF: zSeries)"); 49 50 /* TPF OS specific stack-pointer offset. */ 51 #undef STACK_POINTER_OFFSET 52 #define STACK_POINTER_OFFSET 448 53 54 /* When building for TPF, set a generic default target that is 64 bits. Also 55 enable TPF profiling support and the standard backchain by default. */ 56 #undef TARGET_DEFAULT 57 #define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \ 58 | MASK_HARD_DFP | MASK_BACKCHAIN) 59 60 /* Exception handling. */ 61 62 /* Select a format to encode pointers in exception handling data. */ 63 #undef ASM_PREFERRED_EH_DATA_FORMAT 64 #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr 65 66 /* TPF OS specific compiler settings. */ 67 #undef TARGET_OS_CPP_BUILTINS 68 #define TARGET_OS_CPP_BUILTINS() \ 69 do \ 70 { \ 71 builtin_define_std ("tpf"); \ 72 builtin_assert ("system=tpf"); \ 73 builtin_define ("__ELF__"); \ 74 } \ 75 while (0) 76 77 78 #define EXTRA_SPECS \ 79 { "entry_spec", ENTRY_SPEC } 80 81 /* Make TPF specific spec file settings here. */ 82 83 #undef STARTFILE_SPEC 84 #define STARTFILE_SPEC \ 85 "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s" 86 87 #undef ENDFILE_SPEC 88 #define ENDFILE_SPEC "crtendS%O%s" 89 90 #undef CC1_SPEC 91 #define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}" 92 93 /* The GNU C++ standard library requires that these macros be defined. */ 94 #undef CPLUSPLUS_CPP_SPEC 95 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" 96 97 #undef ASM_SPEC 98 #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \ 99 -alshd=%b.lst" 100 101 /* It would be nice to get the system linker script define the ones that it 102 needed. */ 103 #undef LIB_SPEC 104 #define LIB_SPEC "-lCTIS -lCISO -lCLBM -lCTAL -lCFVS -lCTBX -lCTXO \ 105 -lCJ00 -lCTDF -lCOMX -lCOMS -lCTHD -lCTAD -lTPFSTUB" 106 107 #undef TARGET_C99_FUNCTIONS 108 #define TARGET_C99_FUNCTIONS 1 109 110 #define ENTRY_SPEC "%{mmain:-entry=_start} \ 111 %{!mmain:-entry=0}" 112 113 /* All linking is done shared on TPF-OS. */ 114 /* FIXME: When binutils patch for new emulation is committed 115 then change emulation to elf64_s390_tpf. */ 116 #undef LINK_SPEC 117 #define LINK_SPEC \ 118 "-m elf64_s390 \ 119 %{static:%estatic is not supported on TPF-OS} \ 120 %{shared: -shared} \ 121 %{!shared:-shared} \ 122 %(entry_spec)" 123 124 #define MD_UNWIND_SUPPORT "config/s390/tpf-unwind.h" 125 126 /* IBM copies these libraries over with these names. */ 127 #define MATH_LIBRARY "-lCLBM" 128 #define LIBSTDCXX "-lCPP1" 129 #endif /* ! _TPF_H */ 130