PR target/56858
[official-gcc.git] / gcc / config / s390 / linux.h
blob65ac22955e66f348dce5dbbcecf03302443c1f5d
1 /* Definitions for Linux for S/390.
2 Copyright (C) 1999-2014 Free Software Foundation, Inc.
3 Contributed by Hartmut Penner (hpenner@de.ibm.com) and
4 Ulrich Weigand (uweigand@de.ibm.com).
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 3, or (at your option) any later
11 version.
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #ifndef _LINUX_H
23 #define _LINUX_H
25 /* Target specific type definitions. */
27 /* ??? Do we really want long as size_t on 31-bit? */
28 #undef SIZE_TYPE
29 #define SIZE_TYPE (TARGET_64BIT ? "long unsigned int" : "long unsigned int")
30 #undef PTRDIFF_TYPE
31 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
33 #undef WCHAR_TYPE
34 #define WCHAR_TYPE "int"
35 #undef WCHAR_TYPE_SIZE
36 #define WCHAR_TYPE_SIZE 32
39 /* Target specific preprocessor settings. */
41 #define TARGET_OS_CPP_BUILTINS() \
42 do \
43 { \
44 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
45 } \
46 while (0)
49 /* Target specific assembler settings. */
51 #undef ASM_SPEC
52 #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}"
55 /* Target specific linker settings. */
57 #ifdef DEFAULT_TARGET_64BIT
58 #define MULTILIB_DEFAULTS { "m64" }
59 #else
60 #define MULTILIB_DEFAULTS { "m31" }
61 #endif
63 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
64 #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
66 #undef LINK_SPEC
67 #define LINK_SPEC \
68 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
69 %{shared:-shared} \
70 %{!shared: \
71 %{static:-static} \
72 %{!static: \
73 %{rdynamic:-export-dynamic} \
74 %{m31:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
75 %{m64:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}}"
77 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
79 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
81 #ifdef TARGET_LIBC_PROVIDES_SSP
82 /* s390 glibc provides __stack_chk_guard in 0x14(tp),
83 s390x glibc provides it at 0x28(tp). */
84 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
85 #endif
87 /* Define if long doubles should be mangled as 'g'. */
88 #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
90 #undef TARGET_LIBC_HAS_FUNCTION
91 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
93 #endif