linux.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* Definitions for Linux for S/390.
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. Contributed by Hartmut Penner (hpenner@de.ibm.com) and
  4. Ulrich Weigand (uweigand@de.ibm.com).
  5. This file is part of GCC.
  6. GCC is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 3, or (at your option) any later
  9. version.
  10. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  13. 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. #ifndef _LINUX_H
  18. #define _LINUX_H
  19. /* Target specific type definitions. */
  20. /* ??? Do we really want long as size_t on 31-bit? */
  21. #undef SIZE_TYPE
  22. #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
  23. #undef PTRDIFF_TYPE
  24. #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
  25. #undef WCHAR_TYPE
  26. #define WCHAR_TYPE "int"
  27. #undef WCHAR_TYPE_SIZE
  28. #define WCHAR_TYPE_SIZE 32
  29. /* Target specific preprocessor settings. */
  30. #define TARGET_OS_CPP_BUILTINS() \
  31. do \
  32. { \
  33. GNU_USER_TARGET_OS_CPP_BUILTINS(); \
  34. } \
  35. while (0)
  36. /* Target specific assembler settings. */
  37. #undef ASM_SPEC
  38. #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}"
  39. /* Target specific linker settings. */
  40. #ifdef DEFAULT_TARGET_64BIT
  41. #define MULTILIB_DEFAULTS { "m64" }
  42. #else
  43. #define MULTILIB_DEFAULTS { "m31" }
  44. #endif
  45. #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
  46. #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
  47. #undef LINK_SPEC
  48. #define LINK_SPEC \
  49. "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
  50. %{shared:-shared} \
  51. %{!shared: \
  52. %{static:-static} \
  53. %{!static: \
  54. %{rdynamic:-export-dynamic} \
  55. %{m31:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
  56. %{m64:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}}"
  57. #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
  58. #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
  59. #ifdef TARGET_LIBC_PROVIDES_SSP
  60. /* s390 glibc provides __stack_chk_guard in 0x14(tp),
  61. s390x glibc provides it at 0x28(tp). */
  62. #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
  63. #endif
  64. /* Define if long doubles should be mangled as 'g'. */
  65. #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
  66. #undef TARGET_LIBC_HAS_FUNCTION
  67. #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
  68. /* Uninitialized common symbols in non-PIE executables, even with
  69. strong definitions in dependent shared libraries, will resolve
  70. to COPY relocated symbol in the executable. See PR65780. */
  71. #undef TARGET_BINDS_LOCAL_P
  72. #define TARGET_BINDS_LOCAL_P default_binds_local_p_2
  73. #endif