tpf.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* Definitions for target OS TPF for GNU compiler, for IBM S/390 hardware
  2. Copyright (C) 2003-2015 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. This file is part of GCC.
  7. GCC is free software; you can redistribute it and/or modify it under
  8. the terms of the GNU General Public License as published by the Free
  9. Software Foundation; either version 3, or (at your option) any later
  10. version.
  11. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  12. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with GCC; see the file COPYING3. If not see
  17. <http://www.gnu.org/licenses/>. */
  18. #ifndef _TPF_H
  19. #define _TPF_H
  20. /* TPF wants the following macros defined/undefined as follows. */
  21. #undef TARGET_TPF
  22. #define TARGET_TPF 1
  23. #undef ASM_APP_ON
  24. #define ASM_APP_ON "#APP\n"
  25. #undef ASM_APP_OFF
  26. #define ASM_APP_OFF "#NO_APP\n"
  27. #define NO_IMPLICIT_EXTERN_C
  28. #define TARGET_POSIX_IO
  29. #undef SIZE_TYPE
  30. #define SIZE_TYPE ("long unsigned int")
  31. #undef PTRDIFF_TYPE
  32. #define PTRDIFF_TYPE ("long int")
  33. #undef WCHAR_TYPE
  34. #define WCHAR_TYPE "int"
  35. #undef WCHAR_TYPE_SIZE
  36. #define WCHAR_TYPE_SIZE 32
  37. /* TPF OS specific stack-pointer offset. */
  38. #undef STACK_POINTER_OFFSET
  39. #define STACK_POINTER_OFFSET 448
  40. /* When building for TPF, set a generic default target that is 64 bits. Also
  41. enable TPF profiling support and the standard backchain by default. */
  42. #undef TARGET_DEFAULT
  43. #define TARGET_DEFAULT (MASK_TPF_PROFILING | MASK_64BIT | MASK_ZARCH \
  44. | MASK_HARD_DFP | MASK_BACKCHAIN)
  45. /* Exception handling. */
  46. /* Select a format to encode pointers in exception handling data. */
  47. #undef ASM_PREFERRED_EH_DATA_FORMAT
  48. #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL) DW_EH_PE_absptr
  49. /* TPF OS specific compiler settings. */
  50. #undef TARGET_OS_CPP_BUILTINS
  51. #define TARGET_OS_CPP_BUILTINS() \
  52. do \
  53. { \
  54. builtin_define_std ("tpf"); \
  55. builtin_assert ("system=tpf"); \
  56. builtin_define ("__ELF__"); \
  57. } \
  58. while (0)
  59. #define EXTRA_SPECS \
  60. { "entry_spec", ENTRY_SPEC }
  61. /* Make TPF specific spec file settings here. */
  62. #undef STARTFILE_SPEC
  63. #define STARTFILE_SPEC \
  64. "%{mmain:crt0%O%s} crtbeginS%O%s crt3%O%s"
  65. #undef ENDFILE_SPEC
  66. #define ENDFILE_SPEC "crtendS%O%s"
  67. #undef CC1_SPEC
  68. #define CC1_SPEC "%{!fverbose-asm: -fverbose-asm}"
  69. /* The GNU C++ standard library requires that these macros be defined. */
  70. #undef CPLUSPLUS_CPP_SPEC
  71. #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
  72. #undef ASM_SPEC
  73. #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*} \
  74. -alshd=%b.lst"
  75. #define ENTRY_SPEC "%{mmain:-entry=_start} \
  76. %{!mmain:-entry=0}"
  77. /* All linking is done shared on TPF-OS. */
  78. /* FIXME: When binutils patch for new emulation is committed
  79. then change emulation to elf64_s390_tpf. */
  80. #undef LINK_SPEC
  81. #define LINK_SPEC \
  82. "-m elf64_s390 \
  83. %{static:%estatic is not supported on TPF-OS} \
  84. %{shared: -shared} \
  85. %{!shared:-shared} \
  86. %(entry_spec)"
  87. /* IBM copies these libraries over with these names. */
  88. #define MATH_LIBRARY "CLBM"
  89. #define LIBSTDCXX "CPP2"
  90. #undef TARGET_LIBC_HAS_FUNCTION
  91. #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
  92. #endif /* ! _TPF_H */