1 /* Definitions for Linux for S/390.
2 Copyright (C) 1999-2018 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
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
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/>. */
25 /* Target specific type definitions. */
27 /* For 31 bit our size type differs from most other targets (where it
28 is "unsigned int"). The difference tends to cause trouble e.g.:
29 Glibc BZ #16712, GCC BZ #79358 but cannot be changed due to ABI
32 #define SIZE_TYPE "long unsigned int"
34 #define PTRDIFF_TYPE (TARGET_64BIT ? "long int" : "int")
37 #define WCHAR_TYPE "int"
38 #undef WCHAR_TYPE_SIZE
39 #define WCHAR_TYPE_SIZE 32
42 /* Target specific preprocessor settings. */
44 #define TARGET_OS_CPP_BUILTINS() \
47 GNU_USER_TARGET_OS_CPP_BUILTINS(); \
52 /* Target specific assembler settings. */
53 /* Rewrite -march=arch* options to the original CPU name in order to
54 make it work with older binutils. */
57 "%{m31&m64}%{mesa&mzarch}%{march=z*}" \
58 "%{march=arch3:-march=g5}" \
59 "%{march=arch5:-march=z900}" \
60 "%{march=arch6:-march=z990}" \
61 "%{march=arch7:-march=z9-ec}" \
62 "%{march=arch8:-march=z10}" \
63 "%{march=arch9:-march=z196}" \
64 "%{march=arch10:-march=zEC12}" \
65 "%{march=arch11:-march=z13}"
68 /* Target specific linker settings. */
70 #ifdef DEFAULT_TARGET_64BIT
71 #define MULTILIB_DEFAULTS { "m64" }
73 #define MULTILIB_DEFAULTS { "m31" }
76 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
77 #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
81 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
85 %{!static:%{!static-pie: \
86 %{rdynamic:-export-dynamic} \
87 %{m31:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
88 %{m64:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}}} \
89 %{static-pie:-static -pie --no-dynamic-linker -z text}"
91 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
93 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
95 #ifdef TARGET_LIBC_PROVIDES_SSP
96 /* s390 glibc provides __stack_chk_guard in 0x14(tp),
97 s390x glibc provides it at 0x28(tp). */
98 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
101 /* Define if long doubles should be mangled as 'g'. */
102 #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
104 #undef TARGET_LIBC_HAS_FUNCTION
105 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
107 /* Uninitialized common symbols in non-PIE executables, even with
108 strong definitions in dependent shared libraries, will resolve
109 to COPY relocated symbol in the executable. See PR65780. */
110 #undef TARGET_BINDS_LOCAL_P
111 #define TARGET_BINDS_LOCAL_P default_binds_local_p_2