1 /* Definitions for Linux for S/390.
2 Copyright (C) 1999-2020 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=arch5:-march=z900}" \
59 "%{march=arch6:-march=z990}" \
60 "%{march=arch7:-march=z9-ec}" \
61 "%{march=arch8:-march=z10}" \
62 "%{march=arch9:-march=z196}" \
63 "%{march=arch10:-march=zEC12}" \
64 "%{march=arch11:-march=z13}"
67 /* Target specific linker settings. */
69 #ifdef DEFAULT_TARGET_64BIT
70 #define MULTILIB_DEFAULTS { "m64" }
72 #define MULTILIB_DEFAULTS { "m31" }
75 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
76 #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
78 #undef MUSL_DYNAMIC_LINKER32
79 #define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-s390.so.1"
80 #undef MUSL_DYNAMIC_LINKER64
81 #define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-s390x.so.1"
85 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
89 %{!static:%{!static-pie: \
90 %{rdynamic:-export-dynamic} \
91 %{m31:-dynamic-linker " GNU_USER_DYNAMIC_LINKER32 "} \
92 %{m64:-dynamic-linker " GNU_USER_DYNAMIC_LINKER64 "}}}} \
93 %{static-pie:-static -pie --no-dynamic-linker -z text}"
95 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
97 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
99 #ifdef TARGET_LIBC_PROVIDES_SSP
100 /* s390 glibc provides __stack_chk_guard in 0x14(tp),
101 s390x glibc provides it at 0x28(tp). */
102 #define TARGET_THREAD_SSP_OFFSET (TARGET_64BIT ? 0x28 : 0x14)
105 /* Define if long doubles should be mangled as 'g'. */
106 #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
108 #undef TARGET_LIBC_HAS_FUNCTION
109 #define TARGET_LIBC_HAS_FUNCTION gnu_libc_has_function
111 /* Uninitialized common symbols in non-PIE executables, even with
112 strong definitions in dependent shared libraries, will resolve
113 to COPY relocated symbol in the executable. See PR65780. */
114 #undef TARGET_BINDS_LOCAL_P
115 #define TARGET_BINDS_LOCAL_P default_binds_local_p_2