xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/config/s390/linux.h (revision 9573673d78c64ea1eac42d7f2e9521be89932ae5)
1 /* Definitions for Linux for S/390.
2    Copyright (C) 1999-2013 Free Software Foundation, Inc.
3    Contributed by Hartmut Penner (hpenner@de.ibm.com) and
4                   Ulrich Weigand (uweigand@de.ibm.com).
5 
6 This file is part of GCC.
7 
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.
12 
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.
17 
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/>.  */
21 
22 #ifndef _LINUX_H
23 #define _LINUX_H
24 
25 /* Target specific type definitions.  */
26 
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")
32 
33 #undef  WCHAR_TYPE
34 #define WCHAR_TYPE "int"
35 #undef  WCHAR_TYPE_SIZE
36 #define WCHAR_TYPE_SIZE 32
37 
38 
39 /* Target specific preprocessor settings.  */
40 
41 #define TARGET_OS_CPP_BUILTINS()		\
42   do						\
43     {						\
44       GNU_USER_TARGET_OS_CPP_BUILTINS();	\
45     }						\
46   while (0)
47 
48 
49 /* Target specific assembler settings.  */
50 
51 #undef  ASM_SPEC
52 #define ASM_SPEC "%{m31&m64}%{mesa&mzarch}%{march=*}"
53 
54 
55 /* Target specific linker settings.  */
56 
57 #ifdef DEFAULT_TARGET_64BIT
58 #define MULTILIB_DEFAULTS { "m64" }
59 #else
60 #define MULTILIB_DEFAULTS { "m31" }
61 #endif
62 
63 #define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
64 #define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
65 
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 "}}}"
76 
77 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
78 
79 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
80 
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
86 
87 /* Define if long doubles should be mangled as 'g'.  */
88 #define TARGET_ALTERNATE_LONG_DOUBLE_MANGLING
89 
90 #endif
91