dragonfly.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* Base configuration file for all DragonFly targets.
  2. Copyright (C) 2014-2015 Free Software Foundation, Inc.
  3. Contributed by John Marino <gnugcc@marino.st>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. GCC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. Under Section 7 of GPL version 3, you are granted additional
  14. permissions described in the GCC Runtime Library Exception, version
  15. 3.1, as published by the Free Software Foundation.
  16. You should have received a copy of the GNU General Public License and
  17. a copy of the GCC Runtime Library Exception along with this program;
  18. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. <http://www.gnu.org/licenses/>. */
  20. #undef TARGET_OS_CPP_BUILTINS
  21. #define TARGET_OS_CPP_BUILTINS() \
  22. do \
  23. { \
  24. builtin_define_std ("unix"); \
  25. builtin_define ("__DragonFly__"); \
  26. builtin_assert ("system=unix"); \
  27. builtin_assert ("system=bsd"); \
  28. builtin_assert ("system=DragonFly"); \
  29. } \
  30. while (0)
  31. #undef CPP_SPEC
  32. #define CPP_SPEC \
  33. "%(cpp_cpu) %(cpp_arch) %{posix:-D_POSIX_SOURCE}"
  34. #undef STARTFILE_SPEC
  35. #define STARTFILE_SPEC \
  36. "%{!shared: \
  37. %{pg:gcrt1.o%s} \
  38. %{!pg: \
  39. %{p:gcrt1.o%s} \
  40. %{!p: \
  41. %{profile: gcrt1.o%s} \
  42. %{!profile: \
  43. %{pie: Scrt1.o%s;:crt1.o%s}}}}} \
  44. crti.o%s \
  45. %{shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
  46. #undef ENDFILE_SPEC
  47. #define ENDFILE_SPEC \
  48. "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
  49. #undef LIB_SPEC
  50. #define LIB_SPEC \
  51. "%{pthread:-lpthread} -lc"
  52. #if defined(HAVE_LD_EH_FRAME_HDR)
  53. #define LINK_EH_SPEC "--eh-frame-hdr"
  54. #endif
  55. /* Provide a LINK_SPEC appropriate for DragonFly. Here we provide support
  56. for the special GCC options -static and -shared, which allow us to
  57. link things in one of these three modes by applying the appropriate
  58. combinations of options at link-time.
  59. When the -shared link option is used a final link is not being
  60. done. */
  61. #define DFBSD_LINK_SPEC \
  62. "%{p:%nconsider using '-pg' instead of '-p' with gprof(1)} \
  63. %{v:-V} \
  64. %{assert*} %{R*} %{rpath*} %{defsym*} \
  65. %{shared:-Bshareable %{h*} %{soname*}} \
  66. %{!shared: \
  67. %{!static: \
  68. %{rdynamic:-export-dynamic} \
  69. -dynamic-linker %(dfbsd_dynamic_linker) \
  70. } \
  71. %{static:-Bstatic} \
  72. } \
  73. %{!static:--hash-style=gnu} \
  74. %{symbolic:-Bsymbolic}"
  75. #undef LINK_SPEC
  76. #define LINK_SPEC DFBSD_LINK_SPEC
  77. #define DFBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.2"
  78. /* Use --as-needed -lgcc_s for eh support. */
  79. #ifdef HAVE_LD_AS_NEEDED
  80. #define USE_LD_AS_NEEDED 1
  81. #endif
  82. /************************[ Target stuff ]***********************************/
  83. /* All DragonFly Architectures support the ELF object file format. */
  84. #undef OBJECT_FORMAT_ELF
  85. #define OBJECT_FORMAT_ELF
  86. /* Don't assume anything about the header files. */
  87. #undef NO_IMPLICIT_EXTERN_C
  88. #define NO_IMPLICIT_EXTERN_C 1
  89. /* Follow DragonFly's standard headers (<machine/stdint.h>, etc...). */
  90. #undef WCHAR_TYPE
  91. #define WCHAR_TYPE "int"
  92. #undef WINT_TYPE
  93. #define WINT_TYPE "int"
  94. /* Code generation parameters. */
  95. /* Use periods rather than dollar signs in special g++ assembler names.
  96. This ensures the configuration knows our system correctly so we can link
  97. with libraries compiled with the native cc. */
  98. #undef NO_DOLLAR_IN_LABEL
  99. /* Used by libgcc2.c. We support file locking with fcntl / F_SETLKW.
  100. This enables the test coverage code to use file locking when exiting a
  101. program, which avoids race conditions if the program has forked. */
  102. #define TARGET_POSIX_IO