xref: /minix3/external/gpl3/gcc/files/minix-spec.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1 /* Base configuration file for all MINIX targets.
2    Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
3    Adapted for MINIX by Lionel Sambuc <lionel@minix3.org>
4 
5    This file is part of GCC.
6 
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 2, or (at your
10    option) any later version.
11 
12    GCC is distributed in the hope that it will be useful, but WITHOUT
13    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15    License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with GCC; see the file COPYING.  If not, write to the
19    Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
20    MA 02110-1301, USA.  */
21 
22 /* MINIX defines
23  * Default, architecture independent values for MINIX
24  *
25  * For this to work properly, the order in the tm_file variable has
26  * to be the following:
27  *   minix-spec.h $arch/minix.h minix.h
28  *
29  * minix-spec.h	: specifies default arch-independent values
30  * $arch/minix.h: redefines as needed default minix values
31  * minix.h	: maps GCC defines to the minix defines.
32  *
33  * WARNING:
34  *   When changing any default, also check in the arch headers
35  *   if the default is redefined and update them as required.
36  */
37 
38 /* In case we need to know.  */
39 #define USING_CONFIG_MINIX_SPEC 1
40 
41 #define MINIX_TARGET_OS_CPP_BUILTINS()					\
42   do									\
43     {									\
44 		builtin_define ("__minix");				\
45 		builtin_define ("__minix__");				\
46 		builtin_define ("__unix__");				\
47 		builtin_assert ("system=bsd");				\
48 		builtin_assert ("system=unix");				\
49 		builtin_assert ("system=minix");			\
50 		MINIX_TARGET_CPU_CPP_BUILTINS();			\
51     }									\
52   while (0)
53 
54 /* Define the default MINIX-specific per-CPU hook code.  */
55 #define MINIX_TARGET_CPU_CPP_BUILTINS() do {} while (0)
56 
57 /* Look for the include files in the system-defined places.  */
58 
59 #define MINIX_GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
60 
61 #define MINIX_GPLUSPLUS_BACKWARD_INCLUDE_DIR "/usr/include/g++/backward"
62 
63 #define MINIX_GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT 1
64 
65 #define MINIX_GCC_INCLUDE_DIR_ADD_SYSROOT 1
66 
67 /*
68  * XXX figure out a better way to do this
69  */
70 #define MINIX_GCC_INCLUDE_DIR "/usr/include/gcc-4.8"
71 
72 /* Provide a CPP_SPEC appropriate for MINIX.  We just deal with the GCC
73    option `-posix'.  */
74 #define MINIX_CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
75 
76 /* Pass -cxx-isystem to cc1/cc1plus.  */
77 #define MINIX_CC1PLUS_SPEC "%{cxx-isystem}"
78 #define MINIX_CC1_SPEC "%{cxx-isystem}"
79 
80 
81 #define MINIX_SUBTARGET_CPP_SPEC ""
82 #define MINIX_SUBTARGET_EXTRA_ASM_SPEC ""
83 #define MINIX_SUBTARGET_ASM_FLOAT_SPEC ""
84 
85 #define MINIX_DYNAMIC_LINKER "/usr/libexec/ld.elf_so"
86 
87 /* Under MINIX, just like on NetBSD, the normal location of the various
88  *    *crt*.o files is the /usr/lib directory.  */
89 #define MINIX_STANDARD_STARTFILE_PREFIX	"/usr/lib/"
90 
91 /* Under NetBSD, the normal location of the compiler back ends is the
92    /usr/libexec directory.  */
93 
94 #define MINIX_STANDARD_EXEC_PREFIX		"/usr/libexec/"
95 #define MINIX_TOOLDIR_BASE_PREFIX		"../"
96 #define MINIX_STANDARD_BINDIR_PREFIX		"/usr/bin"
97 #define MINIX_STANDARD_LIBEXEC_PREFIX		MINIX_STANDARD_EXEC_PREFIX
98 
99 #define MINIX_LINK_GCC_C_SEQUENCE_SPEC \
100 	"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
101 
102 /* Provide a STARTFILE_SPEC appropriate for MINIX.  Here we add
103    the magical crtbegin.o file (see crtstuff.c) which provides part
104    of the support for getting C++ file-scope static object constructed
105    before entering `main'.  */
106 #define MINIX_STARTFILE_SPEC	\
107   "%{!shared:			\
108      %{pg:gcrt0%O%s}		\
109      %{!pg:			\
110 	 %{p:gcrt0%O%s}		\
111 	 %{!p:%{profile:gcrt0%O%s} \
112 	      %{!profile:crt0%O%s}}}} \
113    %:if-exists(crti%O%s)	\
114    %{static:%:if-exists-else(crtbeginT%O%s crtbegin%O%s)} \
115    %{!static:                   \
116      %{!shared:			\
117 	 %{!pie:crtbegin%O%s}	\
118 	 %{pie:crtbeginS%O%s}}	\
119      %{shared:crtbeginS%O%s}}"
120 
121 /* Provide an ENDFILE_SPEC appropriate for NetBSD ELF.  Here we
122    add crtend.o, which provides part of the support for getting
123    C++ file-scope static objects deconstructed after exiting "main".  */
124 #define MINIX_ENDFILE_SPEC	\
125   "%{!shared:                   \
126     %{!pie:crtend%O%s}          \
127     %{pie:crtendS%O%s}}         \
128    %{shared:crtendS%O%s}        \
129    %:if-exists(crtn%O%s)"
130 
131 /* Provide a LIB_SPEC appropriate for MINIX.  Just select the appropriate
132    libc, depending on whether we're doing profiling or need threads support.
133    (similar to the default, except no -lg, and no -p).  */
134 #define MINIX_LIB_SPEC "						\
135 %{pthread: %eThe -pthread option is only supported on MINIX when gcc	\
136 is built with the --enable-threads configure-time option.}		\
137   %{shared:-lc}			\
138   %{!shared:			\
139     %{!symbolic:		\
140       %{!p:			\
141 	%{!pg:-lc}}		\
142       %{p:-lc_p}		\
143       %{pg:-lc_p}}}"
144 
145 /* Provide a LINK_SPEC appropriate for MINIX.  Here we provide support
146    for the special GCC options -static and -shared, which allow us to
147    link things in one of these three modes by applying the appropriate
148    combinations of options at link-time. We like to support here for
149    as many of the other GNU linker options as possible. But I don't
150    have the time to search for those flags. I am sure how to add
151    support for -soname shared_object_name. H.J.
152 
153    I took out %{v:%{!V:-V}}. It is too much :-(. They can use
154    -Wl,-V.
155 
156    When the -shared link option is used a final link is not being
157    done.  */
158 #define MINIX_LINK_SPEC "						\
159   -X									\
160   %{p:%nconsider using `-pg' instead of `-p' with gprof(1) }		\
161   %{assert*} %{R*} %{rpath*}						\
162   %{shared:-Bshareable %{h*} %{soname*}}				\
163   %{symbolic:-Bsymbolic}						\
164   %{!shared:								\
165     -dc -dp								\
166     %{!static:								\
167       %{rdynamic:-export-dynamic}					\
168       %{!dynamic-linker:-dynamic-linker %(minix_dynamic_linker) }}	\
169     %{static:-Bstatic}}"
170 
171 #define MINIX_TARGET_UNWIND_TABLES_DEFAULT true
172