patch-gcc_config_mips_openbsd64_h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. $OpenBSD: patch-gcc_config_mips_openbsd64_h,v 1.1 2013/01/10 15:00:55 pascal Exp $
  2. --- gcc/config/mips/openbsd64.h.orig Wed Jan 9 10:49:40 2013
  3. +++ gcc/config/mips/openbsd64.h Wed Jan 9 10:55:00 2013
  4. @@ -0,0 +1,175 @@
  5. +/* Configuration file for a mips64 OpenBSD target.
  6. + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  7. + Free Software Foundation, Inc.
  8. +
  9. +This file is part of GCC.
  10. +
  11. +GCC is free software; you can redistribute it and/or modify
  12. +it under the terms of the GNU General Public License as published by
  13. +the Free Software Foundation; either version 2, or (at your option)
  14. +any later version.
  15. +
  16. +GCC is distributed in the hope that it will be useful,
  17. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. +GNU General Public License for more details.
  20. +
  21. +You should have received a copy of the GNU General Public License
  22. +along with GCC; see the file COPYING. If not, write to
  23. +the Free Software Foundation, 51 Franklin Street, Fifth Floor,
  24. +Boston, MA 02110-1301, USA. */
  25. +
  26. +/* This must agree with <machine/_types.h> */
  27. +#undef SIZE_TYPE
  28. +#define SIZE_TYPE "long unsigned int"
  29. +
  30. +#undef PTRDIFF_TYPE
  31. +#define PTRDIFF_TYPE "long int"
  32. +
  33. +#undef INTMAX_TYPE
  34. +#define INTMAX_TYPE "long long int"
  35. +
  36. +#undef UINTMAX_TYPE
  37. +#define UINTMAX_TYPE "long long unsigned int"
  38. +
  39. +#undef WCHAR_TYPE
  40. +#define WCHAR_TYPE "int"
  41. +
  42. +#undef WCHAR_TYPE_SIZE
  43. +#define WCHAR_TYPE_SIZE 32
  44. +
  45. +/* If defined, a C expression whose value is a string containing the
  46. + assembler operation to identify the following data as
  47. + uninitialized global data. If not defined, and neither
  48. + `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
  49. + uninitialized global data will be output in the data section if
  50. + `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
  51. + used. */
  52. +#define BSS_SECTION_ASM_OP "\t.section\t.bss"
  53. +
  54. +#undef ASM_DECLARE_OBJECT_NAME
  55. +#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
  56. +
  57. +#undef MD_EXEC_PREFIX
  58. +#undef MD_STARTFILE_PREFIX
  59. +
  60. +/* If we don't set MASK_ABICALLS, we can't default to PIC. */
  61. +#undef TARGET_DEFAULT
  62. +#define TARGET_DEFAULT MASK_ABICALLS
  63. +
  64. +#define TARGET_OS_CPP_BUILTINS() \
  65. + do { \
  66. + OPENBSD_OS_CPP_BUILTINS(); \
  67. + \
  68. + if (TARGET_64BIT) \
  69. + builtin_define ("__mips64__"); \
  70. + \
  71. + if (TARGET_ABICALLS) \
  72. + builtin_define ("__ABICALLS__"); \
  73. + \
  74. + if (mips_abi == ABI_EABI) \
  75. + builtin_define ("__mips_eabi"); \
  76. + else if (mips_abi == ABI_N32) \
  77. + builtin_define ("__mips_n32"); \
  78. + else if (mips_abi == ABI_64) \
  79. + builtin_define ("__mips_n64"); \
  80. + else if (mips_abi == ABI_O64) \
  81. + builtin_define ("__mips_o64"); \
  82. + \
  83. + if (mips_abi == ABI_N32) \
  84. + { \
  85. + builtin_define ("_ABIN32=2"); \
  86. + builtin_define ("_MIPS_SIM=_ABIN32"); \
  87. + builtin_define ("_MIPS_SZLONG=32"); \
  88. + builtin_define ("_MIPS_SZPTR=32"); \
  89. + } \
  90. + else if (mips_abi == ABI_64) \
  91. + { \
  92. + builtin_define ("_ABI64=3"); \
  93. + builtin_define ("_MIPS_SIM=_ABI64"); \
  94. + builtin_define ("_MIPS_SZLONG=64"); \
  95. + builtin_define ("_MIPS_SZPTR=64"); \
  96. + } \
  97. + else \
  98. + { \
  99. + builtin_define ("_ABIO32=1"); \
  100. + builtin_define ("_MIPS_SIM=_ABIO32"); \
  101. + builtin_define ("_MIPS_SZLONG=32"); \
  102. + builtin_define ("_MIPS_SZPTR=32"); \
  103. + } \
  104. + if (TARGET_FLOAT64) \
  105. + builtin_define ("_MIPS_FPSET=32"); \
  106. + else \
  107. + builtin_define ("_MIPS_FPSET=16"); \
  108. + \
  109. + builtin_define ("_MIPS_SZINT=32"); \
  110. + } while (0)
  111. +
  112. +#undef SUBTARGET_CPP_SPEC
  113. +#define SUBTARGET_CPP_SPEC OBSD_CPP_SPEC
  114. +
  115. +/* A standard GNU/Linux mapping. On most targets, it is included in
  116. + CC1_SPEC itself by config/linux.h, but mips.h overrides CC1_SPEC
  117. + and provides this hook instead. */
  118. +#undef SUBTARGET_CC1_SPEC
  119. +#define SUBTARGET_CC1_SPEC "%{profile:-p}"
  120. +
  121. +/* From iris5.h */
  122. +/* -G is incompatible with -KPIC which is the default, so only allow objects
  123. + in the small data section if the user explicitly asks for it. */
  124. +#undef MIPS_DEFAULT_GVALUE
  125. +#define MIPS_DEFAULT_GVALUE 0
  126. +
  127. +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  128. +
  129. +/* Borrowed from sparc/linux.h */
  130. +#undef LINK_SPEC
  131. +#define LINK_SPEC \
  132. + "%(endian_spec) \
  133. + %{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
  134. + %{shared:-shared} %{R*} \
  135. + %{static:-Bstatic} \
  136. + %{!static:-Bdynamic} \
  137. + %{rdynamic:-export-dynamic} \
  138. + %{assert*} \
  139. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
  140. +
  141. +/* As an elf system, we need crtbegin/crtend stuff. */
  142. +#undef STARTFILE_SPEC
  143. +#define STARTFILE_SPEC "\
  144. + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
  145. + crtbegin%O%s} %{shared:crtbeginS%O%s}"
  146. +#undef ENDFILE_SPEC
  147. +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  148. +
  149. +#undef SUBTARGET_ASM_SPEC
  150. +#define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
  151. +
  152. +/* The MIPS assembler has different syntax for .set. We set it to
  153. + .dummy to trap any errors. */
  154. +#undef SET_ASM_OP
  155. +#define SET_ASM_OP "\t.dummy\t"
  156. +
  157. +#undef ASM_OUTPUT_DEF
  158. +#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
  159. + do { \
  160. + fputc ( '\t', FILE); \
  161. + assemble_name (FILE, LABEL1); \
  162. + fputs ( " = ", FILE); \
  163. + assemble_name (FILE, LABEL2); \
  164. + fputc ( '\n', FILE); \
  165. + } while (0)
  166. +
  167. +#undef LOCAL_LABEL_PREFIX
  168. +#define LOCAL_LABEL_PREFIX "."
  169. +
  170. +/* The glibc _mcount stub will save $v0 for us. Don't mess with saving
  171. + it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
  172. + presence of $gp-relative calls. */
  173. +#undef ASM_OUTPUT_REG_PUSH
  174. +#undef ASM_OUTPUT_REG_POP
  175. +
  176. +#undef LIB_SPEC
  177. +#define LIB_SPEC OBSD_LIB_SPEC
  178. +
  179. +#undef ENABLE_EXECUTE_STACK