patch-gcc_config_i386_openbsd64_h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. $OpenBSD: patch-gcc_config_i386_openbsd64_h,v 1.2 2012/03/31 20:02:03 pascal Exp $
  2. --- gcc/config/i386/openbsd64.h.orig Sun Mar 11 19:10:40 2012
  3. +++ gcc/config/i386/openbsd64.h Sun Mar 11 19:54:21 2012
  4. @@ -0,0 +1,122 @@
  5. +/* Configuration for an OpenBSD x86-64 target.
  6. +
  7. + Copyright (C) 2003 Free Software Foundation, Inc.
  8. +
  9. +This file is part of GNU CC.
  10. +
  11. +GNU CC 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. +GNU CC 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 GNU CC; see the file COPYING. If not, write to
  23. +the Free Software Foundation, 59 Temple Place - Suite 330,
  24. +Boston, MA 02111-1307, USA. */
  25. +
  26. +#undef TARGET_VERSION
  27. +#define TARGET_VERSION fprintf (stderr, " (OpenBSD/x86-64 ELF)")
  28. +
  29. +/* This gets defined in tm.h->linux.h->svr4.h, and keeps us from using
  30. + libraries compiled with the native cc, so undef it. */
  31. +#undef NO_DOLLAR_IN_LABEL
  32. +
  33. +/* Override the default comment-starter of "/". */
  34. +#undef ASM_COMMENT_START
  35. +#define ASM_COMMENT_START "#"
  36. +
  37. +/* Run-time target specifications */
  38. +
  39. +#define TARGET_OS_CPP_BUILTINS() \
  40. + do \
  41. + { \
  42. + OPENBSD_OS_CPP_BUILTINS_ELF(); \
  43. + if (TARGET_64BIT) \
  44. + OPENBSD_OS_CPP_BUILTINS_LP64(); \
  45. + } \
  46. + while (0)
  47. +
  48. +/* As an elf system, we need crtbegin/crtend stuff. */
  49. +#undef STARTFILE_SPEC
  50. +#define STARTFILE_SPEC "\
  51. + %{!shared: %{pg:gcrt0%O%s} %{!pg:%{p:gcrt0%O%s} %{!p:crt0%O%s}} \
  52. + crtbegin%O%s} %{shared:crtbeginS%O%s}"
  53. +#undef ENDFILE_SPEC
  54. +#define ENDFILE_SPEC "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
  55. +
  56. +/* Layout of source language data types. */
  57. +
  58. +/* This must agree with <machine/_types.h> */
  59. +#undef SIZE_TYPE
  60. +#define SIZE_TYPE "long unsigned int"
  61. +
  62. +#undef PTRDIFF_TYPE
  63. +#define PTRDIFF_TYPE "long int"
  64. +
  65. +#undef WCHAR_TYPE
  66. +#define WCHAR_TYPE "int"
  67. +
  68. +#undef WCHAR_TYPE_SIZE
  69. +#define WCHAR_TYPE_SIZE 32
  70. +
  71. +/* Assembler format: overall framework. */
  72. +
  73. +#undef ASM_APP_ON
  74. +#define ASM_APP_ON "#APP\n"
  75. +
  76. +#undef ASM_APP_OFF
  77. +#define ASM_APP_OFF "#NO_APP\n"
  78. +
  79. +#undef SET_ASM_OP
  80. +#define SET_ASM_OP "\t.set\t"
  81. +
  82. +/* The following macros were originally stolen from i386v4.h.
  83. + These have to be defined to get PIC code correct. */
  84. +
  85. +/* Assembler format: dispatch tables. */
  86. +
  87. +/* Assembler format: sections. */
  88. +
  89. +/* Stack & calling: aggregate returns. */
  90. +
  91. +/* Don't default to pcc-struct-return, because gcc is the only compiler, and
  92. + we want to retain compatibility with older gcc versions. */
  93. +#define DEFAULT_PCC_STRUCT_RETURN 0
  94. +
  95. +/* Assembler format: alignment output. */
  96. +
  97. +/* Stack & calling: profiling. */
  98. +
  99. +/* OpenBSD's profiler recovers all information from the stack pointer.
  100. + The icky part is not here, but in machine/profile.h. */
  101. +#undef FUNCTION_PROFILER
  102. +#define FUNCTION_PROFILER(FILE, LABELNO) \
  103. + fputs (flag_pic ? "\tcall __mcount@PLT\n": "\tcall __mcount\n", FILE);
  104. +
  105. +/* Assembler format: exception region output. */
  106. +
  107. +/* Assembler format: alignment output. */
  108. +
  109. +/* Note that we pick up ASM_OUTPUT_MAX_SKIP_ALIGN from i386/gas.h */
  110. +
  111. +/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
  112. +
  113. +#undef LINK_SPEC
  114. +#define LINK_SPEC \
  115. + "%{!shared:%{!nostdlib:%{!r*:%{!e*:-e __start}}}} \
  116. + %{shared:-shared} %{R*} \
  117. + %{static:-Bstatic} \
  118. + %{!static:-Bdynamic} \
  119. + %{rdynamic:-export-dynamic} \
  120. + %{assert*} \
  121. + %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.so}"
  122. +
  123. +#define OBSD_HAS_CORRECT_SPECS
  124. +
  125. +#undef JUMP_TABLES_IN_TEXT_SECTION
  126. +#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)