OSDN Git Service

abf1a021819129d3223e1742bbe27928b26f3feb
[pf3gnuchains/gcc-fork.git] / gcc / config / i370 / linux.h
1 /* Definitions of target machine for GNU compiler.  System/370 version.
2    Copyright (C) 1989, 1993, 1995, 1996, 1997, 2003
3    Free Software Foundation, Inc.
4    Contributed by Jan Stein (jan@cd.chalmers.se).
5    Modified for Linux/390 by Linas Vepstas (linas@linas.org)
6
7 This file is part of GNU CC.
8
9 GNU CC is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
12 any later version.
13
14 GNU CC is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU CC; see the file COPYING.  If not, write to
21 the Free Software Foundation, 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.  */
23
24
25 #define TARGET_VERSION fprintf (stderr, " (i370 GNU/Linux with ELF)");
26
27 /* Specify that we're generating code for a Linux port to 370 */
28
29 #define TARGET_ELF_ABI
30 #define LINUX_DEFAULT_ELF
31
32 /* Target OS preprocessor built-ins.  */
33 #define TARGET_OS_CPP_BUILTINS()                \
34     do {                                        \
35         builtin_define_std ("unix");            \
36         builtin_define_std ("linux");           \
37         builtin_define ("__gnu_linux__");       \
38         builtin_assert ("system=posix");        \
39     } while (0)
40
41 /* Options for this target machine.  */
42
43 #define LIBGCC_SPEC "libgcc.a%s"
44
45 #ifdef SOME_FUTURE_DAY
46  
47 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE} %(cpp_sysv) %(cpp_endian_big) \
48 %{mcall-linux: %(cpp_os_linux) } \
49 %{!mcall-linux: %(cpp_os_default) }"
50
51 #define LIB_SPEC "\
52 %{mcall-linux: %(lib_linux) } \
53 %{!mcall-linux:%(lib_default) }"
54
55 #define STARTFILE_SPEC "\
56 %{mcall-linux: %(startfile_linux) } \
57 %{!mcall-linux: %(startfile_default) }"
58
59 #define ENDFILE_SPEC "\
60 %{mcall-linux: %(endfile_linux) } \
61 %{!mcall-linux: %(endfile_default) }"
62
63 /* GNU/Linux support.  */
64 #ifndef LIB_LINUX_SPEC
65 #define LIB_LINUX_SPEC "%{mnewlib: --start-group -llinux -lc --end-group } %{!mnewlib: -lc }"
66 #endif
67
68 #ifndef STARTFILE_LINUX_SPEC
69 #define STARTFILE_LINUX_SPEC "\
70 %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
71 %{mnewlib: ecrti.o%s} \
72 %{!mnewlib: crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
73 #endif
74
75 #ifndef ENDFILE_LINUX_SPEC
76 #define ENDFILE_LINUX_SPEC "\
77 %{mnewlib: ecrtn.o%s} \
78 %{!mnewlib: %{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s}"
79 #endif
80
81 #ifndef LINK_START_LINUX_SPEC
82 #define LINK_START_LINUX_SPEC "-Ttext 0x10000"
83 #endif
84
85 #ifndef LINK_OS_LINUX_SPEC
86 #define LINK_OS_LINUX_SPEC ""
87 #endif
88
89 #ifndef CPP_OS_LINUX_SPEC
90 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__gnu_linux__ -D__linux__ \
91 %{!ansi: -Dunix -Dlinux } \
92 -Asystem=unix -Asystem=linux"
93 #endif
94
95 #ifndef CPP_OS_LINUX_SPEC
96 #define CPP_OS_LINUX_SPEC ""
97 #endif
98
99
100 /* Define any extra SPECS that the compiler needs to generate.  */
101 #undef  SUBTARGET_EXTRA_SPECS
102 #define SUBTARGET_EXTRA_SPECS                                           \
103   { "lib_linux",                LIB_LINUX_SPEC },                       \
104   { "lib_default",              LIB_DEFAULT_SPEC },                     \
105   { "startfile_linux",          STARTFILE_LINUX_SPEC },                 \
106   { "startfile_default",        STARTFILE_DEFAULT_SPEC },               \
107   { "endfile_linux",            ENDFILE_LINUX_SPEC },                   \
108   { "endfile_default",          ENDFILE_DEFAULT_SPEC },                 \
109   { "link_shlib",               LINK_SHLIB_SPEC },                      \
110   { "link_target",              LINK_TARGET_SPEC },                     \
111   { "link_start",               LINK_START_SPEC },                      \
112   { "link_start_linux",         LINK_START_LINUX_SPEC },                \
113   { "link_os",                  LINK_OS_SPEC },                         \
114   { "link_os_linux",            LINK_OS_LINUX_SPEC },                   \
115   { "link_os_default",          LINK_OS_DEFAULT_SPEC },                 \
116   { "cpp_endian_big",           CPP_ENDIAN_BIG_SPEC },                  \
117   { "cpp_os_linux",             CPP_OS_LINUX_SPEC },                    \
118   { "cpp_os_default",           CPP_OS_DEFAULT_SPEC },
119
120 #endif /* SOME_FUTURE_DAY */