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