linux.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /* Definitions of target machine for GNU compiler,
  2. for Alpha Linux-based GNU systems.
  3. Copyright (C) 1996-2015 Free Software Foundation, Inc.
  4. Contributed by Richard Henderson.
  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. #define TARGET_OS_CPP_BUILTINS() \
  18. do { \
  19. builtin_define ("__gnu_linux__"); \
  20. builtin_define ("_LONGLONG"); \
  21. builtin_define_std ("linux"); \
  22. builtin_define_std ("unix"); \
  23. builtin_assert ("system=linux"); \
  24. builtin_assert ("system=unix"); \
  25. builtin_assert ("system=posix"); \
  26. /* The GNU C++ standard library requires this. */ \
  27. if (c_dialect_cxx ()) \
  28. builtin_define ("_GNU_SOURCE"); \
  29. } while (0)
  30. #undef LIB_SPEC
  31. #define LIB_SPEC \
  32. "%{pthread:-lpthread} \
  33. %{shared:-lc} \
  34. %{!shared: %{profile:-lc_p}%{!profile:-lc}}"
  35. #undef CPP_SPEC
  36. #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
  37. /* Show that we need a GP when profiling. */
  38. #undef TARGET_PROFILING_NEEDS_GP
  39. #define TARGET_PROFILING_NEEDS_GP 1
  40. /* Don't care about faults in the prologue. */
  41. #undef TARGET_CAN_FAULT_IN_PROLOGUE
  42. #define TARGET_CAN_FAULT_IN_PROLOGUE 1
  43. /* OS fixes up EV5 data fault on prefetch. */
  44. #undef TARGET_FIXUP_EV5_PREFETCH
  45. #define TARGET_FIXUP_EV5_PREFETCH 1
  46. #undef WCHAR_TYPE
  47. #define WCHAR_TYPE "int"
  48. #ifdef SINGLE_LIBC
  49. #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
  50. #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
  51. #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
  52. #else
  53. #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
  54. #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
  55. #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
  56. #endif
  57. /* Determine what functions are present at the runtime;
  58. this includes full c99 runtime and sincos. */
  59. #undef TARGET_LIBC_HAS_FUNCTION
  60. #define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
  61. #define TARGET_POSIX_IO
  62. #define LINK_GCC_C_SEQUENCE_SPEC \
  63. "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
  64. /* Use --as-needed -lgcc_s for eh support. */
  65. #ifdef HAVE_LD_AS_NEEDED
  66. #define USE_LD_AS_NEEDED 1
  67. #endif
  68. /* Define if long doubles should be mangled as 'g'. */
  69. #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
  70. /* -mcpu=native handling only makes sense with compiler running on
  71. an Alpha chip. */
  72. #if defined(__alpha__) || defined(__alpha)
  73. extern const char *host_detect_local_cpu (int argc, const char **argv);
  74. # define EXTRA_SPEC_FUNCTIONS \
  75. { "local_cpu_detect", host_detect_local_cpu },
  76. # define MCPU_MTUNE_NATIVE_SPECS \
  77. " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
  78. " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
  79. #else
  80. # define MCPU_MTUNE_NATIVE_SPECS ""
  81. #endif
  82. #define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS