linux.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /* Definitions for GCC. Part of the machine description for CRIS.
  2. Copyright (C) 2001-2015 Free Software Foundation, Inc.
  3. Contributed by Axis Communications. Written by Hans-Peter Nilsson.
  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. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. /* After the first "Node:" comment comes all preprocessor directives and
  17. attached declarations described in the info files, the "Using and
  18. Porting GCC" manual (uapgcc), in the same order as found in the "Target
  19. macros" section in the gcc-2.9x CVS edition of 2000-03-17. FIXME: Not
  20. really, but needs an update anyway.
  21. There is no generic copy-of-uapgcc comment, you'll have to see uapgcc
  22. for that. If applicable, there is a CRIS-specific comment. The order
  23. of macro definitions follow the order in the manual. Every section in
  24. the manual (node in the info pages) has an introductory `Node:
  25. <subchapter>' comment. If no macros are defined for a section, only
  26. the section-comment is present. */
  27. /* This file defines the macros for cris-axis-linux-gnu that are not
  28. covered by cris.h, elfos.h and (config/)linux.h. */
  29. /* Make sure we have a valid TARGET_CPU_DEFAULT, so we can assume it
  30. and take shortcuts below. */
  31. #ifndef TARGET_CPU_DEFAULT
  32. #error "TARGET_CPU_DEFAULT not defined"
  33. #elif (TARGET_CPU_DEFAULT+0) != 10 && (TARGET_CPU_DEFAULT+0) != 32
  34. #error "TARGET_CPU_DEFAULT must be 10 or 32, or this file be updated"
  35. #endif
  36. /* Node: Instruction Output */
  37. #undef USER_LABEL_PREFIX
  38. #define USER_LABEL_PREFIX ""
  39. /* Node: Driver */
  40. /* These macros are CRIS-specific, but used in target driver macros. */
  41. #undef CRIS_CPP_SUBTARGET_SPEC
  42. #if TARGET_CPU_DEFAULT == 32
  43. # define CRIS_CPP_SUBTARGET_SPEC \
  44. "%{pthread:-D_REENTRANT}\
  45. %{!march=*:%{!mcpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}"
  46. #else
  47. # define CRIS_CPP_SUBTARGET_SPEC \
  48. "%{pthread:-D_REENTRANT}\
  49. %{!march=*:%{!mcpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}"
  50. #endif
  51. #undef CRIS_CC1_SUBTARGET_SPEC
  52. #if TARGET_CPU_DEFAULT == 32
  53. # define CRIS_CC1_SUBTARGET_SPEC \
  54. "%{!march=*:%{!mcpu=*:-march=v32}}"
  55. #define CRIS_SUBTARGET_DEFAULT_ARCH MASK_AVOID_GOTPLT
  56. #else
  57. # define CRIS_CC1_SUBTARGET_SPEC \
  58. "%{!march=*:%{!mcpu=*:-march=v10}}"
  59. #define CRIS_SUBTARGET_DEFAULT_ARCH 0
  60. #endif
  61. #undef CRIS_ASM_SUBTARGET_SPEC
  62. #if TARGET_CPU_DEFAULT == 32
  63. # define CRIS_ASM_SUBTARGET_SPEC \
  64. "--em=criself \
  65. %{!march=*:%{!mcpu=*:--march=v32}} \
  66. %{!fleading-underscore:--no-underscore}\
  67. %{fPIC|fpic|fPIE|fpie: --pic}"
  68. #else
  69. # define CRIS_ASM_SUBTARGET_SPEC \
  70. "--em=criself \
  71. %{!march=*:%{!mcpu=*:--march=v10}} \
  72. %{!fleading-underscore:--no-underscore}\
  73. %{fPIC|fpic|fPIE|fpie: --pic}"
  74. #endif
  75. /* Previously controlled by target_flags. */
  76. #undef TARGET_LINUX
  77. #define TARGET_LINUX 1
  78. #undef CRIS_SUBTARGET_DEFAULT
  79. #define CRIS_SUBTARGET_DEFAULT \
  80. (MASK_SVINTO \
  81. + MASK_ETRAX4_ADD \
  82. + MASK_ALIGN_BY_32 \
  83. + CRIS_SUBTARGET_DEFAULT_ARCH)
  84. #undef CRIS_DEFAULT_CPU_VERSION
  85. #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
  86. #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
  87. #undef CRIS_LINK_SUBTARGET_SPEC
  88. #define CRIS_LINK_SUBTARGET_SPEC \
  89. "-mcrislinux\
  90. %{shared} %{static}\
  91. %{symbolic:-Bdynamic} %{static:-Bstatic}\
  92. %{!shared:%{!static:\
  93. %{rdynamic:-export-dynamic}\
  94. -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}}\
  95. %{!r:%{O2|O3: --gc-sections}}"
  96. /* Node: Run-time Target */
  97. /* For the cris-*-linux* subtarget. */
  98. #undef TARGET_OS_CPP_BUILTINS
  99. #define TARGET_OS_CPP_BUILTINS() \
  100. do \
  101. { \
  102. GNU_USER_TARGET_OS_CPP_BUILTINS(); \
  103. if (flag_leading_underscore <= 0) \
  104. builtin_define ("__NO_UNDERSCORES__"); \
  105. } \
  106. while (0)
  107. /* Node: Type Layout */
  108. #undef SIZE_TYPE
  109. #define SIZE_TYPE "unsigned int"
  110. #undef PTRDIFF_TYPE
  111. #define PTRDIFF_TYPE "int"
  112. /* Node: Sections */
  113. /* GNU/Linux has crti and crtn and does not need the
  114. CRT_CALL_STATIC_FUNCTION trick in cris.h. */
  115. #undef CRT_CALL_STATIC_FUNCTION
  116. /*
  117. * Local variables:
  118. * eval: (c-set-style "gnu")
  119. * indent-tabs-mode: t
  120. * End:
  121. */