hpux.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /* Definitions of target machine GNU compiler. IA-64 version.
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. Contributed by Steve Ellcey <sje@cup.hp.com> and
  4. Reva Cuthbertson <reva@cup.hp.com>
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3, or (at your option)
  9. any later version.
  10. GCC is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with GCC; see the file COPYING3. If not see
  16. <http://www.gnu.org/licenses/>. */
  17. /* Enable HPUX ABI quirks. */
  18. #undef TARGET_HPUX
  19. #define TARGET_HPUX 1
  20. #undef WCHAR_TYPE
  21. #define WCHAR_TYPE "unsigned int"
  22. #undef WCHAR_TYPE_SIZE
  23. #define WCHAR_TYPE_SIZE 32
  24. /* Target OS builtins. */
  25. #define TARGET_OS_CPP_BUILTINS() \
  26. do { \
  27. builtin_assert("system=hpux"); \
  28. builtin_assert("system=posix"); \
  29. builtin_assert("system=unix"); \
  30. builtin_define_std("hpux"); \
  31. builtin_define_std("unix"); \
  32. builtin_define("__IA64__"); \
  33. builtin_define("_LONGLONG"); \
  34. builtin_define("_INCLUDE_LONGLONG"); \
  35. builtin_define("__STDC_EXT__"); \
  36. builtin_define("_UINT128_T"); \
  37. if (c_dialect_cxx () || !flag_iso) \
  38. { \
  39. builtin_define("_HPUX_SOURCE"); \
  40. builtin_define("__STDCPP__"); \
  41. builtin_define("_INCLUDE__STDC_A1_SOURCE"); \
  42. } \
  43. if (TARGET_ILP32) \
  44. builtin_define("_ILP32"); \
  45. } while (0)
  46. #undef CPP_SPEC
  47. #define CPP_SPEC \
  48. "%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
  49. /* aCC defines also -DRWSTD_MULTI_THREAD, -DRW_MULTI_THREAD. These
  50. affect only aCC's C++ library (Rogue Wave-derived) which we do not
  51. use, and they violate the user's name space. */
  52. #undef ASM_EXTRA_SPEC
  53. #define ASM_EXTRA_SPEC "%{milp32:-milp32} %{mlp64:-mlp64}"
  54. #ifndef USE_GAS
  55. #define AS_NEEDS_DASH_FOR_PIPED_INPUT
  56. #endif
  57. #ifndef CROSS_DIRECTORY_STRUCTURE
  58. #undef MD_EXEC_PREFIX
  59. #define MD_EXEC_PREFIX "/usr/ccs/bin/"
  60. #undef MD_STARTFILE_PREFIX
  61. #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
  62. #endif
  63. #undef ENDFILE_SPEC
  64. #undef STARTFILE_SPEC
  65. #define STARTFILE_SPEC "%{!shared:%{static:crt0%O%s} \
  66. %{mlp64:/usr/lib/hpux64/unix98%O%s} \
  67. %{!mlp64:/usr/lib/hpux32/unix98%O%s}}"
  68. #undef LINK_SPEC
  69. #define LINK_SPEC \
  70. "-z +Accept TypeMismatch \
  71. %{shared:-b} \
  72. %{!shared: \
  73. -u main \
  74. %{static:-noshared}}"
  75. #undef LIB_SPEC
  76. #define LIB_SPEC \
  77. "%{!shared: \
  78. %{mt|pthread:%{fopenacc|fopenmp|ftree-parallelize-loops=*:-lrt} -lpthread} \
  79. %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \
  80. %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \
  81. %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \
  82. %{mlp64:-L/usr/lib/hpux64/libp} -lgprof} \
  83. %{!symbolic:-lc}}"
  84. #define MULTILIB_DEFAULTS { "milp32" }
  85. /* A C expression whose value is zero if pointers that need to be extended
  86. from being `POINTER_SIZE' bits wide to `Pmode' are sign-extended and
  87. greater then zero if they are zero-extended and less then zero if the
  88. ptr_extend instruction should be used. */
  89. #define POINTERS_EXTEND_UNSIGNED -1
  90. #define JMP_BUF_SIZE (8 * 76)
  91. #undef TARGET_DEFAULT
  92. #define TARGET_DEFAULT \
  93. (MASK_DWARF2_ASM | MASK_BIG_ENDIAN | MASK_ILP32)
  94. /* ASM_OUTPUT_EXTERNAL_LIBCALL defaults to just a globalize_label call,
  95. but that doesn't put out the @function type information which causes
  96. shared library problems. */
  97. #undef ASM_OUTPUT_EXTERNAL_LIBCALL
  98. #define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
  99. do { \
  100. (*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0)); \
  101. ASM_OUTPUT_TYPE_DIRECTIVE (FILE, XSTR (FUN, 0), "function"); \
  102. } while (0)
  103. #undef FUNCTION_ARG_PADDING
  104. #define FUNCTION_ARG_PADDING(MODE, TYPE) \
  105. ia64_hpux_function_arg_padding ((MODE), (TYPE))
  106. #undef PAD_VARARGS_DOWN
  107. #define PAD_VARARGS_DOWN (!AGGREGATE_TYPE_P (type))
  108. #define REGISTER_TARGET_PRAGMAS() \
  109. c_register_pragma (0, "builtin", ia64_hpux_handle_builtin_pragma)
  110. /* Tell ia64.c that we are using the HP linker and we should delay output of
  111. function extern declarations so that we don't output them for functions
  112. which are never used (and may not be defined). */
  113. #undef TARGET_HPUX_LD
  114. #define TARGET_HPUX_LD 1
  115. /* The HPUX dynamic linker objects to weak symbols with no
  116. definitions, so do not use them in gthr-posix.h. */
  117. #define GTHREAD_USE_WEAK 0
  118. #undef CTORS_SECTION_ASM_OP
  119. #define CTORS_SECTION_ASM_OP "\t.section\t.init_array,\t\"aw\",\"init_array\""
  120. #undef DTORS_SECTION_ASM_OP
  121. #define DTORS_SECTION_ASM_OP "\t.section\t.fini_array,\t\"aw\",\"fini_array\""
  122. /* The init_array/fini_array technique does not permit the use of
  123. initialization priorities. */
  124. #define SUPPORTS_INIT_PRIORITY 0
  125. #undef READONLY_DATA_SECTION_ASM_OP
  126. #define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata,\t\"a\",\t\"progbits\""
  127. #undef DATA_SECTION_ASM_OP
  128. #define DATA_SECTION_ASM_OP "\t.section\t.data,\t\"aw\",\t\"progbits\""
  129. #undef SDATA_SECTION_ASM_OP
  130. #define SDATA_SECTION_ASM_OP "\t.section\t.sdata,\t\"asw\",\t\"progbits\""
  131. #undef BSS_SECTION_ASM_OP
  132. #define BSS_SECTION_ASM_OP "\t.section\t.bss,\t\"aw\",\t\"nobits\""
  133. #undef SBSS_SECTION_ASM_OP
  134. #define SBSS_SECTION_ASM_OP "\t.section\t.sbss,\t\"asw\",\t\"nobits\""
  135. #undef TEXT_SECTION_ASM_OP
  136. #define TEXT_SECTION_ASM_OP "\t.section\t.text,\t\"ax\",\t\"progbits\""
  137. /* It is illegal to have relocations in shared segments on HPUX.
  138. Pretend flag_pic is always set. */
  139. #undef TARGET_ASM_RELOC_RW_MASK
  140. #define TARGET_ASM_RELOC_RW_MASK ia64_hpux_reloc_rw_mask
  141. /* ia64 HPUX has the float and long double forms of math functions.
  142. We redefine this hook so the version from elfos.h header won't be used. */
  143. #undef TARGET_LIBC_HAS_FUNCTION
  144. #define TARGET_LIBC_HAS_FUNCTION default_libc_has_function
  145. #undef TARGET_INIT_LIBFUNCS
  146. #define TARGET_INIT_LIBFUNCS ia64_hpux_init_libfuncs
  147. #define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) ((MODE) == TFmode)
  148. /* HP-UX headers are C++-compatible. */
  149. #define NO_IMPLICIT_EXTERN_C
  150. /* HP-UX uses PROFILE_HOOK instead of FUNCTION_PROFILER but we need a
  151. FUNCTION_PROFILER defined because its use is not ifdefed. When using
  152. PROFILE_HOOK, the profile call comes after the prologue. */
  153. #undef FUNCTION_PROFILER
  154. #define FUNCTION_PROFILER(FILE, LABELNO) do { } while (0)
  155. #undef PROFILE_HOOK
  156. #define PROFILE_HOOK(LABEL) ia64_profile_hook (LABEL)
  157. #undef PROFILE_BEFORE_PROLOGUE
  158. #undef NO_PROFILE_COUNTERS
  159. #define NO_PROFILE_COUNTERS 0
  160. /* The HP-UX linker has a bug that causes calls from functions in
  161. .text.unlikely to functions in .text to cause a segfault. Until
  162. it is fixed, prevent code from being put into .text.unlikely or
  163. .text.hot. */
  164. #define TARGET_ASM_FUNCTION_SECTION ia64_hpux_function_section
  165. #define TARGET_POSIX_IO
  166. /* Define this to be nonzero if static stack checking is supported. */
  167. #define STACK_CHECK_STATIC_BUILTIN 1
  168. /* Minimum amount of stack required to recover from an anticipated stack
  169. overflow detection. */
  170. #define STACK_CHECK_PROTECT (24 * 1024)